-2

enter image description here

I have developed an app in android studio and test it in my phone. I have formatted my computer and forgot to save my project to somewhere. Now i want to get my source codes back. I get the APK file from my phone (either by using adb and some other tools).

I am using dex2jar and decompile my classes.dex file but it does not show my own Java classes. Is it possible to get them back?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
parliament
  • 371
  • 1
  • 5
  • 18
  • Even if you got your classses and decompiled them, they would be a mostly unreadable, and definitely unmaintainable mess. – Carcigenicate Oct 10 '16 at 17:57
  • why do you need that.? dex files are dalvik files ONLY required by the Dalvik or JVM – ΦXocę 웃 Пepeúpa ツ Oct 10 '16 at 17:59
  • The only thing I want is to get back my classes which I have written in the project. I dont want to write them again. I only have my own application in my phone and I can pul the apk file. I just need to obtain my classes from this apk file – parliament Oct 11 '16 at 06:31

2 Answers2

1

You can decompile it so easily a great tutorial below:

https://futurestud.io/tutorials/how-to-decompile-an-android-app-apk

4 easy steps as below:

1- unzip you apk like you unzip any zip file

2-find classes.dex files

3-convert them to jar file using dexToJar tool

4- open the jar file using JD-Gui application (availbale for windows/ubuntu/mac)

Amir Ziarati
  • 14,248
  • 11
  • 47
  • 52
0

This is usually done by some obfuscator, such as Proguard. This means, among other things, that the class names of your classes will be changed into meaningless names (such as A/B/C) the names will still be different in the fully qualified path of a java class, e.g. you might have multiple ""A" classes in different packages, but other than that you will have those class names multiple times. In most cases it will not harm te functionality of your program, but it will make it harder to reverse-engineer.

If this is your app and you can rebuild it, you can disable ProGuard or a subset of its features, otherwise you will need to reverse engineer it on your own.

MByD
  • 135,866
  • 28
  • 264
  • 277