在将proguard应用于我的代码后,它仍然非常可读.类和包未重命名.类变量,即所有已重命名的变量.
Android Studio 2.2.3.
建立:等级:2.2.3
build.gradle
apply plugin: 'com.androID.application'androID {compileSdkVersion 24buildToolsversion "25.0.1"defaultConfig { applicationID "com.mypackagename" minSdkVersion 19 targetSdkVersion 24 versionCode 3 versionname "1.0" vectorDrawables.useSupportlibrary = true} buildTypes { release { MinifyEnabled true shrinkResources true proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}dexOptions { dexInProcess = true} lintoptions { abortOnError true checkReleaseBuilds true}}ext {supportlibVersion = '25.0.1'playServisesversion = '10.0.0'}repositorIEs {maven { url "https://jitpack.io" }}dependencIEs {compile filetree(dir: 'libs', include: ['*.jar'])compile 'com.github.PhilJay:MPAndroIDChart:v2.2.5'compile 'org.greenrobot:eventbus:3.0.0'compile 'com.wdullaer:materialdatetimepicker:3.0.0'compile 'com.aurelhubert:ahbottomnavigation:2.0.1'compile "com.androID.support:appcompat-v7:${supportlibVersion}"compile "com.androID.support:cardvIEw-v7:${supportlibVersion}"compile "com.androID.support:design:${supportlibVersion}"compile "com.Google.androID.gms:play-services-analytics:${playServisesversion}"compile "com.Google.androID.gms:play-services-drive:${playServisesversion}"compile "com.Google.firebase:firebase-ads:${playServisesversion}"compile "com.Google.firebase:firebase-core:${playServisesversion}"compile 'com.anjlab.androID.iab.v3:library:1.0.34'compile 'com.github.paolorotolo:appintro:4.1.0'compile 'net.danlew:androID.joda:2.9.5.1'}apply plugin: 'com.Google.gms.Google-services'
proguard-rules.pro
# Add project specific ProGuard rules here.# By default, the flags in this file are appended to flags specifIEd# in C:.....proguard/proguard-androID.txt# You can edit the include path and order by changing the proguardfiles# directive in build.gradle.## 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 com.github.mikephil.charting.**-keep class androID.support.v7.** { *; }-keep class androID.support.graphics.drawable.** { *; }
查看我的发行版APK
解决方法:
我可以看到您正在使用AppIntro库.该库有一个问题,其中库的保护规则会保留项目中的所有类.库的proguard规则与本地规则合并,因此在最终版本中,所有类都将保留并且不会被混淆.
此问题已在4.2中修复,但尚未在Maven Central上发布此版本.同时,您必须在本地克隆该库,然后在gradle中手动将其导入.
脚步:
>通过Github在本地下载或克隆库(绿色的“克隆”或“下载”按钮)
>在项目的根目录中创建一个新的文件夹库
>在libs文件夹中创建一个新文件夹AppIntro
>将克隆项目的库文件夹的内容放入我们在步骤3中创建的AppIntro文件夹中
>在您的settings.gradle中添加include’:libs:AppIntro’
>用build.gradle中的编译项目(‘:libs:AppIntro’)替换编译’com.github.paolorotolo:appintro:4.1.0′
现在,proguard应该可以正常工作!
总结以上是内存溢出为你收集整理的Android Studio中的ProGuard提供了非常弱的混淆功能.全部内容,希望文章能够帮你解决Android Studio中的ProGuard提供了非常弱的混淆功能.所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)