-1

Recently I decompiled some Android APKs with dex2jar, jd-gui and Android studio.

Why can some classes' methods see the source code, and some classes' method can only see /compiled code/?
What's the difference between these two class when compiling?

What's more, I want to do the same compile work to my code to ensure the security. What tools can I look for ?

zccneil
  • 139
  • 11

2 Answers2

0

It can be happens because, your JAVA file cannot be readable due to improper bytecode or it may be encrypted. You cannot differentiate correct and incorrect JAVA files type.

Anyways, to properly compile your JAVA file, you can alternatively use Luyten (same as the jd-gui).

Source Link

Dhruv Patel
  • 1,529
  • 1
  • 18
  • 27
0

When Android Studio opens a .class file and cannot decompile the code, it just displays the "compiled code" message. There are lots of things that could prevent a decompilation because a lot of stuff is legal in byte code that is illegal in Java. (For instance, it's perfectly legal byte code to have a method named if or for, but those are Java keywords and cannot be used to name a Java method.) These sorts of things can easily show up when the .class files are processed by ProGuard, and possibly by other tools in the APK build process.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • Thanks. I want to do the same work to my code to ensure the security. What tools can I look for ? – zccneil Jan 11 '18 at 01:54
  • @zccneil - A good tool is ProGuard. If you set `minifyEnabled true` in your `build.gradle` file, you'll get much of the same effect. Note that obfuscation like this is an extremely poor way of ensuring security. The subject is much too broad for this forum, but you should decide exactly what security you need and research the best technologies for achieving it. – Ted Hopp Jan 11 '18 at 04:18