How to extract source code from apk

Search This thread

amit@12

Senior Member
Hey guys heres a way to extract source code of an apk

I know many of u may know it but still no thread in this section
If its wrong or right or a question only then reply

NOW WHAT IS SOURCE CODE:
A text listing of commands to be compiled or assembled into an executable program

How to extract source code:

Requirements
1. Android-apktool

2. Dex2jar

3. JD-Gui

Procedure
Rename the .apk file you wish to retrieve and change the extension to .zip. Then extract the file that it creates.

Copy the contents of the dex2jar folder to the extracted folder to make it easier for yourself, and run:

dex2jar classes.dex

and copy the resulting “classes.dex.dex2jar.jar” into a new folder.
Open up the Java Decompiler and drag “classes.dex.dex2jar.jar” into the window and then go to File > Save and save the source in a .zip file.
Extract the saved .zip and copy the contents to a new folder somewhere. This will be where we keep your source code.
Now, copy “framework-res.apk” and “yourapk.apk” to the APKTool folder. Then open a command prompt or Terminal window and type:

apktool if framework-res.apk
apktool d

Now just copy the contents of the resulting folder to the same place you copied the contents of “classes.dex.dex2jar.jar” earlier and you have your source code.

Apk source code files
http://db.tt/oqdrcBpk

Now to import this project into eclipse
Go here
Enjoy modifying

Sent by typing by my fingers
 
Last edited:

Scripts

Senior Member
Dec 14, 2013
54
7
Thanks for the small guide. I've been wondering if there was a way to do this.

Sent from ALCATEL One Touch Fierce
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Hey guys heres a way to extract source code of an apk

    I know many of u may know it but still no thread in this section
    If its wrong or right or a question only then reply

    NOW WHAT IS SOURCE CODE:
    A text listing of commands to be compiled or assembled into an executable program

    How to extract source code:

    Requirements
    1. Android-apktool

    2. Dex2jar

    3. JD-Gui

    Procedure
    Rename the .apk file you wish to retrieve and change the extension to .zip. Then extract the file that it creates.

    Copy the contents of the dex2jar folder to the extracted folder to make it easier for yourself, and run:

    dex2jar classes.dex

    and copy the resulting “classes.dex.dex2jar.jar” into a new folder.
    Open up the Java Decompiler and drag “classes.dex.dex2jar.jar” into the window and then go to File > Save and save the source in a .zip file.
    Extract the saved .zip and copy the contents to a new folder somewhere. This will be where we keep your source code.
    Now, copy “framework-res.apk” and “yourapk.apk” to the APKTool folder. Then open a command prompt or Terminal window and type:

    apktool if framework-res.apk
    apktool d

    Now just copy the contents of the resulting folder to the same place you copied the contents of “classes.dex.dex2jar.jar” earlier and you have your source code.

    Apk source code files
    http://db.tt/oqdrcBpk

    Now to import this project into eclipse
    Go here
    Enjoy modifying

    Sent by typing by my fingers
    1
    M not Able to Find dex2jar classes.dex

    You have to run it in CMD that "dex2jar classes.dex" is not a file. its a command.