Ever wanted to get your source code back from an .apk file after having lost it? Well here’s how to do it. Losing source code is always a complete annoyance during Android app development, but following this method you can get it back fairly easily. Download links are below and written instructions come after the break:
Prerequisites:
1. Get APK source code files for Windows
or
2. Get APK source code files for Mac OS X
or
3. Get APK source code files for Linux
Step 1. Rename the .apk file you wish to retrieve and change the extension to .zip. Then extract the file that it creates.
Step 2. 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.
Step 3. 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.
Step 4. Extract the saved .zip and copy the contents to a new folder somewhere. This will be where we keep your source code.
Step 5. 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 <yourapk.apk>
Step 6. Now just copy the contents of the resulting folder to the same place you copied the contents of “classes.dex.dex2jar.jar” earlier and voila, you have your source code. You may need to remove a couple of things as shown in the video, but your entire code should be there!






hello. I did exactly as you explained and got everything OK, but I couldn’t get it into eclipse.
could you explain me how to do it?
thanks
Thanks for sharing this video. Well explained, perfectly done and an excellent work.
It worked like a charm…It helped me a lot…thanks again..
@John: I even able to import to Eclips, its cool nothing complicated.
1. Navigate to Import section
2. Select ‘Existing Android project into workshop’ option under ‘Android’ section and click on ‘Next’
3. In the next screen browse and select the app folder, check the option ‘Copy project into workspace’.
A app is imported successfully.
Hope this will help you…
Cheers..
Hi
Thanks for information,we have successfully tried out all the steps mention To Retrieve Source Code From An Android .APK File. But we are unable to open with Eclips , by trying the below steps.
1. Navigate to Import section
2. Select ‘Existing Android project into workshop’ option under ‘Android’ section and click on ‘Next’
3. In the next screen browse and select the app folder, check the option ‘Copy project into workspace’.
So we created the new android project in Eclips and copy paste the res src and other files then source code is given lots of error,
Kindly let use know how to proceed
I would suggest that if you don’t know how to deal with Eclipse errors, you shouldn’t be messing with code :p
I am getting some problems during step 3.
The error is “jd-gui.exe has encountered a problem and needs to close. We are sorry for the inconvenience.” and because of that my .src file is not getting generated. I tried downloading directly from jd-gui website but still the error persists. How can I fix this problem?
Run it in compatibility mode with Win XP
OR downloading the latest version of jd-gui will also solve this problem
http://java.decompiler.free.fr/?q=jdgui
Is there any way you can get the update version of it please…?
Thank you.
I just saw v1.5.2 of the apk tool but there are files missing from the zip that the new version has.
So could you help us out?
It’s working perfectly.Thanks for sharing the knowledge.Cheers!!
i’m not able tp get the source code u plz help me to retrive an application for me
What’s the issue?