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

Commit c7bc5a3

Browse files
chore: support android 16k page size (#9)
1 parent bdfb0d5 commit c7bc5a3

File tree

8 files changed

+52
-37
lines changed

8 files changed

+52
-37
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath "com.android.tools.build:gradle:7.2.1"
11+
classpath "com.android.tools.build:gradle:8.0.2"
1212
// noinspection DifferentKotlinGradleVersion
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}

android/gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
LiteCard_kotlinVersion=1.7.0
1+
LiteCard_kotlinVersion=2.1.20
22
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

android/src/main/cpp/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Os -Oz")
55
set(CMAKE_C_VISIBILITY_PRESET hidden)
66
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
77

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+
812
add_library(keys SHARED
913
../../../../keys/keys.c
1014
validation.c)

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)