Skip to content

Commit

Permalink
demo: add proguard rules and release type to sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacksgong committed Apr 8, 2018
1 parent 1fa61a2 commit e4090c9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Binary file added keystore
Binary file not shown.
13 changes: 12 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ android {
versionName "1.0"
}

signingConfigs {
release {
storeFile rootProject.file('keystore')
storePassword 'okdownload'
keyAlias 'okdownload'
keyPassword 'okdownload'
}
}

buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down
22 changes: 22 additions & 0 deletions sample/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,25 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


# ------- because of we using okhttp on sample ----
# https://github.com/square/okhttp/#proguard
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn org.conscrypt.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
# ------- end okhttp proguard rules ----

# ------- because of we using com.liulishuo.okdownload:okhttp on sample ----
-keepnames class com.liulishuo.okdownload.core.connection.DownloadOkHttp3Connection
# ------- end com.liulishuo.okdownload:okhttp proguard rules ----

# ------- because of we using com.liulishuo.okdownload:sqlite on sample ----
-keep class com.liulishuo.okdownload.core.breakpoint.BreakpointStoreOnSQLite {
public com.liulishuo.okdownload.core.breakpoint.DownloadStore createRemitSelf();
public com.liulishuo.okdownload.core.breakpoint.BreakpointStoreOnSQLite(android.content.Context);
}
# ------- end com.liulishuo.okdownload:sqlite proguard rules ----

0 comments on commit e4090c9

Please sign in to comment.