Android Studio 中的 Proguard 混淆项目



我的第一个问题(希望我能解决(

  • Proguard 我有几个错误
  • My Build.Gradle (app(

=--=-=-=-=

apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
android {
compileSdkVersion 25
buildToolsVersion '26'
defaultConfig {
applicationId "com.navigator.byiaaamh.navi"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dexOptions {
jumboMode = true
// Avoid the OutOfMemoryError: GC overhead limit exceeded:
incremental true
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

greendao {
schemaVersion 1
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// greendao

compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.android.support:multidex:1.0.1'
compile 'org.greenrobot:greendao:3.2.0'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.2'
}
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:UsersHemoAppDataLocalAndroidSdk/tools/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 *;
#}

=-=-=-==-= 现在在构建生成签名的 Apk 后,我得到了这个 (也有照片检查一下(

Information:Gradle tasks [:app:assembleRelease]
Warning:The `android.dexOptions.incremental` property is deprecated and it has no effect on the build process.
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find superclass or interface net.sqlcipher.database.SQLiteOpenHelper
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find superclass or interface rx.Observable$OnSubscribe
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find superclass or interface rx.functions.Func0
Warning:org.greenrobot.greendao.AbstractDao: can't find referenced class rx.schedulers.Schedulers
Warning:org.greenrobot.greendao.AbstractDaoSession: can't find referenced class rx.schedulers.Schedulers
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper: can't find referenced method 'net.sqlcipher.database.SQLiteDatabase getReadableDatabase(java.lang.String)' in program class org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper: can't find referenced method 'net.sqlcipher.database.SQLiteDatabase getWritableDatabase(char[])' in program class org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper: can't find referenced method 'net.sqlcipher.database.SQLiteDatabase getReadableDatabase(char[])' in program class org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteOpenHelper
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteOpenHelper
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteDatabase$CursorFactory
Warning:org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning:org.greenrobot.greendao.database.EncryptedDatabase: can't find referenced class net.sqlcipher.database.SQLiteDatabase
Warning:org.greenrobot.greendao.database.EncryptedDatabaseStatement: can't find referenced class net.sqlcipher.database.SQLiteStatement
Warning:org.greenrobot.greendao.query.Query: can't find referenced class rx.schedulers.Schedulers
Warning:org.greenrobot.greendao.rx.RxBase: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxBase: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxBase: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxDao: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxDao: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxDao: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxQuery: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxQuery: can't find referenced class rx.Observable$OnSubscribe
Warning:org.greenrobot.greendao.rx.RxQuery: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxQuery: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxQuery: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Subscriber
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.exceptions.Exceptions
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Subscriber
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Observable$OnSubscribe
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.exceptions.Exceptions
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Subscriber
Warning:org.greenrobot.greendao.rx.RxQuery$3: can't find referenced class rx.Observable$OnSubscribe
Warning:org.greenrobot.greendao.rx.RxTransaction: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxTransaction: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxTransaction: can't find referenced class rx.Scheduler
Warning:org.greenrobot.greendao.rx.RxUtils: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find referenced class rx.functions.Func0
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find referenced class rx.Observable
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find referenced class rx.functions.Func0
Warning:org.greenrobot.greendao.rx.RxUtils$1: can't find referenced class rx.Observable
Warning:there were 163 unresolved references to classes or interfaces.
Warning:there were 3 unresolved references to program class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Information:BUILD FAILED
Information:Total time: 6.572 secs
Information:1 error
Information:49 warnings
Information:See complete output in console

=-=-=-

首先当我制作签名的 Apk 时

完成第一个错误后证明

添加

### greenDAO 3
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
# If you do not use SQLCipher:
-dontwarn org.greenrobot.greendao.database.**
# If you do not use RxJava:
-dontwarn rx.**
### greenDAO 2
-keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties

到你的保护规则。从这里无耻地偷走

你必须为绿色道编写保护规则。

这是 绿色DAO 保护规则的链接 . 复制并粘贴到您的专业保护规则文件中。

最新更新