2

I am trying to keep all classes in packages that contain the word model in the package name.

Eg - com.xyz.model, com.xyz.abc.model, com.xyz.model.abc

All the classes in these packages should not be obfuscated.

I tried using wildcard for package names but it isn't working

-keep class com.xyz.**.model.**{ *; }

How to achieve the desired result?

Learning
  • 89
  • 11

1 Answers1

6

Please try below. Remove dot(.) before the model.

-keep class com.xyz.**model.**{ *; }
Shalu T D
  • 3,921
  • 2
  • 26
  • 37
  • 1
    if it worked, upvote the answer it will be helpful for other users. – Shalu T D Jul 02 '20 at 11:32
  • Done. Thanks for the reply. In addition, I am getting issues that proguard is renaming interface and class with the same name `public class c implements c` which is causing bean creation error in autowired fields. Any suggestions to fix that? – Learning Jul 02 '20 at 16:17
  • Sorry. I didn't hear such an issue. I will update if I get any idea on this. Thanks – Shalu T D Jul 03 '20 at 04:37