From e4090c90eb9dcc8e0f192d302eac7cf35d4f286a Mon Sep 17 00:00:00 2001 From: Jacksgong Date: Sun, 8 Apr 2018 23:55:23 +0800 Subject: [PATCH] demo: add proguard rules and release type to sample project --- keystore | Bin 0 -> 2266 bytes sample/build.gradle | 13 ++++++++++++- sample/proguard-rules.pro | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 keystore diff --git a/keystore b/keystore new file mode 100644 index 0000000000000000000000000000000000000000..de2bcb18e2425b93110e133eb2f7b7de6715c2bb GIT binary patch literal 2266 zcmc(gX*3iJ7sqGJSemgk%^=GlX2_I`WvnG+#%}B>R6Mf87~&zqFvU}rQZi{8OO{Gx zow5xzOd(53WX+aGmJtuKH1X;=z324d{r=u_?uYw3_rpE^d(Z!FbGNww0Dx~df&V6i z9Oy%i3=SfD`RpR^LR~&J0DvEWrGj}_Q31#y0U#KN;e!Ez`~WZ&{DlBb7v|95(@L?f z!c*p@AH|Qqs?N*Vn@wzcxvun)2qTn4ob5Ji8F}pD_NuQo$j+8n>&yAHS9A)w(J`kZ z{fT^bj94I0>-$i=#x8bi+f3m_+Il7Xn(Z5EVRor%S)De-=&DyPCb<%yW3bk?)~WK> zy?u*{xCK7J5^qY@k?N0^)-`#ArEB{2*2$CJY@>G-(=(w7qlBP>V8p9@rLS|WyeKE1 zIce$Svg~E$ayK;w8)lG}U0^|5$YC3SJw5Q1lacAJtQaO@BrKM{b|rdjn1*LCi$hGd z2$IFOH|1WJ1fB73^bTxKW#?d{ zOI(_Bb7tWc_`m>Afg$PHWaH)?iSq1+W9U94EBvhc)5gzj#^`z)1DQ3h@ZjxK&f~jf zS#D|$gOGp|sDAU+ZwaFZU21eBN9>;+=Cbw!>4&2Pr9P}R#6PRMqk8o0rHkUsE!i(4 zkaSwIC8_hT*H8QpCAb8z8y886on?;|=KnUnH?#jXXNBQ%UZx?v3$Jp(tQy4C)-@2* z?=MXNky;)qL_j;QAc>&Za21m9I@&)>_48`~=J#P-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*~@!^&>^W5@5uQ!{j*n#IW z=?eSW{FUc7SH1W)bkofxcjzczXJJ@Cl9WAl6@UMFYde^ONnANs%lpIQyk#16xZ%YC z1zSBg&SXq&Dn*tABZdv;*V-ILJ;@?<8%k+rY}+5qaC=ryjLYdN?|P*F1)`(^WUyAz zwm#<04cU4q=D4MKN1%*H-rB%iyRDsdZb^Y-7)wwh80n}Jo4dheO&5V|ebzFKZz2Y< zw(y-GBUw`|a@dt=x4DJZoy!>dA{?ILK{}F`{9a`4d2v}E7%d+$xY%hu96xh&zA8jc zqB)s+CLl7~E^|=#%yMlr#Xpph5u~+93}_L~k6u-JHVmgJj@o)81?x;_KZOdZ6w<)% G)Bgcw<>UeY literal 0 HcmV?d00001 diff --git a/sample/build.gradle b/sample/build.gradle index 4781d55e..cd32eb09 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -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' } } diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro index 090ab842..a58f79df 100644 --- a/sample/proguard-rules.pro +++ b/sample/proguard-rules.pro @@ -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 ----