Search code examples
androidcompiler-errorsapkdecompiling

Error in Java file after decompiling APK


I got resource code of an app after decompiling its APK with apktool. But in some java files I got code like that:

/* Error */
public void a(int paramAnonymousInt1, int paramAnonymousInt2)
{
  // Byte code:
  //   0: aload_0
  //   1: getfield 14   com/example/service/MyService$2:a;
  //   4: astore_3
  //   8: tableswitch   default:+40 -> 48, 0:+116->124, 1:+40->48, 2:+43->51, 3:+143->151, 4:+77->85, 5:+170->178
............................................
};

I don't understand what it is? Is it original code of author? Or is it a part of code, which apktool can not decompile? Did author use something to protect this code?

Can anyone give me an answer? Thanks a lot!


Solution

  • The source code is obfuscated, Obfuscation means the code is encrypted you can say in layman term. While releasing APK developer can enable proGuard which help to secure source code by obfuscating it.

    Check more about Obfuscation and ProGuard.