Search code examples
xml-parsingapkapktool

How to Decompiling Apk files that Generated By Android Studio


I have lost my android studio project completely and there is no way to get it back. Now, I'm trying to decompile my apk file to access my java classes and xml files.

using dex2jar and jd-gui, I get my java classes BUT non of programs that I tested.So far, I can't decompile my xml files!

apktool show me this error:

Exception in thread "main" brut.androlib.err.UndefinedResObject: could not decode arsc file

do i have to create all of my xml again? or there any way to decompile apks that generated by android studio?

Edit: "Apk Studio" Give me same error with apktool for decompiling apk file.


Solution

  • To decompile the XML files you can use the following tools:

    1. JadX - https://github.com/skylot/jadx
    2. Apktool - https://github.com/iBotPeaches/Apktool

    Remember the apktool which you are using is probably a very old version. Download the latest version of apktool.jar from https://github.com/iBotPeaches/Apktool/releases/download/2.1.1/apktool_2.1.1.jar

    Below are the two process through which you can get the xml files.

    Apktool Method:

    1. Download the latest apktool jar from https://github.com/iBotPeaches/Apktool/releases/download/2.1.1/apktool_2.1.1.jar
    2. Run it using java -jar apktool.jar d <apkfile.apk> without the angular brackets and substituting apkfile.apk with the actual path to the apk file

    Jadx method:

    1. Download the latest release of jadx from https://github.com/skylot/jadx/releases
    2. Unzip the file and then goto bin/ folder
    3. Windows user can double click the jadx-gui.bat file
    4. Linux/Mac users can run the shell script ./jadx-gui
    5. This will open jadx gui through which you can open the apk file.

    Reference: Jadx open dialogue

    enter image description here