Advertisement
metalx1000

Android Unpack and Repack APK files

Jul 11th, 2020 (edited)
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.32 KB | None | 0 0
  1. #Unpacking and repacking APKs for Android
  2. sudo apt install apksigner zipalign apktool
  3.  
  4. #####MAKE SURE YOU HAVE THE NEWEST RELEASE!!!!!!!!!!!!!
  5. #or get current release
  6. # https://github.com/iBotPeaches/Apktool/releases/
  7. wget "https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar"
  8.  
  9. #list apks on device
  10. adb shell pm list packages -f -3
  11.  
  12. #pull apk from device
  13. adb pull /data/app/com.stupid.name-yX7iNj2s_26_re5bRH-Hfw==/base.apk
  14.  
  15. #unpack apk
  16. apktool d base.apk
  17. #or if jar file downloaded from git
  18. java -jar apktool_2.7.0.jar d base.apk
  19.  
  20. #make changes and repack
  21. ####To make home screen launcher add this to AndroidManifest.zml#####
  22. <category android:name="android.intent.category.HOME"/>
  23. <category android:name="android.intent.category.DEFAULT" />
  24.  
  25.  
  26. apktool b base
  27. #or if jar file downloaded from git
  28. java -jar apktool_2.7.0.jar b base
  29.  
  30. #alg
  31. zipalign -f -p 4 base/dist/base.apk myapp.apk
  32.  
  33. #create key to sign with - and password for key
  34. keytool -genkey -v -keystore release.keystore -alias example -keyalg RSA -keysize 2048 -validity 10000
  35.  
  36.  
  37. #sign the apk - remember the password you just created
  38. apksigner sign --ks release.keystore myapp.apk
  39.  
  40. #install on device
  41. adb install myapp.apk
  42.  
  43. ##Note, if the app is already installed with a different key you will need to uninstall it first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement