Skip to content

Commit 5f6d4b2

Browse files
Merge pull request #106 from PaystackHQ/fix/proguard
Fix response parsing issues after R8 / proguard obfuscation
2 parents 03ab6f9 + a3d2488 commit 5f6d4b2

File tree

4 files changed

+7
-26
lines changed

4 files changed

+7
-26
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ ext {
3030

3131
buildToolsVersion = "29.0.2"
3232
supportLibraryVersion = "28.0.0"
33-
versionName = "3.0.18"
33+
versionName = "3.0.19-dev"
3434
}

paystack/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@ android {
1212
defaultConfig {
1313
minSdkVersion rootProject.ext.minSdkVersion
1414
targetSdkVersion rootProject.ext.targetSdkVersion
15-
versionCode rootProject.ext.versionCode
1615
versionName rootProject.ext.versionName
17-
}
18-
buildTypes {
19-
release {
20-
minifyEnabled false
21-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22-
}
16+
consumerProguardFiles 'proguard-rules.pro'
2317
}
2418

2519
compileOptions {

paystack/proguard-rules.pro

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in /Users/segunfamisa/Documents/Softwares/adt-bundle-mac-x86_64-20130729/sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
6-
#
7-
# For more details, see
8-
# http://developer.android.com/guide/developing/tools/proguard.html
9-
10-
# Add any project specific keep options here:
11-
12-
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
14-
# class:
15-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16-
# public *;
17-
#}
1+
-keepclassmembers class co.paystack.android.api.model.** { <fields>; }

paystack/src/main/java/co/paystack/android/api/model/TransactionApiResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public static TransactionApiResponse fromJsonString(String jsonString) {
3535
try {
3636
return new Gson().fromJson(jsonString, TransactionApiResponse.class);
3737
} catch (Exception e) {
38-
return TransactionApiResponse.unknownServerResponse();
38+
TransactionApiResponse t = new TransactionApiResponse();
39+
t.status = "0";
40+
t.message = e.getMessage();
41+
return t;
3942
}
4043
}
4144

0 commit comments

Comments
 (0)