@onekeyfe/react-native-lite-card 1.0.12 → 1.0.13

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
11
+ classpath "com.android.tools.build:gradle:8.0.2"
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
@@ -1,5 +1,5 @@
1
- LiteCard_kotlinVersion=1.7.0
1
+ LiteCard_kotlinVersion=2.1.20
2
2
  LiteCard_minSdkVersion=21
3
- LiteCard_targetSdkVersion=31
4
- LiteCard_compileSdkVersion=31
5
- LiteCard_ndkversion=21.4.7075529
3
+ LiteCard_targetSdkVersion=35
4
+ LiteCard_compileSdkVersion=35
5
+ LiteCard_ndkversion=26.1.10909125
@@ -5,6 +5,10 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Os -Oz")
5
5
  set(CMAKE_C_VISIBILITY_PRESET hidden)
6
6
  set(CMAKE_CXX_VISIBILITY_PRESET hidden)
7
7
 
8
+ # Support for Android 15 16KB page size
9
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")
10
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384")
11
+
8
12
  add_library(keys SHARED
9
13
  ../../../../keys/keys.c
10
14
  validation.c)
@@ -323,18 +323,20 @@ class OKLiteManager(private val context: ReactApplicationContext) :
323
323
  }
324
324
 
325
325
  @ReactMethod
326
- fun getLiteInfo(callback: Callback) = launch {
327
- Log.d(TAG, "getLiteInfo")
328
- handleOperation(callback) { isoDep ->
329
- Log.e(TAG, "getLiteInfo Obtain the device")
330
- val cardInfo = OneKeyLiteCard.getCardInfo(isoDep)
331
- Log.e(TAG, "getLiteInfo result $cardInfo")
332
- cardInfo.createArguments()
326
+ fun getLiteInfo(callback: Callback) {
327
+ launch {
328
+ Log.d(TAG, "getLiteInfo")
329
+ handleOperation(callback) { isoDep ->
330
+ Log.e(TAG, "getLiteInfo Obtain the device")
331
+ val cardInfo = OneKeyLiteCard.getCardInfo(isoDep)
332
+ Log.e(TAG, "getLiteInfo result $cardInfo")
333
+ cardInfo.createArguments()
334
+ }
333
335
  }
334
336
  }
335
337
 
336
338
  @ReactMethod
337
- fun setMnemonic(mnemonic: String, pwd: String, overwrite: Boolean, callback: Callback) =
339
+ fun setMnemonic(mnemonic: String, pwd: String, overwrite: Boolean, callback: Callback) {
338
340
  launch {
339
341
  handleOperation(callback) { isoDep ->
340
342
  Log.e(TAG, "setMnemonic Obtain the device")
@@ -345,22 +347,27 @@ class OKLiteManager(private val context: ReactApplicationContext) :
345
347
  true
346
348
  }
347
349
  }
350
+ }
348
351
 
349
352
  @ReactMethod
350
- fun getMnemonicWithPin(pwd: String, callback: Callback) = launch {
351
- Log.d(TAG, "getMnemonicWithPin")
352
- handleOperation(callback) { isoDep ->
353
- Log.e(TAG, "getMnemonicWithPin Obtain the device")
354
- OneKeyLiteCard.getMnemonicWithPin(mCurrentCardState, isoDep, pwd)
353
+ fun getMnemonicWithPin(pwd: String, callback: Callback) {
354
+ launch {
355
+ Log.d(TAG, "getMnemonicWithPin")
356
+ handleOperation(callback) { isoDep ->
357
+ Log.e(TAG, "getMnemonicWithPin Obtain the device")
358
+ OneKeyLiteCard.getMnemonicWithPin(mCurrentCardState, isoDep, pwd)
359
+ }
355
360
  }
356
361
  }
357
362
 
358
363
  @ReactMethod
359
- fun changePin(oldPwd: String, newPwd: String, callback: Callback) = launch {
360
- Log.d(TAG, "changePin")
361
- handleOperation(callback) { isoDep ->
362
- Log.e(TAG, "changePin Obtain the device")
363
- OneKeyLiteCard.changPin(mCurrentCardState, isoDep, oldPwd, newPwd)
364
+ fun changePin(oldPwd: String, newPwd: String, callback: Callback) {
365
+ launch {
366
+ Log.d(TAG, "changePin")
367
+ handleOperation(callback) { isoDep ->
368
+ Log.e(TAG, "changePin Obtain the device")
369
+ OneKeyLiteCard.changPin(mCurrentCardState, isoDep, oldPwd, newPwd)
370
+ }
364
371
  }
365
372
  }
366
373
 
@@ -396,22 +403,26 @@ class OKLiteManager(private val context: ReactApplicationContext) :
396
403
  }
397
404
 
398
405
  @ReactMethod
399
- fun reset(callback: Callback) = launch {
400
- Log.d(TAG, "reset")
401
- handleOperation(callback) { isoDep ->
402
- Log.e(TAG, "reset Obtain the device")
403
- val isSuccess = OneKeyLiteCard.reset(isoDep)
404
- if (!isSuccess) throw NFCExceptions.ExecFailureException()
405
- Log.e(TAG, "reset result success")
406
- true
406
+ fun reset(callback: Callback) {
407
+ launch {
408
+ Log.d(TAG, "reset")
409
+ handleOperation(callback) { isoDep ->
410
+ Log.e(TAG, "reset Obtain the device")
411
+ val isSuccess = OneKeyLiteCard.reset(isoDep)
412
+ if (!isSuccess) throw NFCExceptions.ExecFailureException()
413
+ Log.e(TAG, "reset result success")
414
+ true
415
+ }
407
416
  }
408
417
  }
409
418
 
410
419
  @ReactMethod
411
- fun intoSetting() = launch {
412
- Log.d(TAG, "intoSetting")
413
- Utils.getTopActivity()?.let {
414
- NfcUtils.intentToNfcSetting(it)
420
+ fun intoSetting() {
421
+ launch {
422
+ Log.d(TAG, "intoSetting")
423
+ Utils.getTopActivity()?.let {
424
+ NfcUtils.intentToNfcSetting(it)
425
+ }
415
426
  }
416
427
  }
417
428
  }
@@ -39,7 +39,7 @@ object OneKeyLiteCard {
39
39
 
40
40
  NfcPermissionUtils.checkPermission(activity) {
41
41
  printLog(TAG, "startNfc Have permission")
42
- if (!activity.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
42
+ if (!activity.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
43
43
  return@checkPermission
44
44
  }
45
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-lite-card",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "lite card",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",