diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 96c96ed..e792622 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -22,7 +22,29 @@ #实体类不参与混淆 -keep class com.kk.afdd.FaceInfo { *; } +-keep class com.kk.afdd.User { *; } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } --keepnames class * implements java.io.Serializable \ No newline at end of file +-keepnames class * implements java.io.Serializable +-keepattributes Signature +-keep class **.R$* {*;} +-ignorewarnings +-keepclassmembers class **.R$* { + public static ; +} + +-keepattributes *Annotation* + +-keepclasseswithmembernames class * { # 保持native方法不被混淆 + native ; +} + +-keep public class * extends android.app.Activity + +-keep class * { + public void onFaceDetected(java.lang.String); +} + + + diff --git a/config/build_config.gradle b/config/build_config.gradle index b3143d6..72403ce 100644 --- a/config/build_config.gradle +++ b/config/build_config.gradle @@ -17,6 +17,19 @@ android { consumerProguardFiles 'proguard-rules.pro' } + signingConfigs { + release { + def keystorePropertiesFile = rootProject.file("config/keystore.properties") + def keystoreProperties = new Properties() + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + + storeFile rootProject.file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + } + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -25,12 +38,14 @@ android { buildTypes { debug { minifyEnabled false +// signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { minifyEnabled true zipAlignEnabled true +// signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }