1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 02:25:50 +01:00

Fix PineTime firmware upload for Android 12 target

Now that the target SDK was changed to 31, the `no.nordicsemi.android:dfu`
library needs to be updated, as the current version dies on Android 12+.

However, the fixed version (1.12.0) also fixed MTU handling: The previous
versions ignored the MTU settings completely for legacy DFU.
<https://github.com/NordicSemiconductor/Android-DFU-Library/pull/260>

And while our `PineTimeJFSupport` code always tried to set MTU to 517, it was
ignored. Which was good because PineTime does not support larger MTUs. So that
we need to set the correct low MTU now the library really applies it.

Note that the current version of the DFU library cannot be used right now, it
does not even compile because of androidx dependency mismatch.

Fixes #3203
This commit is contained in:
mormegil 2023-07-14 16:08:24 +02:00 committed by José Rebelo
parent 7eee3e16cd
commit 8f5c32fbee
2 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ dependencies {
implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation "com.google.code.gson:gson:2.8.6" implementation "com.google.code.gson:gson:2.8.6"
implementation "no.nordicsemi.android:dfu:1.11.1" implementation "no.nordicsemi.android:dfu:1.12.0"
implementation("com.github.tony19:logback-android:2.0.0") { implementation("com.github.tony19:logback-android:2.0.0") {
exclude group: "com.google.android", module: "android" exclude group: "com.google.android", module: "android"
} }

View File

@ -425,7 +425,7 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
.setKeepBond(true) .setKeepBond(true)
.setForeground(false) .setForeground(false)
.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(false) .setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(false)
.setMtu(517) .setMtu(23)
.setZip(uri); .setZip(uri);
controller = starter.start(getContext(), PineTimeDFUService.class); controller = starter.start(getContext(), PineTimeDFUService.class);