summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp6
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h2
-rw-r--r--patches/monero/0001-polyseed.patch5
-rw-r--r--patches/wownero/0002-polyseed-support.patch5
4 files changed, 11 insertions, 7 deletions
diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
index 0160b8c..a39182c 100644
--- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
+++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
@@ -1135,10 +1135,12 @@ const char* MONERO_Wallet_getPolyseed(void* wallet_ptr, const char* passphrase)
return buffer;
}
// static bool createPolyseed(std::string &seed_words, std::string &err, const std::string &language = "English");
-const char* MONERO_Wallet_createPolyseed() {
+const char* MONERO_Wallet_createPolyseed(const char* language) {
std::string seed_words = "";
std::string err;
- Monero::Wallet::createPolyseed(seed_words, err);
+ Monero::Wallet::createPolyseed(seed_words, err, std::string(language));
+ std::cout << "MONERO_Wallet_createPolyseed(language: " << language << "):" << std::endl;
+ std::cout << " err: " << err << std::endl;
std::string str = seed_words;
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
index c995b24..afa2a71 100644
--- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
+++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
@@ -645,7 +645,7 @@ extern ADDAPI void MONERO_Wallet_init3(void* wallet_ptr, const char* argv0, cons
// virtual bool getPolyseed(std::string &seed, std::string &passphrase) const = 0;
extern ADDAPI const char* MONERO_Wallet_getPolyseed(void* wallet_ptr, const char* passphrase);
// static bool createPolyseed(std::string &seed_words, std::string &err, const std::string &language = "English");
-extern ADDAPI const char* MONERO_Wallet_createPolyseed();
+extern ADDAPI const char* MONERO_Wallet_createPolyseed(const char* language);
extern ADDAPI void MONERO_Wallet_startRefresh(void* wallet_ptr);
// virtual void pauseRefresh() = 0;
extern ADDAPI void MONERO_Wallet_pauseRefresh(void* wallet_ptr);
diff --git a/patches/monero/0001-polyseed.patch b/patches/monero/0001-polyseed.patch
index 855a2dc..9e3c061 100644
--- a/patches/monero/0001-polyseed.patch
+++ b/patches/monero/0001-polyseed.patch
@@ -1,8 +1,9 @@
From bf347a3c80f0e0647176752867a54ae9ecedb580 Mon Sep 17 00:00:00 2001
-From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 09:42:37 +0100
Subject: [PATCH 1/8] polyseed
+Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
.github/workflows/build.yml | 4 +-
.gitmodules | 6 +
@@ -533,7 +534,7 @@ index 000000000..b26f37574
+ static size_t utf8_nfc(const char* str, polyseed_str norm) {
+ // Note: UTF8PROC_LUMP is used here to replace the ideographic space with a regular space for Japanese phrases
+ // to allow wallets to split on ' '.
-+ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA | UTF8PROC_LUMP));
++ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA));
+ }
+
+ static size_t utf8_nfkd(const char* str, polyseed_str norm) {
diff --git a/patches/wownero/0002-polyseed-support.patch b/patches/wownero/0002-polyseed-support.patch
index 8c5c12e..698b5ef 100644
--- a/patches/wownero/0002-polyseed-support.patch
+++ b/patches/wownero/0002-polyseed-support.patch
@@ -1,8 +1,9 @@
From 33d611538efef134106f427c7ee5535d28d588f6 Mon Sep 17 00:00:00 2001
-From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+From: tobtoht <tob@featherwallet.org>
Date: Tue, 26 Mar 2024 08:19:23 +0100
Subject: [PATCH 2/9] polyseed support
+Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
.github/workflows/build.yml | 4 +-
.gitmodules | 6 +
@@ -533,7 +534,7 @@ index 000000000..b26f37574
+ static size_t utf8_nfc(const char* str, polyseed_str norm) {
+ // Note: UTF8PROC_LUMP is used here to replace the ideographic space with a regular space for Japanese phrases
+ // to allow wallets to split on ' '.
-+ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA | UTF8PROC_LUMP));
++ return utf8_norm(str, norm, (utf8proc_option_t)(UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_COMPOSE | UTF8PROC_STRIPNA));
+ }
+
+ static size_t utf8_nfkd(const char* str, polyseed_str norm) {