• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Recover source code of app installed on device via 'Instant run'

adrianrff

Newbie
Jul 1, 2013
21
3
I have completely lost an Android Studio project I have been working on for a couple of months (lesson learned) and I only have the app installed on my device via 'instant run'.

Is there a way to recover the source code of an app that's installed in a device this way as opposed to a normal, generated apk?

I have tried several decompiler tools available and none of them give me any of my code. I tried posting in stackoverflow and got no useful answers either.

Help help will be greatly appreciated.

Thanks in advance.
 
Decompilers won't give you the original code back as you wrote it. They can only do a certain amount.

If the project with its original source code has been deleted, assuming it's not in the recycle bin or trashcan or stored elsewhere, it's gone.


Thanks, I know they don't give me the code as I wrote it, but I could at least recover some of my code and rebuild the app from there. The thing is that it doesn't give me anything at all. I've tried with other apps (my own apps too) and I can see every class and the code in them, but not with this one. I assume that it is because of the way the app was installed on the device.
 
Upvote 0
Instant run compiles an apk on the fly for code change deployment.

So if its deploying the apk each time then the code still exists.

What you are asking for is something that cant really be discussed here.

Try running a memory scanner and see what is being transfered via ram.

Would you please elaborate a bit, I'm not very experienced in this. How would running a memory scanner help me? What would I see and what kind of memory scanner should I use?
 
Upvote 0
I have completely lost an Android Studio project I have been working on for a couple of months (lesson learned) and I only have the app installed on my device via 'instant run'.

Is there a way to recover the source code of an app that's installed in a device this way as opposed to a normal, generated apk?

I have tried several decompiler tools available and none of them give me any of my code. I tried posting in stackoverflow and got no useful answers either.

Help help will be greatly appreciated.

Thanks in advance.

Your only option is to attempt to decompile the APK. Just a reminder that we don't discuss such topics on this forum, as obviously these techniques can be used for illicit purposes.
Unfortunately you've learned a hard lesson, which is that you should always use a source control system, and backup your code regularly.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones