1

I have an android app on Google Play, from which I have lost the original files. I had everything on my computer, and usually I backup everything, but somehow I lost the project.

So, I have downloaded the APK from my Google Play Console, but the contents inside don't resemble in any way the structure of the original project. There is a Classes.dex file/ folder inside the package, which I can't seem to be able to open.

Is there a - relatively - easy way to reverse engineer the package and get the original projeckt back?

Many thanks in advance.

rainer
  • 3,295
  • 5
  • 34
  • 50
  • Few months ago I wrote an article about that (in Italian): https://www.informatica-libera.net/content/%C3%A8-possibile-il-reverse-engineering-di-unapp-fatta-con-codename-one-risalire-al-codice – Francesco Galgani Apr 30 '20 at 14:10
  • @FrancescoGalgani, thanks for sharing this. Unfortunately, my command of written and spoken Italian is rather poor ;-). (I speak Portuguese as another Latin based language, though, but that doesn't help much, from what I have seen at a first glance.) Before I try to translate, is it possible do achieve the above? – rainer May 01 '20 at 14:05
  • 1
    As Shai answered, the main issue is the obfuscation. In the page I linked, look for the text `Form hi = new Form("Decompile Me", BoxLayout.y());`. You will find three lines of code. Below them, there is the result of the decompilation using jadx: that code is close to the original Codename One code because there wasn't obfuscation (debug build). The next three lines of code show the result of decompilation in the case of obfuscation (release build): it's quite unreadable. So, if you used the obfuscation (that is the default for release builds), the decompilation is not very useful. – Francesco Galgani May 01 '20 at 16:54
  • Not much time to waste, then ... no need to dig any deeper, since I definitely didn't alter anything in the default settings. – rainer May 01 '20 at 18:09

1 Answers1

1

While there are tools to reverse engineer an Android project you won't have much to salvage. You can see some of that discussion here: decompiling DEX into Java sourcecode

But here are a few things about Codename One. I'll start with the good news: The res file will be intact.

If you didn't use CSS you can just take the res file "as is" and it should work just fine.

The bad news is that everything else is obfuscated by default. That means that all classes will be named with names such as a. So would all the methods etc. You might be able to salvage some code from that but not much.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks for looking into this. I have tried using d2jar, but, indeed, there are no classes or methods to make use of. :-( – rainer Apr 27 '20 at 13:46