Advertisement
efxtv

How to replace files in an apk without decompiling it

Jan 23rd, 2025 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | Cybersecurity | 0 0
  1. To replace files in an apk without opening it; example
  2.  
  3. ##################################################################
  4. JOIN US ON TELEGRAM FOR MORE AND DETAILED CLASSES
  5. VISIT OUR TELEGRAM PROFILE: https://t.me/LinuxClassesEFXTv
  6. ##################################################################
  7.  
  8. ic_launcher.png files in your base.apk with new PNG files from other directories while maintaining the same directory structure, you can follow these steps:
  9.  
  10. Extract the APK: First, you need to extract the contents of the APK file. You can do this using the unzip command:
  11. $ unzip base.apk -d base_extracted
  12.  
  13. Replace the PNG Files: You can use the cp command to copy the new PNG files to the appropriate locations. Assuming you have the new files named the same as the original ones, you can do something like this:
  14. $ cp new_icons/ic_launcher.png base_extracted/res/mipmap-hdpi-v4/ic_launcher.png
  15. $ cp new_icons/ic_launcher.png base_extracted/res/mipmap-mdpi-v4/ic_launcher.png
  16. $ cp new_icons/ic_launcher.png base_extracted/res/mipmap-xhdpi-v4/ic_launcher.png
  17. $ cp new_icons/ic_launcher.png base_extracted/res/mipmap-xxhdpi-v4/ic_launcher.png
  18. $ $ cp new_icons/ic_launcher.png base_extracted/res/mipmap-xxxhdpi-v4/ic_launcher.png
  19.  
  20. Repack the APK: After replacing the files, you need to repack the APK. You can do this using the zip command:
  21. $ cd base_extracted
  22. $ zip -r ../new_base.apk *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement