How to deobfuse a jar file using the mapping.txt file created by Proguard?

This may seem suspicious, but I need to deobfuscate my own application . Some time ago I published my application, which I messed up with Proguard. Unfortunately, I did not save this version of the application and changed the code a lot.

Now I need the code for this older version. I still have a mapping.txt file created by Proguard.

I converted the classes.dex file to jar (using the dex2jar tool), now I need to un-defix it according to map.txt. Are there any tools that can help me? Maybe Proguard?

UPD I need a tool that can automatically rename all classes, functions, etc., Therefore, I do not need to do this manually. thank you

+5
source share
2 answers

If you have mappings, you can return all class, field, and method names. You can use java-asm (A bytecode modification library) to reassign class names and members. Most of the work will update member descriptors.

I made one for myself, and it took about a day for it to work reliably.

Edit: It's not perfect, but it's pretty damn close. Link GUI screenshot Give him a jar file, mappings and his "Rename everything he can find. There are a few questions, but in order to just look at the source, he has to do this work. Just unload the jar that it does (FileName +" -Re.jar ") to a decompiler such as Luyten / JD-GUI. Also, file inputs are changed only using buttons. Text fields are for visual feedback / confirmation only.

Edit 2: Fixed NPE that occurs when a class record in mappings does not exist in this bank.

Edit 3: Fixed a lot of problems, as a result of which the methods were not renamed.

Editing 4: Loaded compiled jar in github (releases, in the zip file that it uses in the mapping), support for several types of matching has been added.

+8
source

I suggest using the proguard tool as mentioned above in, as well as Enigma . Solving your problem cannot be very simple, and you need to use a combination of the available tools to fix it.

+2
source

Source: https://habr.com/ru/post/1245848/


All Articles