Skip to content

Commit

Permalink
Upgrade to monero v0.11.0.0 (m2049r#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r committed Sep 8, 2017
1 parent 9b82023 commit bf64f77
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.gradle
build
local.properties
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ target_link_libraries( monerujo

blockchain_db
lmdb
#easylogging # not for 0.10.3.1
easylogging
unbound
p2p

Expand Down
11 changes: 8 additions & 3 deletions app/src/main/cpp/monerujo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ JNIEXPORT jboolean JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_closeJ(JNIEnv *env, jobject instance,
jobject walletInstance) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, walletInstance);
bool closeSuccess = Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(wallet);
bool closeSuccess = Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(wallet, false);
if (closeSuccess) {
MyWalletListener *walletListener = getHandle<MyWalletListener>(env, walletInstance,
"listenerHandle");
Expand Down Expand Up @@ -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<Bitmonero::Wallet>(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<Bitmonero::Wallet>(env, instance);
return env->NewStringUTF(wallet->secretSpendKey().c_str());
}

JNIEXPORT jboolean JNICALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ private class AsyncShow extends AsyncTask<String, Void, Boolean> {
String address;
String seed;
String viewKey;
String spendKey;
boolean isWatchOnly;
Wallet.Status status;

Expand Down Expand Up @@ -129,6 +130,7 @@ protected Boolean doInBackground(String... params) {
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;
Expand All @@ -147,12 +149,7 @@ protected void onPostExecute(Boolean result) {
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
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ protected void onResume() {
}
}


private class MyProgressDialog extends ProgressDialog {
Activity activity;

Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/m2049r/xmrwallet/SendFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -443,6 +444,7 @@ public void onClick(DialogInterface dialog, int which) {
}
});
builder.setMessage(errorText);
builder.setCancelable(false);
builder.create().show();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ public enum Status {
}

public enum Priority {
Priority_Default(0),
Priority_Low(1),
Priority_Medium(2),
Priority_High(3),
Priority_Last(4);

public static Priority fromInteger(int n) {
switch (n) {
case 0:
return Priority_Default;
case 1:
return Priority_Low;
case 2:
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/m2049r/xmrwallet/model/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public Status getStatus() {

public native String getSecretViewKey();

public native String getSecretSpendKey();

public boolean store() {
return store("");
}
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@
<string name="big_amount">999999.999999999999</string>

<string-array name="mixin">
<item>Mixin 4</item>
<item>Mixin 6</item>
<item>Mixin 8</item>
<item>Mixin 10</item>
<item>Mixin 13</item>
<item>Ring Size 5</item>
<item>Ring Size 8</item>
<item>Ring Size 13</item>
<item>Ring Size 26</item>
</string-array>

<string-array name="priority">
<item>Default Priority</item>
<item>Low Priority</item>
<item>Medium Priority</item>
<item>High Priority</item>
Expand Down
42 changes: 35 additions & 7 deletions external-libs/monero/include/wallet2_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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<std::string> &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
Expand Down Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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
Expand Down
Binary file modified external-libs/monero/lib/armeabi-v7a/libblockchain_db.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libblocks.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libcncrypto.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libcommon.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libcryptonote_basic.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libcryptonote_core.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libcryptonote_protocol.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libdaemonizer.a
Binary file not shown.
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libepee.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/liblmdb.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libminiupnpc.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libmnemonics.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libp2p.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libringct.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/librpc.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libunbound.a
Binary file not shown.
Binary file modified external-libs/monero/lib/armeabi-v7a/libwallet.a
Binary file not shown.
Empty file modified gradlew
100644 → 100755
Empty file.
12 changes: 0 additions & 12 deletions local.properties

This file was deleted.

0 comments on commit bf64f77

Please sign in to comment.