You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the app as it is to see the versionName.
Now, decode, build and run the app without making any changes. On running, you will see that the versionName is null. versionName is read using the following piece of code -
There is no versionCode in this application and versionName is a reference instead of a literal value.
Prior to the world of Gradle, you could use a reference, but with Gradle it will choke if you try and use a reference in the gradle configuration. This is such a small priority edge case. Please manually extract the literal value from the reference and use it as this is not on my radar for a fix any time soon.
The alternative is having Apktool detect a string reference in versionName and extract the literal value from that reference and then using that literal value in the parameter passed to aapt. In the past I've written functions that track down literal values from references, but these modified the original apk inserting said literal value which I don't like any more as that changes the original.
If anyone would like to submit a pull request. Please don't modify the original files, so just grab the value of the reference and pass that to AndroidLibResources. Accepting PRs to fix this.
iBotPeaches
changed the title
versionName field read programmatically is null after decode and building the app
versionName reference instead of literal value fails
Apr 28, 2016
2.1.0/Mac/https://www.dropbox.com/s/0c6kwrqoutxtfh5/sampleapp.apk?dl=0
Steps to Reproduce
Run the app as it is to see the versionName.
Now, decode, build and run the app without making any changes. On running, you will see that the versionName is null. versionName is read using the following piece of code -
The text was updated successfully, but these errors were encountered: