0

I am currently working on a project using the javascript language. What I do is rename the extension of my apk to zip file. Then through the JZIP library I capture the data from the androidManifest.xml file to edit the name of the application, but this file is encrypted and I can not edit it. There is some way to be able to decode that file to native xml, apply changes and re-encode it. This is posible? Thanks

2 Answers2

0

Basically, you could use apktool/aapt to decode your AndroidManifest.xml.

If you want just update AndroidManifest, put it back in the apk and run it - it won't work. The checksum and the signature won't be valid anymore.

If you thinking about decompiling the app and recompiling it with the updated manifest, it might work, but the result will depend on the complexity of the application. Keep in mind that you'll need to sign the app.

There're multiple questions similar to yours, you could try to find luck with them:

Decompile an APK, modify it and then recompile it

How to view AndroidManifest.xml from APK file?

Is it possible to edit AndroidManifest.xml after packaging the APK

scor4er
  • 1,580
  • 12
  • 23
  • Thanks for the answer, then there is another way to read encode androidManifest from javascript and re-code again? Yes I need to sign apk but I will perform with external app – Jose Ahías Vargas Mar 27 '18 at 14:13
  • I doubt that it can be done in a client-side js, it looks like a server task. I would create a web service which has an access to the aapt tool and send an APK and a new app name to it for processing. Then I would download a decoded result. – scor4er Mar 27 '18 at 14:24
  • Thanks men this is the accepted answer. By the way, could you give me your help in this question https://stackoverflow.com/questions/49599747/compile-androidmanifest-xml-from-java-aapt – Jose Ahías Vargas Apr 01 '18 at 16:18
0

I found the solution. First you need apktool.jar, after make a java rest API like spring boot, and execute apktool commands with processbuilder java method. The only way that I found to change appname programatically is decompiled, edit androidManifest and smali archives and compiled again the apk with apktool or aapt