Skip to content

Commit 14f396e

Browse files
committed
Added proguard configuration
1 parent 910f352 commit 14f396e

File tree

11 files changed

+27
-41
lines changed

11 files changed

+27
-41
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ allprojects {
2424
}
2525

2626
project.ext {
27-
sdkVersion='0.6.13'
27+
sdkVersion='0.6.14'
2828
versionCode=1
2929

3030
compileSdkVersion=27

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ android {
1111
versionCode project.versionCode
1212
versionName project.sdkVersion
1313
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles 'proguard-rules.pro'
1415

1516
resValue "string", "okhttp_version", project.okhttpVersion
1617
}
@@ -40,7 +41,6 @@ dependencies {
4041
implementation "com.squareup.okhttp3:okhttp:${project.okhttpVersion}"
4142
implementation "com.squareup.okhttp3:logging-interceptor:${project.okhttpVersion}"
4243
implementation 'com.google.code.gson:gson:2.8.2'
43-
implementation "com.android.support:support-annotations:${project.supportLibraryVersion}"
4444

4545
testImplementation 'junit:junit:4.12'
4646

core/proguard-rules.pro

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
# Add project specific ProGuard rules here.
2-
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
4-
#
5-
# For more details, see
6-
# http://developer.android.com/guide/developing/tools/proguard.html
1+
-dontwarn java.lang.invoke.**
72

8-
# If your project uses WebView with JS, uncomment the following
9-
# and specify the fully qualified class name to the JavaScript interface
10-
# class:
11-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12-
# public *;
13-
#}
3+
# OkHttp
4+
-keepattributes Signature
5+
-keepattributes *Annotation*
6+
-keep class okhttp3.** { *; }
7+
-keep interface okhttp3.** { *; }
8+
-dontwarn okhttp3.**
149

15-
# Uncomment this to preserve the line number information for
16-
# debugging stack traces.
17-
#-keepattributes SourceFile,LineNumberTable
10+
# Okio
11+
-keep class sun.misc.Unsafe { *; }
12+
-dontwarn java.nio.file.*
13+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
14+
-dontwarn okio.**
1815

19-
# If you keep the line number information, uncomment this to
20-
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
16+
# Picasso
17+
-dontwarn com.squareup.okhttp.**
18+
19+
# Gson
20+
-keepattributes Signature
21+
-keepattributes *Annotation*
22+
-dontwarn sun.misc.**
23+
-keep class * implements com.google.gson.TypeAdapterFactory
24+
-keep class * implements com.google.gson.JsonSerializer
25+
-keep class * implements com.google.gson.JsonDeserializer
26+
27+
# SDK
28+
-keep class io.snabble.sdk.** { *; }

core/src/main/java/io/snabble/sdk/Checkout.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import android.os.Handler;
44
import android.os.HandlerThread;
55
import android.os.Looper;
6-
import android.support.annotation.Keep;
76

87
import com.google.gson.Gson;
98
import com.google.gson.GsonBuilder;
@@ -34,7 +33,6 @@
3433
import okhttp3.Response;
3534
import okhttp3.ResponseBody;
3635

37-
@Keep
3836
public class Checkout {
3937
/*
4038
* Data structures as defined here:

core/src/main/java/io/snabble/sdk/PaymentMethod.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package io.snabble.sdk;
22

3-
import android.support.annotation.Keep;
4-
53
import com.google.gson.annotations.SerializedName;
64

7-
@Keep
85
public enum PaymentMethod {
96
@SerializedName("cash")
107
CASH(false),

core/src/main/java/io/snabble/sdk/Product.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.snabble.sdk;
22

3-
import android.support.annotation.Keep;
4-
53
import com.google.gson.annotations.SerializedName;
64

75
import java.math.BigDecimal;
@@ -10,7 +8,6 @@
108
/**
119
* Class that holds all of the product information.
1210
*/
13-
@Keep
1411
public class Product {
1512
public enum Type {
1613
/**

core/src/main/java/io/snabble/sdk/ProductApi.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import android.os.Handler;
44
import android.os.Looper;
5-
import android.support.annotation.Keep;
6-
75
import com.google.gson.Gson;
86
import com.google.gson.GsonBuilder;
97
import com.google.gson.JsonParseException;
@@ -23,7 +21,6 @@
2321
import okhttp3.Response;
2422
import okhttp3.ResponseBody;
2523

26-
@Keep
2724
class ProductApi {
2825
private static class ApiProduct {
2926
private String sku;

core/src/main/java/io/snabble/sdk/Shop.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.snabble.sdk;
22

3-
import android.support.annotation.Keep;
4-
53
import com.google.gson.Gson;
64
import com.google.gson.GsonBuilder;
75
import com.google.gson.JsonElement;
@@ -12,7 +10,6 @@
1210

1311
import io.snabble.sdk.utils.Logger;
1412

15-
@Keep
1613
public class Shop implements Serializable {
1714
public enum Service {
1815
@SerializedName("euro")

core/src/main/java/io/snabble/sdk/ShoppingCart.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.os.Handler;
44
import android.os.Looper;
5-
import android.support.annotation.Keep;
65

76
import java.util.ArrayList;
87
import java.util.Collections;
@@ -12,7 +11,6 @@
1211

1312
import io.snabble.sdk.codes.ScannableCode;
1413

15-
@Keep
1614
public class ShoppingCart {
1715
public static final int MAX_QUANTITY = 100000;
1816

core/src/main/java/io/snabble/sdk/codes/EAN13.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package io.snabble.sdk.codes;
22

3-
import android.support.annotation.Keep;
43
import android.util.SparseIntArray;
54

65
import java.io.Serializable;
76

8-
@Keep
97
public class EAN13 extends ScannableCode implements Serializable {
108
private String lookupCode;
119
private int embeddedData;

0 commit comments

Comments
 (0)