update wallet lib
This commit is contained in:
parent
920494120c
commit
ba9a266247
@ -115,19 +115,19 @@ public:
|
|||||||
inline char* getKeySecond() {return key_second;}
|
inline char* getKeySecond() {return key_second;}
|
||||||
inline char* getKeyBackup() {return key_backup;}
|
inline char* getKeyBackup() {return key_backup;}
|
||||||
inline char* getKeySeed() {return key_seed;}
|
inline char* getKeySeed() {return key_seed;}
|
||||||
void setKeyMaster(char *val) {
|
void setKeyMaster(const char *val) {
|
||||||
key_master = (char*)malloc(strlen(val) + 1);
|
key_master = (char*)malloc(strlen(val) + 1);
|
||||||
strcpy(key_master, val);
|
strcpy(key_master, val);
|
||||||
}
|
}
|
||||||
void setKeySecond(char *val) {
|
void setKeySecond(const char *val) {
|
||||||
key_second = (char*)malloc(strlen(val) + 1);
|
key_second = (char*)malloc(strlen(val) + 1);
|
||||||
strcpy(key_second, val);
|
strcpy(key_second, val);
|
||||||
}
|
}
|
||||||
void setKeyBackup(char *val) {
|
void setKeyBackup(const char *val) {
|
||||||
key_backup = (char*)malloc(strlen(val) + 1);
|
key_backup = (char*)malloc(strlen(val) + 1);
|
||||||
strcpy(key_backup, val);
|
strcpy(key_backup, val);
|
||||||
}
|
}
|
||||||
void setKeySeed(char *val) {
|
void setKeySeed(const char *val) {
|
||||||
key_seed = (char*)malloc(strlen(val) + 1);
|
key_seed = (char*)malloc(strlen(val) + 1);
|
||||||
strcpy(key_seed, val);
|
strcpy(key_seed, val);
|
||||||
}
|
}
|
||||||
|
@ -653,9 +653,9 @@ void copyTextToClipboardJNI(const std::string& text)
|
|||||||
JniHelper::callStaticVoidMethod(JCLS_HELPER, "copyTextToClipboard", text);
|
JniHelper::callStaticVoidMethod(JCLS_HELPER, "copyTextToClipboard", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showQRCodeJNI(const std::string& funid, const std::string& content, const std::string& title)
|
void showQRCodeJNI(const std::string& funid, const std::string& content, const std::string& title, const std::string& oid)
|
||||||
{
|
{
|
||||||
JniHelper::callStaticVoidMethod(JCSDK, "showQRCode", funid, content, title);
|
JniHelper::callStaticVoidMethod(JCSDK, "showQRCode", funid, content, title, oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void scanQRCodeJNI(const std::string& funid, const std::string& title)
|
void scanQRCodeJNI(const std::string& funid, const std::string& title)
|
||||||
@ -663,6 +663,11 @@ void scanQRCodeJNI(const std::string& funid, const std::string& title)
|
|||||||
JniHelper::callStaticVoidMethod(JCSDK, "scanQRCode", funid, title);
|
JniHelper::callStaticVoidMethod(JCSDK, "scanQRCode", funid, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void loadRestoreKeyJNI(const std::string& funid, const std::string& oid)
|
||||||
|
{
|
||||||
|
JniHelper::callStaticVoidMethod(JCSDK, "loadRestoreKey", funid, oid);
|
||||||
|
}
|
||||||
|
|
||||||
void signWithGoogleJNI(const std::string& funid)
|
void signWithGoogleJNI(const std::string& funid)
|
||||||
{
|
{
|
||||||
JniHelper::callStaticVoidMethod(JCSDK, "signWithGoogle", funid);
|
JniHelper::callStaticVoidMethod(JCSDK, "signWithGoogle", funid);
|
||||||
|
@ -35,8 +35,9 @@ extern void exitApplication();
|
|||||||
|
|
||||||
extern std::string getApkPathJNI();
|
extern std::string getApkPathJNI();
|
||||||
extern std::string getPackageNameJNI();
|
extern std::string getPackageNameJNI();
|
||||||
void showQRCodeJNI(const std::string& funid, const std::string& content, const std::string& title);
|
void showQRCodeJNI(const std::string& funid, const std::string& content, const std::string& title, const std::string& id);
|
||||||
void scanQRCodeJNI(const std::string& funid, const std::string& title);
|
void scanQRCodeJNI(const std::string& funid, const std::string& title);
|
||||||
|
void loadRestoreKeyJNI(const std::string& funid, const std::string& oid);
|
||||||
void signWithGoogleJNI(const std::string& funid);
|
void signWithGoogleJNI(const std::string& funid);
|
||||||
void signOutGoogleJNI(const std::string& funid);
|
void signOutGoogleJNI(const std::string& funid);
|
||||||
void toWalletJNI(const std::string& url);
|
void toWalletJNI(const std::string& url);
|
||||||
|
@ -809,7 +809,7 @@ static bool JSB_showQRCode(se::State& s)
|
|||||||
const auto& args = s.args();
|
const auto& args = s.args();
|
||||||
size_t argc = args.size();
|
size_t argc = args.size();
|
||||||
CC_UNUSED bool ok = true;
|
CC_UNUSED bool ok = true;
|
||||||
if (argc > 1) {
|
if (argc > 4) {
|
||||||
std::string funid;
|
std::string funid;
|
||||||
ok = seval_to_std_string(args[0], &funid);
|
ok = seval_to_std_string(args[0], &funid);
|
||||||
SE_PRECONDITION2(ok, false, "funid is invalid!");
|
SE_PRECONDITION2(ok, false, "funid is invalid!");
|
||||||
@ -819,11 +819,14 @@ static bool JSB_showQRCode(se::State& s)
|
|||||||
std::string title;
|
std::string title;
|
||||||
ok = seval_to_std_string(args[2], &title);
|
ok = seval_to_std_string(args[2], &title);
|
||||||
SE_PRECONDITION2(ok, false, "title is invalid!");
|
SE_PRECONDITION2(ok, false, "title is invalid!");
|
||||||
showQRCodeJNI(funid, text, title);
|
std::string id;
|
||||||
|
ok = seval_to_std_string(args[3], &id);
|
||||||
|
SE_PRECONDITION2(ok, false, "data id is invalid!");
|
||||||
|
showQRCodeJNI(funid, text, title, id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2);
|
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 4);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SE_BIND_FUNC(JSB_showQRCode)
|
SE_BIND_FUNC(JSB_showQRCode)
|
||||||
@ -849,6 +852,27 @@ static bool JSB_scanQRCode(se::State& s)
|
|||||||
}
|
}
|
||||||
SE_BIND_FUNC(JSB_scanQRCode)
|
SE_BIND_FUNC(JSB_scanQRCode)
|
||||||
|
|
||||||
|
static bool JSB_restoreKey(se::State& s)
|
||||||
|
{
|
||||||
|
const auto& args = s.args();
|
||||||
|
size_t argc = args.size();
|
||||||
|
CC_UNUSED bool ok = true;
|
||||||
|
if (argc > 1) {
|
||||||
|
std::string funid;
|
||||||
|
ok = seval_to_std_string(args[0], &funid);
|
||||||
|
SE_PRECONDITION2(ok, false, "funid is invalid!");
|
||||||
|
std::string oid;
|
||||||
|
ok = seval_to_std_string(args[1], &oid);
|
||||||
|
SE_PRECONDITION2(ok, false, "oid is invalid!");
|
||||||
|
loadRestoreKeyJNI(funid, oid);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SE_BIND_FUNC(JSB_restoreKey)
|
||||||
|
|
||||||
static bool JSB_signWithGoogle(se::State& s)
|
static bool JSB_signWithGoogle(se::State& s)
|
||||||
{
|
{
|
||||||
const auto& args = s.args();
|
const auto& args = s.args();
|
||||||
@ -909,7 +933,9 @@ static bool JSB_generateWallet(se::State& s)
|
|||||||
{
|
{
|
||||||
const auto& args = s.args();
|
const auto& args = s.args();
|
||||||
size_t argc = args.size();
|
size_t argc = args.size();
|
||||||
|
CCLOG("JSB_generateWallet\n");
|
||||||
CC_UNUSED bool ok = true;
|
CC_UNUSED bool ok = true;
|
||||||
|
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
std::string id;
|
std::string id;
|
||||||
ok = seval_to_std_string(args[0], &id);
|
ok = seval_to_std_string(args[0], &id);
|
||||||
@ -917,15 +943,29 @@ static bool JSB_generateWallet(se::State& s)
|
|||||||
std::string seed;
|
std::string seed;
|
||||||
ok = seval_to_std_string(args[1], &seed);
|
ok = seval_to_std_string(args[1], &seed);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing seed");
|
SE_PRECONDITION2(ok, false, "Error processing seed");
|
||||||
|
CCLOG("JSB_generateWallet 1 %s\n", seed.c_str());
|
||||||
CWallet wallet = new_wallet(seed.c_str());
|
CWallet wallet = new_wallet(seed.c_str());
|
||||||
std::string address = get_address(&wallet);
|
CCLOG("JSB_generateWallet 2 %s\n", wallet.master_key);
|
||||||
std::string storageKey =StringUtils::format("cebg_wallet_%s", id.c_str());
|
std::string address = get_address(
|
||||||
localStorageSetItem(storageKey, wallet.second_key);
|
seed.c_str(),
|
||||||
|
wallet.master_key,
|
||||||
|
wallet.second_key,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
CCLOG("JSB_generateWallet 3 %s\n", address.c_str());
|
||||||
|
std::string localSKey = StringUtils::format("cebg_wallet_s_%s", id.c_str());
|
||||||
|
localStorageSetItem(localSKey, wallet.second_key);
|
||||||
|
CCLOG("JSB_generateWallet 4 \n");
|
||||||
Application::getInstance()->setKeySeed(wallet.msg_key);
|
Application::getInstance()->setKeySeed(wallet.msg_key);
|
||||||
Application::getInstance()->setKeyMaster(wallet.master_key);
|
Application::getInstance()->setKeyMaster(wallet.master_key);
|
||||||
Application::getInstance()->setKeySecond(wallet.second_key);
|
Application::getInstance()->setKeySecond(wallet.second_key);
|
||||||
Application::getInstance()->setKeyBackup(wallet.backup_key);
|
Application::getInstance()->setKeyBackup(wallet.backup_key);
|
||||||
showQRCodeJNI("", wallet.backup_key, "save this qrcode plz");
|
CCLOG("JSB_generateWallet 5 \n");
|
||||||
|
|
||||||
|
size_t msgLen = strlen(wallet.backup_key);
|
||||||
|
char* msg_cpy = (char*)malloc(msgLen + 1);
|
||||||
|
strcpy(msg_cpy, wallet.backup_key);
|
||||||
|
showQRCodeJNI("", msg_cpy, "save this qrcode plz", id);
|
||||||
std::string result = StringUtils::format("{\"master\": \"%s\",\"backup\": \"%s\", \"address\": \"%s\"}\n",
|
std::string result = StringUtils::format("{\"master\": \"%s\",\"backup\": \"%s\", \"address\": \"%s\"}\n",
|
||||||
wallet.master_key,
|
wallet.master_key,
|
||||||
wallet.backup_key,
|
wallet.backup_key,
|
||||||
@ -956,33 +996,24 @@ static bool JSB_prepareWallet(se::State& s)
|
|||||||
std::string keyMaster;
|
std::string keyMaster;
|
||||||
ok = seval_to_std_string(args[2], &keyMaster);
|
ok = seval_to_std_string(args[2], &keyMaster);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing master key");
|
SE_PRECONDITION2(ok, false, "Error processing master key");
|
||||||
std::string storageKey = StringUtils::format("cebg_wallet_%s", id.c_str());
|
std::string storageSKey = StringUtils::format("cebg_wallet_s_%s", id.c_str());
|
||||||
std::string localKey;
|
std::string storageBKey = StringUtils::format("cebg_wallet_b_%s", id.c_str());
|
||||||
localStorageGetItem(storageKey, &localKey);
|
std::string localSKey;
|
||||||
|
localStorageGetItem(storageSKey, &localSKey);
|
||||||
|
std::string localBKey;
|
||||||
|
localStorageGetItem(storageBKey, &localBKey);
|
||||||
|
|
||||||
Application::getInstance()->setKeyMaster(const_cast<char *>(keyMaster.c_str()));
|
Application::getInstance()->setKeyMaster(keyMaster.c_str());
|
||||||
Application::getInstance()->setKeySecond(const_cast<char *>(localKey.c_str()));
|
Application::getInstance()->setKeySecond(localSKey.c_str());
|
||||||
Application::getInstance()->setKeySeed(const_cast<char *>(seed.c_str()));
|
Application::getInstance()->setKeyBackup(localBKey.c_str());
|
||||||
|
Application::getInstance()->setKeySeed(seed.c_str());
|
||||||
|
|
||||||
size_t masterLen = strlen(Application::getInstance()->getKeyMaster());
|
std::string address = get_address(
|
||||||
char* master_cpy = (char*)malloc(masterLen + 1);
|
Application::getInstance()->getKeySeed(),
|
||||||
strcpy(master_cpy, Application::getInstance()->getKeyMaster());
|
Application::getInstance()->getKeyMaster(),
|
||||||
|
Application::getInstance()->getKeySecond(),
|
||||||
size_t msgLen = strlen(Application::getInstance()->getKeySeed());
|
Application::getInstance()->getKeyBackup()
|
||||||
char* msg_cpy = (char*)malloc(msgLen + 1);
|
);
|
||||||
strcpy(msg_cpy, Application::getInstance()->getKeySeed());
|
|
||||||
|
|
||||||
size_t secondLen = strlen(Application::getInstance()->getKeySecond());
|
|
||||||
char* second_cpy = (char*)malloc(secondLen + 1);
|
|
||||||
strcpy(second_cpy, Application::getInstance()->getKeySecond());
|
|
||||||
|
|
||||||
CWallet wallet = CWallet{
|
|
||||||
.msg_key = msg_cpy,
|
|
||||||
.master_key = master_cpy,
|
|
||||||
.second_key = second_cpy,
|
|
||||||
.backup_key = ""
|
|
||||||
};
|
|
||||||
std::string address = get_address(&wallet);
|
|
||||||
std::string result = StringUtils::format("{\"address\": \"%s\"}\n",
|
std::string result = StringUtils::format("{\"address\": \"%s\"}\n",
|
||||||
address.c_str()
|
address.c_str()
|
||||||
);
|
);
|
||||||
@ -1011,41 +1042,24 @@ static bool JSB_restoreWallet(se::State& s)
|
|||||||
std::string keyMaster;
|
std::string keyMaster;
|
||||||
ok = seval_to_std_string(args[2], &keyMaster);
|
ok = seval_to_std_string(args[2], &keyMaster);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing master key");
|
SE_PRECONDITION2(ok, false, "Error processing master key");
|
||||||
|
|
||||||
std::string keyBackup;
|
std::string keyBackup;
|
||||||
ok = seval_to_std_string(args[3], &keyBackup);
|
ok = seval_to_std_string(args[3], &keyBackup);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing backup key");
|
SE_PRECONDITION2(ok, false, "Error processing backup key");
|
||||||
|
|
||||||
size_t masterLen = strlen(keyMaster.c_str());
|
Application::getInstance()->setKeySeed(seed.c_str());
|
||||||
char* master_cpy = (char*)malloc(masterLen + 1);
|
Application::getInstance()->setKeyMaster(keyMaster.c_str());
|
||||||
strcpy(master_cpy, keyMaster.c_str());
|
Application::getInstance()->setKeySecond("");
|
||||||
|
Application::getInstance()->setKeyBackup(keyBackup.c_str());
|
||||||
|
|
||||||
size_t msgLen = strlen(seed.c_str());
|
std::string address = get_address(
|
||||||
char* msg_cpy = (char*)malloc(msgLen + 1);
|
seed.c_str(),
|
||||||
strcpy(msg_cpy, seed.c_str());
|
keyMaster.c_str(),
|
||||||
|
"",
|
||||||
size_t backLen = strlen(keyBackup.c_str());
|
keyBackup.c_str()
|
||||||
char* back_cpy = (char*)malloc(backLen + 1);
|
);
|
||||||
strcpy(back_cpy, keyBackup.c_str());
|
std::string storageKey =StringUtils::format("cebg_wallet_b_%s", id.c_str());
|
||||||
|
localStorageSetItem(storageKey, Application::getInstance()->getKeyBackup());
|
||||||
CWallet wallet_tmp = CWallet{
|
std::string result = StringUtils::format("{\"address\": \"%s\"}\n",
|
||||||
.msg_key = msg_cpy,
|
|
||||||
.master_key = master_cpy,
|
|
||||||
.second_key = "",
|
|
||||||
.backup_key = back_cpy
|
|
||||||
};
|
|
||||||
CWallet wallet = reset_wallet(&wallet_tmp);
|
|
||||||
std::string address = get_address(&wallet);
|
|
||||||
std::string storageKey =StringUtils::format("cebg_wallet_%s", id.c_str());
|
|
||||||
localStorageSetItem(storageKey, wallet.second_key);
|
|
||||||
Application::getInstance()->setKeySeed(wallet.msg_key);
|
|
||||||
Application::getInstance()->setKeyMaster(wallet.master_key);
|
|
||||||
Application::getInstance()->setKeySecond(wallet.second_key);
|
|
||||||
Application::getInstance()->setKeyBackup(wallet.backup_key);
|
|
||||||
showQRCodeJNI("", wallet.backup_key, "save this qrcode plz");
|
|
||||||
std::string result = StringUtils::format("{\"master\": \"%s\",\"backup\": \"%s\", \"address\": \"%s\"}\n",
|
|
||||||
wallet.master_key,
|
|
||||||
wallet.backup_key,
|
|
||||||
address.c_str()
|
address.c_str()
|
||||||
);
|
);
|
||||||
s.rval().setString(result);
|
s.rval().setString(result);
|
||||||
@ -1068,24 +1082,12 @@ static bool JSB_walletSign(se::State& s)
|
|||||||
std::string msg;
|
std::string msg;
|
||||||
ok = seval_to_std_string(args[0], &msg);
|
ok = seval_to_std_string(args[0], &msg);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing seed");
|
SE_PRECONDITION2(ok, false, "Error processing seed");
|
||||||
size_t masterLen = strlen(Application::getInstance()->getKeyMaster());
|
std::string sign_str = sign(
|
||||||
char* master_cpy = (char*)malloc(masterLen + 1);
|
Application::getInstance()->getKeySeed(),
|
||||||
strcpy(master_cpy, Application::getInstance()->getKeyMaster());
|
Application::getInstance()->getKeyMaster(),
|
||||||
|
Application::getInstance()->getKeySecond(),
|
||||||
size_t msgLen = strlen(Application::getInstance()->getKeySeed());
|
Application::getInstance()->getKeyBackup(),
|
||||||
char* msg_cpy = (char*)malloc(msgLen + 1);
|
msg.c_str());
|
||||||
strcpy(msg_cpy, Application::getInstance()->getKeySeed());
|
|
||||||
|
|
||||||
size_t secondLen = strlen(Application::getInstance()->getKeySecond());
|
|
||||||
char* second_cpy = (char*)malloc(secondLen + 1);
|
|
||||||
strcpy(second_cpy, Application::getInstance()->getKeySecond());
|
|
||||||
CWallet wallet = CWallet{
|
|
||||||
.msg_key = msg_cpy,
|
|
||||||
.master_key = master_cpy,
|
|
||||||
.second_key = second_cpy,
|
|
||||||
.backup_key = ""
|
|
||||||
};
|
|
||||||
std::string sign_str = sign(&wallet, msg.c_str());
|
|
||||||
s.rval().setString(sign_str);
|
s.rval().setString(sign_str);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1104,24 +1106,12 @@ static bool JSB_walletSecKey(se::State& s)
|
|||||||
std::string funid;
|
std::string funid;
|
||||||
ok = seval_to_std_string(args[0], &funid);
|
ok = seval_to_std_string(args[0], &funid);
|
||||||
SE_PRECONDITION2(ok, false, "funid is invalid!");
|
SE_PRECONDITION2(ok, false, "funid is invalid!");
|
||||||
size_t masterLen = strlen(Application::getInstance()->getKeyMaster());
|
std::string key_str = generate_sec_key(
|
||||||
char* master_cpy = (char*)malloc(masterLen + 1);
|
Application::getInstance()->getKeySeed(),
|
||||||
strcpy(master_cpy, Application::getInstance()->getKeyMaster());
|
Application::getInstance()->getKeyMaster(),
|
||||||
|
Application::getInstance()->getKeySecond(),
|
||||||
size_t msgLen = strlen(Application::getInstance()->getKeySeed());
|
Application::getInstance()->getKeyBackup()
|
||||||
char* msg_cpy = (char*)malloc(msgLen + 1);
|
);
|
||||||
strcpy(msg_cpy, Application::getInstance()->getKeySeed());
|
|
||||||
|
|
||||||
size_t secondLen = strlen(Application::getInstance()->getKeySecond());
|
|
||||||
char* second_cpy = (char*)malloc(secondLen + 1);
|
|
||||||
strcpy(second_cpy, Application::getInstance()->getKeySecond());
|
|
||||||
CWallet wallet = CWallet{
|
|
||||||
.msg_key = msg_cpy,
|
|
||||||
.master_key = master_cpy,
|
|
||||||
.second_key = second_cpy,
|
|
||||||
.backup_key = ""
|
|
||||||
};
|
|
||||||
std::string key_str = generate_sec_key(&wallet);
|
|
||||||
s.rval().setString(key_str);
|
s.rval().setString(key_str);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1140,24 +1130,12 @@ static bool JSB_walletSignTran(se::State& s)
|
|||||||
std::string msg;
|
std::string msg;
|
||||||
ok = seval_to_std_string(args[0], &msg);
|
ok = seval_to_std_string(args[0], &msg);
|
||||||
SE_PRECONDITION2(ok, false, "Error processing seed");
|
SE_PRECONDITION2(ok, false, "Error processing seed");
|
||||||
size_t masterLen = strlen(Application::getInstance()->getKeyMaster());
|
std::string sign_str = sign_for_tran(
|
||||||
char* master_cpy = (char*)malloc(masterLen + 1);
|
Application::getInstance()->getKeySeed(),
|
||||||
strcpy(master_cpy, Application::getInstance()->getKeyMaster());
|
Application::getInstance()->getKeyMaster(),
|
||||||
|
Application::getInstance()->getKeySecond(),
|
||||||
size_t msgLen = strlen(Application::getInstance()->getKeySeed());
|
Application::getInstance()->getKeyBackup(),
|
||||||
char* msg_cpy = (char*)malloc(msgLen + 1);
|
msg.c_str());
|
||||||
strcpy(msg_cpy, Application::getInstance()->getKeySeed());
|
|
||||||
|
|
||||||
size_t secondLen = strlen(Application::getInstance()->getKeySecond());
|
|
||||||
char* second_cpy = (char*)malloc(secondLen + 1);
|
|
||||||
strcpy(second_cpy, Application::getInstance()->getKeySecond());
|
|
||||||
CWallet wallet = CWallet{
|
|
||||||
.msg_key = msg_cpy,
|
|
||||||
.master_key = master_cpy,
|
|
||||||
.second_key = second_cpy,
|
|
||||||
.backup_key = ""
|
|
||||||
};
|
|
||||||
std::string sign_str = sign_for_tran(&wallet, msg.c_str());
|
|
||||||
s.rval().setString(sign_str);
|
s.rval().setString(sign_str);
|
||||||
// free_cwallet(wallet);
|
// free_cwallet(wallet);
|
||||||
return true;
|
return true;
|
||||||
@ -1191,6 +1169,7 @@ bool jsb_register_global_variables(se::Object* global)
|
|||||||
__jsbObj->defineFunction("copyTextToClipboard", _SE(JSB_copyTextToClipboard));
|
__jsbObj->defineFunction("copyTextToClipboard", _SE(JSB_copyTextToClipboard));
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||||
__jsbObj->defineFunction("scanQRCode", _SE(JSB_scanQRCode));
|
__jsbObj->defineFunction("scanQRCode", _SE(JSB_scanQRCode));
|
||||||
|
__jsbObj->defineFunction("restoreKey", _SE(JSB_restoreKey));
|
||||||
__jsbObj->defineFunction("showQRCode", _SE(JSB_showQRCode));
|
__jsbObj->defineFunction("showQRCode", _SE(JSB_showQRCode));
|
||||||
__jsbObj->defineFunction("signWithGoogle", _SE(JSB_signWithGoogle));
|
__jsbObj->defineFunction("signWithGoogle", _SE(JSB_signWithGoogle));
|
||||||
__jsbObj->defineFunction("signOutGoogle", _SE(JSB_signOutGoogle));
|
__jsbObj->defineFunction("signOutGoogle", _SE(JSB_signOutGoogle));
|
||||||
|
@ -12,16 +12,31 @@ typedef struct CWallet {
|
|||||||
|
|
||||||
struct CWallet new_wallet(const char *msg);
|
struct CWallet new_wallet(const char *msg);
|
||||||
|
|
||||||
struct CWallet restore_wallet(const struct CWallet *cw);
|
struct CWallet reset_wallet(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
struct CWallet reset_wallet(const struct CWallet *cw);
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
void free_cwallet(struct CWallet cw);
|
void free_cwallet(struct CWallet cw);
|
||||||
|
|
||||||
char *get_address(const struct CWallet *cw);
|
char *get_address(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *generate_sec_key(const struct CWallet *cw);
|
char *generate_sec_key(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *sign(const struct CWallet *cw, const char *msg);
|
char *sign(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
|
||||||
char *sign_for_tran(const struct CWallet *cw, const char *msg);
|
char *sign_for_tran(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
BIN
external/android/arm64-v8a/librustwallet.a
vendored
BIN
external/android/arm64-v8a/librustwallet.a
vendored
Binary file not shown.
@ -12,16 +12,31 @@ typedef struct CWallet {
|
|||||||
|
|
||||||
struct CWallet new_wallet(const char *msg);
|
struct CWallet new_wallet(const char *msg);
|
||||||
|
|
||||||
struct CWallet restore_wallet(const struct CWallet *cw);
|
struct CWallet reset_wallet(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
struct CWallet reset_wallet(const struct CWallet *cw);
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
void free_cwallet(struct CWallet cw);
|
void free_cwallet(struct CWallet cw);
|
||||||
|
|
||||||
char *get_address(const struct CWallet *cw);
|
char *get_address(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *generate_sec_key(const struct CWallet *cw);
|
char *generate_sec_key(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *sign(const struct CWallet *cw, const char *msg);
|
char *sign(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
|
||||||
char *sign_for_tran(const struct CWallet *cw, const char *msg);
|
char *sign_for_tran(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
BIN
external/android/armeabi-v7a/librustwallet.a
vendored
BIN
external/android/armeabi-v7a/librustwallet.a
vendored
Binary file not shown.
@ -12,16 +12,31 @@ typedef struct CWallet {
|
|||||||
|
|
||||||
struct CWallet new_wallet(const char *msg);
|
struct CWallet new_wallet(const char *msg);
|
||||||
|
|
||||||
struct CWallet restore_wallet(const struct CWallet *cw);
|
struct CWallet reset_wallet(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
struct CWallet reset_wallet(const struct CWallet *cw);
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
void free_cwallet(struct CWallet cw);
|
void free_cwallet(struct CWallet cw);
|
||||||
|
|
||||||
char *get_address(const struct CWallet *cw);
|
char *get_address(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *generate_sec_key(const struct CWallet *cw);
|
char *generate_sec_key(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *sign(const struct CWallet *cw, const char *msg);
|
char *sign(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
|
||||||
char *sign_for_tran(const struct CWallet *cw, const char *msg);
|
char *sign_for_tran(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
BIN
external/android/x86/librustwallet.a
vendored
BIN
external/android/x86/librustwallet.a
vendored
Binary file not shown.
@ -12,16 +12,31 @@ typedef struct CWallet {
|
|||||||
|
|
||||||
struct CWallet new_wallet(const char *msg);
|
struct CWallet new_wallet(const char *msg);
|
||||||
|
|
||||||
struct CWallet restore_wallet(const struct CWallet *cw);
|
struct CWallet reset_wallet(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
struct CWallet reset_wallet(const struct CWallet *cw);
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
void free_cwallet(struct CWallet cw);
|
void free_cwallet(struct CWallet cw);
|
||||||
|
|
||||||
char *get_address(const struct CWallet *cw);
|
char *get_address(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *generate_sec_key(const struct CWallet *cw);
|
char *generate_sec_key(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key);
|
||||||
|
|
||||||
char *sign(const struct CWallet *cw, const char *msg);
|
char *sign(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
|
||||||
char *sign_for_tran(const struct CWallet *cw, const char *msg);
|
char *sign_for_tran(const char *msg_key,
|
||||||
|
const char *master_key,
|
||||||
|
const char *second_key,
|
||||||
|
const char *backup_key,
|
||||||
|
const char *msg);
|
||||||
|
BIN
external/android/x86_64/librustwallet.a
vendored
BIN
external/android/x86_64/librustwallet.a
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user