Search code examples
javaandroidapkdecompiling

Get source code of my installed Android app


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.


Solution

  • 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.