@onekeyfe/hd-transport-react-native 1.1.29-alpha.6 → 1.1.29-alpha.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAIL,UAAU,IAAI,aAAa,EAE5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,SAAS,EAAE,EAGhB,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAahC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAkBjE,KAAK,0BAA0B,GAAG;IAChC,mBAAmB,EAAE,cAAc,CAAC;IACpC,oBAAoB,EAAE,cAAc,CAAC;CACtC,CAAC;AAoDF,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,MAAM,CAAC;AA0C1D,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IAEzC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,IAAI,SAA6B;IAEjC,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAExC,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,8BAA8B,cAAqB;gBAEvC,OAAO,EAAE,gBAAgB;IAIrC,IAAI,CAAC,OAAO,EAAE,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EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIjE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA6MpE,IAAI;IAIE,UAAU,CAAC,OAAO,EAAE,MAAM;IA0EhC,MAAM;CAOP"}
package/dist/index.js CHANGED
@@ -493,10 +493,15 @@ class ReactNativeBleTransport {
493
493
  Log === null || Log === void 0 ? void 0 : Log.debug('search device end ======================\n');
494
494
  }
495
495
  });
496
- getConnectedDeviceIds(getBluetoothServiceUuids()).then(devices => {
496
+ getConnectedDeviceIds(reactNative.Platform.OS === 'ios' ? getBluetoothServiceUuids() : []).then(devices => {
497
497
  for (const device of devices) {
498
- Log === null || Log === void 0 ? void 0 : Log.debug('search connected peripheral: ', device.id);
499
- addDevice(device);
498
+ const { serviceUUIDs } = device;
499
+ const hasCachedServiceUuid = Boolean(serviceUUIDs === null || serviceUUIDs === void 0 ? void 0 : serviceUUIDs.length);
500
+ const keepDevice = reactNative.Platform.OS === 'ios' || hasCachedServiceUuid;
501
+ if (keepDevice) {
502
+ Log === null || Log === void 0 ? void 0 : Log.debug('search connected peripheral: ', device.id);
503
+ addDevice(device);
504
+ }
500
505
  }
501
506
  });
502
507
  const addDevice = (device) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-react-native",
3
- "version": "1.1.29-alpha.6",
3
+ "version": "1.1.29-alpha.7",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,11 +19,11 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@onekeyfe/hd-core": "1.1.29-alpha.6",
23
- "@onekeyfe/hd-shared": "1.1.29-alpha.6",
24
- "@onekeyfe/hd-transport": "1.1.29-alpha.6",
22
+ "@onekeyfe/hd-core": "1.1.29-alpha.7",
23
+ "@onekeyfe/hd-shared": "1.1.29-alpha.7",
24
+ "@onekeyfe/hd-transport": "1.1.29-alpha.7",
25
25
  "@onekeyfe/react-native-ble-utils": "^0.1.5",
26
26
  "react-native-ble-plx": "3.5.1"
27
27
  },
28
- "gitHead": "1a0239548cde4577d79bbb12da93ff4bccefa0c8"
28
+ "gitHead": "c27884354d9a7303f12004ce9b5236c493738223"
29
29
  }
package/src/index.ts CHANGED
@@ -404,15 +404,19 @@ export default class ReactNativeBleTransport {
404
404
  }
405
405
  );
406
406
 
407
- getConnectedDeviceIds(getBluetoothServiceUuids()).then(devices => {
408
- for (const device of devices) {
409
- // Already filtered by the OneKey service UUID via getConnectedDeviceIds;
410
- // no extra name-based filter (it would drop real OneKey devices that
411
- // report a null name on iOS).
412
- Log?.debug('search connected peripheral: ', device.id);
413
- addDevice(device as unknown as Device);
407
+ getConnectedDeviceIds(Platform.OS === 'ios' ? getBluetoothServiceUuids() : []).then(
408
+ devices => {
409
+ for (const device of devices) {
410
+ const { serviceUUIDs } = device as { serviceUUIDs?: string[] };
411
+ const hasCachedServiceUuid = Boolean(serviceUUIDs?.length);
412
+ const keepDevice = Platform.OS === 'ios' || hasCachedServiceUuid;
413
+ if (keepDevice) {
414
+ Log?.debug('search connected peripheral: ', device.id);
415
+ addDevice(device as unknown as Device);
416
+ }
417
+ }
414
418
  }
415
- });
419
+ );
416
420
 
417
421
  const addDevice = (device: Device) => {
418
422
  if (deviceList.every(d => d.id !== device.id)) {