2

I have accidentally formatted the hard drive where I had all of my projects. The project I'm currently working on is completely lost, but I have the app running on my device. I didn't generate an apk, I just ran it using the 'run' option in Android Studio to test as a wrote the code.

Is there a way to retrieve the source code in this case? I have tried extracting the apk from the device (inside \data\app[package name]) and using several decompilers tools available, but none of them show me any of my code.

Thanks in advance.

Adrian Flores
  • 325
  • 4
  • 10
  • 1
    There is one decompiler you could try, but he will take a bit of time to do it. His name is Adrian Flores. – Derrops Mar 27 '17 at 23:07
  • @Snickers3192 Not very helpful. I spent a lot of time developing this, rewriting the app is definitely my last resource. It is my own code, I'm not stealing code from anyone else. Is there a way to recover MY source code or not? – Adrian Flores Mar 27 '17 at 23:10
  • Have you seen: http://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk – Morrison Chang Mar 27 '17 at 23:12
  • Sorry couldn't resist. Take it as a learning experience. I suggest getting a private github repository or at least google drive it. Put a cap on how much time you'll spend on trying to get this code back, me personally I think you already know what you must do. – Derrops Mar 27 '17 at 23:13
  • Thank you, @MorrisonChang. I tried that, but I only see one package (com.android.tools) after I convert the classes.dex files to .jar and then use jd-gui to decompile it. I don't see any of my own code there. Is it maybe because the app was not installed like a normal, generated apk, but using the 'run' action in Android Studio? – Adrian Flores Mar 27 '17 at 23:41
  • Perhaps, I'm unfamiliar with how 'instant run' may interact with the Dalvik/ART runtime. Regardless I agree with @Snickers3192, time limit your reconstruction attempts, learn from experience, and start coding with backups. – Morrison Chang Mar 27 '17 at 23:53
  • try http://www.javadecompilers.com/apk – TWL Mar 28 '17 at 00:15
  • @TWL Same result. Only one package and none of my code there. Thanks anyway. – Adrian Flores Mar 28 '17 at 00:44
  • How are those decompilers going for you @AdrianFlores ? – Derrops Mar 29 '17 at 04:57
  • 1
    @Snickers3192 The first decompiler you "suggested" is doing great work. Not only is he decompiling the code, he's making it better. He can also use github to back it up now. – Adrian Flores Mar 30 '17 at 16:06
  • See, I know what I'm talking about (; haha – Derrops Mar 31 '17 at 04:14

0 Answers0