diff --git a/.gitignore b/.gitignore index f8b92c3a..1703c9ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .gradle build +local.properties diff --git a/README.md b/README.md index 7ccef7c3..a8e1628c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Another Android Monero Wallet You may lose all your Moneroj if you use this App. Be cautious when spending on the mainnet. ### Random Notes -- Based off monero v0.10.3.1 with pull requests #2238, #2239 and #2289 applied => so can it be used on the mainnet! +- Based off monero v0.11.0.0 with PR #2289 applied - currently only android32 (runs on 64-bit as well) - works on the testnet & mainnet - takes forever to sync due to 32-bit architecture diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d971b423..a8adc8d7 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -147,7 +147,7 @@ target_link_libraries( monerujo blockchain_db lmdb - #easylogging # not for 0.10.3.1 + easylogging unbound p2p diff --git a/app/src/main/cpp/monerujo.cpp b/app/src/main/cpp/monerujo.cpp index edcb6352..9f7dbae9 100644 --- a/app/src/main/cpp/monerujo.cpp +++ b/app/src/main/cpp/monerujo.cpp @@ -465,7 +465,7 @@ JNIEXPORT jboolean JNICALL Java_com_m2049r_xmrwallet_model_WalletManager_closeJ(JNIEnv *env, jobject instance, jobject walletInstance) { Bitmonero::Wallet *wallet = getHandle(env, walletInstance); - bool closeSuccess = Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(wallet); + bool closeSuccess = Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(wallet, false); if (closeSuccess) { MyWalletListener *walletListener = getHandle(env, walletInstance, "listenerHandle"); @@ -563,8 +563,13 @@ Java_com_m2049r_xmrwallet_model_Wallet_getIntegratedAddress(JNIEnv *env, jobject JNIEXPORT jstring JNICALL Java_com_m2049r_xmrwallet_model_Wallet_getSecretViewKey(JNIEnv *env, jobject instance) { Bitmonero::Wallet *wallet = getHandle(env, instance); - //return env->NewStringUTF(wallet->secretViewKey().c_str()); // changed in head - return env->NewStringUTF(wallet->privateViewKey().c_str()); + return env->NewStringUTF(wallet->secretViewKey().c_str()); +} + +JNIEXPORT jstring JNICALL +Java_com_m2049r_xmrwallet_model_Wallet_getSecretSpendKey(JNIEnv *env, jobject instance) { + Bitmonero::Wallet *wallet = getHandle(env, instance); + return env->NewStringUTF(wallet->secretSpendKey().c_str()); } JNIEXPORT jboolean JNICALL diff --git a/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java b/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java index 0793a4d2..c2278cd9 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java @@ -100,6 +100,7 @@ public class GenerateReviewFragment extends Fragment { String address; String seed; String viewKey; + String spendKey; boolean isWatchOnly; Wallet.Status status; @@ -129,6 +130,7 @@ public class GenerateReviewFragment extends Fragment { address = wallet.getAddress(); seed = wallet.getSeed(); viewKey = wallet.getSecretViewKey(); + spendKey = isWatchOnly ? getActivity().getString(R.string.watchonly_label) : wallet.getSecretSpendKey(); isWatchOnly = wallet.isWatchOnly(); if (closeWallet) wallet.close(); return true; @@ -147,12 +149,7 @@ public class GenerateReviewFragment extends Fragment { tvWalletAddress.setText(address); tvWalletMnemonic.setText(seed); tvWalletViewKey.setText(viewKey); - String spend = isWatchOnly ? "" : "not available - use seed for recovery"; - if (spend.length() > 0) { //TODO should be == 64, but spendkey is not in the API yet - tvWalletSpendKey.setText(spend); - } else { - tvWalletSpendKey.setText(getString(R.string.generate_wallet_watchonly)); - } + tvWalletSpendKey.setText(spendKey); } else { // TODO show proper error message // TODO end the fragment diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java index e1ad0db1..463c0431 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java @@ -511,7 +511,6 @@ public class LoginActivity extends AppCompatActivity } } - private class MyProgressDialog extends ProgressDialog { Activity activity; diff --git a/app/src/main/java/com/m2049r/xmrwallet/SendFragment.java b/app/src/main/java/com/m2049r/xmrwallet/SendFragment.java index d5617d72..61c48d4a 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/SendFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/SendFragment.java @@ -67,9 +67,10 @@ public class SendFragment extends Fragment { Button bReallySend; ProgressBar pbProgress; - final static int Mixins[] = {4, 6, 8, 10, 13}; // must match the layout XML + final static int Mixins[] = {4, 7, 12, 25}; // must match the layout XML final static PendingTransaction.Priority Priorities[] = - {PendingTransaction.Priority.Priority_Low, + {PendingTransaction.Priority.Priority_Default, + PendingTransaction.Priority.Priority_Low, PendingTransaction.Priority.Priority_Medium, PendingTransaction.Priority.Priority_High}; // must match the layout XML @@ -443,6 +444,7 @@ public class SendFragment extends Fragment { } }); builder.setMessage(errorText); + builder.setCancelable(false); builder.create().show(); } diff --git a/app/src/main/java/com/m2049r/xmrwallet/model/PendingTransaction.java b/app/src/main/java/com/m2049r/xmrwallet/model/PendingTransaction.java index 0c3e1eaa..6168d3f9 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/model/PendingTransaction.java +++ b/app/src/main/java/com/m2049r/xmrwallet/model/PendingTransaction.java @@ -34,6 +34,7 @@ public class PendingTransaction { } public enum Priority { + Priority_Default(0), Priority_Low(1), Priority_Medium(2), Priority_High(3), @@ -41,6 +42,8 @@ public class PendingTransaction { public static Priority fromInteger(int n) { switch (n) { + case 0: + return Priority_Default; case 1: return Priority_Low; case 2: 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 84969532..3ae2bf03 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java +++ b/app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java @@ -81,6 +81,8 @@ public class Wallet { public native String getSecretViewKey(); + public native String getSecretSpendKey(); + public boolean store() { return store(""); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 043d5c79..727b8af0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -193,14 +193,14 @@ 999999.999999999999 - Mixin 4 - Mixin 6 - Mixin 8 - Mixin 10 - Mixin 13 + Ring Size 5 + Ring Size 8 + Ring Size 13 + Ring Size 26 + Default Priority Low Priority Medium Priority High Priority diff --git a/external-libs/monero/include/wallet2_api.h b/external-libs/monero/include/wallet2_api.h index 6a7419b6..7a5e01af 100644 --- a/external-libs/monero/include/wallet2_api.h +++ b/external-libs/monero/include/wallet2_api.h @@ -156,6 +156,7 @@ struct TransactionInfo virtual uint64_t fee() const = 0; virtual uint64_t blockHeight() const = 0; virtual uint64_t confirmations() const = 0; + virtual uint64_t unlockTime() const = 0; //! transaction_id virtual std::string hash() const = 0; virtual std::time_t timestamp() const = 0; @@ -312,10 +313,28 @@ struct Wallet virtual std::string integratedAddress(const std::string &payment_id) const = 0; /*! - * \brief privateViewKey - returns private view key - * \return - private view key + * \brief secretViewKey - returns secret view key + * \return - secret view key */ - virtual std::string privateViewKey() const = 0; + virtual std::string secretViewKey() const = 0; + + /*! + * \brief publicViewKey - returns public view key + * \return - public view key + */ + virtual std::string publicViewKey() const = 0; + + /*! + * \brief secretSpendKey - returns secret spend key + * \return - secret spend key + */ + virtual std::string secretSpendKey() const = 0; + + /*! + * \brief publicSpendKey - returns public spend key + * \return - public spend key + */ + virtual std::string publicSpendKey() const = 0; /*! * \brief store - stores wallet to file. @@ -361,6 +380,12 @@ struct Wallet */ virtual void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) = 0; + /*! + * \brief getRestoreHeight - get wallet creation height + * + */ + virtual uint64_t getRefreshFromBlockHeight() const = 0; + /*! * \brief setRecoveringFromSeed - set state recover form seed * @@ -571,6 +596,9 @@ struct Wallet virtual bool verifySignedMessage(const std::string &message, const std::string &addres, const std::string &signature) const = 0; virtual bool parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector &unknown_parameters, std::string &error) = 0; + + virtual std::string getDefaultDataDir() const = 0; + /* * \brief rescanSpent - Rescan spent outputs - Can only be used with trusted daemon * \return true on success @@ -635,7 +663,7 @@ struct WalletManager * \param wallet previously opened / created wallet instance * \return None */ - virtual bool closeWallet(Wallet *wallet) = 0; + virtual bool closeWallet(Wallet *wallet, bool store = true) = 0; /* * ! checks if wallet with the given name already exists @@ -644,7 +672,7 @@ struct WalletManager /*! * @brief TODO: delme walletExists - check if the given filename is the wallet * @param path - filename - * @return + * @return - true if wallet exists */ virtual bool walletExists(const std::string &path) = 0; @@ -653,9 +681,9 @@ struct WalletManager * @param keys_file_name - location of keys file * @param password - password to verify * @param watch_only - verify only view keys? - * @return + * @return - true if password is correct */ - virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, const bool watch_only) = 0; + virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool watch_only) const = 0; /*! * \brief findWallets - searches for the wallet files by given path name recursively diff --git a/external-libs/monero/lib/armeabi-v7a/libblockchain_db.a b/external-libs/monero/lib/armeabi-v7a/libblockchain_db.a index a3c17e0b..4941c122 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libblockchain_db.a and b/external-libs/monero/lib/armeabi-v7a/libblockchain_db.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libblocks.a b/external-libs/monero/lib/armeabi-v7a/libblocks.a index 4f2accf8..e7a54b09 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libblocks.a and b/external-libs/monero/lib/armeabi-v7a/libblocks.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libcncrypto.a b/external-libs/monero/lib/armeabi-v7a/libcncrypto.a index 3b9769b1..3878a422 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libcncrypto.a and b/external-libs/monero/lib/armeabi-v7a/libcncrypto.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libcommon.a b/external-libs/monero/lib/armeabi-v7a/libcommon.a index 33720a03..22b985d8 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libcommon.a and b/external-libs/monero/lib/armeabi-v7a/libcommon.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libcryptonote_basic.a b/external-libs/monero/lib/armeabi-v7a/libcryptonote_basic.a index 8d0e4fef..b4da188b 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libcryptonote_basic.a and b/external-libs/monero/lib/armeabi-v7a/libcryptonote_basic.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libcryptonote_core.a b/external-libs/monero/lib/armeabi-v7a/libcryptonote_core.a index 92208c79..b24aa73b 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libcryptonote_core.a and b/external-libs/monero/lib/armeabi-v7a/libcryptonote_core.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libcryptonote_protocol.a b/external-libs/monero/lib/armeabi-v7a/libcryptonote_protocol.a index 5d31a892..73a799d5 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libcryptonote_protocol.a and b/external-libs/monero/lib/armeabi-v7a/libcryptonote_protocol.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libdaemonizer.a b/external-libs/monero/lib/armeabi-v7a/libdaemonizer.a index 568d67b0..b160a361 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libdaemonizer.a and b/external-libs/monero/lib/armeabi-v7a/libdaemonizer.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libeasylogging.a b/external-libs/monero/lib/armeabi-v7a/libeasylogging.a new file mode 100644 index 00000000..ddae46d9 Binary files /dev/null and b/external-libs/monero/lib/armeabi-v7a/libeasylogging.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libepee.a b/external-libs/monero/lib/armeabi-v7a/libepee.a index 40dd8493..42792957 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libepee.a and b/external-libs/monero/lib/armeabi-v7a/libepee.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/liblmdb.a b/external-libs/monero/lib/armeabi-v7a/liblmdb.a index dd38c1e2..3c5c4113 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/liblmdb.a and b/external-libs/monero/lib/armeabi-v7a/liblmdb.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libminiupnpc.a b/external-libs/monero/lib/armeabi-v7a/libminiupnpc.a index dba80840..74fec283 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libminiupnpc.a and b/external-libs/monero/lib/armeabi-v7a/libminiupnpc.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libmnemonics.a b/external-libs/monero/lib/armeabi-v7a/libmnemonics.a index 6df688b4..39959607 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libmnemonics.a and b/external-libs/monero/lib/armeabi-v7a/libmnemonics.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libp2p.a b/external-libs/monero/lib/armeabi-v7a/libp2p.a index 60764963..a3bd0a83 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libp2p.a and b/external-libs/monero/lib/armeabi-v7a/libp2p.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libringct.a b/external-libs/monero/lib/armeabi-v7a/libringct.a index 21d235bb..9a9399a3 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libringct.a and b/external-libs/monero/lib/armeabi-v7a/libringct.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/librpc.a b/external-libs/monero/lib/armeabi-v7a/librpc.a index 8136509c..a4fd34c9 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/librpc.a and b/external-libs/monero/lib/armeabi-v7a/librpc.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libunbound.a b/external-libs/monero/lib/armeabi-v7a/libunbound.a index a2ff8df4..ff5fa205 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libunbound.a and b/external-libs/monero/lib/armeabi-v7a/libunbound.a differ diff --git a/external-libs/monero/lib/armeabi-v7a/libwallet.a b/external-libs/monero/lib/armeabi-v7a/libwallet.a index 2959da80..2451cc9c 100644 Binary files a/external-libs/monero/lib/armeabi-v7a/libwallet.a and b/external-libs/monero/lib/armeabi-v7a/libwallet.a differ diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/local.properties b/local.properties deleted file mode 100644 index ee2784dd..00000000 --- a/local.properties +++ /dev/null @@ -1,12 +0,0 @@ -## This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Sat May 13 17:52:51 CEST 2017 -ndk.dir=C\:\\Users\\Test\\AppData\\Local\\Android\\Sdk\\ndk-bundle -sdk.dir=C\:\\Users\\Test\\AppData\\Local\\Android\\Sdk