2

Are there ways to decompile obfuscated dex/jar files into Java source code? I have an APK with no classes.dex file within it, but I have the odex file. I've tried using oat2dex and dex2jar to get the dex/jar files, and then used a few decompilers to get the Java source, but I'm either getting errors on some parts, or really hard to read code since it's obfuscated.

Here's what I've tried

  • JD-GUI (first I've tried that completed decompilation, but with multiple errors)
  • Fernflower (couldn't complete)
  • Procyon (pretty good, but with some errors)
  • CFR (better, but with some errors)
  • Jadx (best, with least errors, but code is still obfuscated and hard to read, with multiple classes/methods with the same random names)

What can I do to get more readable code?

user1118764
  • 9,255
  • 18
  • 61
  • 113
  • Why are you decompiling obfuscated code? Making this difficult is the purpose of obfuscation tools. – Elliott Frisch Apr 26 '16 at 04:09
  • If there is a good one, i think people will stop obfuscating their code. – T D Nguyen Apr 26 '16 at 04:14
  • So am I right to say there's no solution? – user1118764 Apr 26 '16 at 04:17
  • The Krakatau decompiler is specifically designed for handling obfuscated code. However, there's nothing that will magically fix gibberish names. – Antimony Apr 26 '16 at 04:36
  • To "Fix" gibberish names you'll have to manually remap classes with a deobfuscator program like Enigma. Or if you can use a decompiler to get the source, you can do that all in your IDE (but it does take longer to do this). – Display Name Apr 27 '16 at 01:16

1 Answers1

4

There isn't any magical tool that will refactor all your obfuscated code into something meaningful and "clean". Obfuscated code is obfuscated: deal with it.

You can however save the obfuscated source code, create a project with your prefered ide (that support refactor) and manually analize functions and variables and refactor them to something meaninful. This require a lot of time, but eventually you will obtain an almost clean source code.

Luca D'Amico
  • 3,192
  • 2
  • 26
  • 38