Question

Unfortunately I got my computer stolen and the automatic cloudservice backup appeared to look automatic, but it had stopped months earlier. So I have lost all my Eclipse source files for my Android apps.

I'm trying to recover all these files and was hoping you could help me with the last steps.

So, what I did:

  1. Downloaded Astro File Manager from the Play Store: https://play.google.com/store/apps/details?id=com.metago.astro&hl=en

  2. Backed up my apps with Astro File Manager and copied them from my SD card to the computer.

  3. Downloaded the APK-tool: http://code.google.com/p/android-apktool/ (apktool-install-windows-r04-brut1.tar.bz2 and apktool1.4.3.tar.bz2) and extracted them into the c:\windows folder.

  4. Decoded the apk: apktool d name.apk

So far so good, but here I'm stuck. Since I'm quite new to Android Programming:

I get the following folders: res and smali

The res folders contains all my resources, but...

I can see that all my files that used to be in Eclipse in the src folder are now in the smali folder and have an .smali extension, but they look totally different.

Is there any method to get them back to "normal" (Java code)? Some kind of tool/trick step by step?

Thanks!

I came along this blog: http://jack-mannino.blogspot.com.es/2010/09/reversing-android-apps-101.html

But after extracting the dex2jar file Eclipse can't open the .class files. Anybody that can help? Also, what do the $1, $2 etc. mean behind the filenames?


OK, basically, what I did, but I'm missing the last step (I'm guessing):

  • Installed Astro File Manager
  • Backed up the app
  • Copied the APK and used dex2jar: 'd2j-dex2jar c:\apk\myappname.apk' to create the jar file
  • Used JD (http://java.decompiler.free.fr/?q=jdgui) to create a zipfile
  • extracted the zipfile

So I can see all the source code, but the Manifest seems to be missing, so Eclipse still doesn't open it as a project.

Can anybody give me the last tip? Thanks a lot!

Was it helpful?

Solution

In this kind of situation your best shot would be using dex2jar tool to convert apk(actually dex in it) to jar file and inspecting it with java decompiler like jd.

But JD sometimes produces misguiding java sources so you may have to refer smali code of the class which can be get by apktool.

Here is the dalvik opcodes : http://s.android.com/tech/dalvik/dalvik-bytecode.html

Finally, those $1, $2 after class names means inner classes those used in that class.

OTHER TIPS

use axmlprinter 2 to decode your manifest (most of the cases apktool doesn't work )so use dex 2 jar and for using AXMLprinter2 you have to unzip the file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top