简体   繁体   中英

Recovering Source Code from Unfinished App on Android Phone

For the past month and a half I have been working on a project, an app for Android. Today my computer crashed. Apparently the backup didn't backup the source files for any of my projects though; it only backed up the drawable folders for some reason?

Anyway, I was wondering if there was a way to recover the source code from the app on the phone somehow. I never fully finished the app and created an .apk or anything, but I ran it on my phone several times for debugging purposes, so it is on my phone in a fairly recent state. Is there a way to somehow recover the source code for this? I would hate to have to redo anything, but it seems like I'm probably going to have to end up doing that.

I began the project in Eclipse Indigo but later switched IDEs to IntelliJ IDEA. The files I currently have on my computer are:

  • An EML file for the project. It appears to be blank.

  • The drawable folders

And that's it. Any ideas?

You can use dex2Jar to get a jar and then use JD-GUI to examine the code. Since it is decompiling it will not be exact, but close.

dex2jar: http://code.google.com/p/dex2jar/

JD-GUI: http://java.decompiler.free.fr/

You could look into this as an option:

It is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc.

http://code.google.com/p/android-apktool/

You can try file recovery softwares to get back your deleted files from your hard disk(if it is working). These softwares worked for me in recovering pictures from a formatted SDCARD. So you can give it a try.

You may be able to use IntelliJ IDEA's "local history" feature. IntelliJ keeps track of all your edits in .IntelliJIdea10 folder in the use home. If that folder has not been damaged in the crash you should be able to recover all your codes.

Just right click on the module directory in the Project tab and select Local History > Show History . Wait for the list of history items to load, it may take a couple of seconds. Right click on an item in the left panel and select Revert .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM