@mentra/bluetooth-sdk 3.4.0-dev.1156 → 3.4.0-dev.1161

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.
package/README.md CHANGED
@@ -46,6 +46,8 @@ changes. Adding this JS package alone cannot reroute logs in an older binary.
46
46
  - React Native `0.72+`.
47
47
  - Expo `49+` when using Expo.
48
48
  - Android min SDK `28+`.
49
+ - Android source builds use Kotlin `2.3.0+`; the Expo config plugin selects it
50
+ automatically. The public Maven SDK still targets Kotlin 2.1 consumers.
49
51
  - iOS deployment target `15.1+`.
50
52
  - Native macOS deployment target `13+`. The Starter Kit's separate
51
53
  `react-native-macos` host requires macOS `14+` and a matching React Native / Expo
@@ -218,8 +218,8 @@ if (standaloneBuild) {
218
218
  useExpoPublishing()
219
219
  }
220
220
 
221
- // Hosts that embed @mentra/crust compile with Kotlin 2.3 (its QuickJS library
222
- // requires it). Keep the public Maven artifact usable from Kotlin 2.1 builds:
221
+ // Source builds use Kotlin 2.3 for avif-coder (and Crust's QuickJS when present).
222
+ // Keep the public Maven artifact usable from Kotlin 2.1 builds:
223
223
  // 2.2 metadata (a 2.1 compiler reads one version ahead; 2.2 is also the lowest
224
224
  // language version that reads the 2.3 expo-modules-core classes compiled here),
225
225
  // 2.1 stdlib APIs, and a kotlin-stdlib 2.1.20 dependency in the POM.
@@ -315,13 +315,15 @@ dependencies {
315
315
  implementation 'androidx.exifinterface:exifinterface:1.3.7'
316
316
 
317
317
  // AVIF decode for BLE photo fallback. Public Maven artifacts omit this
318
- // JitPack-only decoder from runtime metadata; Android 12+ can still use the
319
- // platform decoder, while MentraOS app builds keep HeifCoder for broader
320
- // fallback support.
321
- // Pinned to the JitPack 1.7.3 build (same as asg_client): the Maven Central
322
- // 2.2.x releases transitively pull kotlin-stdlib 2.3.0, which breaks this
323
- // project's Kotlin 2.1 compile of :expo.
324
- dependencies.add(publicMavenSdk ? 'compileOnly' : 'implementation', 'com.github.awxkee:avif-coder:1.7.3')
318
+ // decoder from runtime metadata; Android 12+ can still use the platform
319
+ // decoder, while MentraOS app builds keep Coder for broader fallback.
320
+ // 3.0.0 ships 16 KB-aligned libcoder.so (1.7.3 was 4 KB). Its POM depends
321
+ // on kotlin-stdlib 2.3.0. Exclude it to keep the public SDK's runtime
322
+ // dependencies on 2.1; the Expo plugin selects a 2.3 source compiler to
323
+ // read the decoder's metadata, independently of this stdlib exclusion.
324
+ dependencies.add(publicMavenSdk ? 'compileOnly' : 'implementation', 'io.github.awxkee:avif-coder:3.0.0') {
325
+ exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
326
+ }
325
327
 
326
328
  testImplementation 'junit:junit:4.13.2'
327
329
  testImplementation 'org.robolectric:robolectric:4.11.1'
@@ -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.4.0"
6
- const val RELEASE_IDENTITY: String = "3.4.0-dev.1156"
7
- const val RELEASE_SET_ID: String = "mentra-3.4.0-dev.1156"
8
- const val SOURCE_COMMIT: String = "717d4d0278125ca02ff315433bcfe542250e2e8b"
9
- const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1156.json"
10
- const val OTA_MANIFEST_SHA256: String = "d1622398af985825853569b6382055371765f9e92d20faa556dedc32aedc8012"
6
+ const val RELEASE_IDENTITY: String = "3.4.0-dev.1161"
7
+ const val RELEASE_SET_ID: String = "mentra-3.4.0-dev.1161"
8
+ const val SOURCE_COMMIT: String = "3ad76b45ba38cce4e08110ac5957be8c7a2e3ccb"
9
+ const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1161.json"
10
+ const val OTA_MANIFEST_SHA256: String = "60677c0826858b1b15a3c1ddb14ccfc1eaf838629b237bb5e682dffc828acf27"
11
11
  }
@@ -10,7 +10,7 @@ import java.util.Arrays;
10
10
  import java.util.List;
11
11
 
12
12
  /**
13
- * Removes the Exif metadata item from glasses BLE AVIF so {@link com.radzivon.bartoshyk.avif.coder.HeifCoder}
13
+ * Removes the Exif metadata item from glasses BLE AVIF so {@link com.radzivon.bartoshyk.avif.coder.Coder}
14
14
  * can decode the image. EXIF is appended to {@code mdat} by the glasses encoder; libavif then fails if that
15
15
  * trailer is present. IMU JSON must be read from the original bytes before stripping.
16
16
  */
@@ -41,7 +41,7 @@ final class AvifExifStripper {
41
41
 
42
42
  /**
43
43
  * Truncates mdat at the {@code Exif\0\0} byte position, then removes the Exif item from
44
- * iloc/iinf/iref so HeifCoder does not try to seek to the now-absent data.
44
+ * iloc/iinf/iref so Coder does not try to seek to the now-absent data.
45
45
  */
46
46
  private static byte[] stripMdatTailAndMeta(byte[] avif, int exifMarker) throws IOException {
47
47
  List<BmffBox> top = parseTopLevel(avif);
@@ -11,7 +11,7 @@ import androidx.exifinterface.media.ExifInterface;
11
11
 
12
12
  import com.mentra.bluetoothsdk.debug.BleTraceLogger;
13
13
  import com.mentra.bluetoothsdk.photoreceiver.LocalPhotoReceiverRegistry;
14
- import com.radzivon.bartoshyk.avif.coder.HeifCoder;
14
+ import com.radzivon.bartoshyk.avif.coder.Coder;
15
15
  import com.radzivon.bartoshyk.avif.coder.PreferredColorConfig;
16
16
 
17
17
  import org.json.JSONArray;
@@ -371,12 +371,12 @@ public class BlePhotoUploadService {
371
371
  @Nullable
372
372
  private static Bitmap decodeAvifBytes(byte[] avifBytes) {
373
373
  try {
374
- Bitmap bmp = new HeifCoder().decode(avifBytes, PreferredColorConfig.RGBA_8888);
374
+ Bitmap bmp = new Coder().decode(avifBytes, PreferredColorConfig.RGBA_8888);
375
375
  if (bmp != null) {
376
376
  return bmp;
377
377
  }
378
378
  } catch (Exception | LinkageError e) {
379
- NativeLog.w(TAG, "HeifCoder AVIF decode unavailable/failed, trying BitmapFactory: " + e.getMessage());
379
+ NativeLog.w(TAG, "AVIF Coder decode unavailable/failed, trying BitmapFactory: " + e.getMessage());
380
380
  }
381
381
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
382
382
  return BitmapFactory.decodeByteArray(avifBytes, 0, avifBytes.length);
@@ -1,10 +1,10 @@
1
1
  export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "3.4.0",
4
- "releaseIdentity": "3.4.0-dev.1156",
5
- "releaseSetId": "mentra-3.4.0-dev.1156",
6
- "sourceCommit": "717d4d0278125ca02ff315433bcfe542250e2e8b",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1156.json",
8
- "otaManifestSha256": "d1622398af985825853569b6382055371765f9e92d20faa556dedc32aedc8012"
4
+ "releaseIdentity": "3.4.0-dev.1161",
5
+ "releaseSetId": "mentra-3.4.0-dev.1161",
6
+ "sourceCommit": "3ad76b45ba38cce4e08110ac5957be8c7a2e3ccb",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1161.json",
8
+ "otaManifestSha256": "60677c0826858b1b15a3c1ddb14ccfc1eaf838629b237bb5e682dffc828acf27"
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,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,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.4.0\",\n \"releaseIdentity\": \"3.4.0-dev.1156\",\n \"releaseSetId\": \"mentra-3.4.0-dev.1156\",\n \"sourceCommit\": \"717d4d0278125ca02ff315433bcfe542250e2e8b\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1156.json\",\n \"otaManifestSha256\": \"d1622398af985825853569b6382055371765f9e92d20faa556dedc32aedc8012\"\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,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,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.4.0\",\n \"releaseIdentity\": \"3.4.0-dev.1161\",\n \"releaseSetId\": \"mentra-3.4.0-dev.1161\",\n \"sourceCommit\": \"3ad76b45ba38cce4e08110ac5957be8c7a2e3ccb\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1161.json\",\n \"otaManifestSha256\": \"60677c0826858b1b15a3c1ddb14ccfc1eaf838629b237bb5e682dffc828acf27\"\n})\n"]}
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
16
16
  /// silently disable it on every pair the app touches.
17
17
  static let autoPowerOffEnabled = true
18
18
  private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
19
- private static let swiftPackageSdkVersion = "3.4.0-dev.1156"
19
+ private static let swiftPackageSdkVersion = "3.4.0-dev.1161"
20
20
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
21
21
 
22
22
  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.4.0"
6
- static let releaseIdentity = "3.4.0-dev.1156"
7
- static let releaseSetId = "mentra-3.4.0-dev.1156"
8
- static let sourceCommit = "717d4d0278125ca02ff315433bcfe542250e2e8b"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1156.json"
10
- static let otaManifestSha256 = "d1622398af985825853569b6382055371765f9e92d20faa556dedc32aedc8012"
6
+ static let releaseIdentity = "3.4.0-dev.1161"
7
+ static let releaseSetId = "mentra-3.4.0-dev.1161"
8
+ static let sourceCommit = "3ad76b45ba38cce4e08110ac5957be8c7a2e3ccb"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1161.json"
10
+ static let otaManifestSha256 = "60677c0826858b1b15a3c1ddb14ccfc1eaf838629b237bb5e682dffc828acf27"
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.4.0-dev.1156",
3
+ "version": "3.4.0-dev.1161",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",
@@ -115,7 +115,7 @@
115
115
  "registry": "https://registry.npmjs.org/"
116
116
  },
117
117
  "dependencies": {
118
- "@mentra/cloud-protocol": "3.4.0-dev.1156"
118
+ "@mentra/cloud-protocol": "3.4.0-dev.1161"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -8,6 +8,7 @@ const child_process_1 = require("child_process");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const config_plugins_1 = require("expo/config-plugins");
10
10
  const analyticsProps_1 = require("./analyticsProps");
11
+ const withKotlinVersion_1 = require("./withKotlinVersion");
11
12
  const META_ANALYTICS_DISABLED = "com.mentra.bluetoothsdk.analytics.disabled";
12
13
  const META_ANALYTICS_ENVIRONMENT = "com.mentra.bluetoothsdk.analytics.environment";
13
14
  const STALE_META_POSTHOG_API_KEY = "com.mentra.bluetoothsdk.analytics.posthog_api_key";
@@ -173,6 +174,7 @@ function withAnalyticsManifestMetadata(config, props) {
173
174
  });
174
175
  }
175
176
  const withAndroidConfiguration = (config, props) => {
177
+ config = (0, withKotlinVersion_1.withKotlinVersion)(config);
176
178
  config = withSettingsGradleModifications(config);
177
179
  config = withSherpaOnnxLocalMavenRepo(config);
178
180
  config = withAnalyticsManifestMetadata(config, props);
@@ -0,0 +1,2 @@
1
+ import { type ConfigPlugin } from "expo/config-plugins";
2
+ export declare const withKotlinVersion: ConfigPlugin;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withKotlinVersion = void 0;
4
+ const config_plugins_1 = require("expo/config-plugins");
5
+ // avif-coder 3.0.0 contains Kotlin 2.3 metadata. Match the standalone SDK
6
+ // compiler and @mentra/crust; Expo SDK 55 also has a KSP mapping for 2.3.0.
7
+ const MIN_KOTLIN_VERSION = "2.3.0";
8
+ const UNVERSIONED_KOTLIN_PLUGIN = "classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')";
9
+ const PINNED_KOTLIN_PLUGIN = `classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:\${findProperty('android.kotlinVersion')}")`;
10
+ const ROOT_KOTLIN_VERSION = "ext.kotlinVersion = findProperty('android.kotlinVersion')";
11
+ const EXPO_ROOT_PROJECT = 'apply plugin: "expo-root-project"';
12
+ function isOlderVersion(version) {
13
+ const actual = version.split(".").map(Number);
14
+ const minimum = MIN_KOTLIN_VERSION.split(".").map(Number);
15
+ for (let index = 0; index < minimum.length; index++) {
16
+ if ((actual[index] ?? 0) !== minimum[index])
17
+ return (actual[index] ?? 0) < minimum[index];
18
+ }
19
+ return false;
20
+ }
21
+ const withKotlinVersion = (config) => {
22
+ config = (0, config_plugins_1.withGradleProperties)(config, (cfg) => {
23
+ const property = cfg.modResults.find((item) => item.type === "property" && item.key === "android.kotlinVersion");
24
+ if (property?.type !== "property") {
25
+ cfg.modResults.push({ type: "property", key: "android.kotlinVersion", value: MIN_KOTLIN_VERSION });
26
+ }
27
+ else if (isOlderVersion(property.value)) {
28
+ property.value = MIN_KOTLIN_VERSION;
29
+ }
30
+ return cfg;
31
+ });
32
+ return (0, config_plugins_1.withProjectBuildGradle)(config, (cfg) => {
33
+ if (cfg.modResults.language !== "groovy")
34
+ return cfg;
35
+ // Expo 55's unversioned classpath resolves React Native's Kotlin 2.1.20
36
+ // compiler even when android.kotlinVersion is set. Pin the actual plugin
37
+ // and Expo's version catalog, as @mentra/crust does for QuickJS.
38
+ let gradle = cfg.modResults.contents.replace(UNVERSIONED_KOTLIN_PLUGIN, PINNED_KOTLIN_PLUGIN);
39
+ if (!gradle.includes(ROOT_KOTLIN_VERSION)) {
40
+ gradle = gradle.replace(EXPO_ROOT_PROJECT, `// Kotlin compiler required by @mentra/bluetooth-sdk's AVIF decoder.\n${ROOT_KOTLIN_VERSION}\n${EXPO_ROOT_PROJECT}`);
41
+ }
42
+ cfg.modResults.contents = gradle;
43
+ return cfg;
44
+ });
45
+ };
46
+ exports.withKotlinVersion = withKotlinVersion;
@@ -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.4.0",
15
- "releaseIdentity": "3.4.0-dev.1156",
16
- "releaseSetId": "mentra-3.4.0-dev.1156",
17
- "sourceCommit": "717d4d0278125ca02ff315433bcfe542250e2e8b",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1156.json",
19
- "otaManifestSha256": "d1622398af985825853569b6382055371765f9e92d20faa556dedc32aedc8012"
15
+ "releaseIdentity": "3.4.0-dev.1161",
16
+ "releaseSetId": "mentra-3.4.0-dev.1161",
17
+ "sourceCommit": "3ad76b45ba38cce4e08110ac5957be8c7a2e3ccb",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1161.json",
19
+ "otaManifestSha256": "60677c0826858b1b15a3c1ddb14ccfc1eaf838629b237bb5e682dffc828acf27"
20
20
  })