Skip to content

Commit

Permalink
Fixed connection update not working in obfuscated applications (#634)
Browse files Browse the repository at this point in the history
Proguard by default removes unused code. BluetoothGattCallback.onConnectionUpdated() function is hidden in AOSP and therefore Proguard removes the callback. Added a correct consumer Proguard configuration to the library package so the callback will not be renamed/removed.
  • Loading branch information
dariuszseweryn committed Oct 24, 2019
1 parent 10d82e8 commit 1cd337e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions rxandroidble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}
}

Expand Down
7 changes: 5 additions & 2 deletions rxandroidble/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
# public *;
#}

# hide warnings caused by Retrolamdba
-dontwarn java.lang.invoke.*
# RxAndroidBle
-keepclassmembers class * extends android.bluetooth.BluetoothGattCallback {
# This method is hidden in AOSP sources and therefore Proguard strips it by default
public void onConnectionUpdated(android.bluetooth.BluetoothGatt, int, int, int, int);
}

0 comments on commit 1cd337e

Please sign in to comment.