@onekeyfe/react-native-lite-card 1.0.12 → 1.0.14
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.
- package/android/build.gradle +1 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/CMakeLists.txt +4 -0
- package/android/src/main/java/so/onekey/app/wallet/lite/OKLiteManager.kt +41 -30
- package/android/src/main/java/so/onekey/app/wallet/lite/onekeyLite/OnekeyLiteCard.kt +1 -1
- package/android/src/main/java/so/onekey/app/wallet/lite/utils/Utils.java +5 -1
- package/android/src/main/jniLibs/arm64-v8a/libgpchannelNDK.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libgpchannelNDK.so +0 -0
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,7 @@ buildscript {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
dependencies {
|
|
11
|
-
classpath "com.android.tools.build:gradle:
|
|
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.
|
|
1
|
+
LiteCard_kotlinVersion=2.1.20
|
|
2
2
|
LiteCard_minSdkVersion=21
|
|
3
|
-
LiteCard_targetSdkVersion=
|
|
4
|
-
LiteCard_compileSdkVersion=
|
|
5
|
-
LiteCard_ndkversion=
|
|
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)
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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)
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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()
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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.
|
|
42
|
+
if (!activity.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
|
43
43
|
return@checkPermission
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -345,8 +345,12 @@ public final class Utils {
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
private void setTopActivity(final Activity activity) {
|
|
348
|
+
if (activity == null || mActivityList == null) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
348
351
|
if (mActivityList.contains(activity)) {
|
|
349
|
-
|
|
352
|
+
Activity lastActivity = mActivityList.getLast();
|
|
353
|
+
if (lastActivity != null && !lastActivity.equals(activity)) {
|
|
350
354
|
mActivityList.remove(activity);
|
|
351
355
|
mActivityList.addLast(activity);
|
|
352
356
|
}
|
|
Binary file
|
|
Binary file
|