简体   繁体   中英

How to obfuscate only package names using Proguard

I want to rename only package name in my application from com. company1 .utils --> com. company2 .utils.

How to do this using ProGuard? I Don't want to apply any optimizations in this except changing my package names.

ProGuard doesn't have a standard option to rename packages yet keep their simple class names.

You could create a ProGuard mapping file manually, with lines like:

com.example.MyClass -> a.MyClass:
com.example.MyOtherClass -> a.MyOtherClass:

also with this command: -applymapping mapping.txt

https://stackoverflow.com/a/15792982/4960200

This might be totally weird, but since your package name is "utils" and we faced a similar issue on our project https://github.com/coding-blocks/CBOnlineApp , I can tell you that renaming our package from utils to util solved the proguard issue that it removes the entire package.

This needs deeper digging, but maybe some internal configuration problem leads proguard to remove packages named "utils"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM