mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-03 08:23:04 +02:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cc46dc06c4 | ||
![]() |
be236cce1b | ||
![]() |
af18a89a5e | ||
![]() |
9aa8d10d9d | ||
![]() |
9efc1d513d | ||
![]() |
1757a1de85 | ||
![]() |
feae490e93 | ||
![]() |
7fd6e47f88 | ||
![]() |
3d0b06ccf8 | ||
![]() |
79186c5e09 | ||
![]() |
e14bbc6bae | ||
![]() |
553a97a68b | ||
![]() |
b78902ac77 | ||
![]() |
b00734a0d6 | ||
![]() |
c4f9e8cf58 | ||
![]() |
ba408b8889 | ||
![]() |
ac6f824201 | ||
![]() |
99a7048e26 | ||
![]() |
7be001bd85 | ||
![]() |
862716406e | ||
![]() |
4965cbf679 | ||
![]() |
39d92e0867 |
12
.idea/libraries/animated_vector_drawable_25_3_1.xml
generated
12
.idea/libraries/animated_vector_drawable_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/appcompat_v7_25_3_1.xml
generated
12
.idea/libraries/appcompat_v7_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/cardview_v7_25_3_1.xml
generated
12
.idea/libraries/cardview_v7_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/design_25_3_1.xml
generated
12
.idea/libraries/design_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/recyclerview_v7_25_3_1.xml
generated
12
.idea/libraries/recyclerview_v7_25_3_1.xml
generated
@@ -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>
|
11
.idea/libraries/support_annotations_25_3_1.xml
generated
11
.idea/libraries/support_annotations_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_compat_25_3_1.xml
generated
12
.idea/libraries/support_compat_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_core_ui_25_3_1.xml
generated
12
.idea/libraries/support_core_ui_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_core_utils_25_3_1.xml
generated
12
.idea/libraries/support_core_utils_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_fragment_25_3_1.xml
generated
12
.idea/libraries/support_fragment_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_media_compat_25_3_1.xml
generated
12
.idea/libraries/support_media_compat_25_3_1.xml
generated
@@ -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>
|
10
.idea/libraries/support_v4_25_3_1.xml
generated
10
.idea/libraries/support_v4_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/support_vector_drawable_25_3_1.xml
generated
12
.idea/libraries/support_vector_drawable_25_3_1.xml
generated
@@ -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>
|
12
.idea/libraries/transition_25_3_1.xml
generated
12
.idea/libraries/transition_25_3_1.xml
generated
@@ -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>
|
@@ -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)
|
||||
|
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "com.m2049r.xmrwallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 12
|
||||
versionName "0.7"
|
||||
versionCode 15
|
||||
versionName "0.8.0.2"
|
||||
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',
|
||||
]
|
||||
}
|
||||
|
||||
|
@@ -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">
|
||||
|
@@ -529,7 +529,7 @@ 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);
|
||||
|
BIN
app/src/main/ic_launcher-web.png
Normal file
BIN
app/src/main/ic_launcher-web.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 253 KiB |
@@ -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
@@ -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() {
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -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 = false;
|
||||
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();
|
||||
}
|
||||
}
|
@@ -36,6 +36,7 @@ public class Wallet {
|
||||
|
||||
Wallet(long handle) {
|
||||
this.handle = handle;
|
||||
getAddress(); // cache address for later
|
||||
}
|
||||
|
||||
public enum Status {
|
||||
@@ -50,8 +51,6 @@ public class Wallet {
|
||||
ConnectionStatus_WrongVersion
|
||||
}
|
||||
|
||||
//public native long createWalletListenerJ();
|
||||
|
||||
public native String getSeed();
|
||||
|
||||
public native String getSeedLanguage();
|
||||
@@ -68,7 +67,20 @@ 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();
|
||||
}
|
||||
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
|
||||
// just die!
|
||||
throw new IllegalStateException("Wallet returned invalid address: " + address);
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
private native String getAddressJ();
|
||||
|
||||
public native String getPath();
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
66
app/src/main/java/com/m2049r/xmrwallet/util/NodeList.java
Normal file
66
app/src/main/java/com/m2049r/xmrwallet/util/NodeList.java
Normal 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();
|
||||
}
|
||||
}
|
38
app/src/main/res/drawable/ic_monerujo.xml
Normal file
38
app/src/main/res/drawable/ic_monerujo.xml
Normal file
File diff suppressed because one or more lines are too long
38
app/src/main/res/layout/licenses_fragment.xml
Normal file
38
app/src/main/res/layout/licenses_fragment.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:padding="8sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_text"
|
||||
android:layout_below="@+id/icon"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="8sp"/>
|
||||
|
||||
<WebView
|
||||
android:id="@+id/licensesFragmentWebView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/text"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/licensesFragmentIndeterminateProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="true" />
|
||||
|
||||
</RelativeLayout>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user