Skip to content

Commit

Permalink
chore: enabling code shrinking and obfuscation in the example app and… (
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 authored Feb 8, 2024
1 parent 3f3b11e commit 8456b40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Add this dependency to your project's build file:
}
```

Add the ProGuard rules found in example/proguard-rules.pro to your project's rules if you build
enables code shrinking or obfuscation

## Features

- [TextElement](https://developers.basistheory.com/docs/sdks/mobile/android/types#textelement) to securely collect text input
Expand Down
3 changes: 2 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
29 changes: 11 additions & 18 deletions example/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-dontwarn javax.validation.valueextraction.UnwrapByDefault
-dontwarn javax.validation.valueextraction.ValueExtractor

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Needed to keep generic signatures
-keepattributes Signature

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# Used by Gson serialization and deserialization internally in BT's SDK
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# BT's SDK classes
-keep class com.basistheory.** {
*;
}

0 comments on commit 8456b40

Please sign in to comment.