Android Question Recovery Source Code

fabio borges

Member
Licensed User
Longtime User
Good afternoon Erel, my name is Fabio, I'm from Brazil, I've been using B4A for about 13 years and I'm very happy to have discovered your work. I'm writing here because I'm having a very serious problem, my writer was robbed and they stole a server where I kept several B4A and B4I projects, and unfortunately my backup system wasn't working, so I only have the sources for the projects updated until May of this year. I know there are messages on the forum with this question, but I decided to ask you for help directly because I'm kind of desperate, and I would like to know if there really isn't a tool that can extract the sources in B4 through the APK, this would be crucial for me to recover my company. I count on your understanding. Thank you in advance.
 

agraham

Expert
Licensed User
Longtime User
The closest thing to what you need that I know about is JADX but it produces Java, not B4A code. The B4A code doesn't make it into the apk, it is transpiled to Java and lost.
This is the download page - for simplicity you want jadx-gui-1.5.1-with-jre-win.zip
If you open the apk with 7-Zip and extract the classes.dex file then JADX can open it convert the DEX to Java and you can then save it with File -> Save All to get the sources as Java code. You would then have to see if you could recognise any B4A constructs from that Java.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
they stole a server where I kept several B4A and B4I projects
Maybe at some point, you uploaded some code to some cloud service (Dropbox, Google Drive, Github...) and don't remember it?
 
Upvote 0

xiaoyao

Active Member
Licensed User
Longtime User
can
Sorry to say, as @agraham wrote it is technically not possible to recover the B4A source code from the APK.
You can get JAVA code from APK, do not know if B4A has any mixed program?Encrypting or changing JAVA code to something that humans can't read directly makes it more complex
 
Upvote 0

xiaoyao

Active Member
Licensed User
Longtime User
The best way is to write a tool to automatically back up the project directory to the mailbox or another hard disk, and back up once a day or once a week. It is best to automatically filter not to back up APK files and DEX files.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Sorry for your loss but thanks for reminding me. I just did a backup.

Question: How often should I back up?
Answer: How much are you willing to lose?
 
Upvote 0

emexes

Expert
Licensed User
my writer was robbed and they stole a server where I kept several B4A and B4I projects,
Maybe at some point, you uploaded some code to some cloud service (Dropbox, Google Drive, Github...)

Also have a really good look on your local computers (and your writer on their computers), especially under B4X directories, for any automatic backups or intermediate files that might be left behind from when building projects.
 
Upvote 0

vmag

Active Member
All users are divided into two categories: those who do not make backups and those who will start making backups soon... There are many contradictions in your message... How can you store your developments on someone else's server for 13 years, especially the source code? These sources were not originally yours and belonged to the company you worked for..
 
Upvote 0
Top