@mentra/bluetooth-sdk 3.4.0-dev.1155 → 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 +2 -0
- package/android/build.gradle +11 -9
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AvifExifStripper.java +2 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +3 -3
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/package.json +2 -2
- package/plugin/build/withAndroid.js +2 -0
- package/plugin/build/withKotlinVersion.d.ts +2 -0
- package/plugin/build/withKotlinVersion.js +46 -0
- package/src/generated/releaseMetadata.ts +5 -5
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
|
package/android/build.gradle
CHANGED
|
@@ -218,8 +218,8 @@ if (standaloneBuild) {
|
|
|
218
218
|
useExpoPublishing()
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
//
|
|
222
|
-
//
|
|
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
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
// 2.
|
|
323
|
-
//
|
|
324
|
-
dependencies.add(publicMavenSdk ? 'compileOnly' : 'implementation', '
|
|
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.
|
|
7
|
-
const val RELEASE_SET_ID: String = "mentra-3.4.0-dev.
|
|
8
|
-
const val SOURCE_COMMIT: String = "
|
|
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.
|
|
10
|
-
const val OTA_MANIFEST_SHA256: String = "
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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, "
|
|
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.
|
|
5
|
-
"releaseSetId": "mentra-3.4.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
7
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.
|
|
8
|
-
"otaManifestSha256": "
|
|
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.
|
|
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.
|
|
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.
|
|
7
|
-
static let releaseSetId = "mentra-3.4.0-dev.
|
|
8
|
-
static let sourceCommit = "
|
|
9
|
-
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.
|
|
10
|
-
static let otaManifestSha256 = "
|
|
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.
|
|
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.
|
|
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,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.
|
|
16
|
-
"releaseSetId": "mentra-3.4.0-dev.
|
|
17
|
-
"sourceCommit": "
|
|
18
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.
|
|
19
|
-
"otaManifestSha256": "
|
|
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
|
})
|