@onekeyfe/react-native-lite-card 1.0.4 → 1.0.5

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.
@@ -373,8 +373,6 @@ class OKLiteManager(private val context: ReactApplicationContext) :
373
373
  return
374
374
  }
375
375
  NfcPermissionUtils.checkPermission(topActivity) {
376
- // 没有 NFC 使用权限
377
- Log.d(TAG, "NFC device not permission")
378
376
  callback.invoke(null, null, null)
379
377
  return
380
378
  }
@@ -1,5 +1,6 @@
1
1
  package so.onekey.app.wallet.lite.onekeyLite.nfc
2
2
 
3
+ import android.nfc.TagLostException
3
4
  import android.nfc.tech.IsoDep
4
5
  import org.haobtc.onekey.card.gpchannel.GPChannelNatives
5
6
  import org.haobtc.onekey.card.gpchannel.GPChannelNatives.nativeGPCFinalize
@@ -42,6 +43,8 @@ class Connection(val isoDep: IsoDep, private val mCommandGenerator: CommandGener
42
43
  val sw2 = response[response.size - 1]
43
44
 
44
45
  return SendResponse(byteArr2HexStr(response), sw1, sw2, byteArr2HexStr(resp))
46
+ } catch (e: TagLostException) {
47
+ throw NFCExceptions.InterruptException()
45
48
  } catch (e: IOException) {
46
49
  e.printStackTrace()
47
50
  return SendResponse("0xFFFF", 0xFF.toByte(), 0xFF.toByte())
@@ -16,8 +16,8 @@ object NfcPermissionUtils {
16
16
 
17
17
  inline fun checkMiuiPermission(activity: Activity, doNext: () -> Unit): Int {
18
18
  when (MiUtil.checkNfcPermission(activity)) {
19
- MiUtil.PermissionResult.PERMISSION_GRANTED -> doNext()
20
- else -> doNext()
19
+ MiUtil.PermissionResult.PERMISSION_GRANTED -> doNext.invoke()
20
+ else -> {}
21
21
  }
22
22
  return MiUtil.checkNfcPermission(activity)
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-lite-card",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "lite card",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",