Closed OwenLiuBo closed 2 months ago
According to your configuration, you have no -libraryjars
which ProGuard needs to perform preverification correctly. There are probably warnings printed about missing classes.
If you're using Java >8: in your case, you'll need to add at least the base jmod and the sql jmod:
-libraryjars /path/to/jdk/jmods/java.base.jmod
-libraryjars /path/to/jdk/jmods/java.sql.jmod
If using Java <=8: then you'll need to add the rt.jar
e.g.
-libraryjars /path/to/jdk/lib/rt.jar
It works! Thanks, James. You saved my day. :-)
Just put more information about this perhaps will save someone's time as well.
I used -dontwarn
option for ProGuard. This is the reason why I didn't see the warnings. If no this, the output will be:
Initializing...
Warning: test.test: can't find referenced class java.sql.Timestamp
Warning: test.test: can't find referenced class java.sql.Timestamp
Warning: there were 2 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedclass)
Unexpected error
I tried to use Proguard 7.5 to obfuscate the following code:
but the obfuscated code throws following exception:
The obfuscation configuration is: