Skip to content

Instantly share code, notes, and snippets.

@benvium
Created February 20, 2015 16:14
Show Gist options
  • Save benvium/5923d50c30ab7c7df0f3 to your computer and use it in GitHub Desktop.
Save benvium/5923d50c30ab7c7df0f3 to your computer and use it in GitHub Desktop.
How to change the version number on an existing APK without re-building

This requires the latest version of apktool.

apktool d $APK_PATH -o $OUTPUT_FOLDER

# Open the apktool.yml text file
# Alter the versionCode and versionName entries

# now rebuild!
apktool build $OUTPUT_FOLDER 

# next you need to re-sign the apk with the original keystore file
jarsigner -verbose -keystore $KEYSTORE_PATH -storepass $KEYSTORE_PASSWORD -keypass $KEYSTORE_KEY_PASSWORD $APK_PATH $KEYSTORE_KEY_NAME
~/android-sdk/build-tools/21.1.1/zipalign  -v 4 $APK_PATH $APK_OUT_PATH
@NikolayJuly
Copy link

I'm trying to do the same with aab. But changing AndroidManifest.xml is not enough... while upload aab I'm getting error that Version code already used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment