I know that .apk files are zip files and when we extract them can parse manifest file inorder to finding some information about the app. It is very useful for someone like me that is going to create an app-store. Actually at least I can find the version name and version code of the app.
But in the android-studio when we build a signed apk the version name and version code is not defining in the manifest file. We should define them in the build.gradle
file. So now in my app-store when users upload the files how can I find the version code and version name and detect that is not same with old versions?
The version code is an incremental integer value that represents the version of the application code. The version name is a string value that represents the “friendly” version name displayed to the users.
Once in Settings, tap Apps and notifications (or your phone manufacturer's name it). When you're in there, tap See all xyz apps (where xyz is the number of apps you have installed). Now scroll down until you find the app you want to find the version for. Then tap it in the list.
Just use AAPT from your path/to/your/android-sdk/build-tools/your-api-version-available/...
An example of the command execution:
aapt dump badging theuserapp.apk
And it will respond with something like:
package: name='com.blabla.theuserapp' versionCode='2000' versionName='2.0.0'
Of course, as the tool is an executable which produces a raw text output you can easily script it and parse from your favorite scripting languaje.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With