英文:
How to obfuscate classes present in a package by proguard Android?
问题
我想在实施了ProGuard之后混淆一些类文件。
例如,我想要隐藏或混淆特定包中的一些类名和成员,以便在反编译应用程序后不容易理解。
示例:我想混淆位于包com.myapp.serverCall
中的类。
我该如何做到这一点?
请帮助我实现这个目标。提前感谢。
英文:
I want to obfuscate some class files after ProGuard implemented.
Like I want to hide or obfuscation some classes name and members in a particular package. So that these will not be understandable after decompiling the application.
Example: I want to obfuscate classes present in package com.myapp.serverCall
How can I do this?
Please help me to achieve this. Thanks in advance.
答案1
得分: 1
你可以使用类似以下选项来保留除了某些包中的类之外的所有类:
-keep class !com.myapp.serverCall.** { *; }
感叹号表示“不包括这些类”,因此只匹配所有其余的类。括号内的星号表示“所有字段和方法”。
英文:
You can preserve all classes except the ones in some packages with an option like
-keep class !com.myapp.serverCall.** { *; }
The exclamation mark means "not these classes", thus only matching all remaining classes. The asterisk between parentheses means "all fields and methods".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论