1
mirror of https://github.com/m2049r/xmrwallet synced 2025-09-03 08:23:04 +02:00

Compare commits

...

29 Commits

Author SHA1 Message Date
m2049r
dceca0e198 new version 2017-09-26 22:58:08 +02:00
m2049r
94947de9ef Minor fixes (#88)
* another attempt to fix android.view.WindowManager

* trim entered daemon
2017-09-26 21:41:58 +02:00
m2049r
10ea6d8e0c Update FAQ.md 2017-09-26 08:02:55 +02:00
m2049r
0d03b75785 Poppins license (#86) 2017-09-25 23:12:43 +02:00
m2049r
a3db07c6a7 Bugfixes (#85)
* android.view.WindowManager

* refactor

* lock_guard listener

* new version
2017-09-25 22:53:16 +02:00
m2049r
6678222202 Bugfix: Generate screen is now scrollable (#84)
* generate+detail screens made scrollable

* new version
2017-09-23 22:26:12 +02:00
m2049r
793d984200 Bugfix: crashing on android 5 & 6 (new wallet, receive, ...) (#83)
* getAddress() mess fixed

* v0.8.0.3
2017-09-23 18:23:41 +02:00
m2049r
cc46dc06c4 Bugfixes (#82)
* cache getAddress()

* savedInstanceState handling

* v0.8.0.2
2017-09-23 14:16:30 +02:00
m2049r
be236cce1b new bugfix version 2017-09-23 11:09:27 +02:00
m2049r
af18a89a5e Bugfixes based on ANR reports from google (#81)
* remove id in toolbar include (NPE on some devices)

* deal with progress when activity closed
2017-09-23 11:06:10 +02:00
m2049r
9aa8d10d9d Update FAQ.md 2017-09-23 09:04:38 +02:00
m2049r
9efc1d513d Update BUILDING-external-libs.md 2017-09-23 00:10:42 +02:00
m2049r
1757a1de85 Update BUILDING-external-libs.md 2017-09-23 00:09:20 +02:00
m2049r
feae490e93 Docs & Version (#80)
* update for v0.8

* cleanup
2017-09-23 00:03:57 +02:00
m2049r
7fd6e47f88 new logo (#79) 2017-09-23 00:01:09 +02:00
m2049r
3d0b06ccf8 Create privacy-policy.md 2017-09-21 21:31:51 +02:00
m2049r
79186c5e09 allow backup/archive of unsynced wallet (#77)
closes #60 - we don't have better errors messages (too many variables), but we can now delete / backup nonsynced wallets.
2017-09-21 20:00:24 +02:00
m2049r
e14bbc6bae New sexy logo (#76)
* new logo

* sexy logo
2017-09-21 19:00:04 +02:00
m2049r
553a97a68b new logo (#75) 2017-09-21 14:52:52 +02:00
m2049r
b78902ac77 deamon selection belongs to loginfragment (#74) 2017-09-20 19:43:59 +02:00
m2049r
b00734a0d6 Die if getAddress() is not valid (#73)
mitigates serious effects of issue #72 by crashing - does not solve the root cause which is still unknown.
2017-09-19 21:40:17 +02:00
m2049r
c4f9e8cf58 network slection in menu (#71)
moved code from fragment to activity; dropdownlist is now better
2017-09-19 19:46:22 +02:00
m2049r
ba408b8889 node defaults and history (#70) 2017-09-18 23:02:36 +02:00
m2049r
ac6f824201 Update README.md 2017-09-12 23:48:01 +02:00
m2049r
99a7048e26 added monero licenses (#65) 2017-09-12 23:43:56 +02:00
m2049r
7be001bd85 Correct license infos (#64)
and some .idea files

* corrected license info
2017-09-12 22:02:31 +02:00
m2049r
862716406e Show Licenses (#63)
and upgrade to support library 25.4.0
resolves #59
2017-09-12 21:32:05 +02:00
m2049r
4965cbf679 F: Backup / Archive says "Backup/Archive failed" 2017-09-12 07:59:53 +02:00
m2049r
39d92e0867 Update FAQ.md 2017-09-11 13:30:36 +02:00
69 changed files with 1686 additions and 751 deletions

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="animated-vector-drawable-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.android/build-cache/c5daa70b6947fa9fd8a9960e661cc14fc4797397/output/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.android/build-cache/c5daa70b6947fa9fd8a9960e661cc14fc4797397/output/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/25.3.1/animated-vector-drawable-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="appcompat-v7-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/7347280c7c5efbce562b3f7493acce3ce62120aa/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/7347280c7c5efbce562b3f7493acce3ce62120aa/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="cardview-v7-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/d3101339ab3be4a16068a03e764036d173229f64/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/d3101339ab3be4a16068a03e764036d173229f64/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/cardview-v7/25.3.1/cardview-v7-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="design-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/222602355d1fc232e06a3e23c06dc49c03836f7a/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/222602355d1fc232e06a3e23c06dc49c03836f7a/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/design/25.3.1/design-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="recyclerview-v7-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.android/build-cache/99e5fdc3d331d7083d1b3759b72d024c2f736dcd/output/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.android/build-cache/99e5fdc3d331d7083d1b3759b72d024c2f736dcd/output/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="support-annotations-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/25.3.1/support-annotations-25.3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/25.3.1/support-annotations-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-compat-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/bfee7899a02ec429f8d6fbb22abb30af9d75dd54/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/bfee7899a02ec429f8d6fbb22abb30af9d75dd54/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-compat/25.3.1/support-compat-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-core-ui-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/f1e0938f7953f4d9d6e09e6205aea1c4ea1bf919/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/f1e0938f7953f4d9d6e09e6205aea1c4ea1bf919/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-ui/25.3.1/support-core-ui-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-core-utils-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/3399641f4104cc67bc990816452765709c509ff9/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/3399641f4104cc67bc990816452765709c509ff9/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-utils/25.3.1/support-core-utils-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-fragment-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.android/build-cache/3f5c9811e6cfbd571b84d0dbb634b48dfe989015/output/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.android/build-cache/3f5c9811e6cfbd571b84d0dbb634b48dfe989015/output/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-fragment/25.3.1/support-fragment-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-media-compat-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/7ed270352f6e04a617f3ff349bf4590f91afd032/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/7ed270352f6e04a617f3ff349bf4590f91afd032/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-media-compat/25.3.1/support-media-compat-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="support-v4-25.3.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/00ab1c7e820f681dc2b7ac4321cc1d73f2876d96/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/00ab1c7e820f681dc2b7ac4321cc1d73f2876d96/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-vector-drawable-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.android/build-cache/e6ca1fb96a4aeca737119703e3fea72846da3ca1/output/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.android/build-cache/e6ca1fb96a4aeca737119703e3fea72846da3ca1/output/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-vector-drawable/25.3.1/support-vector-drawable-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="transition-25.3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.android/build-cache/1ff9f43f47f4f75d31b57959475cee7001de24ac/output/jars/classes.jar!/" />
<root url="file://$USER_HOME$/.android/build-cache/1ff9f43f47f4f75d31b57959475cee7001de24ac/output/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/transition/25.3.1/transition-25.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -23,18 +23,19 @@ You may lose all your Moneroj if you use this App. Be cautious when spending on
### TODO
- review visibility of methods/classes
- more sensible error dialogs
- check licenses of included libraries; License Dialog
### Issues / Pitfalls
- Created wallets on a private testnet are unusable because the restore height is set to that
of the "real" testnet. After creating a new wallet, make a **new** one by recovering from the seed.
The official monero client shows the same behaviour.
- In rare occasions the monero core code returns a wallet address with corrupted characters -
in these cases Monerujo crashes on purpose to make sure nothing bad happens
### HOW TO BUILD
No need to build. Binaries are included:
- openssl-1.0.2l
- monero-v0.10.3.1 + pull requests #2238, #2239 and #2289
- monero-v0.11.0.0 + pull requests #2289
- boost_1_64_0
If you want to build them yourself (recommended) check out [the instructions](doc/BUILDING-external-libs.md)

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 12
versionName "0.7"
versionCode 20
versionName "0.8.0.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
@@ -36,36 +36,35 @@ android {
}
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
}
dependencyVerification {
verify = [
'com.android.support:design:a3e83064fe99d0a4369f9b46d8bfbe77d0c3022fffdee4be3ac3857b87cc89e3',
'com.android.support:appcompat-v7:ac1ebbc46589195dda3e0b1becfe410bafd75bdf3edd1cd9acf04850f3895830',
'com.android.support:appcompat-v7:70551e62660db15b790c5275f56b9de4dd9407d1494d07c8f3dd5698f3638677',
'com.android.support:design:3f409bf2019967ffc344cfaf11e52131fac982468a1707aaeb25bf3c52838966',
'com.android.support:support-v4:ee44c481a1f4d6978568e223e8125379b52b2ececdd53450e09ebae144bd377d',
'com.android.support:recyclerview-v7:a2fe121f9d01ed8980e97095b4a3fe9700a0aa0a7d4b0f8c594f765ad8455a0d',
'com.android.support:cardview-v7:f3fbbe1fcfdbec7333c6a2c516c5fd511a909d1975271818e268d6fe297d8c70',
'com.android.support.constraint:constraint-layout:b0c688cc2b7172608f8153a689d746da40f71e52d7e2fe2bfd9df2f92db77085',
'com.android.support:transition:36c688825a8c0e6e879e18886de83dc90673322822d5b606ee302f70fb558e16',
'me.dm7.barcodescanner:zxing:d43973c9527c23fa8e6d338c6a2c458e373ce1ac6bcaa3bc41d11ae49116000d',
'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
'com.android.support:support-v4:07d389154bcf73b47e514964df1578136b26cba78257b8a577a3ccb54beff0ae',
'com.android.support:recyclerview-v7:375974a8724e359d97d77fa8522c614f813a3ac4583c1807f154a3f9a054b0a1',
'com.android.support:cardview-v7:defc17032ffa600a82e1c7d96bb574aa5ed64e2b57e28414a245da7d6db0c666',
'com.android.support:animated-vector-drawable:4bc46edf1946b32d518b41416d1734e915e0cbb28021de3b340527419b070691',
'com.android.support:support-vector-drawable:13728f337f36d1c02d52198a6c20724edb447a0875454d829f95cb9eb4aa293b',
'com.android.support:support-fragment:541d6393c1e024453aca2a14f31bea0c7270ff4e2a02783f3528aa426367444d',
'com.android.support:support-media-compat:cbed07d07e0e84fdb4b75712f5fd946229a8af155933c9a92e41db64d00791e0',
'com.android.support:support-core-utils:32fac02eb2c20a77fa3e3bc3ede62392a19613f72b8f8e10f5dfa84bb4c89ea1',
'com.android.support:support-core-ui:6182278a6653e6c111c888963626cbb16f2d0022571cb239760475119e0b92a8',
'com.android.support:support-compat:e02d781268dc60aab6638d8dc20156ea11ca20b962d294b85e6f1e8418cabfa7',
'com.android.support:support-annotations:aedf76962584adfaed2bd3fcaa22406461c4310237fc27e301128edaa2dba2fa',
'com.android.support:support-annotations:a774272036941b4e912eb426d70c848bde7f06a3bf5fb491f75a427dc6595270',
'com.android.support:support-vector-drawable:077009d13882ee96f061e4bc2dbe7cce7ae1762d8297592a787ff741afbfb1f2',
'com.android.support:animated-vector-drawable:628ab1d56a6ee4cbedf32617af8b2a1fe02964ed0628e8f898cc09ddba6e1835',
'com.android.support:transition:848270144fb180efd2bf928a00ed176dbbc5290badfd638390ffba90088df8b3',
'com.android.support:support-compat:54019c63614ce08b02d7b9605490cd2b29ba5b2505f394a9517450b5f72b30ca',
'com.android.support:support-media-compat:566a161d9cb0083ef62a53e46b71ce5b3d455b8635b1a0a4ae28d96d4b583de8',
'com.android.support:support-core-utils:34b8437dfa95ff28d29cf57ffa3b1354a9fa9bfe4059f0fd5ce2f5e4326a1748',
'com.android.support:support-core-ui:e72ae29b823889686cff6fcb948d6745c2baf6d4c2af4fdffa1ec1e42e3833a3',
'com.android.support:support-fragment:316d35d4d2d2902057efad104a73e4bdb50bee260a7075678185b8cd71170945',
'com.android.support.constraint:constraint-layout-solver:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d',
'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
'com.google.zxing:core:bba7724e02a997cec38213af77133ee8e24b0d5cf5fa7ecbc16a4fa93f11ee0d',
]
}

View File

@@ -11,7 +11,7 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_monero_32dp"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/MyMaterialTheme">

View File

@@ -39,6 +39,8 @@ static jclass class_WalletListener;
static jclass class_TransactionInfo;
static jclass class_Transfer;
std::mutex _listenerMutex;
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
cachedJVM = jvm;
LOGI("JNI_OnLoad");
@@ -101,6 +103,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
};
void deleteGlobalJavaRef(JNIEnv *env) {
std::lock_guard<std::mutex> lock(_listenerMutex);
env->DeleteGlobalRef(jlistener);
jlistener = nullptr;
}
@@ -109,6 +112,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @brief updated - generic callback, called when any event (sent/received/block reveived/etc) happened with the wallet;
*/
void updated() {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
LOGD("updated");
JNIEnv *jenv;
@@ -128,6 +132,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @param amount - amount
*/
void moneySpent(const std::string &txId, uint64_t amount) {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
LOGD("moneySpent %"
PRIu64, amount);
@@ -139,6 +144,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @param amount - amount
*/
void moneyReceived(const std::string &txId, uint64_t amount) {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
LOGD("moneyReceived %"
PRIu64, amount);
@@ -150,6 +156,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @param amount - amount
*/
void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
LOGD("unconfirmedMoneyReceived %"
PRIu64, amount);
@@ -160,6 +167,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @param height - block height
*/
void newBlock(uint64_t height) {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
//LOGD("newBlock");
JNIEnv *jenv;
@@ -178,6 +186,7 @@ struct MyWalletListener : Bitmonero::WalletListener {
* @brief refreshed - called when wallet refreshed by background thread or explicitly refreshed by calling "refresh" synchronously
*/
void refreshed() {
std::lock_guard<std::mutex> lock(_listenerMutex);
if (jlistener == nullptr) return;
LOGD("refreshed");
JNIEnv *jenv;
@@ -465,14 +474,15 @@ 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, false);
bool closeSuccess = Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(wallet,
false);
if (closeSuccess) {
MyWalletListener *walletListener = getHandle<MyWalletListener>(env, walletInstance,
"listenerHandle");
if (walletListener != nullptr) {
walletListener->deleteGlobalJavaRef(env);
delete walletListener;
}
delete walletListener;
}
LOGD("wallet closed");
return closeSuccess;
@@ -529,10 +539,9 @@ Java_com_m2049r_xmrwallet_model_Wallet_setPassword(JNIEnv *env, jobject instance
}
JNIEXPORT jstring JNICALL
Java_com_m2049r_xmrwallet_model_Wallet_getAddress(JNIEnv *env, jobject instance) {
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
const char *address = wallet->address().c_str();
return env->NewStringUTF(address);
return env->NewStringUTF(wallet->address().c_str());
}
JNIEXPORT jstring JNICALL
@@ -602,7 +611,8 @@ Java_com_m2049r_xmrwallet_model_Wallet_initJ(JNIEnv *env, jobject instance,
const char *_daemon_username = env->GetStringUTFChars(daemon_username, JNI_FALSE);
const char *_daemon_password = env->GetStringUTFChars(daemon_password, JNI_FALSE);
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
bool status = wallet->init(_daemon_address, upper_transaction_size_limit, _daemon_username, _daemon_password);
bool status = wallet->init(_daemon_address, upper_transaction_size_limit, _daemon_username,
_daemon_password);
env->ReleaseStringUTFChars(daemon_address, _daemon_address);
env->ReleaseStringUTFChars(daemon_username, _daemon_username);
env->ReleaseStringUTFChars(daemon_password, _daemon_password);
@@ -920,7 +930,7 @@ jobject newTransferInstance(JNIEnv *env, uint64_t amount, const std::string &add
jobject newTransferList(JNIEnv *env, Bitmonero::TransactionInfo *info) {
const std::vector<Bitmonero::TransactionInfo::Transfer> &transfers = info->transfers();
if (transfers.size()==0) { // don't create empty Lists
if (transfers.size() == 0) { // don't create empty Lists
return nullptr;
}
// make new ArrayList

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

View File

@@ -34,6 +34,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.util.Helper;
@@ -278,8 +279,7 @@ public class GenerateFragment extends Fragment {
private boolean addressOk() {
String address = etWalletAddress.getText().toString();
boolean testnet = WalletManager.getInstance().isTestNet();
return ((address.length() == 95) && ((testnet ? "9A" : "4").indexOf(address.charAt(0)) >= 0));
return Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet());
}
private boolean viewKeyOk() {
@@ -295,7 +295,7 @@ public class GenerateFragment extends Fragment {
private void generateWallet() {
String name = etWalletName.getText().toString();
if (name.length() == 0) return;
if (name.charAt(0)=='.') {
if (name.charAt(0) == '.') {
Toast.makeText(getActivity(), getString(R.string.generate_wallet_dot), Toast.LENGTH_LONG).show();
etWalletName.requestFocus();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -277,7 +277,7 @@ public class SendFragment extends Fragment {
private boolean addressOk() {
String address = etAddress.getText().toString();
return Helper.isAddressOk(address, WalletManager.getInstance().isTestNet());
return Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet());
}
private boolean amountOk() {

View File

@@ -150,14 +150,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.wallet_activity);
if (savedInstanceState != null) {
return;
// we don't store anything ourselves
}
setContentView(R.layout.wallet_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.app_name);
setSupportActionBar(toolbar);
toolbar.setTitle(R.string.app_name);
boolean testnet = WalletManager.getInstance().isTestNet();
if (testnet) {
toolbar.setBackgroundResource(R.color.colorPrimaryDark);
@@ -697,7 +699,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
address = null;
}
if (Helper.isAddressOk(address, WalletManager.getInstance().isTestNet())) {
if (Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
return new BarcodeData(address, paymentId, amount);
}
return null;

View File

@@ -0,0 +1,54 @@
/*
* Copyright (c) 2017 m2049r
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// https://stackoverflow.com/questions/2126717/android-autocompletetextview-show-suggestions-when-no-text-entered
package com.m2049r.xmrwallet.layout;
import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.AppCompatAutoCompleteTextView;
import android.util.AttributeSet;
public class DropDownEditText extends AppCompatAutoCompleteTextView {
public DropDownEditText(Context context) {
super(context);
}
public DropDownEditText(Context arg0, AttributeSet arg1) {
super(arg0, arg1);
}
public DropDownEditText(Context arg0, AttributeSet arg1, int arg2) {
super(arg0, arg1, arg2);
}
@Override
public boolean enoughToFilter() {
return true;
}
@Override
protected void onFocusChanged(boolean focused, int direction,
Rect previouslyFocusedRect) {
super.onFocusChanged(focused, direction, previouslyFocusedRect);
if (focused && getAdapter() != null) {
performFiltering("", 0);
}
}
}

View File

@@ -0,0 +1,210 @@
/**
* Copyright 2013 Adam Speakman, m2049r
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.m2049r.xmrwallet.license;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
//TODO If you don't support Android 2.x, you should use the non-support version!
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.m2049r.xmrwallet.BuildConfig;
import com.m2049r.xmrwallet.R;
/**
* Created by Adam Speakman on 24/09/13.
* http://speakman.net.nz
*/
public class LicensesFragment extends DialogFragment {
int versionCode = BuildConfig.VERSION_CODE;
String versionName = BuildConfig.VERSION_NAME;
private AsyncTask<Void, Void, String> mLicenseLoader;
private static final String FRAGMENT_TAG = "nz.net.speakman.androidlicensespage.LicensesFragment";
private static final String KEY_SHOW_CLOSE_BUTTON = "keyShowCloseButton";
/**
* Creates a new instance of LicensesFragment with no Close button.
*
* @return A new licenses fragment.
*/
public static LicensesFragment newInstance() {
return new LicensesFragment();
}
/**
* Creates a new instance of LicensesFragment with an optional Close button.
*
* @param showCloseButton Whether to show a Close button at the bottom of the dialog.
* @return A new licenses fragment.
*/
public static LicensesFragment newInstance(boolean showCloseButton) {
LicensesFragment fragment = new LicensesFragment();
Bundle bundle = new Bundle();
bundle.putBoolean(KEY_SHOW_CLOSE_BUTTON, showCloseButton);
fragment.setArguments(bundle);
return fragment;
}
/**
* Builds and displays a licenses fragment with no Close button. Requires
* "/res/raw/licenses.html" and "/res/layout/licenses_fragment.xml" to be
* present.
*
* @param fm A fragment manager instance used to display this LicensesFragment.
*/
public static void displayLicensesFragment(FragmentManager fm) {
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(FRAGMENT_TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = LicensesFragment.newInstance();
newFragment.show(ft, FRAGMENT_TAG);
}
/**
* Builds and displays a licenses fragment with or without a Close button.
* Requires "/res/raw/licenses.html" and "/res/layout/licenses_fragment.xml"
* to be present.
*
* @param fm A fragment manager instance used to display this LicensesFragment.
* @param showCloseButton Whether to show a Close button at the bottom of the dialog.
*/
public static void displayLicensesFragment(FragmentManager fm, boolean showCloseButton) {
FragmentTransaction ft = fm.beginTransaction();
Fragment prev = fm.findFragmentByTag(FRAGMENT_TAG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
DialogFragment newFragment = LicensesFragment.newInstance(showCloseButton);
newFragment.show(ft, FRAGMENT_TAG);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
loadLicenses();
}
@Override
public void onDestroy() {
super.onDestroy();
if (mLicenseLoader != null) {
mLicenseLoader.cancel(true);
}
}
private WebView mWebView;
private ProgressBar mIndeterminateProgress;
@SuppressLint("InflateParams")
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View content = LayoutInflater.from(getActivity()).inflate(R.layout.licenses_fragment, null);
mWebView = (WebView) content.findViewById(R.id.licensesFragmentWebView);
mIndeterminateProgress = (ProgressBar) content.findViewById(R.id.licensesFragmentIndeterminateProgress);
boolean showCloseButton = true;
Bundle arguments = getArguments();
if (arguments != null) {
showCloseButton = arguments.getBoolean(KEY_SHOW_CLOSE_BUTTON);
}
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
TextView text = (TextView) content.findViewById(R.id.text);
text.setText(getString(R.string.about_text, versionName, versionCode));
builder.setView(content);
if (showCloseButton) {
builder.setNegativeButton(R.string.about_close,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
}
return builder.create();
}
private void loadLicenses() {
// Load asynchronously in case of a very large file.
mLicenseLoader = new AsyncTask<Void, Void, String>() {
@Override
protected String doInBackground(Void... params) {
InputStream rawResource = getActivity().getResources().openRawResource(R.raw.licenses);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(rawResource));
String line;
StringBuilder sb = new StringBuilder();
try {
while ((line = bufferedReader.readLine()) != null) {
sb.append(line);
sb.append("\n");
}
bufferedReader.close();
} catch (IOException e) {
// TODO You may want to include some logging here.
}
return sb.toString();
}
@Override
protected void onPostExecute(String licensesBody) {
super.onPostExecute(licensesBody);
if (getActivity() == null || isCancelled()) {
return;
}
mIndeterminateProgress.setVisibility(View.INVISIBLE);
mWebView.setVisibility(View.VISIBLE);
mWebView.loadDataWithBaseURL(null, licensesBody, "text/html", "utf-8", null);
mLicenseLoader = null;
}
}.execute();
}
}

View File

@@ -50,8 +50,6 @@ public class Wallet {
ConnectionStatus_WrongVersion
}
//public native long createWalletListenerJ();
public native String getSeed();
public native String getSeedLanguage();
@@ -68,7 +66,16 @@ public class Wallet {
public native boolean setPassword(String password);
public native String getAddress();
private String address = null;
public String getAddress() {
if (address == null) {
address = getAddressJ();
}
return address;
}
private native String getAddressJ();
public native String getPath();

View File

@@ -557,7 +557,7 @@ public class WalletService extends Service {
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
Notification notification = new Notification.Builder(this)
.setContentTitle(getString(R.string.service_description))
.setSmallIcon(R.drawable.ic_monero_32dp)
.setSmallIcon(R.drawable.ic_monerujo)
.setContentIntent(pendingIntent)
.build();
startForeground(NOTIFICATION_ID, notification);

View File

@@ -46,7 +46,7 @@ import javax.net.ssl.HttpsURLConnection;
public class Helper {
static private final String TAG = "Helper";
static private final String WALLET_DIR = "Monerujo";
static private final String WALLET_DIR = "monerujo";
static public File getStorageRoot(Context context) {
if (!isExternalStorageWritable()) {
@@ -144,15 +144,6 @@ public class Helper {
act.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
static public boolean isAddressOk(String address, boolean testnet) {
if (address == null) return false;
if (testnet) {
return ((address.length() == 95) && ("9A".indexOf(address.charAt(0)) >= 0));
} else {
return ((address.length() == 95) && ("4".indexOf(address.charAt(0)) >= 0));
}
}
static public String getDisplayAmount(long amount) {
String s = Wallet.getDisplayAmount(amount);
int lastZero = 0;
@@ -165,7 +156,6 @@ public class Helper {
break;
}
}
//Log.d(TAG, decimal + "/" + lastZero + "/" + s);
int cutoff = Math.max(lastZero, decimal + 2);
return s.substring(0, cutoff);
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright (c) 2017 m2049r
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.m2049r.xmrwallet.util;
import android.util.Log;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class NodeList {
static private final String TAG = "NodeList";
static public final int MAX_SIZE = 5;
List<String> nodes = new ArrayList<>();
public List<String> getNodes() {
return nodes;
}
public void setRecent(String aNode) {
if (aNode.trim().isEmpty()) return;
boolean found = false;
for (int i = 0; i < nodes.size(); i++) {
if (nodes.get(i).equals(aNode)) { // node is already in the list => move it to top
nodes.remove(i);
found = true;
break;
}
}
if (!found) {
if (nodes.size() > MAX_SIZE) {
nodes.remove(nodes.size() - 1); // drop last one
}
}
nodes.add(0, aNode);
}
public NodeList(String aString) {
String[] newNodes = aString.split(";");
nodes.addAll(Arrays.asList(newNodes));
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (String node : this.nodes) {
sb.append(node).append(";");
}
return sb.toString();
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,107 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/etWalletName"
style="@style/MoneroEdit"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_name_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:textAlignment="center" />
android:orientation="horizontal"
android:weightSum="2">
<EditText
android:id="@+id/etWalletName"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_name_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletPassword"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_password_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletPassword"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_password_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletMnemonic"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_mnemonic_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletAddress"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_address_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<LinearLayout
android:id="@+id/llRestoreKeys"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:id="@+id/etWalletViewKey"
android:id="@+id/etWalletMnemonic"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_viewkey_hint"
android:hint="@string/generate_mnemonic_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletSpendKey"
android:id="@+id/etWalletAddress"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_spendkey_hint"
android:hint="@string/generate_address_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center"/>
android:textAlignment="center" />
<LinearLayout
android:id="@+id/llRestoreKeys"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:id="@+id/etWalletViewKey"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_viewkey_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletSpendKey"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_spendkey_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletRestoreHeight"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_restoreheight_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:visibility="gone" />
<Button
android:id="@+id/bGenerate"
style="@style/MoneroButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:text="@string/generate_buttonGenerate" />
</LinearLayout>
<EditText
android:id="@+id/etWalletRestoreHeight"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_restoreheight_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:visibility="gone" />
<Button
android:id="@+id/bGenerate"
style="@style/MoneroButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:text="@string/generate_buttonGenerate" />
</LinearLayout>
</ScrollView>

Some files were not shown because too many files have changed in this diff Show More