Android - 如何检查 Proguard 混淆是否有效? [英] Android - How to check Proguard obfuscation has worked?

查看:44
本文介绍了Android - 如何检查 Proguard 混淆是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我的 apk 进行了混淆处理,但文件大小仅从 12MB 减少到 10.5MB.

I have obfuscated my apk, but the file size has only been reduced from 12MB to 10.5MB.

这只是相对较小的减少的原因可能是因为我的应用程序使用了几个大型库,但有什么方法可以检查已执行的混淆级别?

The reason it is only a relatively small reduction may be because my app uses a couple of large libraries, but is there any way I can check the level of obfuscation that has been performed?

以防万一,这是我的 proguard-project.txt 文件...

Just in case, this is my proguard-project.txt file...

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

-dontwarn twitter4j.**

...我使用的库是 android-support-v4.jaracra-4.5.0.jartwitter4j-core-4.0.2.jar.

...and the libraries I'm using are android-support-v4.jar, acra-4.5.0.jar and twitter4j-core-4.0.2.jar.

推荐答案

在您的项目目录中,您将找到一个 Proguard 文件夹,您将在其中看到四个文本文件:

In your project directory you will find a Proguard folder, in which you will see four text files:

dump.txt

描述.apk文件中所有类文件的内部结构

Describes the internal structure of all the class files in the .apk file

ma​​pping.txt

列出原始和混淆的类、方法和字段名称之间的映射.当您从以下位置收到错误报告时,此文件很重要发布版本,因为它将混淆的堆栈跟踪转换回原始类、方法和成员名称.请参阅解码混淆的堆栈跟踪了解更多信息.

Lists the mapping between the original and obfuscated class, method, and field names. This file is important when you receive a bug report from a release build, because it translates the obfuscated stack trace back to the original class, method, and member names. See Decoding Obfuscated Stack Traces for more information.

seeds.txt

列出未被混淆的类和成员

Lists the classes and members that are not obfuscated

usage.txt

列出从 .apk 中剥离的代码

Lists the code that was stripped from the .apk

来源:Proguard

希望这有帮助!

这篇关于Android - 如何检查 Proguard 混淆是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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