关于Proguard的问题 [英] Questions about Proguard

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

问题描述

我混淆使用ProGuard 4.7我的申请。从那以后,我使用Dex2Jar解开我的申请。而我却高兴不起来与混淆的结果。我有以下问题:

1。如何掩盖字符串常量?

(可能使用此选项:一个字符串常量从服务器加载。
    我知道,这会影响性能,但防守为主)

2。如何重命名标准的类名?

例如:混淆后非标准类名保持不变。
(可以使所有的标准类的副本,然后将ProGuard的重新命名他们)


 进口android.content.BroadcastReceiver;
进口android.content.Context;
进口android.content.Intent;
进口android.media.MediaRecorder;
进口android.telephony.TelephonyManager;


3 .. ProGuard的创造了许多新的软件包,但所有的工人阶级是其中之一。
 如何将它们放置在不同的包?


  A.A
b.a
my.package.name //这里我的应用程序的所有工作班
b.b
C.C


4。为什么是我班的一些名字并没有改变?


解决方案

问题2.你不能有ProGuard的重命名这些,因为他们是手机的一部分。与外部类不混乱你不丢失任何模糊处理的安全性。试图让您包括您的应用程序的本地副本,只会导致你毁灭的道路,你希望那是在手机上的版本。

问题3,预期,并涉及到问题4包含您的活动(或其他公共入口点)包的任何部分需要保持这条道路。

所以,如果你有包:

  com.mycompany.myapp.activities

然后,活动包必须完全保留,因为任何活动类不会被混淆。还com.mycompay.myapp必须保留从XML引用的任何项目,以便系统能正确找到在清单中定义的条目。

这听起来像ProGuard的工作,因为它应该在你的设置。

I've obfuscated my application using ProGuard 4.7. After that I unpacked my application using Dex2Jar. And I was not happy with the result of obfuscation. And I have the following questions:

1.. How to mask a string constant?

(May be using this option: a string constant is loaded from the server. I know that this will affect performance, but the defense primarily)

2.. How to rename the standard class names?

For example: after obfuscation standart class names remain unchanged. (can make copies of all standard classes and then ProGuard will rename them)

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaRecorder;
import android.telephony.TelephonyManager;

3.. ProGuard has created many new packages, but all the working classes are in one of them. How to place them in different packages?

a.a
b.a
my.package.name // here all working classes of my app
b.b
c.c

4.. Why are some names of my classes have not changed?

解决方案

Question 2. You can't have ProGuard rename those as they are part of the phone. You don't loose any obfuscation security with external classes not obfuscated. Attempting to make local copies that you include with your app will only lead you down a path of ruin, you want the versions that are on the phone.

Question 3. That is expected, and relates to question 4. Anything part of the package that contains your Activities (or other public entry points) needs to maintain that path.

So if you have packages:

com.mycompany.myapp.activities

Then the activities package must be fully retained because any activity classes will not be obfuscated. Also com.mycompay.myapp must be retain for any item referenced from XML so the system can correctly find your entry as defined in the manifest.

It sounds like ProGuard is working as it should be in your setup.

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

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