Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit 8107a74

Browse files
committed
chore: support android 16k page size
1 parent bdfb0d5 commit 8107a74

File tree

5 files changed

+43
-32
lines changed

5 files changed

+43
-32
lines changed

android/src/main/java/so/onekey/app/wallet/lite/OKLiteManager.kt

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -323,18 +323,20 @@ class OKLiteManager(private val context: ReactApplicationContext) :
323323
}
324324

325325
@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+
}
333335
}
334336
}
335337

336338
@ReactMethod
337-
fun setMnemonic(mnemonic: String, pwd: String, overwrite: Boolean, callback: Callback) =
339+
fun setMnemonic(mnemonic: String, pwd: String, overwrite: Boolean, callback: Callback) {
338340
launch {
339341
handleOperation(callback) { isoDep ->
340342
Log.e(TAG, "setMnemonic Obtain the device")
@@ -345,22 +347,27 @@ class OKLiteManager(private val context: ReactApplicationContext) :
345347
true
346348
}
347349
}
350+
}
348351

349352
@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+
}
355360
}
356361
}
357362

358363
@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+
}
364371
}
365372
}
366373

@@ -396,22 +403,26 @@ class OKLiteManager(private val context: ReactApplicationContext) :
396403
}
397404

398405
@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+
}
407416
}
408417
}
409418

410419
@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+
}
415426
}
416427
}
417428
}

android/src/main/java/so/onekey/app/wallet/lite/onekeyLite/OnekeyLiteCard.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object OneKeyLiteCard {
3939

4040
NfcPermissionUtils.checkPermission(activity) {
4141
printLog(TAG, "startNfc Have permission")
42-
if (!activity.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
42+
if (!activity.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
4343
return@checkPermission
4444
}
4545

180 KB
Binary file not shown.
13.6 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onekeyfe/react-native-lite-card",
3-
"version": "1.0.12",
3+
"version": "1.0.13",
44
"description": "lite card",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)