如何混淆只有几级或单包?

2023-09-06 04:01:58 作者:今天分享一些带有深意的个性,来看看有没有你喜欢的类型呢?

我不会混淆我的所有项目,但只是大多是重点班。 如何写ProGuard的文件,排除所有的项目和混淆只有一个班或一个包?

I would not obfuscate all my project but just the mostly key class. how to write the proguard file to exclude all project and obfuscate only a single class or a single package ?

推荐答案

请阅读downvote之前的答案。你需要 !前类。

Please read the answer before downvote. You need ! before your class.

看看 Proguard的手册:保存选项部分,的Andr​​oid例如。

例如:

 -keeppackagenames com.vtcmobile {
    ! com.yourpackage.CategoryParser // keep package com.vtcmobile excluded class com.vtcmobile.CategoryParser
    }

编辑:用

-keeppackagenames [package_filter]       指定不进行模糊处理指定的包名。可选的过滤器是一个逗号分隔的包名称列表。包名可以   包含哪些内容?,*,**和通配符,而且他们可以通过pceded $ P $!    否定符的。只有混淆时适用。

-keeppackagenames [package_filter] Specifies not to obfuscate the given package names. The optional filter is a comma-separated list of package names. Package names can contain ?, *, and ** wildcards, and they can be preceded by the ! negator. Only applicable when obfuscating.

相关推荐