Search code examples
androidxmlcordovaapk

Encoding issue of AndroidManifest.xml file


I'm building phonegap app using phonegap-build.

I need to make some changes to the manifest of the android apk.

After i download the apk of my phonegap build, i rename it to .zip file to see the contents of the file.

When i open it, there i see the xml file there, and when i open that one, it has encoding problem.

This is what i see:

enter image description here

I understand it's a binary, but i need to see the content in plain english, if possible.

1) How can i encode it to see what is the content of this file properly? 2) After a change that i do on it, can i "decode" it back to binary?


Solution

  • So from what you wrote, you want to edit the AndroidManifest.xml from an APK file AFTER you built it, which is quite complicated. I suggest editing the source AndroidManifest.xml and then re-building the APK. If you can't do this then please do the following:

    (1) First, download and install Apktool. It is a free Android tool for decompiling and recompiling apps quickly. It provides access to .class files, resources and XML's. Here's a tutorial on how to install Apktool.

    (2) Then you want to decompile your APK file (tutorial).

    (3) Edit the AndroidManifest.xml file.

    (4) Re-build the application (tutorial).

    (5) Finally, you will have your APK file but it will be mostly useless as it is un-signed. You can't install un-signed apps as you will get an error (it may be possible to force-install it using root or adb tho) and you can't publish them. To sign it you can check out this link.

    IMPORTANT INFORMATION: Your app will have to be signed with the same certificate with which it was signed the first time, otherwise it will be considered a different app. Not completely tho, you will have to un-install previous versions in order to install this one.
    And yes, I know it's a very long and time-taking process but it is supposed to be, only if you have the source you should be able to edit the app.