Extracting an APK: Difference between revisions
Fieryhenry (talk | contribs) Package name editing link |
Fieryhenry (talk | contribs) remove external link |
||
| Line 7: | Line 7: | ||
Note that using this method will not decode any resources and the AndroidManifest.xml file will be in a binary format which is difficult to edit. In practice this means that you won't be able to edit the app name, icon, permissions and any other metadata you may want to edit. | Note that using this method will not decode any resources and the AndroidManifest.xml file will be in a binary format which is difficult to edit. In practice this means that you won't be able to edit the app name, icon, permissions and any other metadata you may want to edit. | ||
You can [[Package name editing|edit the package name]] with a tool such as [ | You can [[Package name editing|edit the package name]] with a tool such as [[simpleapk]], in the future this tool may expand to edit the app name and other data. | ||
== Extract using Apktool == | == Extract using Apktool == | ||
Latest revision as of 19:25, 5 September 2025
To see the internal files in an APK you need to extract it. There are various tools that can do this for you.
Extract as a zip file
Apks are effectively just zip files with some other signing information, therefore you can just use a tool such as 7zip to extract it, or just add a .zip extension to the end of the filename and extract it with your file explorer's zip extractor.
Note that using this method will not decode any resources and the AndroidManifest.xml file will be in a binary format which is difficult to edit. In practice this means that you won't be able to edit the app name, icon, permissions and any other metadata you may want to edit.
You can edit the package name with a tool such as simpleapk, in the future this tool may expand to edit the app name and other data.
Extract using Apktool
Apktool can extract the apk as well as decode any resources.
See install to install apktool to your system.
Then to extract the APK and decode the resources the following command can be used:
apktool d path/to/apk.apk --no-src -o path/to/output_dir
Replacing path/to/apk.apk with the file location of the input apk file you want to extract.
-o path/to/output_dir is optional, but useful if you want to place the extracted files in a specific location, replacing path/to/output_dir with the location of the folder to put the extracted files in.
--no-src is used to prevent apktool decompiling some of the game code, if you want to modify the dex code remove this flag.
Note that sometimes apktool may fail to decode some resources and so when you build the apk after modding, it may fail to build correctly. If this is the case, you may want to just extract without decoding resources:
apktool d path/to/apk.apk --no-src --no-res -o path/to/output_dir
If you still want to change certain details such as the package name, permissions, and other metadata stored in the AndroidManifest.xml, you can use the --force-manifest flag:
apktool d path/to/apk.apk --no-src --no-res --force-manifest -o path/to/output_dir