2

I am using Allatori obfuscator for java jar file it works well when there is no initialized variable during declaration but if there is only variable which is initialized and not final generates exception:

[ERROR] Only final fields may have an initial value!

What should I do to skip this exception because I don't want to uninitialize my variables?

Any suggestions please

1 Answers1

1

This has reportedly been acknowledged by the Allatori vendor (Smardec Inc) as a bug. Mahmoud M. Hammad states the following in his PhD thesis Self-Protection of Android Systems from Inter-Component Communication Attacks 2018.

"For instance, Allatori raised this exception “com.allatori.IiIIIIiiii: Only final fields may have an initial value!” on many apps. We contacted the provider of Allatori about this exception, who informed us that this problem has been reported by other users, but could not be reproduced. Consequently, we helped them reproduce it to improve their product. They reported to us that this exception is mainly caused by the use of dex2jar, although a fix for the exception is still in progress."

I did not see mention of a specific version of Allatori in Hammad's thesis, but there is a good chance that the bug has been fixed in a recent version. Check that you are using an up-to-date version of the tool. You could also contact the vendor about this1.

How to skip the error?

I don't think you can.


1 ... assuming that you have a legitimate copy. The idea of someone (hypothetically!) using a pirated or unsupported copy of a proprietary obfuscator to protect their own software is delightfully ironic.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216