Android studio 混淆代码 -问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

Android studio 混淆代码

爵霸 2016-05-30 10:35:33 3271

混淆代码直接报

 Information:Gradle tasks [:app:assembleRelease]
 :MyLibray:compileLint
 :MyLibray:copyReleaseLint UP-TO-DATE
 :MyLibray:preBuild UP-TO-DATE
 :MyLibray:preReleaseBuild UP-TO-DATE
 :MyLibray:checkReleaseManifest
 :MyLibray:preDebugAndroidTestBuild UP-TO-DATE
 :MyLibray:preDebugBuild UP-TO-DATE
 :MyLibray:preDebugUnitTestBuild UP-TO-DATE
 :MyLibray:preReleaseUnitTestBuild UP-TO-DATE
 :MyLibray:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
 :MyLibray:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
 :MyLibray:prepareReleaseDependencies
 :MyLibray:compileReleaseAidl UP-TO-DATE
 :MyLibray:compileReleaseRenderscript UP-TO-DATE
 :MyLibray:generateReleaseBuildConfig UP-TO-DATE
 :MyLibray:generateReleaseAssets UP-TO-DATE
 :MyLibray:mergeReleaseAssets UP-TO-DATE
 :MyLibray:generateReleaseResValues UP-TO-DATE
 :MyLibray:generateReleaseResources UP-TO-DATE
 :MyLibray:mergeReleaseResources UP-TO-DATE
 :MyLibray:processReleaseManifest UP-TO-DATE
 :MyLibray:processReleaseResources UP-TO-DATE
 :MyLibray:generateReleaseSources UP-TO-DATE
 :MyLibray:processReleaseJavaRes UP-TO-DATE
 :MyLibray:compileReleaseJavaWithJavac UP-TO-DATE
 :MyLibray:extractReleaseAnnotations UP-TO-DATE
 :MyLibray:mergeReleaseProguardFiles UP-TO-DATE
 :MyLibray:packageReleaseJar UP-TO-DATE
 :MyLibray:compileReleaseNdk UP-TO-DATE
 :MyLibray:packageReleaseJniLibs UP-TO-DATE
 :MyLibray:packageReleaseLocalJar UP-TO-DATE
 :MyLibray:packageReleaseRenderscript UP-TO-DATE
 :MyLibray:packageReleaseResources UP-TO-DATE
 :MyLibray:bundleRelease UP-TO-DATE
 :app:preBuild UP-TO-DATE
 :app:preReleaseBuild UP-TO-DATE
 :app:checkReleaseManifest
 :app:preDebugBuild UP-TO-DATE
 :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
 :app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
 :app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
 :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
 :app:prepareComCjjMaterialrefeshlayoutLibrary130Library UP-TO-DATE
 :app:prepareFinancialPHKXMyLibrayUnspecifiedLibrary UP-TO-DATE
 :app:prepareReleaseDependencies
 :app:compileReleaseAidl UP-TO-DATE
 :app:compileReleaseRenderscript UP-TO-DATE
 :app:generateReleaseBuildConfig UP-TO-DATE
 :app:generateReleaseAssets UP-TO-DATE
 :app:mergeReleaseAssets UP-TO-DATE
 :app:generateReleaseResValues UP-TO-DATE
 :app:generateReleaseResources UP-TO-DATE
 :app:mergeReleaseResources UP-TO-DATE
 :app:processReleaseManifest UP-TO-DATE
 :app:processReleaseResources UP-TO-DATE
 :app:generateReleaseSources UP-TO-DATE
 :app:processReleaseJavaRes UP-TO-DATE
 :app:compileReleaseJavaWithJavac UP-TO-DATE
 :app:compileReleaseNdk UP-TO-DATE
 :app:compileReleaseSources UP-TO-DATE
 :app:collectReleaseMultiDexComponents UP-TO-DATE
 :app:proguardRelease UP-TO-DATE
 :app:shrinkReleaseMultiDexComponents FAILED
 Error:Execution failed for task ':app:shrinkReleaseMultiDexComponents'.


java.io.IOException: The output jar [F:\save\YGJY\FinancialYGJY\app\build\intermediates\multi-dex\release\componentClasses.jar] must be specified after an input jar, or it will be empty.
 Information:BUILD FAILED
 Information:Total time: 1.666 secs
 Information:1 error
 Information:0 warnings
 Information:See complete output in console

这是什么意思?

下面是混淆代码,我基本都屏蔽了!

 -keep public class * extends android.app.Fragment
 -keep public class * extends android.app.Activity
 -keep public class * extends android.app.Application
 -keep public class * extends android.app.Service
 -keep public class * extends android.content.BroadcastReceiver
 -keep public class * extends android.content.ContentProvider
 -keep public class * extends android.app.backup.BackupAgentHelper
 -keep public class * extends android.preference.Preference
 -keep public class * extends android.support.v4.**
 -keepclasseswithmembernames class * { # 保持 native 方法不被混淆
 native ;
 }
 -keepclasseswithmembers class * { # 保持自定义控件类不被混淆
 public (android.content.Context, android.util.AttributeSet);
 }
 -keepclasseswithmembers class * {# 保持自定义控件类不被混淆
 public (android.content.Context, android.util.AttributeSet, int);
 }
 -keepclassmembers class * extends android.app.Activity { # 保持自定义控件类不被混淆
 public void (android.view.View);
 }
 -keepclassmembers enum * { # 保持枚举 enum 类不被混淆
 public static *[] values();
 public static ** valueOf(java.lang.String);
 }
 -keep class * implements android.os.Parcelable { # 保持 Parcelable 不被混淆
 public static final android.os.Parcelable$Creator ;
 }
 -keep public class * implements java.io.Serializable{
 public protected private *;
 }
 -keep class com.baidu.*{*;}
 -dontwarn com.baidu.**
 -keep class com.google.gson.**{*;}
 -dontwarn com.google.gson.**
 #bcprov-ext-jdk15on
 -dontwarn org.bouncycastle.**
 #commons-lang-2.4
 -dontwarn org.apache.commons.lang.**
 #adnroid-async-http-1.4.8
 -dontwarn com.loopj.android.http.**
 #androidquery
 -dontwarn com.androidquery.**
 #esb
 -dontwarn com.hansy.qhxg.restClient.**
 #gson-2.2.4
 -dontwarn com.google.gson.**
 #httpcore-4.3.jar
 -dontwarn org.apache.http.**
 #slf4j-api-1.7.5
 -dontwarn org.slf4j.**
 #universal-img-loader
 -dontwarn com.nostra13.universalimageloader.**
android代码 android代码混淆 studio代码
分享到
取消 提交回答
全部回答(1)
  • 保持可爱mmm
    2019-10-18 10:52:19
    Android Studio混淆打包apk: //混淆,新版本ninifyEnabled再runproguard minifyEnabled true //加载默认混淆配置文件及自定义混淆 配置 proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard.cfg' 设置minifyEnabled true,打包候进行代码混淆处理. 其proguard-android.txt用管sdk目录面主要配置proguard.cfg文件 直接android studio创建项目文件 proguard-rules.pro文件其实项目eclipse迁移前eclipse混淆 proguard.cfg文件
    

    来源于网络,供您参考,如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】 希望我的回答对您有所帮助,望采纳! ~ O(∩_∩)O~

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

相似问题
最新问题