Proguard的不断类的名字呢? [英] Proguard keep class names?

查看:246
本文介绍了Proguard的不断类的名字呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我正在写一个Android应用程序,我已经设置了Proguard的混淆我的应用程序。然而,我用一个类加载器来动态加载不同的扩展我的应用程序。的问题是,这些如果他们的名称被​​更改不正确加载。如何保持Proguard的混淆,从具体的类名?

Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?

推荐答案

在你的proguard.cfg使用 -keepnames 选项

Use the -keepnames option in your proguard.cfg

请参考手册 <一href="http://proguard.sourceforge.net/#manual/usage.html#keepnames">http://proguard.sourceforge.net/#manual/usage.html#keepnames:

-keepnames class_specification

-keepnames class_specification

简称 -keep,allowshrinking class_specification

Short for -keep,allowshrinking class_specification

指定类和类成员的名称是preserved,如果他们在萎缩阶段不会被删除。例如,您可能希望保留的实现Serializable接口,这样处理过的code保持与任何最初连载类兼容类中的所有类名。未使用在所有的类仍然可以除去。只有混淆时适用。

Specifies classes and class members whose names are to be preserved, if they aren't removed in the shrinking phase. For example, you may want to keep all class names of classes that implement the Serializable interface, so that the processed code remains compatible with any originally serialized classes. Classes that aren't used at all can still be removed. Only applicable when obfuscating.

这篇关于Proguard的不断类的名字呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆