Enigma icon indicating copy to clipboard operation
Enigma copied to clipboard

Illegal Forward Reference

Open barkatthemoon18 opened this issue 4 years ago • 2 comments

Greetings.

First off, great work! I started using enigma to obfuscate Strings and it worked perfectly so far, but when I use static initializer to load native library (NDK) it fails with the title's name. Is there any way to prevent Enigma from obfuscate that static initializer without excluding the whole code, or obfuscate it as well?

Example error:

public class A {
  static { 
    System.loadLibrary("somelib"); <- Illegal Forward Reference
  }
}

Appreciate any guidance or help.

Thanks!

barkatthemoon18 avatar Mar 28 '21 22:03 barkatthemoon18

Hi,

You can ignore the class with the JNI call by using the falling option:

enigma​.​ignoredClasses ​=​ [​"​com.your.package-name.A.java​"​]

christopherney avatar Mar 29 '21 08:03 christopherney

As a workaround, put the String as a constant in a dedicated class and add that class to the ignored classes

obirawa avatar Apr 22 '21 17:04 obirawa