代码混淆-Android studio 混淆代码

问题描述

Android studio 混淆代码

混淆代码直接报
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:saveYGJYFinancialYGJYappuildintermediatesmulti-dex
eleasecomponentClasses.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.**

解决方案

在 build.gradle 中配置android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'some-other-rules.txt'......
答案就在这里:Android Studio之代码混淆

解决方案二:

buildTypes {
release {
multiDexEnabled true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}添加了的

解决方案三:

你没用爱加密吗?支持Android和iOS的

时间: 2024-10-03 17:13:20

代码混淆-Android studio 混淆代码的相关文章

代码混淆-android studio 混淆文件配置

问题描述 android studio 混淆文件配置 下面是我的配置文件: -optimizationpasses 5 -dontusemixedcaseclassnames -verbose -dontpreverify -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keepattributes Annotation -keepattributes Signature -keep class

android studio 中代码为什么会有一块是黄色的高亮显示?

问题描述 android studio 中代码为什么会有一块是黄色的高亮显示? 百度没有找到理想的答案 解决方案 提示你,这块有内存泄露的危险,handler最好声明为static的,里面对外部类,使用若引用 解决方案二: 就是警告的意思 说明这里可以优化 解决方案三: 工作区背景设置问题,去preferences找找看,重新设置背景颜色

android studio 混淆后,打包报错!!!

问题描述 android studio 混淆后,打包报错!!! `` Exception while processing task java.io.IOException: The same input jar [E:Workgvapplibsopen_sdk_r5509.jar] is specified twice. > at proguard.ConfigurationChecker.checkConflicts(ConfigurationChecker.java:216) > at

android studio 混淆打包时报错,找不到解决方案求帮助啊

问题描述 android studio 混淆打包时报错,找不到解决方案求帮助啊 混淆打包,报错,百度也查不到,困扰1天了... Error:ProGuard: [JinFu1.1] java.io.IOException: Can't read C:Usersadmin.AndroidStudio1.2systemcompile-server_temp_proguard_input0.jar)) Error:ProGuard: [JinFu1.1] at proguard.InputReader

android studio混淆编码是出现以下提示怎么过滤

问题描述 android studio混淆编码是出现以下提示怎么过滤 解决方案 你混淆文件发下啊. 貌似是引用重复了. 解决方案二: 嗯好的# Add project specific ProGuard rules here. By default, the flags in this file are appended to flags specified in C:UsersAdministratorAppDataLocalAndroidSdk/tools/proguard/proguard

eclipse-Eclipse项目转到Android Studio混淆加密报错

问题描述 Eclipse项目转到Android Studio混淆加密报错 我的AS版本是1.5的,直接使用AS的Import Eclipse (etc)功能,导入Eclipse项目.导入成功后,可以进行调试,生成apk. 但是在混淆加密的时候,就提示重复导入第三方jar包. Error:java.io.IOException: Can't read BaiduLBS_Android.jar (;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [

代码混淆-android工程混淆代码打包的APK安装后无法启动

问题描述 android工程混淆代码打包的APK安装后无法启动 加了混淆安装在手机上之后,点击APP时无法启动程序,是什么情况? 解决方案 对index文件做的混淆? 解决方案二: 对index文件做的混淆? 解决方案三: 对index文件做的混淆? 解决方案四: 对index文件做的混淆? 解决方案五: 对index文件做的混淆? 解决方案六: 资源文件找不到了把... 解决方案七: 以前的那个app没有删掉吧 解决方案八: android apk 代码混淆

Android studio 混淆+打包+验证是否成功

前言: 单挑Android项目,最近即时通讯用到环信,集成sdk的时候 官方有一句 在 ProGuard 文件中加入以下 keep. -keep class com.hyphenate.** {*;} -dontwarn com.hyphenate.** 即:混淆规则. 自己没写过关于混淆打包的文章,在此补上. 下面了解Android studio环境下 项目混淆打包的操作. 一.打包: 即 将Android项目生成.apk文件,让用户去安装. 1.工具栏 Build->Generate Sig

android studio跪求远程混淆编码,及打包!一百下载积分送上!

问题描述 android studio跪求远程混淆编码,及打包!一百下载积分送上! android studio跪求远程混淆编码,及打包!一波带走,一百下载积分送上!求大神求大神!!!本人扣扣2691608900 解决方案 有米有大神啊!一百几分也没人要么 解决方案二: Android studio 打包.混淆android studio混淆打包android studio混淆打包