Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encode/Decode AndroidManifest.xml inside APK

Tags:

I'm using ApkTool to decode AndroidManifest.xml inside an APK file and it works perfectly but how can I encode it again ,the same way it was encoded before, after applying some changes? For example (in my case) changing the app label.

like image 979
Soheil Setayeshi Avatar asked May 27 '13 16:05

Soheil Setayeshi


1 Answers

You may use apktool again to create a new APK file including your changed AndroidManifest.xml.

First, decompile the APK file:

java -jar apktool.jar decode app.apk app 

Then modify the files you want in the app directory and recompile it back into a new APK:

java -jar apktool.jar build app app_new.apk 

aapt must be on our PATH or use the --aapt option to specify the location of the executable. Otherwise apktool will fail when rebuilding the APK.

Note: The rebuilt APK is neither signed nor zipaligned, just repackaged. Take a look at this website for details about signing and aligning your new APK.

like image 191
nif Avatar answered Sep 16 '22 14:09

nif