Decompile AndroidManifest.xml packaged in apk from binary form into normal xml file, edit it and recompile it back into binary file acceptable for apk. Basically I need a driver for AXML files
I'm working on an APK injection project. My goal is
I use apktool for assembling and disassembling the apk. However the apk tool works only with --no-res
option, if apk is disassemled with resources it can not be built back. Here's a github issue describing this bug.
Since I disassemle the apktool d --no-res app-debug.apk
with no res flag the Generated android manifest comes in binary form. I can disassemble the manifest using apktool
but I can not assemnle it back.
I need to either:
apktool
with resourcesAndroidManifest.xml
with plain-text version and then build. The apktool
would build. However the installation of the app to device fails with "Parse error there is a problem while parsing the package".apktool
: v2.3.2
, v2.3.1
, v2.3.0
, v2.2.0
, v2.2.1
, v2.2.2
Although stackoverflow is a community for knowledge sharing, and not judging what it's used for - I see a lot of people picking on others in similar questions with accusations for illegal activities.
What I'm doing is absolutely legal and will not be used to exploit anyone.
Installation can give parse error on following condition, see if any met with you -
You can manually sign your apk as given here.
The only reliable way I found to repackage the application with plain text androiod manifest is by repacking it using aapt
directly.
aapt package -f -M ./AndroidManifest.xml -S res1/ -S res2/ ... -I android.jar -F MyProject.apk.unaligned
To create the apk, and then :
aapt add -f MyProject.apk.unaligned classes.dex
To add compiled sources to the package.
Then using jarsigner to sign the package:
jarsigner -storepass <keystore password> -keystore <keystore filename> MyProject.apk.unaligned <key name>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With