I have exported Java SE application with multiple 3rd party libraries using Eclipse's Export as Runnable JAR file menu. How I must set the injars
and libraryjar
options of Proguard to obfuscate this application?
Like this?
injars MyApp.jar
injars 3rd party lib
injars second 3rd party lib etc
libraryjar ${java.home}/lib/rt.jar
libraryjar ${java.home}/lib/jsse.jar
libraryjar ${java.home}/lib/jce.jar
So I must set the 3rd party libraries as injars
and ${java.home}/lib/*
as libraryjar
?
R8 differs from proguard in the following ways: R8 has higher Kotlin language support as compared to proguard. Proguard is mainly used by applications developed using Java. Usually, the R8 compiler is much faster than the proguard compiler.
ProGuard offers basic protection against static analysis only, while DexGuard shields applications from both static and dynamic analysis. This is an important differentiator as it relates to mobile app security because attackers generally combine two approaches when attempting to reverse engineer an application.
injars
contains the jar you want to obfuscate, and libraryjars
the 3rd party libs that are not obfuscated.
Specifies the input jars (or aars, wars, ears, zips, apks, or directories) of the application to be processed. The class files in these jars will be processed and written to the output jars. By default, any non-class files will be copied without changes. Please be aware of any temporary files (e.g. created by IDEs), especially if you are reading your input files straight from directories. The entries in the class path can be filtered, as explained in the filters section. For better readability, class path entries can be specified using multiple -injars options.
Specifies the library jars (or aars, wars, ears, zips, apks, or directories) of the application to be processed. The files in these jars will not be included in the output jars. The specified library jars should at least contain the class files that are extended by application class files. Library class files that are only called needn't be present
, although their presence can improve the results of the optimization step. The entries in the class path can be filtered, as explained in the filters section. For better readability, class path entries can be specified using multiple -libraryjars options.
Please note that the boot path and the class path set for running ProGuard are not considered when looking for library classes. This means that you explicitly have to specify the run-time jar that your code will use.
Although this may seem cumbersome, it allows you to process applications targeted at different run-time environments. For example, you can process J2SE applications as well as JME midlets or Android apps, just by specifying the appropriate run-time jar.
My result`
As for 3rd part lib,there has some difference.
The specified library jars should at least contain the class files that are extended by application class files. Library class files that are only called needn't be present
,so 3rd part lib may not need set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With