metalx1000

Android Unpack and Repack APK files

Jul 11th, 2020
468
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Unpacking and repacking APKs for Android
  2. sudo apt install apktool apksigner
  3.  
  4. #list apks on device
  5. adb shell pm list packages -f -3
  6.  
  7. #pull apk from device
  8. adb pull /data/app/com.stupid.name-yX7iNj2s_26_re5bRH-Hfw==/base.apk
  9.  
  10. #unpack apk
  11. apktool d base.apk
  12.  
  13. #make changes and repack
  14. apktool b base
  15.  
  16. #create key to sign with - and password for key
  17. keytool -genkey -v -keystore release.keystore -alias example -keyalg RSA -keysize 2048 -validity 10000
  18.  
  19. #sign the apk - remember the password you just created
  20. apksigner sign --ks release.keystore base/dist/base.apk
  21.  
  22. #install on device
  23. adb install base/dist/base.apk
  24.  
  25. ##Note, if the app is already installed with a different key you will need to uninstall it first
RAW Paste Data