Source code from apk file recovered but its not the same which I wrote
I was creating a app for Android, it was nearly complete but now the hard drive crashed and I lost all my data along with the source code for my app. But, Luckily I had installed that app on my phone so I got the .apk file for my app and also decompiled the file using the steps mentioned in this article, Is there a way to get the source code from an APK file?
But I am having one problem, the source has changed a bit, at some places where I had mentioned some variable names are replaced by some digits. I am attaching the Screenshot of the code so that you can have a proper look at the problem.
Can anyone tell me how can I solve the problem and recover the original code which I wrote. Because I can't waste the time in writing the whole code again.
I was not able to upload the screenshot here, so I am pasting the link to the photo.
You cannot recover the exact source code from an APK; it's not there. The code you have recovered is the best you can do -- it's an approximation based on the compiled code.
Based on the screenshot of what you've recovered, you're very fortunate to have something at that high a level.
Use this to convert it to JAR and then this to get the code.
The problem with the variables could be caused by obfuscator - ProGuard. There is a way to de-obfuscate it, but as mentioned above, you have gotten very very far and you are lucky to have what you have.
EDIT:
From official developer site:
Caution: Every time you run a build in release mode, these files are overwritten with the latest files generated by ProGuard. Save a copy of them each time you release your application in order to de-obfuscate bug reports from your release builds.
I am not sure you can de-obfuscate it withou the original ProGuard settings...
链接地址: http://www.djcxy.com/p/31974.html