Skip to content

Commit

Permalink
add proguard file
Browse files Browse the repository at this point in the history
  • Loading branch information
kkroid committed Nov 14, 2020
1 parent f465cf9 commit bb07fb2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
24 changes: 23 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
-keepnames class * implements java.io.Serializable
-keepattributes Signature
-keep class **.R$* {*;}
-ignorewarnings
-keepclassmembers class **.R$* {
public static <fields>;
}

-keepattributes *Annotation*

-keepclasseswithmembernames class * { # 保持native方法不被混淆
native <methods>;
}

-keep public class * extends android.app.Activity

-keep class * {
public void onFaceDetected(java.lang.String);
}



15 changes: 15 additions & 0 deletions config/build_config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
}
}
Expand Down

0 comments on commit bb07fb2

Please sign in to comment.