Java – set Proguard to confuse only my application packages

I tried to use Proguard for obfuscation, but got a third-party library error, so I excluded each package one by one:

-keepclassmembers class android.** {*;}
   -keepclassmembers interface android.** {*;}

   -keepclassmembers class com.google.** {*;}
   -keepclassmembers interface com.google.** {*;}

Is there any way to whitelist my package name?

com. dht. github. myApp

Solution

According to your code, you just let the class members not the whole class

-keep class com. google.** {*;}

-keep interface com. google.** {*;}

You can also use this line to blur your own class and preserve everything else

-keep class! com. yourpackage.**,! com. youranotherpackage.** {*; }

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>