Skip to content

Commit c03229b

Browse files
committed
ios: handle version with and without v prefix
Before BitBoxSwiss/bitbox02-firmware#1447, the product characteristic version string didn't include a 'v' prefix, but after it does. The app backend requires it to parse the version. We handle both cases for backwards compatibility.
1 parent 9e42e21 commit c03229b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontends/ios/BitBoxApp/BitBoxApp/Bluetooth.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ class BluetoothDeviceInfo: NSObject, MobileserverGoDeviceInfoInterfaceProtocol {
498498
}
499499

500500
func serial() -> String {
501-
return "v" + productInfo.version
501+
// BitBox delivers the version with the `v` prefix, and adding it manually here can be
502+
// dropped at some point. Only testing firmwares before the first release did not include
503+
// the prefix.
504+
return productInfo.version.hasPrefix("v") ? productInfo.version : "v" + productInfo.version
502505
}
503506

504507
func usagePage() -> Int {

0 commit comments

Comments
 (0)