I'm using proguard. I wanna know an option that keeps different class names for different packages

So, Here’s a case . I have two packages : package1 and package2.
I want package1 class name’s to be different from package2 class names.
So let’s say package1 has one class which will rename as a after applying obfuscation but now I want package2 class name to be b instead of a.

Can someone help me , how can I achieve this ?

Thank you in advance :blush:

Hi @Bhavi_Gotawala ,

I’m not sure there’s a straightforward way to achieve this. May I ask for more information about this use case? Why do you want to give these packages separate names?

If incremental obfuscation is what you want to apply, please have a look here.

Best regards,


Thank you for the response @jonas.gijbels , What I wanted to achieve was …
let’s say one application is there which has 2 packages pack1 with class animal and pack2 with class bird .
Now for both of the packages I want each class to be renamed with new names so pack1’s class should be renamed as ‘a’ and package2’s class should be renamed as b.
For now I’m using ‘-flattenpackagehierarchy’ and it worked.