![]() |
There are always some scenarios, in which, we need to keep some of our packages from being obfuscated by Pro-guard. The most popular scenario is when we are using GSON and we have got models (POJO) that are used by GSON library. In this post we are going to dig into the ways of keeping entire packages from Pro-guard.
There are several ways of achieving this, we will look into them one by one.
There are several ways of achieving this, we will look into them one by one.
1. Keeping names of public classes:
-keep public class com.salmankhakwani.application.network.gson.models.*
2. Keeping names of public classes for packages and sub-packages:
-keep public class com.salmankhakwani.application.network.gson.models.**
3. Keeping names of public/protected/private classes/methods/fields for packages and sub-packages:
-keep public class com.salmankhakwani.application.network.gson.models.** { public protected private *; }
I hope this helps anyone who got into similar scenario of keeping packages from Pro-guard.