Pages

11/02/2017

Extract Android Source Code from APK File



REQUIRED ZIP FILES

  • apktool1.5.2
  • apktool-install-windows-r05-ibot
  • dex2jar-0.0.9.15
  • jd-gui-0.3.3.windows

All the files listed above are available as freeware on the Internet.


STEP 1:
Create a folder with a name "Step 1".



STEP 2:
Extract "apktool1.5.2".



STEP 3:
Extract "apktool-install-windows-r05-ibot".


STEP 4:
Copying all the files from this extracted ZIP Files to the created new folder called "Step 1".


STEP 5:
Copy the APK File for which you want to extract the source Code to the created new folder called "Step 1".


STEP 6:
Open "Command Prompt" by Right Click with pressing the "Shift Key" on the Keyboard.Then Choose "Open Command Window here" option from the Right Click Menu.



STEP 7:
Type the command as shown below.
apktool decode "Appname.apk"



NOTE:
For Me the Appname is "GPA and CGPA.apk" here.

STEP 8:
Now a new folder will be created with your "Appname".


STEP 9:
Open that folder, You can find Android Manifest file with the Resource folders like Drawables, Layouts, Menu, Values and etc.



STEP 10:
Now rename the "Appname.apk" pasted on the folder "Step 1" as "Appname.zip".


STEP 11:
Then, It will show a warning Click on the "Yes" button.


NOTE:
If you are unable to see the extension of the file. Go to the "Organize" from the menu bar. Then, Choose "Folder and Search options". 


Now, Choose "View" tab. 


Then, disable the "Hide Extensions for the known file types" Checkbox. Click on the "OK" button. It will show the Extension of the file.

STEP 12:
Now extract the Renamed Application ZIP File.



STEP 13:
Now open the extracted folder from the Zip file. There will be "classes.dex" file.


STEP 14:
Extract the "dex2jar-0.0.9.15" Zip file on the folder called "Step 1".


STEP 15:
Now copy the "classes.dex" to the extracted folder called "dex2jar-0.0.9.15".


STEP 16:
As we seen above open the Command Prompt from "dex2jar-0.0.9.15" folder.


STEP 17:
Run the below command to get the jar file of the classes.dex file
"d2j-dex2jar classes.dex"



STEP 18:
Now you can find a jar file called "classes-dex2jar.jar" on the folder called "dex2jar-0.0.9.15".


STEP 19:
Extract the "jd-gui-0.3.3.windows" Zip file on the folder called "Step 1".


STEP 20:
Open "jd-gui.exe" file


STEP 21:
Choose File -> Open file.


STEP 22:
Choose the generated "classes-dex2jar.jar" file. Then, Click on "Open" button.


STEP 23:
Choose File -> Save All Resources.


STEP 24:
Choose the location as "Step 1" folder to save the class files. Then, Click on "Save" button.


STEP 25:
Wait for sometime to save the class files.



STEP 26:
Now you can find a zip file called "classes-dex2jar.src.zip" on the "Step 1" folder.


STEP 27:
Extract the "classes-dex2jar.src.zip" file.


STEP 28:
From there you can see the class files on the created new folders.





NOTE:
For me All Class files are available under the path "\Step 1\soft\pack\gpacgpa\".

Other Related Links



No comments:

Post a Comment