I had developed an android app using Eclipse IDE.I had installed the app on my phone through USB debugging.My Hard drive crashed and i don't have the source code for that app.Is there any way to retrieve the full source code of the app from my phone?
-
do you have an apk file? – Milad Faridnia Nov 23 '14 at 12:16
-
i tried decompiling using apktool,dex2jar and jd-gui , but i'm not getting the original source code.It replaces my for loops with while and some labels as in 8086 programs. – Mario Nov 23 '14 at 13:56
-
1That is normal, that are optimisations by the compiler when the APK file is created. – Pieter Meiresone Nov 23 '14 at 14:59
-
@Mario: Hi ... I request you to mark this as the correct answer and upvote it ... thanks :) – Yash Sampat Apr 19 '15 at 18:18
3 Answers
YES!!!
Go to Google Play Store and install APK Extractor app on your phone. This app will create a copy of the APK of any app installed on your phone and store the copy in a location that can be accessed by you. Without APK extractor you would not be able to access the APKs of your apps (the folder where the APKs are stored requires superuser access, meaning you would have to root your phone).
Once you get the APK on your computer, download APKtool and decompile your app's APK.
Go to the folder created by APKtool where the contents of your decompiled app are kept. The source code is in a file called classes.dex. Convert this file to a .jar file using dex2jar
The source code in the .jar file can be viewed using jd-gui.
Please note that you should only decompile those apps that are your own intellectual property, not those of others. Good luck!

- 30,051
- 12
- 94
- 120
You will need to decompile the APK of your application. You will need to do two things:
Besides this I advise strongly to use a distributed version control system, like Git, to avoid these situations.

- 1
- 1

- 1,910
- 1
- 22
- 22
If you have and apk file i suggest you see this post:
How to inject code into an existing Apk?
it shows the way to decompile and apk. maybe in this way you can retrieve your code.

- 1
- 1

- 9,113
- 13
- 65
- 78