Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,692 Members 52,366 Now Online
XDA Developers Android and Mobile Development Forum

How to extract source code from apk

Tip us?
 
amit@12
Old
(Last edited by amit@12; 17th August 2013 at 02:36 PM.)
#1  
amit@12's Avatar
Senior Member - OP
Thanks Meter 114
Posts: 390
Join Date: Jul 2013
Location: jalandhar
Default How to extract source code from apk

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
My device- SAMSUNG GALAXY ACE PLUS GT S-7500

The Bootanimations Thread for Galaxy Ace Plus

#Bootanimation Hub™: You request, We Design
The Following 8 Users Say Thank You to amit@12 For This Useful Post: [ Click to Expand ]
 
red de0392
Old
#2  
red de0392's Avatar
Senior Member
Thanks Meter 118
Posts: 640
Join Date: Mar 2013
Location: Mumbai
Drop Box Link Not Working...please update it
 
Scripts
Old
#3  
Member
Thanks Meter 7
Posts: 54
Join Date: Dec 2013

 
DONATE TO ME
Thanks for the small guide. I've been wondering if there was a way to do this.

Sent from ALCATEL One Touch Fierce
Web Developer, Gamer. Feel free to message me Application questions.
 
red de0392
Old
#4  
red de0392's Avatar
Senior Member
Thanks Meter 118
Posts: 640
Join Date: Mar 2013
Location: Mumbai
M not Able to Find dex2jar classes.dex
 
DGuru
Old
#5  
Junior Member
Thanks Meter 1
Posts: 1
Join Date: Jan 2014
Quote:
Originally Posted by red de0392 View Post
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.
The Following User Says Thank You to DGuru For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes