How to Edit an Android APK
2013-04-26 09:47 - Programming
I've got a small handful of Android apps where I prefer something older than the latest version. Some change was added that I don't like. But the Play Store has a tendency to auto-update, and then I no longer have the old version I prefer. I do this rarely enough that I can't memorize the steps, but often enough that it's annoying to go look them up again. So here they are. You'll need apktool. Plus keytool and jarsigner, which just happened to be installed for me already (in Ubuntu).
$ apktool d WhateverApp.apk # Now edit some files, especially "versionCode" in AndroidManifest.xml. # I like to change app_name in res/values/strings.xml just a little bit too. $ apktool b WhateverApp/ # First time only: $ keytool -genkey -keystore $USER.keystore -validity 10000 -alias $USER $ jarsigner -keystore $USER.keystore -verbose "WhateverApp/dist/WhateverApp.apk" $USER
Voila! If you set versionCode high enough, you've got an old app's APK which you can side load, and the Play Store will never overwrite.