hardware-example 1.1.11-alpha.1 → 1.1.11-alpha.2

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.
@@ -11,6 +11,11 @@ module.exports = {
11
11
  productName: 'HardwareExample',
12
12
  copyright: 'Copyright © OeKey 2024',
13
13
  asar: true,
14
+ // Unpack native modules so they can be loaded at runtime
15
+ asarUnpack: [
16
+ 'node_modules/@stoprocent/noble/**',
17
+ 'node_modules/@stoprocent/bluetooth-hci-socket/**',
18
+ ],
14
19
  buildVersion: version,
15
20
  directories: {
16
21
  output: 'out',
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "hardware-example",
3
3
  "productName": "HardwareExample",
4
4
  "executableName": "onekey-hardware-example",
5
- "version": "1.1.11-alpha.1",
5
+ "version": "1.1.11-alpha.2",
6
6
  "author": "OneKey",
7
7
  "description": "End-to-end encrypted workspaces for teams",
8
8
  "main": "dist/index.js",
@@ -15,12 +15,15 @@
15
15
  "dev": "npx concurrently \"yarn dev:electron\" \"cross-env TRANSFORM_REGENERATOR_DISABLED=true BROWSER=none yarn dev-electron-web\"",
16
16
  "dev:electron": "electron --inspect=5858 dist/index.js",
17
17
  "build:main": "webpack --config webpack.config.ts",
18
- "make": "yarn clean:build && yarn build-electron-web && electron-builder build -mw --config electron-builder.config.js --publish always",
18
+ "rebuild:deps": "electron-builder install-app-deps",
19
+ "make:mac": "yarn rebuild:deps && yarn clean:build && yarn build-electron-web && electron-builder build --mac --config electron-builder.config.js --publish always",
20
+ "make:win": "yarn rebuild:deps && yarn clean:build && yarn build-electron-web && electron-builder build --win --config electron-builder.config.js --publish always",
19
21
  "lint": "eslint --ext .tsx --ext .ts ./",
20
22
  "ts:check": "yarn tsc --noEmit"
21
23
  },
22
24
  "dependencies": {
23
- "@abandonware/noble": "^1.9.2-26",
25
+ "@onekeyfe/hd-transport-electron": "1.1.11-alpha.2",
26
+ "@stoprocent/noble": "2.3.4",
24
27
  "debug": "4.3.4",
25
28
  "electron-is-dev": "^3.0.1",
26
29
  "electron-log": "^5.1.5",
@@ -41,5 +44,5 @@
41
44
  "resolutions": {
42
45
  "**/node-gyp": "^10.0.1"
43
46
  },
44
- "gitHead": "160f065737c84886f317a23058304584333bc885"
47
+ "gitHead": "4c2adec6fa4eaca0b5b97cdfbdca8cebfa10943d"
45
48
  }
package/src/index.ts CHANGED
@@ -257,8 +257,6 @@ function createMainWindow() {
257
257
  }
258
258
  });
259
259
 
260
- initNobleBleSupport(browserWindow.webContents);
261
-
262
260
  ipcMain.on(ipcMessageKeys.APP_RESTART, () => {
263
261
  browserWindow?.reload();
264
262
  });
@@ -283,6 +281,15 @@ if (!singleInstance && !process.mas) {
283
281
  if (!mainWindow) {
284
282
  mainWindow = createMainWindow();
285
283
  }
284
+
285
+ try {
286
+ log.info('Initializing Noble BLE support...');
287
+ initNobleBleSupport(mainWindow.webContents);
288
+ log.info('Noble BLE support initialized successfully.');
289
+ } catch (e) {
290
+ log.error('Failed to initialize Noble BLE support:', e);
291
+ }
292
+
286
293
  initChildProcess();
287
294
  showMainWindow();
288
295
  console.log('日志文件位置:', log.transports.file.getFile().path);
package/webpack.config.ts CHANGED
@@ -48,8 +48,9 @@ module.exports = {
48
48
  }),
49
49
  }),
50
50
  {
51
- '@abandonware/noble': 'commonjs @abandonware/noble',
52
- '@abandonware/bluetooth-hci-socket': 'commonjs @abandonware/bluetooth-hci-socket',
51
+ '@onekeyfe/hd-transport-electron': 'commonjs @onekeyfe/hd-transport-electron',
52
+ '@stoprocent/noble': 'commonjs @stoprocent/noble',
53
+ '@stoprocent/bluetooth-hci-socket': 'commonjs @stoprocent/bluetooth-hci-socket',
53
54
  bufferutil: 'commonjs bufferutil',
54
55
  'utf-8-validate': 'commonjs utf-8-validate',
55
56
  },