Skip to content

Commit 96c8a2a

Browse files
committed
doc: Cleanup README wording
1 parent 4b1e832 commit 96c8a2a

1 file changed

Lines changed: 8 additions & 22 deletions

File tree

README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,38 +113,24 @@ setup.
113113

114114
There is now a build script at `./scripts/build-java.sh` for building the java portion of the library on linux or macOS. This can also be used as a guide for manual building if need be.
115115

116-
Proguard optimization can be an issue when using btleplug, as the .aar file generated by the java
117-
code in btleplug is only accessed by native code, and can be optimized out as part of dead code
118-
removal and resource shrinking. To fix this, changes will need to be made to your build.gradle file, and proguard rules will need to be defined.
116+
If your app uses Proguard/R8 with `minifyEnabled true`, you must add keep rules for btleplug's
117+
Java classes. All of btleplug's Java code (including vendored jni-utils classes) is only accessed
118+
via JNI from native code, so R8 will treat it as dead code and strip it without these rules.
119119

120-
For build.gradle:
120+
In your `build.gradle`, ensure Proguard is configured for release builds:
121121
```groovy
122122
buildTypes {
123123
release {
124-
// TODO: Add your own signing config for the release build.
125-
// Signing with the debug keys for now, so `flutter run --release` works.
126-
signingConfig signingConfigs.debug
127-
128124
shrinkResources true
129125
minifyEnabled true
130-
131126
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
132-
133127
}
134128
}
135129
```
136130

137131
proguard-rules.pro:
138132
```
139-
#Flutter Wrapper - Only needed if using flutter
140-
-keep class io.flutter.app.** { *; }
141-
-keep class io.flutter.plugin.** { *; }
142-
-keep class io.flutter.util.** { *; }
143-
-keep class io.flutter.view.** { *; }
144-
-keep class io.flutter.** { *; }
145-
-keep class io.flutter.plugins.** { *; }
146-
147-
#btleplug resources
133+
# btleplug Java classes (accessed only via JNI)
148134
-keep class com.nonpolynomial.** { *; }
149135
-keep class io.github.gedgygedgy.** { *; }
150136
```
@@ -202,13 +188,13 @@ west build -b nrf52840dk/nrf52840 && west flash
202188
cargo test --test '*' -- --ignored
203189
```
204190

205-
**Quick start without hardware:**
191+
**Quick start with a virtual peripheral (requires USB BLE dongle):**
206192

207193
```bash
208-
# Start the Bumble virtual peripheral (requires USB BLE dongle)
194+
# Start the Bumble virtual peripheral
209195
cd test-peripheral/bumble
210196
pip install -r requirements.txt
211-
./run.sh usb:0
197+
./run.sh usb:0 # transport argument may vary; see Bumble docs
212198

213199
# In another terminal, run integration tests
214200
cargo test --test '*' -- --ignored

0 commit comments

Comments
 (0)