How to obfuscate only your classes

So, I am creating a project that uses external jar files as dependencies, that I need to compile with. How do I exclude the 3-4 jars from obfuscation that I have that are required?

Hi,

You can exclude dependencies from being obfuscated using a -keep option as shown below;
-keep,allowshrinking,allowoptimization class com.dependency.** { *; }

Please note ProGuard will still shrinkg and optimize the dependency using the configuration rule above. If you do not wish to process the dependency at all, you can use;
-keep class com.dependency.** { *; }

Using the ProGuard Playground you can upload a .jar file together with you -keep options to visualise what parts of the project are preserved without the need to re-build.

2 Likes