diff --git a/app/src/main/cpp/monerujo.cpp b/app/src/main/cpp/monerujo.cpp index 03ab0ab..bd8b281 100644 --- a/app/src/main/cpp/monerujo.cpp +++ b/app/src/main/cpp/monerujo.cpp @@ -536,7 +536,7 @@ Java_com_m2049r_xmrwallet_model_WalletManager_resolveOpenAlias(JNIEnv *env, jobj } JNIEXPORT jboolean JNICALL -Java_com_m2049r_xmrwallet_model_WalletManager_setProxy(JNIEnv *env, jobject instance, +Java_com_m2049r_xmrwallet_model_WalletManager_setProxyJ(JNIEnv *env, jobject instance, jstring address) { const char *_address = env->GetStringUTFChars(address, nullptr); bool rc = @@ -705,14 +705,14 @@ JNIEXPORT jboolean JNICALL Java_com_m2049r_xmrwallet_model_Wallet_initJ(JNIEnv *env, jobject instance, jstring daemon_address, jlong upper_transaction_size_limit, - jstring daemon_username, jstring daemon_password) { + jstring daemon_username, jstring daemon_password, jstring proxy) { const char *_daemon_address = env->GetStringUTFChars(daemon_address, nullptr); const char *_daemon_username = env->GetStringUTFChars(daemon_username, nullptr); const char *_daemon_password = env->GetStringUTFChars(daemon_password, nullptr); Monero::Wallet *wallet = getHandle(env, instance); bool status = wallet->init(_daemon_address, (uint64_t) upper_transaction_size_limit, _daemon_username, - _daemon_password); + _daemon_password, false, false, "127.0.0.1:9050"); env->ReleaseStringUTFChars(daemon_address, _daemon_address); env->ReleaseStringUTFChars(daemon_username, _daemon_username); env->ReleaseStringUTFChars(daemon_password, _daemon_password); diff --git a/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java b/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java index e85d0f8..9032888 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java +++ b/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java @@ -219,11 +219,11 @@ public class Wallet { public boolean init(long upper_transaction_size_limit) { return initJ(WalletManager.getInstance().getDaemonAddress(), upper_transaction_size_limit, WalletManager.getInstance().getDaemonUsername(), - WalletManager.getInstance().getDaemonPassword()); + WalletManager.getInstance().getDaemonPassword(), false, false, WalletManager.getInstance().getProxy()); } private native boolean initJ(String daemon_address, long upper_transaction_size_limit, - String daemon_username, String daemon_password); + String daemon_username, String daemon_password, boolean useSsl, boolean lightWallet, String proxy); // virtual bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const = 0; // virtual void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) = 0; diff --git a/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java b/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java index 2257140..bd28f14 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java +++ b/app/src/main/java/com/m2049r/xmrwallet/model/WalletManager.java @@ -311,7 +311,18 @@ public class WalletManager { public native String resolveOpenAlias(String address, boolean dnssec_valid); - public native boolean setProxy(String address); + private String proxy = ""; + + public String getProxy() { + return proxy; + } + + public boolean setProxy(String address) { + this.proxy = address; + return setProxyJ(address); + } + + public native boolean setProxyJ(String address); //TODO static std::tuple checkUpdates(const std::string &software, const std::string &subdir); diff --git a/app/src/main/java/com/m2049r/xmrwallet/service/MoneroHandlerThread.java b/app/src/main/java/com/m2049r/xmrwallet/service/MoneroHandlerThread.java index 8b8624a..33cf7fa 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/service/MoneroHandlerThread.java +++ b/app/src/main/java/com/m2049r/xmrwallet/service/MoneroHandlerThread.java @@ -54,8 +54,7 @@ public class MoneroHandlerThread extends Thread implements WalletListener { @Override public void run() { WalletManager.getInstance().setProxy("127.0.0.1:9050"); - WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.XMRTW.getUri())); - wallet.setProxy("127.0.0.1:9050"); + WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.MONERUJO_ONION.getUri())); wallet.init(0); wallet.setListener(this); wallet.startRefresh();