Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fixed build and compilation issues with android newarch #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class LeapKeychainRnModule internal constructor(context: ReactApplicationContext
}

@ReactMethod
fun mnemonicToSeed(words: ReadableArray, passphrase: String = "", promise: Promise){
override fun mnemonicToSeed(words: ReadableArray, passphrase: String?, promise: Promise){
try {
val _words: MutableList<String> = arrayListOf()
for (word: String in words.toArrayList() as ArrayList<String>){
_words.add(word)
}
val seed = MnemonicCode.toSeed(_words, passphrase);
val seed = MnemonicCode.toSeed(_words, passphrase ?: "");

val base64String = Base64.encodeToString(seed, Base64.NO_WRAP )
promise.resolve(base64String)
Expand Down
5 changes: 5 additions & 0 deletions android/src/newarch/LeapKeychainRnSpec.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.leapkeychainrn

import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReadableArray

abstract class LeapKeychainRnSpec internal constructor(context: ReactApplicationContext) :
NativeLeapKeychainRnSpec(context) {

abstract fun multiply(a: Double, b: Double, promise: Promise)
abstract override fun mnemonicToSeed(mnemonic: ReadableArray, passphrase: String?, promise: Promise)
}
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.71.0",
"react-native-mmkv": "^2.6.1",
"react-native-quick-crypto": "^0.5.0"
"react-native-mmkv": "2.7.0",
"react-native-quick-crypto": "0.6.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down
Loading