@ledgerhq/device-transport-kit-react-native-hid 0.0.0-hid-candidate-3-20250528083456 → 0.0.0-hid-candidate-4-20250528125313
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.
|
@@ -187,19 +187,30 @@ internal class DefaultAndroidUsbTransport(
|
|
|
187
187
|
"Reconnecting device (sessionId=${deviceConnection.sessionId})"
|
|
188
188
|
)
|
|
189
189
|
)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
)
|
|
190
|
+
|
|
191
|
+
val apduSender = AndroidUsbApduSender(
|
|
192
|
+
dependencies = AndroidUsbApduSender.Dependencies(
|
|
193
|
+
usbDevice = usbDevice,
|
|
194
|
+
ledgerUsbDevice = state.ledgerUsbDevice,
|
|
195
|
+
),
|
|
196
|
+
usbManager = usbManager,
|
|
197
|
+
ioDispatcher = Dispatchers.IO,
|
|
198
|
+
framerService = FramerService(loggerService),
|
|
199
|
+
request = UsbRequest(),
|
|
200
|
+
loggerService = loggerService
|
|
202
201
|
)
|
|
202
|
+
|
|
203
|
+
if (!usbConnectionsPendingReconnection.contains(deviceConnection)) {
|
|
204
|
+
/**
|
|
205
|
+
* We check this because maybe by the time we get here,
|
|
206
|
+
* the reconnection has timed out and the session has been terminated.
|
|
207
|
+
* Easy to reproduce for instance if the permission request requires
|
|
208
|
+
* a user interaction.
|
|
209
|
+
*/
|
|
210
|
+
apduSender.release()
|
|
211
|
+
return@launch
|
|
212
|
+
}
|
|
213
|
+
deviceConnection.handleDeviceConnected(apduSender)
|
|
203
214
|
usbConnectionsPendingReconnection.remove(deviceConnection)
|
|
204
215
|
usbConnections[deviceConnection.sessionId] = deviceConnection
|
|
205
216
|
}
|
|
@@ -335,7 +346,9 @@ internal class DefaultAndroidUsbTransport(
|
|
|
335
346
|
}
|
|
336
347
|
|
|
337
348
|
override suspend fun disconnect(deviceId: String) {
|
|
349
|
+
// The DeviceConnection is either in usbConnections or usbConnectionsPendingReconnection
|
|
338
350
|
usbConnections[deviceId]?.requestCloseConnection()
|
|
351
|
+
usbConnectionsPendingReconnection.find { it.sessionId == deviceId }?.requestCloseConnection()
|
|
339
352
|
}
|
|
340
353
|
|
|
341
354
|
private fun generateSessionId(usbDevice: UsbDevice): String = "usb_${usbDevice.deviceId}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/device-transport-kit-react-native-hid",
|
|
3
|
-
"version": "0.0.0-hid-candidate-
|
|
3
|
+
"version": "0.0.0-hid-candidate-4-20250528125313",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"@types/uuid": "^10.0.0",
|
|
36
36
|
"react-native": "0.76.6",
|
|
37
37
|
"rxjs": "^7.8.2",
|
|
38
|
-
"@ledgerhq/device-management-kit": "0.0.0-hid-candidate-
|
|
38
|
+
"@ledgerhq/device-management-kit": "0.0.0-hid-candidate-4-20250528125313",
|
|
39
39
|
"@ledgerhq/eslint-config-dsdk": "0.0.2",
|
|
40
|
-
"@ledgerhq/
|
|
40
|
+
"@ledgerhq/tsconfig-dsdk": "1.0.1",
|
|
41
41
|
"@ledgerhq/vitest-config-dmk": "0.0.0",
|
|
42
|
-
"@ledgerhq/
|
|
43
|
-
"@ledgerhq/
|
|
42
|
+
"@ledgerhq/ldmk-tool": "0.0.1",
|
|
43
|
+
"@ledgerhq/prettier-config-dsdk": "0.0.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react-native": ">0.74.1",
|
|
47
47
|
"rxjs": "^7.8.2",
|
|
48
|
-
"@ledgerhq/device-management-kit": "0.0.0-hid-candidate-
|
|
48
|
+
"@ledgerhq/device-management-kit": "0.0.0-hid-candidate-4-20250528125313"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"prebuild": "rimraf lib",
|