WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code
MIT License
481 stars 114 forks source link

Obf issue #358

Open Nandi0813 opened 1 week ago

Nandi0813 commented 1 week ago

I have to obf my premium plugin that uses AnvilGUI. But i get this error message: 12:44:06 WARN : 15 unknown classes referenced 16 times: 12:44:06 INFO : |== v1_10_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_14_R1.ContainerAnvil [2] 12:44:06 INFO : |== v1_7_R4.ContainerAnvil [1] 12:44:06 INFO : |== v1_11_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_9_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_16_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_13_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_16_R3.ContainerAnvil [1] 12:44:06 INFO : |== v1_8_R2.ContainerAnvil [1] 12:44:06 INFO : |== v1_15_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_13_R2.ContainerAnvil [1] 12:44:06 INFO : |== v1_9_R2.ContainerAnvil [1] 12:44:06 INFO : |== v1_16_R2.ContainerAnvil [1] 12:44:06 INFO : |== v1_8_R1.ContainerAnvil [1] 12:44:06 INFO : |== v1_12_R1.ContainerAnvil [1] 12:44:06 INFO : For a correct obfuscation minimize the amount of unknown classes.

I shaded AnvilGUI and excluded it from the obfuscation but it still gives the error and I don't know what else to do.

Thanks for the response :)

0dinD commented 1 week ago

What tool are you using to obfuscate the plugin? This is not an issue with AnvilGUI but rather with the obfuscation tool you're using, but I can't help you with that, especially not without knowing which tool is being used.

Either way it sounds like the obfuscation tool doesn't know about all the AnvilGUI classes, so you probably need to configure that somehow. AnvilGUI uses reflection to load some classes at runtime, so statically scanning imports for class dependencies won't work. But all AnvilGUI classes reside in the net.wesjd.anvilgui package (and subpackages), so ideally you should be able to inform your tool about that.