Disclaimer
Please note that the information provided here is intended for educational and research purposes only. Always respect the rights of software developers and abide by the terms of service of the applications you modify.
Introduction
The discussion provided does not relate to "cracking" or "pirating" applications which is often associated with "Modded APKs", but rather several modifications and optimizations to APKs, mainly aiming to improve performance and reduce file size. This includes deletion of certain packages from APKs, such as analytics, crashlytics, trackers etc. This requires removing all invokes and reliances on the packages from the code of the APK.
Tools
-
MT Manager - Extremely useful file manager, designed with a major focus on APKs. A paid version is available, but the free version is sufficient for most necessary functions, and alternative tools are available for some. The official website is in Chinese, and the app is also uploaded on APKCombo by the developer, Lin Jin Bin. Useful features include:
- Quick extraction of APKs
- DEX file editor with features such as:
- Quick navigation between methods and classes
- Quick search and replace in smali files, regex supported
- Search strings in smali quickly
- Quickly clear a method, also minimizing registers for optimization
- Quickly clear all debug info (reduces size)
- Minification of resources
- Obfuscation of resources (this effectively saves space; but has a chance to break some apps)
- Optimization of APKs
- Automatically signing APKs after modification
- MP Manager - A free open source Android file manager with a major focus on APKs, designed by me as an alternative to MT Manager. It integrates many of the tools in this list on-device, including APK decompiling/building, DEX editing, signing, AXML editing, cloning and more. See the MP Manager page for more details.
-
Apktool - A tool for reverse engineering Android APK files. It can decompile and recompile APKs, allowing you to modify the code and resources of an app. It is a command-line tool and requires Java to be installed on your system. Some of its features include:
- Decoding and encoding of APK resources
- Decompiling and recompiling APKs
- Debugging and analyzing APK files
-
JADX is a tool that can decompile DEX of APKs into more readable Java code, and can also show resources/manifest contents.
- Extracts DEX bytecode, decompiles into readable code and reconstructs classes/methods/variables as best as possible
- Searching for specific classes or methods
- Handle inner classes and references to some degree so code is easier to follow
- Some original structure (like exact variable names or comments) may not be recoverable
- Decompiled code typically cannot be recompiled easily due to reconstruction differences
- Apktool M - Not to be confused with the Java program apktool, APKTool M is an Android app with many features, including:
- Fast decompilation of APK files
- Several optimizations for APKs. UltraZip is most effective; I have noticed it breaks media pickers in apps.
- Antisplit - converting split .apks, .xapk, .apkm files to .apk
- Integration with MPatcher, another tool by the same developer, focusing on scripts to patch APKs in several ways, such as:
- Optimizing images (it uses optipng and pngquant)
- Disabling (not removing) analytics
- Deleting languages except default language
- Deleting files that are unnecessary for the current device; this includes files for different CPU architectures or display sizes.
- Deleting some types of unused smali files
- Quickly separating APK with multiple to versions with individual libs to reduce size
- Support for writing custom scripts
- APK Editor - A very old app, some versions may be maintained by other developers. It supports decompilation and custom patches, but is quite slow and may not work on some modern apps.
- AntiSplit M - An open source app worked on by me to convert split APKs to a single APK.
- AXML Editor - Open source editor I worked on to edit Android binary XML (AndroidManifest.xml and layout XML) files (Improved Version integrated in MP Manager).