@mentra/bluetooth-sdk 3.2.0-dev.177 → 3.2.0-dev.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,9 @@ package com.mentra.bluetoothsdk
3
3
  /** Generated by release CI. Do not edit in a release checkout. */
4
4
  internal object GeneratedReleaseMetadata {
5
5
  const val FAMILY_BASE_VERSION: String = "3.2.0"
6
- const val RELEASE_IDENTITY: String = "3.2.0-dev.177"
7
- const val RELEASE_SET_ID: String = "mentra-3.2.0-dev.177"
8
- const val SOURCE_COMMIT: String = "333e6c36f33855ce6db6c192d677c36bd6316c3f"
9
- const val OTA_MANIFEST_URL: String = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.177.json"
10
- const val OTA_MANIFEST_SHA256: String = "2bde3826947a1416081eeab114f207cb182d1a1e31f43c2a6212eb1865e5ba0c"
6
+ const val RELEASE_IDENTITY: String = "3.2.0-dev.180"
7
+ const val RELEASE_SET_ID: String = "mentra-3.2.0-dev.180"
8
+ const val SOURCE_COMMIT: String = "1f24e462561fef37b7082204847a541db4a87c41"
9
+ const val OTA_MANIFEST_URL: String = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.180.json"
10
+ const val OTA_MANIFEST_SHA256: String = "cbf2a1b81430bd34942e2a1764138f6d79197767b4434a2d8c44311768f8b873"
11
11
  }
@@ -72,11 +72,12 @@ internal object OtaManifestChecker {
72
72
  currentMtkVersion: String,
73
73
  currentBesVersion: String,
74
74
  manifest: JSONObject,
75
- // Downgrade floor: a non-positive value (the default) disables downgrades entirely,
76
- // matching ASG's fail-closed DowngradeGate and the engine. OEM SDK consumers that do
77
- // not set a floor therefore get upgrade-only behavior and are never told a downgrade is
78
- // available that the glasses would refuse.
79
- downgradeFloorVersionCode: Long = 0L,
75
+ // Mentra 3.0 is the oldest downgrade-safe target, matching Engine, ASG, and recovery.
76
+ // Coordinated releases guarantee higher supported ASG builds can downgrade; no source gate is needed.
77
+ // The shipped floor may increase, never decrease, and must stay aligned across all checkers.
78
+ // See asg_client/docs/mentra-live-spec.md#ota-and-updates.
79
+ // An explicit non-positive override still disables downgrades.
80
+ downgradeFloorVersionCode: Long = 51518114L,
80
81
  ): Boolean =
81
82
  hasApkUpdate(currentBuildNumber, manifest, downgradeFloorVersionCode) ||
82
83
  hasMtkUpdate(manifest, currentMtkVersion) ||
@@ -31,6 +31,14 @@ class OtaManifestDowngradeTest {
31
31
  downgradeFloorVersionCode = floor,
32
32
  )
33
33
 
34
+ @Test
35
+ fun shippedFloorAllowsMentra30ButRejectsOlderTargets() {
36
+ for ((target, expected) in listOf(51518113L to false, 51518114L to true, 51518115L to true, 100000095L to false)) {
37
+ assertEquals(expected, OtaManifestChecker.hasUpdate("100000095", "", "", manifest(target)))
38
+ }
39
+ assertFalse(OtaManifestChecker.hasUpdate("100000095", "", "", manifest(51518114L), downgradeFloorVersionCode = 0L))
40
+ }
41
+
34
42
  @Test
35
43
  fun upgradeIsAlwaysAnUpdate() {
36
44
  assertTrue(hasUpdate("49000000", manifest(49076573L)))
@@ -1,10 +1,10 @@
1
1
  export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "3.2.0",
4
- "releaseIdentity": "3.2.0-dev.177",
5
- "releaseSetId": "mentra-3.2.0-dev.177",
6
- "sourceCommit": "333e6c36f33855ce6db6c192d677c36bd6316c3f",
7
- "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.177.json",
8
- "otaManifestSha256": "2bde3826947a1416081eeab114f207cb182d1a1e31f43c2a6212eb1865e5ba0c"
4
+ "releaseIdentity": "3.2.0-dev.180",
5
+ "releaseSetId": "mentra-3.2.0-dev.180",
6
+ "sourceCommit": "1f24e462561fef37b7082204847a541db4a87c41",
7
+ "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.180.json",
8
+ "otaManifestSha256": "cbf2a1b81430bd34942e2a1764138f6d79197767b4434a2d8c44311768f8b873"
9
9
  });
10
10
  //# sourceMappingURL=releaseMetadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,wHAAwH;IAC1I,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.2.0\",\n \"releaseIdentity\": \"3.2.0-dev.177\",\n \"releaseSetId\": \"mentra-3.2.0-dev.177\",\n \"sourceCommit\": \"333e6c36f33855ce6db6c192d677c36bd6316c3f\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.177.json\",\n \"otaManifestSha256\": \"2bde3826947a1416081eeab114f207cb182d1a1e31f43c2a6212eb1865e5ba0c\"\n})\n"]}
1
+ {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,wHAAwH;IAC1I,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.2.0\",\n \"releaseIdentity\": \"3.2.0-dev.180\",\n \"releaseSetId\": \"mentra-3.2.0-dev.180\",\n \"sourceCommit\": \"1f24e462561fef37b7082204847a541db4a87c41\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.180.json\",\n \"otaManifestSha256\": \"cbf2a1b81430bd34942e2a1764138f6d79197767b4434a2d8c44311768f8b873\"\n})\n"]}
@@ -11,7 +11,7 @@ enum BluetoothSdkDefaults {
11
11
  static let voiceActivityDetectionEnabled = false
12
12
  static let loudnessGateEnabled = false
13
13
  private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
14
- private static let swiftPackageSdkVersion = "3.2.0-dev.177"
14
+ private static let swiftPackageSdkVersion = "3.2.0-dev.180"
15
15
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
16
16
 
17
17
  private static func normalizedSdkVersion(_ value: String?) -> String? {
@@ -3,9 +3,9 @@ import Foundation
3
3
  /// Generated by release CI. Do not edit in a release checkout.
4
4
  enum GeneratedReleaseMetadata {
5
5
  static let familyBaseVersion = "3.2.0"
6
- static let releaseIdentity = "3.2.0-dev.177"
7
- static let releaseSetId = "mentra-3.2.0-dev.177"
8
- static let sourceCommit = "333e6c36f33855ce6db6c192d677c36bd6316c3f"
9
- static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.177.json"
10
- static let otaManifestSha256 = "2bde3826947a1416081eeab114f207cb182d1a1e31f43c2a6212eb1865e5ba0c"
6
+ static let releaseIdentity = "3.2.0-dev.180"
7
+ static let releaseSetId = "mentra-3.2.0-dev.180"
8
+ static let sourceCommit = "1f24e462561fef37b7082204847a541db4a87c41"
9
+ static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.180.json"
10
+ static let otaManifestSha256 = "cbf2a1b81430bd34942e2a1764138f6d79197767b4434a2d8c44311768f8b873"
11
11
  }
@@ -115,11 +115,12 @@ enum OtaManifestChecker {
115
115
  currentMtkVersion: String,
116
116
  currentBesVersion: String,
117
117
  manifest: OtaManifest,
118
- // Downgrade floor: a non-positive value (the default) disables downgrades entirely,
119
- // matching ASG's fail-closed DowngradeGate and the engine. OEM SDK consumers that do not
120
- // set a floor get upgrade-only behavior and are never told a downgrade is available that
121
- // the glasses would refuse.
122
- downgradeFloorVersionCode: Int = 0
118
+ // Mentra 3.0 is the oldest downgrade-safe target, matching Engine, ASG, and recovery.
119
+ // Coordinated releases guarantee higher supported ASG builds can downgrade; no source gate is needed.
120
+ // The shipped floor may increase, never decrease, and must stay aligned across all checkers.
121
+ // See asg_client/docs/mentra-live-spec.md#ota-and-updates.
122
+ // An explicit non-positive override still disables downgrades.
123
+ downgradeFloorVersionCode: Int = 51518114
123
124
  ) throws -> Bool {
124
125
  try hasApkUpdate(
125
126
  currentBuildNumber: currentBuildNumber,
@@ -0,0 +1,20 @@
1
+ @testable import MentraBluetoothSDK
2
+ import XCTest
3
+
4
+ final class OtaManifestDowngradeTests: XCTestCase {
5
+ func testShippedFloorAllowsMentra30ButRejectsOlderTargets() throws {
6
+ for (target, expected) in [(51_518_113, false), (51_518_114, true), (51_518_115, true), (100_000_095, false)] {
7
+ let manifest = OtaManifest(apps: ["com.mentra.asg_client": OtaManifestApp(versionCode: target)],
8
+ mtkPatches: nil, mtkFullOta: nil, besFirmware: nil, versionCode: nil)
9
+ XCTAssertEqual(try OtaManifestChecker.hasUpdate(currentBuildNumber: "100000095",
10
+ currentMtkVersion: "", currentBesVersion: "", manifest: manifest), expected)
11
+ }
12
+ }
13
+
14
+ func testExplicitDisabledFloorStillRejectsDowngrades() throws {
15
+ let manifest = OtaManifest(apps: ["com.mentra.asg_client": OtaManifestApp(versionCode: 51_518_114)],
16
+ mtkPatches: nil, mtkFullOta: nil, besFirmware: nil, versionCode: nil)
17
+ XCTAssertFalse(try OtaManifestChecker.hasUpdate(currentBuildNumber: "100000095",
18
+ currentMtkVersion: "", currentBesVersion: "", manifest: manifest, downgradeFloorVersionCode: 0))
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.2.0-dev.177",
3
+ "version": "3.2.0-dev.180",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",
@@ -12,9 +12,9 @@ export interface BluetoothSdkReleaseMetadata {
12
12
  export const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({
13
13
  "schemaVersion": 1,
14
14
  "familyBaseVersion": "3.2.0",
15
- "releaseIdentity": "3.2.0-dev.177",
16
- "releaseSetId": "mentra-3.2.0-dev.177",
17
- "sourceCommit": "333e6c36f33855ce6db6c192d677c36bd6316c3f",
18
- "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.177.json",
19
- "otaManifestSha256": "2bde3826947a1416081eeab114f207cb182d1a1e31f43c2a6212eb1865e5ba0c"
15
+ "releaseIdentity": "3.2.0-dev.180",
16
+ "releaseSetId": "mentra-3.2.0-dev.180",
17
+ "sourceCommit": "1f24e462561fef37b7082204847a541db4a87c41",
18
+ "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.180.json",
19
+ "otaManifestSha256": "cbf2a1b81430bd34942e2a1764138f6d79197767b4434a2d8c44311768f8b873"
20
20
  })