@ledgerhq/device-transport-kit-react-native-hid 0.0.0-rn-hid-sync-onboarding-behavior-20250519131533 → 0.0.0-rn-hid-sync-onboarding-behavior-20250519170421
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.
|
@@ -117,7 +117,6 @@ internal class DefaultAndroidUsbTransport(
|
|
|
117
117
|
return@launch
|
|
118
118
|
}
|
|
119
119
|
val (key, deviceConnection) = item
|
|
120
|
-
// (deviceConnection.getApduSender() as AndroidUsbApduSender).clear()
|
|
121
120
|
loggerService.log(
|
|
122
121
|
buildSimpleInfoLogInfo(
|
|
123
122
|
"AndroidUsbTransport",
|
|
@@ -308,7 +307,6 @@ internal class DefaultAndroidUsbTransport(
|
|
|
308
307
|
isFatalSendApduFailure = { false }, // TODO: refine this
|
|
309
308
|
reconnectionTimeoutDuration = 5.seconds,
|
|
310
309
|
onTerminated = {
|
|
311
|
-
// (it.getApduSender() as AndroidUsbApduSender).clear()
|
|
312
310
|
usbConnections.remove(sessionId)
|
|
313
311
|
usbConnectionsPendingReconnection.remove(it)
|
|
314
312
|
eventDispatcher.dispatch(TransportEvent.DeviceConnectionLost(sessionId))
|
|
@@ -17,23 +17,16 @@ import com.ledger.devicesdk.shared.androidMainInternal.transport.USB_MTU
|
|
|
17
17
|
import com.ledger.devicesdk.shared.androidMainInternal.transport.deviceconnection.DeviceApduSender
|
|
18
18
|
import com.ledger.devicesdk.shared.api.apdu.SendApduFailureReason
|
|
19
19
|
import com.ledger.devicesdk.shared.api.apdu.SendApduResult
|
|
20
|
-
import com.ledger.devicesdk.shared.api.utils.toHexadecimalString
|
|
21
20
|
import com.ledger.devicesdk.shared.internal.service.logger.LoggerService
|
|
22
|
-
import com.ledger.devicesdk.shared.internal.service.logger.buildSimpleDebugLogInfo
|
|
23
21
|
import com.ledger.devicesdk.shared.internal.service.logger.buildSimpleErrorLogInfo
|
|
24
22
|
import com.ledger.devicesdk.shared.internal.transport.framer.FramerService
|
|
25
23
|
import com.ledger.devicesdk.shared.internal.transport.framer.to2BytesArray
|
|
26
24
|
import kotlinx.coroutines.CoroutineDispatcher
|
|
27
|
-
import kotlinx.coroutines.
|
|
28
|
-
import kotlinx.coroutines.coroutineScope
|
|
25
|
+
import kotlinx.coroutines.cancel
|
|
29
26
|
import kotlinx.coroutines.delay
|
|
30
27
|
import kotlinx.coroutines.launch
|
|
31
|
-
import kotlinx.coroutines.suspendCancellableCoroutine
|
|
32
28
|
import kotlinx.coroutines.withContext
|
|
33
|
-
import kotlinx.coroutines.withTimeout
|
|
34
|
-
import timber.log.Timber
|
|
35
29
|
import java.nio.ByteBuffer
|
|
36
|
-
import kotlin.coroutines.resume
|
|
37
30
|
import kotlin.random.Random
|
|
38
31
|
import kotlin.time.Duration
|
|
39
32
|
|
|
@@ -70,6 +63,7 @@ internal class AndroidUsbApduSender(
|
|
|
70
63
|
delay(abortTimeoutDuration)
|
|
71
64
|
usbConnection.releaseInterface(usbInterface)
|
|
72
65
|
usbConnection.close()
|
|
66
|
+
cancel("Timeout")
|
|
73
67
|
throw SendApduTimeoutException
|
|
74
68
|
}
|
|
75
69
|
|
|
@@ -127,7 +121,6 @@ internal class AndroidUsbApduSender(
|
|
|
127
121
|
framerService.serialize(mtu = USB_MTU, channelId = generateChannelId(), rawApdu = rawApdu)
|
|
128
122
|
.forEach { apduFrame ->
|
|
129
123
|
val buffer = apduFrame.toByteArray()
|
|
130
|
-
Timber.i("APDU sent = ${buffer.toHexadecimalString()}")
|
|
131
124
|
usbConnection.bulkTransfer(
|
|
132
125
|
androidToUsbEndpoint,
|
|
133
126
|
buffer,
|
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-rn-hid-sync-onboarding-behavior-
|
|
3
|
+
"version": "0.0.0-rn-hid-sync-onboarding-behavior-20250519170421",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
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-rn-hid-sync-onboarding-behavior-
|
|
38
|
+
"@ledgerhq/device-management-kit": "0.0.0-rn-hid-sync-onboarding-behavior-20250519170421",
|
|
39
39
|
"@ledgerhq/eslint-config-dsdk": "0.0.2",
|
|
40
40
|
"@ledgerhq/ldmk-tool": "0.0.1",
|
|
41
41
|
"@ledgerhq/vitest-config-dmk": "0.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react-native": ">0.74.1",
|
|
47
47
|
"rxjs": "^7.8.2",
|
|
48
|
-
"@ledgerhq/device-management-kit": "0.0.0-rn-hid-sync-onboarding-behavior-
|
|
48
|
+
"@ledgerhq/device-management-kit": "0.0.0-rn-hid-sync-onboarding-behavior-20250519170421"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"prebuild": "rimraf lib",
|