This Apktool issue has existed for a long time and is especially prevalent with ROMs with multiple frameworks. The issue happens because Apktool treats reference values inside XMLs (like layouts) as raw text values, and doesn't resolve them during decompile time. This causes some values to be misformed, but more importantly, this causes values referencing to secondary frameworks to not be resolved with their source frameworks, which also means the framework ID won't be added to usesFramework.ids in apktool.yml, and that breaks recompiling. The interesting thing is that reference values are actually being resolved when they are located in value resources, like styles, thus presenting an inconsistent behavior. This simple mod eliminates the "rawValue" for reference values, and that forces the "value" (resource ID) to resolve against the respective frameworks, fixing misformed values in the process. BEFORE: I: Using Apktool 2.4.0-896569-SNAPSHOT on Notes.apk I: Loading resource table... I: Decoding Shared Library (miui), pkgId: 16 I: Decoding Shared Library (miui.system), pkgId: 18 I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: bin\framework\1.apk I: Regular manifest package... I: Decoding file-resources... I: Loading resource table from file: bin\framework\16.apk I: Decoding Shared Library (androidhwext), pkgId: 15 I: Decoding values */* XMLs... I: Baksmaling classes.dex... I: Copying assets and libs... I: Copying unknown files... I: Copying original files... Some comparisons before and after the fix: https://i.imgur.com/2gTllT0.png https://i.imgur.com/KzJUeQt.png AFTER: I: Using Apktool 2.4.0-896569-SNAPSHOT on Notes.apk I: Loading resource table... I: Decoding Shared Library (miui), pkgId: 16 I: Decoding Shared Library (miui.system), pkgId: 18 I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: bin\framework\1.apk I: Regular manifest package... I: Decoding file-resources... I: Loading resource table from file: bin\framework\16.apk I: Decoding Shared Library (androidhwext), pkgId: 15 I: Loading resource table from file: bin\framework\18.apk I: Decoding Shared Library (miui), pkgId: 16 I: Decoding Shared Library (android.miui), pkgId: 17 I: Decoding values */* XMLs... I: Baksmaling classes.dex... I: Copying assets and libs... I: Copying unknown files... I: Copying original files...
Apktool
This is the repository for Apktool. If you are looking for the Apktool website. Click here.
It is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc.
It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like.
Support
Sponsored by
- Sourcetoad - helping with a weekly sponsorship for continued improvement and maintenance of the project.
IDE of Choice
Security Vulnerabilities
If you discover a security vulnerability within Apktool, please send an e-mail to Connor Tumbleson at connor.tumbleson(at)gmail.com. All security vulnerabilities will be promptly addressed.