Unpack, modify and rebuild an APK

This is NOT an “Android hacker HOW-TO”. This is only a quick reference for myself.

  • Step 1 : decompile APK using apktool d -f -r app_name.apk
  • Step 2 : delete the original apk
  • Step 2 : Modify SMALI files
  • Step 3 : Rebuild apk using apktool b app_name
  • Step 4 : Generate a signing key with keytool -genkey -keystore test.keystore -validity 10000 -alias test
  • Step 5 : Sign the new APK jarsigner -keystore test.keystore -verbose app_name.apk test
  • Step 7 : Install apk and enjoy!
apktool d -f -r app_name.apk
delete app_name.apk
--- modify smali files ---
apktool b app_name -o app_name.apk
keytool -genkey -keystore test.keystore -validity 10000 -alias test
zipalign -v 4 app_name.apk app_name_aligned.apk
apksigner sign --ks test.keystore --out app_name_aligned.apk app_name_signed.apk
adb install -r app_name_signed.apk
 

sarbyn

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.