-1

I made an app and installed it on my phone and it's working on my phone, can I get that source code back? Formatted my hard drive and didn't backup the project. It's not a big project but it'd be nice if I could get it back easily.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
qwert
  • 331
  • 2
  • 12
  • This is a poorly researched question: There is no Java source code in a APK. Your code would have been transformed. You would need to get the source code back out from your APK - http://stackoverflow.com/questions/3593420/is-there-a-way-to-get-the-source-code-from-an-apk-file If the app is simple enough - it is probably easier to rewrite it from scratch. – Morrison Chang Dec 23 '16 at 19:16
  • Yeah I realize it's just an APK, was just hoping there was some way. Oh well! – qwert Dec 23 '16 at 19:25

2 Answers2

2

You have to access your android device via terminal to get the APK from it. Moreover you'll need to root the device if the app has been installed from the app store. Once you got the APK you can decompile it in java code.

Root your device: http://www.digitaltrends.com/mobile/how-to-root-android/

Get the APK from the phone:

  • Connect the phone to your computer and open a terminal.
  • Run adb shell so you get into your phone.
  • Run find /data/app -name '*.apk' to list the apks installed and copy the name of the one in your interest.
  • Run adb pull /data/app/appname.apk

Now that you have the APK on your computer you have to decompile the APK.

Community
  • 1
  • 1
Jackie Degl'Innocenti
  • 1,251
  • 1
  • 14
  • 34
0

Yes, it is possible by android reverse engineering. Though it can not get you back all the lost codes always, even it is helpful for the developers. You will have to go through some processes to achieve this. All the method to do this step by step is given here:

Reverse engineering from an APK file to a project

Community
  • 1
  • 1
UkFLSUI
  • 5,509
  • 6
  • 32
  • 47