Open weishirongzhen opened 3 years ago
I have an issue with dart ffi and lookup function, my app is crashed on start. Can you tell, please, what should I do with this?
I have an issue with dart ffi and lookup function, my app is crashed on start. Can you tell, please, what should I do with this?
Any log? And please refer to README.md , there may some way to solved your issue.
Now Android Lib are extract to github package.
repositories {
google()
jcenter()
maven {
url = uri("https://maven.pkg.github.com/weishirongzhen/wallet-core")
credentials {
username = "weishirongzhen"
password = "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" // GH token for only allow read package
}
}
}
then
implementation "com.weishirongzhen:wallet-core:2.6.20"
How to build the android lib or ios framework from the trust wallet core, what should we modify the code of trust wallet core repo to build succesful for flutter, thank you.
How to build the android lib or ios framework from the trust wallet core, what we should modify the code of trust wallet core repo to build succesful for flutter, thank you.
build step please refer to this link https://developer.trustwallet.com/wallet-core/developing-the-library/building
and for android, only need to do is modify CMakeLists.txt and
change set(CMAKE_CXX_VISIBILITY_PRESET hidden)
to set(CMAKE_CXX_VISIBILITY_PRESET default)
How to connect to network?
How to connect to network?
wallet-core only handle local things, create wallet, sign transaction etc, your can broadcast your sign output to any network you like.
Thanks. Please point me to any resource I can read up on broadcasting on a network. Thanks for the work.
Thanks. Please point me to any resource I can read up on broadcasting on a network. Thanks for the work.
For ETH below link may help
Hello. How can I use this package? I ask this, cause before, you wrote in README that we need to build trustwallet core and move to flutter plugin. But now, you removed this steps from README.md. So, I can clone this repo and just use without any building?
yes, if you want to use in your own project just add this in your yaml
flutter_trust_wallet_core:
git:
url: https://github.com/weishirongzhen/flutter_trust_wallet_core_lib_include.git
Okay. But how it works? We are building our wallet app and цe're worried about security. Cause we don't know what is inside android and ios builds. Maybe, mining?)) Sorry, it is joke. But we are a little worried.
But you have done an excellent work and we really want to use your plugin.
if you are worry , you can build your own lib to use. for android only need to change CMakeList.txt line 14 , from "hidden" to "default", and follow the official build step. for iOS, nothing need to change, just follow the official build step. and then replace your lib in to project.
So, for our own builds, we need just move android build to android/libs/....aar, and ios - ios/frameworks/...? Thats all?
yep, that's all you need to do
Understood, thank you so much for information. And thank you for all your work. Please, keep going your excellent work.
Understood, thank you so much for information. And thank you for all your work. Please, keep going your excellent work.
Thanks, there still are lots of code to do, I'm busy at other flutter project, this project are quite slow progress, but will keep update.
Hello. I try to launch on Android and its crashed. I built trustwalletcore.aar from wallet-core repo, put in /android/libs but error occured. Do you know how can I fix this problem, Also, trying to use repo flutter_trust_wallet_core_include_lib, but the same error
.
Hello. I try to launch on Android and its crashed. I built trustwalletcore.aar from wallet-core repo, put in /android/libs but error occured. Do you know how can I fix this problem, Also, trying to use repo flutter_trust_wallet_core_include_lib, but the same error .
Didn't try this project run on x86 platform, try use arm device to run it.
@weishirongzhen Do you know why does it only affect the android build?
构建 ios 需要 调整这个值吗? set(CMAKE_CXX_VISIBILITY_PRESET default)
@weishirongzhen
构建 ios 需要 调整这个值吗?
set(CMAKE_CXX_VISIBILITY_PRESET default)
@weishirongzhen 不需要
构建 ios 需要 调整这个值吗?
set(CMAKE_CXX_VISIBILITY_PRESET default)
@weishirongzhen 不需要
好的,多谢。可以帮看看这个问题吗? https://github.com/trustwallet/wallet-core/discussions/3319
我根据官方文档构建出来的 WalletCore.xcframework, 没办法解密keystore,但是官方直接提供的可以解密,是不是我哪个步骤走错了?最后 WalletCore.xcframework 是从 swift/build/WalletCore.xcframework 取的。 @weishirongzhen
构建 ios 需要 调整这个值吗?
set(CMAKE_CXX_VISIBILITY_PRESET default)
@weishirongzhen 不需要好的,多谢。可以帮看看这个问题吗? trustwallet/wallet-core#3319
我根据官方文档构建出来的 WalletCore.xcframework, 没办法解密keystore,但是官方直接提供的可以解密,是不是我哪个步骤走错了?最后 WalletCore.xcframework 是从 swift/build/WalletCore.xcframework 取的。 @weishirongzhen
请提供下具体的代码调用过程
构建 ios 需要 调整这个值吗?
set(CMAKE_CXX_VISIBILITY_PRESET default)
@weishirongzhen 不需要好的,多谢。可以帮看看这个问题吗? trustwallet/wallet-core#3319 我根据官方文档构建出来的 WalletCore.xcframework, 没办法解密keystore,但是官方直接提供的可以解密,是不是我哪个步骤走错了?最后 WalletCore.xcframework 是从 swift/build/WalletCore.xcframework 取的。 @weishirongzhen
请提供下具体的代码调用过程
@weishirongzhen my build command is:
./tools/install-dependencies
./tools/install-rust-dependencies
./tools/install-wasm-dependencies
./tools/generate-files ios
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
make -Cbuild && ./tools/ios-build && ./tools/ios-xcframework
then i got
./swift/build/WalletCore.xcframework/
./swift/build/SwiftProtobuf.xcframework/
then i import WalletCore.xcframework
& SwiftProtobuf.xcframework
to my ios project, all code is:
//
// ContentView.swift
// wallet
//
//
import SwiftUI
import WalletCore
struct ContentView: View {
var json = """
{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"5fe1054ca4ca68c5f8ee1346cd062239"},"ciphertext":"ae7db4237ec6913241dcf7bcfb6e06671ae381906a2866b04771082ed0204ac4","kdf":"scrypt","kdfparams":{"dklen":32,"n":16384,"p":4,"r":8,"salt":""},"mac":"9ed6e105ebcc39ba38706166a24f03ebfa153fc41bc028418dafb08518d6ebae"},"id":"b4c58a86-f609-4c12-88bd-666cc2ee73be","name":"name","type":"private-key","version":3}
""";
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
Button("click") {
print(SegwitAddress.isValidString(string: "bc1qyd9ky0n2dh8nggk8m4thllh0qh0w2ea2asvtl5"))
print(SegwitAddress.isValidString(string: "1CFx8Qvd3ioDHYWHJMSMNeredCCkW96wAA"))
let storedKey = StoredKey.importJSON(json: json.data(using: String.Encoding.utf8)!)!
let privatekey = storedKey.decryptPrivateKey(password: "password".data(using: String.Encoding.utf8)!)
print(privatekey?.hexString)
}
}
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
then i click click
, i can not decrypt keystore, privateKeyHex
is nil
.
but when i use official package, i can decrypt then same keystore, so , is there have some problem about my build flow?
I think you can try with below two step
./bootstrap.sh
./tools/ios-xcframework
then copy new WalletCore.xcframework and SwiftProtobuf.xcframework to you project
i got nil too... Did you make it? @weishirongzhen
Because official lib build flag in CmakeLists.txt set(CMAKE_CXX_VISIBILITY_PRESET hidden), that will cause android exception when dart ffi lookup function.
Please refer to My other repo to run full demo, also, replace you own build to ensure safety. build step: follow Official build step to prepare your build env , then change
to
build project, replace your own output in My other repo.