VerifyError: Bad access to protected data in getfield
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
Benjamin Jaton reports in the discussion forum:
I'm having a VerifyError issue at runtime like this:
Exception in thread "main" java.lang.VerifyError: Bad access to protected
data in getfield
I've created a demo project to reproduce the issue here:
https://github.com/benji/proguard-allowaccessmodification
Just run:
$ gradle clean jar obfuscate run
I noticed that the subclass changed the method to public but the superclass
still has it protected. I feel like this might be the issue.
Exception in thread "main" java.lang.VerifyError: Bad access to protected data in getfield
Exception Details:
Location:
com/github/benji/proguard/MyClass.process(Lcom/github/a;)Z @1: getfield
Reason:
Type null (current frame, stack[1]) is not assignable to 'com/github/benji/proguard/MyClass'
Current Frame:
bci: @1
flags: { }
locals: { 'com/github/benji/proguard/MyClass', 'com/github/a' }
stack: { 'java/lang/Object' }
Bytecode:
0x0000000: 2bb4 0003 c700 0704 a700 0403 ac
Stackmap Table:
chop_frame(@11,2)
same_locals_1_stack_item_frame(@12,Integer)
at com.github.benji.proguard.Launcher.main(src:6)
Anything more on this one? It looks suspiciously like a VerifyError (...getfield) we're seeing in our app. We've been unable to isolate exactly what might be going on and now suspect this is simply an error in the obfuscator. We are seeing this with PG 6.0.3. If we protect (-keep) the entire class the issues goes away, but we'd like to understand the root cause here.
Thanks for the report and sample project. I verified that the sample runs fine when using ProGuard 6.2.0.