Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

android - Reliable source for older releases of Google Play Services API

I'm working on an App that uses Google Play Services' GcmNetworkManager. This feature was introduced in v7.5, so to maximize the number of devices where my app will not need to ask the user to update Google Play Services, I would like to build my app against that version of the API files.

Unfortunately, I don't seem to be able to select an older version in the Android SDK Manager. There are several websites that come up in a Google search that provide older API versions, but none of them seem to be official Google pages, so I'm a little hesitant to use them for security reasons.

I'd also rather not use the trick suggested in the answer to a similar question here (https://stackoverflow.com/a/32859695/1217178) since I have no idea whether there are parts of the API that will crash if they are tricked into executing against an untested older version of the APK.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Is this actually safe?

Well, it's kinda the point of having artifact versioning. Presumably, Google intends to keep those older artifacts around in your local Google Repository.

If you're seriously nervous, back up your developer machine. (and if you're not seriously nervous, also back up your developer machine) You can always rummage around an old backup to grab the artifacts and cook up some means of using them in your app.

I.e. is it downloading/building the actual older version of the API?

It is compiling into your app the JARs/AARs that represented the Play Services SDK for that version. It's how all artifact versioning works. If you go to your Android SDK installation, and look in extras/google/m2repository/com/google/android/gms/, you will see the various artifact names. Go into those directories, and you will see the versions. Go into a version directory, and you will see the files. Go into the files, and you will see the bits. You can try diving down into the bits to see electrons or something, but I think that'll be carrying it a wee bit too far.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...