Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Update libs, fix ProGuard release problem
Browse files Browse the repository at this point in the history
  • Loading branch information
a.ignatov committed Jul 2, 2021
1 parent 6de5b40 commit c664493
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 119 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
```
В build.gradle уровня приложения добавить зависимость
```
implementation 'com.github.cloudpayments:CloudPayments-SDK-Android:latest-version'
implementation 'com.github.cloudpayments:CloudPayments-SDK-Android:1.0.2'
```
### Структура проекта:

Expand Down
22 changes: 9 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
buildTypes {
debug {
debuggable true
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
Expand Down Expand Up @@ -88,14 +88,14 @@ def getGitCurrentBranch() {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'

implementation 'com.google.android.material:material:1.3.0-alpha04'
implementation 'com.google.android.material:material:1.4.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.fragment:fragment-ktx:1.3.5'
implementation 'androidx.arch.core:core-runtime:2.1.0'

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
Expand All @@ -116,7 +116,7 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation "com.jakewharton.rxbinding2:rxbinding-kotlin:$rxBindingVersion"

implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation 'com.google.android.gms:play-services-wallet:18.1.3'

//Multidex support
implementation 'androidx.multidex:multidex:2.0.1'
Expand All @@ -135,11 +135,7 @@ dependencies {
implementation 'io.card:android-sdk:5.5.0'

implementation project(path: ':sdk')

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

//implementation 'com.github.cloudpayments:CloudPayments-SDK-Android:1.0.2'
}

ext {
Expand Down
32 changes: 31 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,34 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# com.squareup.retrofit2
-dontwarn javax.annotation.**
-dontwarn retrofit2.**
-keep, includedescriptorclasses class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}

# com.squareup.okhttp3
-keepattributes Signature
-keepattributes *Annotation*
-keep, includedescriptorclasses class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-keep class okhttp3.internal.platform.** { *; }
-dontwarn okhttp3.internal.platform.**
-dontnote okhttp3.internal.platform.**

# com.google.gson
-keep class com.google.gson.internal.** { *; }
-dontwarn com.google.gson.internal.**
-dontnote com.google.gson.internal.**

# ru.cloudpayments.sdk
-keep class ru.cloudpayments.demo.** { *; }
-dontwarn ru.cloudpayments.demo.**
-dontnote ru.cloudpayments.demo.**
18 changes: 18 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "ru.cloudpayments.demo",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "release-1.0(1)f762b6f_[master].apk"
}
]
}

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/test/java/ru/cloudpayments/demo/ExampleUnitTest.kt

This file was deleted.

9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.10"
ext.kotlin_version = "1.5.20"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -19,6 +19,7 @@ allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}

Expand All @@ -27,8 +28,8 @@ task clean(type: Delete) {
}

ext {
retrofitVersion = '2.5.0'
retrofitVersion = '2.9.0'
okHttp3Version = '4.5.0'
rxBindingVersion = '2.2.0'
dagger2Version = '2.28'
dagger2Version = '2.35.1'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
27 changes: 13 additions & 14 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0.1"
versionName "1.0.2"
multiDexEnabled false

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -20,17 +20,20 @@ android {
buildTypes {
debug {
debuggable true
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'

buildConfigField "String", "API_HOST", '"https://api.cloudpayments.ru/"'
}
release {
debuggable false
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'

buildConfigField "String", "API_HOST", '"https://api.cloudpayments.ru/"'

}
}

Expand All @@ -48,14 +51,14 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'

implementation 'com.google.android.material:material:1.3.0-alpha04'
implementation 'com.google.android.material:material:1.4.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.fragment:fragment-ktx:1.3.5'
implementation 'androidx.arch.core:core-runtime:2.1.0'

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
Expand All @@ -68,14 +71,14 @@ dependencies {

implementation 'ru.tinkoff.decoro:decoro:1.5.0'

implementation 'org.jsoup:jsoup:1.11.3'
implementation 'org.jsoup:jsoup:1.13.1'

// rxkotlin
implementation 'io.reactivex.rxjava2:rxkotlin:2.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation "com.jakewharton.rxbinding2:rxbinding-kotlin:$rxBindingVersion"

implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation 'com.google.android.gms:play-services-wallet:18.1.3'

//Multidex support
implementation 'androidx.multidex:multidex:2.0.1'
Expand All @@ -89,8 +92,4 @@ dependencies {

//rx google-play-services
implementation 'io.ashdavies.rx.rxtasks:rx-tasks:2.2.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
32 changes: 31 additions & 1 deletion sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,34 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# com.squareup.retrofit2
-dontwarn javax.annotation.**
-dontwarn retrofit2.**
-keep, includedescriptorclasses class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}

# com.squareup.okhttp3
-keepattributes Signature
-keepattributes *Annotation*
-keep, includedescriptorclasses class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-keep class okhttp3.internal.platform.** { *; }
-dontwarn okhttp3.internal.platform.**
-dontnote okhttp3.internal.platform.**

# com.google.gson
-keep class com.google.gson.internal.** { *; }
-dontwarn com.google.gson.internal.**
-dontnote com.google.gson.internal.**

# ru.cloudpayments.sdk
-keep class ru.cloudpayments.sdk.** { *; }
-dontwarn ru.cloudpayments.sdk.**
-dontnote ru.cloudpayments.sdk.**

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class CloudpaymentsApi @Inject constructor(private val apiService: Cloudpayments
.subscribeOn(Schedulers.io())
.map { CloudpaymentsThreeDsResponse(true, "", 0) }
.onErrorReturn {
val response: CloudpaymentsThreeDsResponse = if (it is HttpException && it.response().raw().isRedirect) {
val url = it.response().raw().header("Location")
val response: CloudpaymentsThreeDsResponse = if (it is HttpException && it.response()?.raw()!!.isRedirect) {
val url = it.response()?.raw()?.header("Location")
when {
url?.startsWith(THREE_DS_FAIL_URL) == true -> {
val uri = Uri.parse(url)
Expand Down
17 changes: 0 additions & 17 deletions sdk/src/test/java/ru/cloudpayments/sdk/ExampleUnitTest.kt

This file was deleted.

0 comments on commit c664493

Please sign in to comment.