@@ -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}
0 commit comments