我已经对我的 apk 进行了混淆,但文件大小仅从 12MB 减少到 10.5MB。
它只是相对较小的减少的原因可能是因为我的应用程序使用了几个大型库,但是有什么方法可以检查已执行的混淆级别吗?
以防万一,这是我的 proguard-project.txt 文件...
# 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.jar
, acra-4.5.0.jar
and twitter4j-core-4.0.2.jar
.
这可能是一种更直观的检查方法。
在新版本的 Android Studio 中,它附带了 APK 分析器,让用户可以探索 APK 文件中的内容,并且可以方便地检查您的类是否已被混淆。
下图显示包和方法名称都已被混淆
![You can see the package name and method name is obfuscated](https://i.stack.imgur.com/DY2Ij.png)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)