mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-19 20:40:50 +02:00
Compare commits
60 Commits
v1.3.14
...
aeon-0.1.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4aa46d8cf9 | ||
![]() |
b1d91e2671 | ||
![]() |
271cd2d4a8 | ||
![]() |
22c5a543db | ||
![]() |
cd986860c5 | ||
![]() |
0cf5981eae | ||
![]() |
e109df34f0 | ||
![]() |
5a7aa6cc77 | ||
![]() |
f50629ff81 | ||
![]() |
cb12d64e5f | ||
![]() |
a8f08fb9b9 | ||
![]() |
3e9be418a8 | ||
![]() |
fa5dc9988d | ||
![]() |
857cf8d6d8 | ||
![]() |
63e0c265cb | ||
![]() |
39d2c0a25f | ||
![]() |
ff6e00e1a1 | ||
![]() |
3a839a04d5 | ||
![]() |
42e4db5cc1 | ||
![]() |
d18999e731 | ||
![]() |
425246beb1 | ||
![]() |
e1a2572236 | ||
![]() |
7fdae76f51 | ||
![]() |
b4e1767a7b | ||
![]() |
9b9995437d | ||
![]() |
94abc00422 | ||
![]() |
d7d6601b60 | ||
![]() |
bf95994c9e | ||
![]() |
a2d6ca0740 | ||
![]() |
1115bbb706 | ||
![]() |
0b17ed4322 | ||
![]() |
bcc85a5b3f | ||
![]() |
5b26f1a30b | ||
![]() |
63677d5027 | ||
![]() |
96579c1be4 | ||
![]() |
af58b76f0c | ||
![]() |
7879f31f63 | ||
![]() |
2ca7b41982 | ||
![]() |
8bdc0f8fde | ||
![]() |
0bb9e9cb6c | ||
![]() |
bdc2a72790 | ||
![]() |
073bd96b17 | ||
![]() |
37f22a9dc2 | ||
![]() |
bc3c5b3f66 | ||
![]() |
c61a62cc85 | ||
![]() |
66a6583ec4 | ||
![]() |
d24b37e2f2 | ||
![]() |
161c155de6 | ||
![]() |
dd59233dd4 | ||
![]() |
e9c74d4d9c | ||
![]() |
b37adb4546 | ||
![]() |
a4e99209be | ||
![]() |
45aa8f30e5 | ||
![]() |
60a7b15700 | ||
![]() |
df2ff8b3b7 | ||
![]() |
da8c8f80f1 | ||
![]() |
eda3de11fe | ||
![]() |
7d7de14827 | ||
![]() |
1c709da92c | ||
![]() |
a9092497b2 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,8 +1,7 @@
|
|||||||
.gradle
|
.gradle
|
||||||
/build
|
/build
|
||||||
*.iml
|
*.iml
|
||||||
/.idea/libraries
|
/.idea
|
||||||
/.idea/workspace.xml
|
|
||||||
/local.properties
|
/local.properties
|
||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
|
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
workspace.xml
|
|
||||||
markdown-*
|
|
||||||
misc.xml
|
|
1
.idea/.name
generated
1
.idea/.name
generated
@@ -1 +0,0 @@
|
|||||||
xmrwallet
|
|
22
.idea/compiler.xml
generated
22
.idea/compiler.xml
generated
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<resourceExtensions />
|
|
||||||
<wildcardResourcePatterns>
|
|
||||||
<entry name="!?*.java" />
|
|
||||||
<entry name="!?*.form" />
|
|
||||||
<entry name="!?*.class" />
|
|
||||||
<entry name="!?*.groovy" />
|
|
||||||
<entry name="!?*.scala" />
|
|
||||||
<entry name="!?*.flex" />
|
|
||||||
<entry name="!?*.kt" />
|
|
||||||
<entry name="!?*.clj" />
|
|
||||||
<entry name="!?*.aj" />
|
|
||||||
</wildcardResourcePatterns>
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile default="true" name="Default" enabled="false">
|
|
||||||
<processorPath useClasspath="true" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
3
.idea/copyright/profiles_settings.xml
generated
3
.idea/copyright/profiles_settings.xml
generated
@@ -1,3 +0,0 @@
|
|||||||
<component name="CopyrightManager">
|
|
||||||
<settings default="" />
|
|
||||||
</component>
|
|
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@@ -2,8 +2,8 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/aeonwallet.iml" filepath="$PROJECT_DIR$/aeonwallet.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/xmrwallet.iml" filepath="$PROJECT_DIR$/xmrwallet.iml" />
|
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
21
README.md
21
README.md
@@ -1,12 +1,23 @@
|
|||||||
# Monerujo
|
# Monerujo
|
||||||
Another Android Monero Wallet
|
Another Android Monero Wallet for Monero
|
||||||
|
**(not
|
||||||
|
Monero Classic,
|
||||||
|
Monero-Classic,
|
||||||
|
Monero Zero,
|
||||||
|
Monero Original,
|
||||||
|
Monero C,
|
||||||
|
Monero V)**
|
||||||
|
|
||||||
### QUICKSTART
|
### QUICKSTART
|
||||||
- Download the APK for the most current release [here](https://github.com/m2049r/xmrwallet/releases) and install it
|
- Download the APK for the most current release [here](https://github.com/monerujo-io/aeonwallet/releases) and install it
|
||||||
|
- Alternatively add our F-Droid repo https://f-droid.monerujo.io/fdroid/repo with fingerpint ```A8 2C 68 E1 4A F0 AA 6A 2E C2 0E 6B 27 2E FF 25 E5 A0 38 F3 F6 58 84 31 6E 0F 5E 0D 91 E7 B7 13``` to your F-Droid client
|
||||||
- Run the App and select "Generate Wallet" to create a new wallet or recover a wallet
|
- Run the App and select "Generate Wallet" to create a new wallet or recover a wallet
|
||||||
- Advanced users can copy over synced wallet files (all files) onto sdcard in directory Monerujo (created first time App is started)
|
- Advanced users can copy over synced wallet files (all files) onto sdcard in directory Monerujo (created first time App is started)
|
||||||
- See the [FAQ](doc/FAQ.md)
|
- See the [FAQ](doc/FAQ.md)
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
Help us translate Monerujo! You can find instructions [On Taiga](https://taiga.getmonero.org/project/erciccione-monero-localization/wiki/monerujo), and if you need help/support, open an issue or contact the Localization Workgroup. You can find us on the freenode channel `#monero-translations`, also relayed on [MatterMost](https://mattermost.getmonero.org/monero/channels/monero-translations), and matrix/riot.
|
||||||
|
|
||||||
### Disclaimer
|
### Disclaimer
|
||||||
You may lose all your Moneroj if you use this App. Be cautious when spending on the mainnet.
|
You may lose all your Moneroj if you use this App. Be cautious when spending on the mainnet.
|
||||||
|
|
||||||
@@ -23,6 +34,8 @@ You may lose all your Moneroj if you use this App. Be cautious when spending on
|
|||||||
- see taiga.getmonero.org & issues on github
|
- see taiga.getmonero.org & issues on github
|
||||||
|
|
||||||
### Issues / Pitfalls
|
### Issues / Pitfalls
|
||||||
|
- Users of Zenfone MAX & Zenfone 2 Laser (possibly others) **MUST** use the armeabi-v7a APK as the arm64-v8a build uses hardware AES
|
||||||
|
functionality these models don't have.
|
||||||
- You should backup your wallet files in the "monerujo" folder periodically.
|
- You should backup your wallet files in the "monerujo" folder periodically.
|
||||||
- Also note, that on some devices the backups will only be visible on a PC over USB after a reboot of the device (it's an Android bug/feature)
|
- Also note, that on some devices the backups will only be visible on a PC over USB after a reboot of the device (it's an Android bug/feature)
|
||||||
- Created wallets on a private testnet are unusable because the restore height is set to that
|
- Created wallets on a private testnet are unusable because the restore height is set to that
|
||||||
@@ -33,8 +46,8 @@ The official monero client shows the same behaviour.
|
|||||||
No need to build. Binaries are included:
|
No need to build. Binaries are included:
|
||||||
|
|
||||||
- openssl-1.0.2l
|
- openssl-1.0.2l
|
||||||
- monero-v0.11.1.0
|
- monero-v0.12
|
||||||
- boost_1_64_0
|
- boost_1_58_0
|
||||||
|
|
||||||
If you want to build them yourself (recommended) check out [the instructions](doc/BUILDING-external-libs.md)
|
If you want to build them yourself (recommended) check out [the instructions](doc/BUILDING-external-libs.md)
|
||||||
|
|
||||||
|
@@ -60,71 +60,84 @@ set_target_properties(boost_wserialization PROPERTIES IMPORTED_LOCATION
|
|||||||
${EXTERNAL_LIBS_DIR}/boost/lib/${ANDROID_ABI}/libboost_wserialization.a)
|
${EXTERNAL_LIBS_DIR}/boost/lib/${ANDROID_ABI}/libboost_wserialization.a)
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# Monero set(libs_to_merge wallet cryptonote_core cryptonote_basic mnemonics common cncrypto ringct)
|
# Aeon
|
||||||
#############
|
#############
|
||||||
|
|
||||||
|
add_library(wallet_api STATIC IMPORTED)
|
||||||
|
set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION
|
||||||
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libwallet_api.a)
|
||||||
|
|
||||||
add_library(wallet STATIC IMPORTED)
|
add_library(wallet STATIC IMPORTED)
|
||||||
set_target_properties(wallet PROPERTIES IMPORTED_LOCATION
|
set_target_properties(wallet PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libwallet.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libwallet.a)
|
||||||
|
|
||||||
add_library(cryptonote_core STATIC IMPORTED)
|
add_library(cryptonote_core STATIC IMPORTED)
|
||||||
set_target_properties(cryptonote_core PROPERTIES IMPORTED_LOCATION
|
set_target_properties(cryptonote_core PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libcryptonote_core.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcryptonote_core.a)
|
||||||
|
|
||||||
add_library(cryptonote_basic STATIC IMPORTED)
|
add_library(cryptonote_basic STATIC IMPORTED)
|
||||||
set_target_properties(cryptonote_basic PROPERTIES IMPORTED_LOCATION
|
set_target_properties(cryptonote_basic PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libcryptonote_basic.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcryptonote_basic.a)
|
||||||
|
|
||||||
add_library(mnemonics STATIC IMPORTED)
|
add_library(mnemonics STATIC IMPORTED)
|
||||||
set_target_properties(mnemonics PROPERTIES IMPORTED_LOCATION
|
set_target_properties(mnemonics PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libmnemonics.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libmnemonics.a)
|
||||||
|
|
||||||
add_library(common STATIC IMPORTED)
|
add_library(common STATIC IMPORTED)
|
||||||
set_target_properties(common PROPERTIES IMPORTED_LOCATION
|
set_target_properties(common PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libcommon.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcommon.a)
|
||||||
|
|
||||||
add_library(cncrypto STATIC IMPORTED)
|
add_library(cncrypto STATIC IMPORTED)
|
||||||
set_target_properties(cncrypto PROPERTIES IMPORTED_LOCATION
|
set_target_properties(cncrypto PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libcncrypto.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcncrypto.a)
|
||||||
|
|
||||||
add_library(ringct STATIC IMPORTED)
|
add_library(ringct STATIC IMPORTED)
|
||||||
set_target_properties(ringct PROPERTIES IMPORTED_LOCATION
|
set_target_properties(ringct PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libringct.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libringct.a)
|
||||||
|
|
||||||
#####
|
add_library(ringct_basic STATIC IMPORTED)
|
||||||
|
set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION
|
||||||
add_library(p2p STATIC IMPORTED)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libringct_basic.a)
|
||||||
set_target_properties(p2p PROPERTIES IMPORTED_LOCATION
|
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libp2p.a)
|
|
||||||
|
|
||||||
add_library(blockchain_db STATIC IMPORTED)
|
add_library(blockchain_db STATIC IMPORTED)
|
||||||
set_target_properties(blockchain_db PROPERTIES IMPORTED_LOCATION
|
set_target_properties(blockchain_db PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libblockchain_db.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libblockchain_db.a)
|
||||||
|
|
||||||
add_library(lmdb STATIC IMPORTED)
|
add_library(lmdb STATIC IMPORTED)
|
||||||
set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION
|
set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/liblmdb.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/liblmdb.a)
|
||||||
|
|
||||||
add_library(easylogging STATIC IMPORTED)
|
add_library(easylogging STATIC IMPORTED)
|
||||||
set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION
|
set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libeasylogging.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libeasylogging.a)
|
||||||
|
|
||||||
add_library(unbound STATIC IMPORTED)
|
add_library(unbound STATIC IMPORTED)
|
||||||
set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
|
set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libunbound.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libunbound.a)
|
||||||
|
|
||||||
####
|
|
||||||
add_library(epee STATIC IMPORTED)
|
add_library(epee STATIC IMPORTED)
|
||||||
set_target_properties(epee PROPERTIES IMPORTED_LOCATION
|
set_target_properties(epee PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libepee.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libepee.a)
|
||||||
|
|
||||||
add_library(blocks STATIC IMPORTED)
|
add_library(blocks STATIC IMPORTED)
|
||||||
set_target_properties(blocks PROPERTIES IMPORTED_LOCATION
|
set_target_properties(blocks PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libblocks.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libblocks.a)
|
||||||
|
|
||||||
add_library(miniupnpc STATIC IMPORTED)
|
add_library(checkpoints STATIC IMPORTED)
|
||||||
set_target_properties(miniupnpc PROPERTIES IMPORTED_LOCATION
|
set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libminiupnpc.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcheckpoints.a)
|
||||||
|
|
||||||
|
add_library(device STATIC IMPORTED)
|
||||||
|
set_target_properties(device PROPERTIES IMPORTED_LOCATION
|
||||||
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libdevice.a)
|
||||||
|
|
||||||
|
add_library(multisig STATIC IMPORTED)
|
||||||
|
set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
|
||||||
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libmultisig.a)
|
||||||
|
|
||||||
|
add_library(version STATIC IMPORTED)
|
||||||
|
set_target_properties(version PROPERTIES IMPORTED_LOCATION
|
||||||
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libversion.a)
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# System
|
# System
|
||||||
@@ -132,28 +145,31 @@ set_target_properties(miniupnpc PROPERTIES IMPORTED_LOCATION
|
|||||||
|
|
||||||
find_library( log-lib log )
|
find_library( log-lib log )
|
||||||
|
|
||||||
include_directories( ${EXTERNAL_LIBS_DIR}/monero/include )
|
include_directories( ${EXTERNAL_LIBS_DIR}/aeon/include )
|
||||||
|
|
||||||
message(STATUS EXTERNAL_LIBS_DIR : ${EXTERNAL_LIBS_DIR})
|
message(STATUS EXTERNAL_LIBS_DIR : ${EXTERNAL_LIBS_DIR})
|
||||||
|
|
||||||
target_link_libraries( monerujo
|
target_link_libraries( monerujo
|
||||||
|
|
||||||
|
wallet_api
|
||||||
wallet
|
wallet
|
||||||
cryptonote_core
|
cryptonote_core
|
||||||
cryptonote_basic
|
cryptonote_basic
|
||||||
mnemonics
|
mnemonics
|
||||||
ringct
|
ringct
|
||||||
|
ringct_basic
|
||||||
common
|
common
|
||||||
cncrypto
|
cncrypto
|
||||||
|
|
||||||
blockchain_db
|
blockchain_db
|
||||||
lmdb
|
lmdb
|
||||||
easylogging
|
easylogging
|
||||||
unbound
|
unbound
|
||||||
p2p
|
|
||||||
|
|
||||||
epee
|
epee
|
||||||
blocks
|
blocks
|
||||||
miniupnpc
|
checkpoints
|
||||||
|
device
|
||||||
|
multisig
|
||||||
|
version
|
||||||
|
|
||||||
boost_chrono
|
boost_chrono
|
||||||
boost_date_time
|
boost_date_time
|
||||||
|
@@ -1,15 +1,14 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'witness'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 25
|
||||||
buildToolsVersion '26.0.2'
|
buildToolsVersion '27.0.3'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.m2049r.xmrwallet"
|
applicationId "com.m2049r.aeonwallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 74
|
versionCode 10
|
||||||
versionName "1.3.14 'Satoshis Dream'"
|
versionName "0.1.0 'Rebase ALPHA'"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
@@ -17,9 +16,6 @@ android {
|
|||||||
arguments '-DANDROID_STL=c++_shared'
|
arguments '-DANDROID_STL=c++_shared'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ndk {
|
|
||||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -42,7 +38,7 @@ android {
|
|||||||
enable true
|
enable true
|
||||||
reset()
|
reset()
|
||||||
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
universalApk false
|
universalApk true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,57 +48,34 @@ android {
|
|||||||
// APKs for the same app that all have the same version information.
|
// APKs for the same app that all have the same version information.
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
// Assigns a different version code for each output APK.
|
// Assigns a different version code for each output APK.
|
||||||
variant.outputs.each {
|
variant.outputs.all {
|
||||||
output ->
|
output ->
|
||||||
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
|
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
|
||||||
output.versionCodeOverride = abiCodes.get(abiName, 0) + 10 * variant.versionCode
|
output.versionCodeOverride = abiCodes.get(abiName, 0) + 10 * variant.versionCode
|
||||||
|
|
||||||
|
if (abiName == null) abiName = "universal"
|
||||||
|
def v = "${variant.versionName}".replaceFirst(" .*\$", "").replace(".", "x")
|
||||||
|
outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:appcompat-v7:25.4.0'
|
implementation 'com.android.support:appcompat-v7:25.4.0'
|
||||||
compile 'com.android.support:design:25.4.0'
|
implementation 'com.android.support:design:25.4.0'
|
||||||
compile 'com.android.support:support-v4:25.4.0'
|
implementation 'com.android.support:support-v4:25.4.0'
|
||||||
compile 'com.android.support:recyclerview-v7:25.4.0'
|
implementation 'com.android.support:recyclerview-v7:25.4.0'
|
||||||
compile 'com.android.support:cardview-v7:25.4.0'
|
implementation 'com.android.support:cardview-v7:25.4.0'
|
||||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
||||||
compile 'me.dm7.barcodescanner:zxing:1.9.8'
|
|
||||||
|
|
||||||
compile "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
|
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
|
||||||
compile "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
|
implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
|
||||||
|
|
||||||
compile 'com.nulab-inc:zxcvbn:1.2.3'
|
implementation 'com.nulab-inc:zxcvbn:1.2.3'
|
||||||
|
|
||||||
testCompile "junit:junit:$rootProject.ext.junitVersion"
|
testImplementation "junit:junit:$rootProject.ext.junitVersion"
|
||||||
testCompile "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
|
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
|
||||||
testCompile "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
|
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
|
||||||
testCompile 'org.json:json:20140107'
|
testImplementation 'org.json:json:20140107'
|
||||||
testCompile 'net.jodah:concurrentunit:0.4.2'
|
testImplementation 'net.jodah:concurrentunit:0.4.2'
|
||||||
}
|
|
||||||
|
|
||||||
dependencyVerification {
|
|
||||||
verify = [
|
|
||||||
'com.android.support:design:3f409bf2019967ffc344cfaf11e52131fac982468a1707aaeb25bf3c52838966',
|
|
||||||
'com.android.support:appcompat-v7:70551e62660db15b790c5275f56b9de4dd9407d1494d07c8f3dd5698f3638677',
|
|
||||||
'com.android.support:transition:848270144fb180efd2bf928a00ed176dbbc5290badfd638390ffba90088df8b3',
|
|
||||||
'me.dm7.barcodescanner:zxing:d43973c9527c23fa8e6d338c6a2c458e373ce1ac6bcaa3bc41d11ae49116000d',
|
|
||||||
'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
|
|
||||||
'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:animated-vector-drawable:628ab1d56a6ee4cbedf32617af8b2a1fe02964ed0628e8f898cc09ddba6e1835',
|
|
||||||
'com.android.support:support-vector-drawable:077009d13882ee96f061e4bc2dbe7cce7ae1762d8297592a787ff741afbfb1f2',
|
|
||||||
'com.android.support:support-fragment:316d35d4d2d2902057efad104a73e4bdb50bee260a7075678185b8cd71170945',
|
|
||||||
'com.android.support:support-core-ui:e72ae29b823889686cff6fcb948d6745c2baf6d4c2af4fdffa1ec1e42e3833a3',
|
|
||||||
'com.android.support:support-media-compat:566a161d9cb0083ef62a53e46b71ce5b3d455b8635b1a0a4ae28d96d4b583de8',
|
|
||||||
'com.android.support:support-core-utils:34b8437dfa95ff28d29cf57ffa3b1354a9fa9bfe4059f0fd5ce2f5e4326a1748',
|
|
||||||
'com.android.support:support-compat:54019c63614ce08b02d7b9605490cd2b29ba5b2505f394a9517450b5f72b30ca',
|
|
||||||
'com.android.support:support-annotations:a774272036941b4e912eb426d70c848bde7f06a3bf5fb491f75a427dc6595270',
|
|
||||||
'com.android.support.constraint:constraint-layout-solver:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d',
|
|
||||||
'com.google.zxing:core:bba7724e02a997cec38213af77133ee8e24b0d5cf5fa7ecbc16a4fa93f11ee0d',
|
|
||||||
'com.squareup.okio:okio:734269c3ebc5090e3b23566db558f421f0b4027277c79ad5d176b8ec168bb850',
|
|
||||||
'com.squareup.okhttp3:okhttp:7265adbd6f028aade307f58569d814835cd02bc9beffb70c25f72c9de50d61c4',
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">monerujo - Debug</string>
|
<string name="app_name" translatable="false">monerujoAE</string>
|
||||||
</resources>
|
</resources>
|
@@ -1,12 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.m2049r.xmrwallet">
|
package="com.m2049r.aeonwallet">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
android:name=".service.WalletService"
|
android:name=".service.WalletService"
|
||||||
android:description="@string/service_description"
|
android:description="@string/service_description"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="Monero Wallet Service" />
|
android:label="Wallet Service" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@
|
|||||||
#define XMRWALLET_WALLET_LIB_H
|
#define XMRWALLET_WALLET_LIB_H
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
|
||||||
@@ -27,13 +28,13 @@
|
|||||||
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
|
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
jfieldID getHandleField(JNIEnv *env, jobject obj, const char* fieldName = "handle") {
|
jfieldID getHandleField(JNIEnv *env, jobject obj, const char *fieldName = "handle") {
|
||||||
jclass c = env->GetObjectClass(obj);
|
jclass c = env->GetObjectClass(obj);
|
||||||
return env->GetFieldID(c, fieldName, "J"); // of type long
|
return env->GetFieldID(c, fieldName, "J"); // of type long
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template<typename T>
|
||||||
T *getHandle(JNIEnv *env, jobject obj, const char* fieldName = "handle") {
|
T *getHandle(JNIEnv *env, jobject obj, const char *fieldName = "handle") {
|
||||||
jlong handle = env->GetLongField(obj, getHandleField(env, obj, fieldName));
|
jlong handle = env->GetLongField(obj, getHandleField(env, obj, fieldName));
|
||||||
return reinterpret_cast<T *>(handle);
|
return reinterpret_cast<T *>(handle);
|
||||||
}
|
}
|
||||||
@@ -42,10 +43,30 @@ void setHandleFromLong(JNIEnv *env, jobject obj, jlong handle) {
|
|||||||
env->SetLongField(obj, getHandleField(env, obj), handle);
|
env->SetLongField(obj, getHandleField(env, obj), handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template<typename T>
|
||||||
void setHandle(JNIEnv *env, jobject obj, T *t) {
|
void setHandle(JNIEnv *env, jobject obj, T *t) {
|
||||||
jlong handle = reinterpret_cast<jlong>(t);
|
jlong handle = reinterpret_cast<jlong>(t);
|
||||||
setHandleFromLong(env, obj, handle);
|
setHandleFromLong(env, obj, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// from monero-core crypto/hash-ops.h - avoid #including monero code here
|
||||||
|
enum {
|
||||||
|
HASH_SIZE = 32,
|
||||||
|
HASH_DATA_AREA = 136
|
||||||
|
};
|
||||||
|
|
||||||
|
void cn_slow_hash(const void *data, size_t length, char *hash, int light, int variant, int prehashed);
|
||||||
|
inline void slow_hash(const void *data, const size_t length, char *hash) {
|
||||||
|
cn_slow_hash(data, length, hash, 0 /*light*/, 0 /* variant */, 0/*prehashed*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif //XMRWALLET_WALLET_LIB_H
|
#endif //XMRWALLET_WALLET_LIB_H
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 64 KiB |
@@ -14,14 +14,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.design.widget.TextInputLayout;
|
import android.support.design.widget.TextInputLayout;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -32,20 +35,23 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.util.RestoreHeight;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.aeonwallet.model.WalletManager;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.util.FingerprintHelper;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.KeyStoreHelper;
|
||||||
|
import com.m2049r.aeonwallet.util.RestoreHeight;
|
||||||
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
import com.nulabinc.zxcvbn.Strength;
|
import com.nulabinc.zxcvbn.Strength;
|
||||||
import com.nulabinc.zxcvbn.Zxcvbn;
|
import com.nulabinc.zxcvbn.Zxcvbn;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
@@ -59,6 +65,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
private TextInputLayout etWalletName;
|
private TextInputLayout etWalletName;
|
||||||
private TextInputLayout etWalletPassword;
|
private TextInputLayout etWalletPassword;
|
||||||
|
private LinearLayout llFingerprintAuth;
|
||||||
private TextInputLayout etWalletAddress;
|
private TextInputLayout etWalletAddress;
|
||||||
private TextInputLayout etWalletMnemonic;
|
private TextInputLayout etWalletMnemonic;
|
||||||
private TextInputLayout etWalletViewKey;
|
private TextInputLayout etWalletViewKey;
|
||||||
@@ -79,6 +86,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
etWalletName = (TextInputLayout) view.findViewById(R.id.etWalletName);
|
etWalletName = (TextInputLayout) view.findViewById(R.id.etWalletName);
|
||||||
etWalletPassword = (TextInputLayout) view.findViewById(R.id.etWalletPassword);
|
etWalletPassword = (TextInputLayout) view.findViewById(R.id.etWalletPassword);
|
||||||
|
llFingerprintAuth = (LinearLayout) view.findViewById(R.id.llFingerprintAuth);
|
||||||
etWalletMnemonic = (TextInputLayout) view.findViewById(R.id.etWalletMnemonic);
|
etWalletMnemonic = (TextInputLayout) view.findViewById(R.id.etWalletMnemonic);
|
||||||
etWalletAddress = (TextInputLayout) view.findViewById(R.id.etWalletAddress);
|
etWalletAddress = (TextInputLayout) view.findViewById(R.id.etWalletAddress);
|
||||||
etWalletViewKey = (TextInputLayout) view.findViewById(R.id.etWalletViewKey);
|
etWalletViewKey = (TextInputLayout) view.findViewById(R.id.etWalletViewKey);
|
||||||
@@ -146,6 +154,30 @@ public class GenerateFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (FingerprintHelper.isDeviceSupported(getContext())) {
|
||||||
|
llFingerprintAuth.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
final Switch swFingerprintAllowed = (Switch) llFingerprintAuth.getChildAt(0);
|
||||||
|
swFingerprintAllowed.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (!swFingerprintAllowed.isChecked()) return;
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
builder.setMessage(Html.fromHtml(getString(R.string.generate_fingerprint_warn)))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.label_ok), null)
|
||||||
|
.setNegativeButton(getString(R.string.label_cancel), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
swFingerprintAllowed.setChecked(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (type.equals(TYPE_NEW)) {
|
if (type.equals(TYPE_NEW)) {
|
||||||
etWalletPassword.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
|
etWalletPassword.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@@ -375,7 +407,8 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
private boolean checkMnemonic() {
|
private boolean checkMnemonic() {
|
||||||
String seed = etWalletMnemonic.getEditText().getText().toString();
|
String seed = etWalletMnemonic.getEditText().getText().toString();
|
||||||
boolean ok = (seed.split("\\s").length == 25); // 25 words
|
int seedWords = seed.split("\\s").length;
|
||||||
|
boolean ok = ((seedWords == 25) || (seedWords == 24)); // 24 are old style
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
etWalletMnemonic.setError(getString(R.string.generate_check_mnemonic));
|
etWalletMnemonic.setError(getString(R.string.generate_check_mnemonic));
|
||||||
} else {
|
} else {
|
||||||
@@ -386,7 +419,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
private boolean checkAddress() {
|
private boolean checkAddress() {
|
||||||
String address = etWalletAddress.getEditText().getText().toString();
|
String address = etWalletAddress.getEditText().getText().toString();
|
||||||
boolean ok = Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet());
|
boolean ok = Wallet.isAddressValid(address);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
etWalletAddress.setError(getString(R.string.generate_check_address));
|
etWalletAddress.setError(getString(R.string.generate_check_address));
|
||||||
} else {
|
} else {
|
||||||
@@ -423,18 +456,28 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
String name = etWalletName.getEditText().getText().toString();
|
String name = etWalletName.getEditText().getText().toString();
|
||||||
String password = etWalletPassword.getEditText().getText().toString();
|
String password = etWalletPassword.getEditText().getText().toString();
|
||||||
|
boolean fingerprintAuthAllowed = ((Switch) llFingerprintAuth.getChildAt(0)).isChecked();
|
||||||
|
|
||||||
|
// create the real wallet password
|
||||||
|
String crazyPass = KeyStoreHelper.getCrazyPass(getActivity(), password);
|
||||||
|
|
||||||
long height = getHeight();
|
long height = getHeight();
|
||||||
if (height < 0) height = 0;
|
if (height < 0) height = 0;
|
||||||
|
|
||||||
if (type.equals(TYPE_NEW)) {
|
if (type.equals(TYPE_NEW)) {
|
||||||
bGenerate.setEnabled(false);
|
bGenerate.setEnabled(false);
|
||||||
activityCallback.onGenerate(name, password);
|
if (fingerprintAuthAllowed) {
|
||||||
|
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
||||||
|
}
|
||||||
|
activityCallback.onGenerate(name, crazyPass);
|
||||||
} else if (type.equals(TYPE_SEED)) {
|
} else if (type.equals(TYPE_SEED)) {
|
||||||
if (!checkMnemonic()) return;
|
if (!checkMnemonic()) return;
|
||||||
String seed = etWalletMnemonic.getEditText().getText().toString();
|
String seed = etWalletMnemonic.getEditText().getText().toString();
|
||||||
bGenerate.setEnabled(false);
|
bGenerate.setEnabled(false);
|
||||||
activityCallback.onGenerate(name, password, seed, height);
|
if (fingerprintAuthAllowed) {
|
||||||
|
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
||||||
|
}
|
||||||
|
activityCallback.onGenerate(name, crazyPass, seed, height);
|
||||||
} else if (type.equals(TYPE_KEY) || type.equals(TYPE_VIEWONLY)) {
|
} else if (type.equals(TYPE_KEY) || type.equals(TYPE_VIEWONLY)) {
|
||||||
if (checkAddress() && checkViewKey() && checkSpendKey()) {
|
if (checkAddress() && checkViewKey() && checkSpendKey()) {
|
||||||
bGenerate.setEnabled(false);
|
bGenerate.setEnabled(false);
|
||||||
@@ -444,7 +487,10 @@ public class GenerateFragment extends Fragment {
|
|||||||
if (type.equals(TYPE_KEY)) {
|
if (type.equals(TYPE_KEY)) {
|
||||||
spendKey = etWalletSpendKey.getEditText().getText().toString();
|
spendKey = etWalletSpendKey.getEditText().getText().toString();
|
||||||
}
|
}
|
||||||
activityCallback.onGenerate(name, password, address, viewKey, spendKey, height);
|
if (fingerprintAuthAllowed) {
|
||||||
|
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
||||||
|
}
|
||||||
|
activityCallback.onGenerate(name, crazyPass, address, viewKey, spendKey, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
public interface OnBackPressedListener {
|
public interface OnBackPressedListener {
|
||||||
boolean onBackPressed();
|
boolean onBackPressed();
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
@@ -46,13 +46,13 @@ import com.google.zxing.WriterException;
|
|||||||
import com.google.zxing.common.BitMatrix;
|
import com.google.zxing.common.BitMatrix;
|
||||||
import com.google.zxing.qrcode.QRCodeWriter;
|
import com.google.zxing.qrcode.QRCodeWriter;
|
||||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||||
import com.m2049r.xmrwallet.data.BarcodeData;
|
import com.m2049r.aeonwallet.data.BarcodeData;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
import com.m2049r.aeonwallet.model.WalletManager;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
|
import com.m2049r.aeonwallet.util.MoneroThreadPoolExecutor;
|
||||||
import com.m2049r.xmrwallet.widget.ExchangeView;
|
import com.m2049r.aeonwallet.widget.ExchangeView;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -300,7 +300,7 @@ public class ReceiveFragment extends Fragment {
|
|||||||
String paymentId = etPaymentId.getEditText().getText().toString();
|
String paymentId = etPaymentId.getEditText().getText().toString();
|
||||||
String xmrAmount = evAmount.getAmount();
|
String xmrAmount = evAmount.getAmount();
|
||||||
Timber.d("%s/%s/%s", xmrAmount, paymentId, address);
|
Timber.d("%s/%s/%s", xmrAmount, paymentId, address);
|
||||||
if ((xmrAmount == null) || !Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
|
if ((xmrAmount == null) || !Wallet.isAddressValid(address)) {
|
||||||
clearQR();
|
clearQR();
|
||||||
Timber.d("CLEARQR");
|
Timber.d("CLEARQR");
|
||||||
return;
|
return;
|
||||||
@@ -335,6 +335,7 @@ public class ReceiveFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap generate(String text, int width, int height) {
|
public Bitmap generate(String text, int width, int height) {
|
||||||
|
if ((width <= 0) || (height <= 0)) return null;
|
||||||
Map<EncodeHintType, Object> hints = new HashMap<>();
|
Map<EncodeHintType, Object> hints = new HashMap<>();
|
||||||
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
|
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
|
||||||
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
|
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
|
||||||
@@ -386,7 +387,7 @@ public class ReceiveFragment extends Fragment {
|
|||||||
|
|
||||||
private Bitmap getMoneroLogo() {
|
private Bitmap getMoneroLogo() {
|
||||||
if (logo == null) {
|
if (logo == null) {
|
||||||
logo = Helper.getBitmap(getContext(), R.drawable.ic_monero_logo_b);
|
logo = Helper.getBitmap(getContext(), R.mipmap.ic_launcher);
|
||||||
}
|
}
|
||||||
return logo;
|
return logo;
|
||||||
}
|
}
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
@@ -14,13 +14,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -30,14 +30,12 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
import com.m2049r.aeonwallet.model.TransactionInfo;
|
||||||
import com.m2049r.xmrwallet.model.Transfer;
|
import com.m2049r.aeonwallet.model.Transfer;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.UserNotes;
|
||||||
import com.m2049r.xmrwallet.util.UserNotes;
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -71,23 +69,12 @@ public class TxFragment extends Fragment {
|
|||||||
private TextView etTxNotes;
|
private TextView etTxNotes;
|
||||||
private Button bTxNotes;
|
private Button bTxNotes;
|
||||||
|
|
||||||
// XMRTO stuff
|
|
||||||
private View cvXmrTo;
|
|
||||||
private TextView tvTxXmrToKey;
|
|
||||||
private TextView tvDestinationBtc;
|
|
||||||
private TextView tvTxAmountBtc;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_tx_info, container, false);
|
View view = inflater.inflate(R.layout.fragment_tx_info, container, false);
|
||||||
|
|
||||||
cvXmrTo = view.findViewById(R.id.cvXmrTo);
|
|
||||||
tvTxXmrToKey = (TextView) view.findViewById(R.id.tvTxXmrToKey);
|
|
||||||
tvDestinationBtc = (TextView) view.findViewById(R.id.tvDestinationBtc);
|
|
||||||
tvTxAmountBtc = (TextView) view.findViewById(R.id.tvTxAmountBtc);
|
|
||||||
|
|
||||||
tvTxTimestamp = (TextView) view.findViewById(R.id.tvTxTimestamp);
|
tvTxTimestamp = (TextView) view.findViewById(R.id.tvTxTimestamp);
|
||||||
tvTxId = (TextView) view.findViewById(R.id.tvTxId);
|
tvTxId = (TextView) view.findViewById(R.id.tvTxId);
|
||||||
tvTxKey = (TextView) view.findViewById(R.id.tvTxKey);
|
tvTxKey = (TextView) view.findViewById(R.id.tvTxKey);
|
||||||
@@ -113,14 +100,6 @@ public class TxFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
tvTxXmrToKey.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
Helper.clipBoardCopy(getActivity(), getString(R.string.label_copy_xmrtokey), tvTxXmrToKey.getText().toString());
|
|
||||||
Toast.makeText(getActivity(), getString(R.string.message_copy_xmrtokey), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
TransactionInfo info = args.getParcelable(ARG_INFO);
|
TransactionInfo info = args.getParcelable(ARG_INFO);
|
||||||
show(info);
|
show(info);
|
||||||
@@ -291,21 +270,8 @@ public class TxFragment extends Fragment {
|
|||||||
tvTxTransfers.setText(sb.toString());
|
tvTxTransfers.setText(sb.toString());
|
||||||
tvDestination.setText(dstSb.toString());
|
tvDestination.setText(dstSb.toString());
|
||||||
this.info = info;
|
this.info = info;
|
||||||
showBtcInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void showBtcInfo() {
|
|
||||||
if (userNotes.xmrtoKey != null) {
|
|
||||||
cvXmrTo.setVisibility(View.VISIBLE);
|
|
||||||
tvTxXmrToKey.setText(userNotes.xmrtoKey);
|
|
||||||
tvDestinationBtc.setText(userNotes.xmrtoDestination);
|
|
||||||
tvTxAmountBtc.setText(userNotes.xmrtoAmount + " BTC");
|
|
||||||
} else {
|
|
||||||
cvXmrTo.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -34,22 +34,20 @@ import android.support.v4.app.FragmentTransaction;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.data.BarcodeData;
|
import com.m2049r.aeonwallet.data.BarcodeData;
|
||||||
import com.m2049r.xmrwallet.data.TxData;
|
import com.m2049r.aeonwallet.data.TxData;
|
||||||
import com.m2049r.xmrwallet.dialog.DonationFragment;
|
import com.m2049r.aeonwallet.dialog.CreditsFragment;
|
||||||
import com.m2049r.xmrwallet.dialog.HelpFragment;
|
import com.m2049r.aeonwallet.dialog.HelpFragment;
|
||||||
import com.m2049r.xmrwallet.fragment.send.SendAddressWizardFragment;
|
import com.m2049r.aeonwallet.fragment.send.SendAddressWizardFragment;
|
||||||
import com.m2049r.xmrwallet.fragment.send.SendFragment;
|
import com.m2049r.aeonwallet.fragment.send.SendFragment;
|
||||||
import com.m2049r.xmrwallet.model.PendingTransaction;
|
import com.m2049r.aeonwallet.model.PendingTransaction;
|
||||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
import com.m2049r.aeonwallet.model.TransactionInfo;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
import com.m2049r.aeonwallet.model.WalletManager;
|
||||||
import com.m2049r.xmrwallet.service.WalletService;
|
import com.m2049r.aeonwallet.service.WalletService;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.UserNotes;
|
import com.m2049r.aeonwallet.util.UserNotes;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
@@ -57,13 +55,28 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
WalletService.Observer, SendFragment.Listener, TxFragment.Listener,
|
WalletService.Observer, SendFragment.Listener, TxFragment.Listener,
|
||||||
GenerateReviewFragment.ListenerWithWallet,
|
GenerateReviewFragment.ListenerWithWallet,
|
||||||
GenerateReviewFragment.Listener,
|
GenerateReviewFragment.Listener,
|
||||||
|
GenerateReviewFragment.PasswordChangedListener,
|
||||||
ScannerFragment.OnScannedListener, ReceiveFragment.Listener,
|
ScannerFragment.OnScannedListener, ReceiveFragment.Listener,
|
||||||
SendAddressWizardFragment.OnScanListener {
|
SendAddressWizardFragment.OnScanListener {
|
||||||
|
|
||||||
public static final String REQUEST_ID = "id";
|
public static final String REQUEST_ID = "id";
|
||||||
public static final String REQUEST_PW = "pw";
|
public static final String REQUEST_PW = "pw";
|
||||||
|
public static final String REQUEST_FINGERPRINT_USED = "fingerprint";
|
||||||
|
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
|
private boolean needVerifyIdentity;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPasswordChanged(String newPassword) {
|
||||||
|
password = newPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setToolbarButton(int type) {
|
public void setToolbarButton(int type) {
|
||||||
@@ -119,8 +132,9 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
if (extras != null) {
|
if (extras != null) {
|
||||||
acquireWakeLock();
|
acquireWakeLock();
|
||||||
String walletId = extras.getString(REQUEST_ID);
|
String walletId = extras.getString(REQUEST_ID);
|
||||||
String walletPassword = extras.getString(REQUEST_PW);
|
needVerifyIdentity = extras.getBoolean(REQUEST_FINGERPRINT_USED);
|
||||||
connectWalletService(walletId, walletPassword);
|
password = extras.getString(REQUEST_PW);
|
||||||
|
connectWalletService(walletId, password);
|
||||||
} else {
|
} else {
|
||||||
finish();
|
finish();
|
||||||
//throw new IllegalStateException("No extras passed! Panic!");
|
//throw new IllegalStateException("No extras passed! Panic!");
|
||||||
@@ -159,8 +173,8 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
case R.id.action_info:
|
case R.id.action_info:
|
||||||
onWalletDetails();
|
onWalletDetails();
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_donate:
|
case R.id.action_credits:
|
||||||
DonationFragment.display(getSupportFragmentManager());
|
CreditsFragment.display(getSupportFragmentManager());
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_share:
|
case R.id.action_share:
|
||||||
onShareTxInfo();
|
onShareTxInfo();
|
||||||
@@ -174,6 +188,9 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
case R.id.action_details_help:
|
case R.id.action_details_help:
|
||||||
HelpFragment.display(getSupportFragmentManager(), R.string.help_details);
|
HelpFragment.display(getSupportFragmentManager(), R.string.help_details);
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.action_details_changepw:
|
||||||
|
onWalletChangePassword();
|
||||||
|
return true;
|
||||||
case R.id.action_help_send:
|
case R.id.action_help_send:
|
||||||
HelpFragment.display(getSupportFragmentManager(), R.string.help_send);
|
HelpFragment.display(getSupportFragmentManager(), R.string.help_send);
|
||||||
return true;
|
return true;
|
||||||
@@ -182,6 +199,20 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onWalletChangePassword() {
|
||||||
|
try {
|
||||||
|
GenerateReviewFragment detailsFragment = (GenerateReviewFragment)
|
||||||
|
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||||
|
AlertDialog dialog = detailsFragment.createChangePasswordDialog();
|
||||||
|
if (dialog != null) {
|
||||||
|
Helper.showKeyboard(dialog);
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
} catch (ClassCastException ex) {
|
||||||
|
Timber.w("onWalletChangePassword() called, but no GenerateReviewFragment active");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Timber.d("onCreate()");
|
Timber.d("onCreate()");
|
||||||
@@ -213,8 +244,8 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
case Toolbar.BUTTON_CLOSE:
|
case Toolbar.BUTTON_CLOSE:
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
case Toolbar.BUTTON_DONATE:
|
case Toolbar.BUTTON_CREDITS:
|
||||||
Toast.makeText(WalletActivity.this, getString(R.string.label_donate), Toast.LENGTH_SHORT).show();
|
Toast.makeText(WalletActivity.this, getString(R.string.label_credits), Toast.LENGTH_SHORT).show();
|
||||||
case Toolbar.BUTTON_NONE:
|
case Toolbar.BUTTON_NONE:
|
||||||
default:
|
default:
|
||||||
Timber.e("Button " + type + "pressed - how can this be?");
|
Timber.e("Button " + type + "pressed - how can this be?");
|
||||||
@@ -222,12 +253,7 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
boolean testnet = WalletManager.getInstance().isTestNet();
|
showNet();
|
||||||
if (testnet) {
|
|
||||||
toolbar.setBackgroundResource(R.color.colorPrimaryDark);
|
|
||||||
} else {
|
|
||||||
toolbar.setBackgroundResource(R.drawable.backgound_toolbar_mainnet);
|
|
||||||
}
|
|
||||||
|
|
||||||
Fragment walletFragment = new WalletFragment();
|
Fragment walletFragment = new WalletFragment();
|
||||||
getSupportFragmentManager().beginTransaction()
|
getSupportFragmentManager().beginTransaction()
|
||||||
@@ -238,6 +264,23 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
Timber.d("onCreate() done.");
|
Timber.d("onCreate() done.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showNet() {
|
||||||
|
switch (WalletManager.getInstance().getNetworkType()) {
|
||||||
|
case NetworkType_Mainnet:
|
||||||
|
toolbar.setBackgroundResource(R.drawable.backgound_toolbar_mainnet);
|
||||||
|
break;
|
||||||
|
case NetworkType_Testnet:
|
||||||
|
toolbar.setBackgroundResource(R.color.colorPrimaryDark);
|
||||||
|
break;
|
||||||
|
case NetworkType_Stagenet:
|
||||||
|
toolbar.setBackgroundResource(R.color.colorPrimaryDark);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("Unsupported Network: " + WalletManager.getInstance().getNetworkType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Wallet getWallet() {
|
public Wallet getWallet() {
|
||||||
if (mBoundService == null) throw new IllegalStateException("WalletService not bound.");
|
if (mBoundService == null) throw new IllegalStateException("WalletService not bound.");
|
||||||
return mBoundService.getWallet();
|
return mBoundService.getWallet();
|
||||||
@@ -368,7 +411,17 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSendRequest() {
|
public void onSendRequest() {
|
||||||
replaceFragment(new SendFragment(), null, null);
|
if (needVerifyIdentity) {
|
||||||
|
Helper.promptPassword(WalletActivity.this, getWallet().getName(), true, new Helper.PasswordAction() {
|
||||||
|
@Override
|
||||||
|
public void action(String walletName, String password, boolean fingerprintUsed) {
|
||||||
|
replaceFragment(new SendFragment(), null, null);
|
||||||
|
needVerifyIdentity = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
replaceFragment(new SendFragment(), null, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -668,9 +721,21 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case DialogInterface.BUTTON_POSITIVE:
|
case DialogInterface.BUTTON_POSITIVE:
|
||||||
Bundle extras = new Bundle();
|
final Bundle extras = new Bundle();
|
||||||
extras.putString("type", GenerateReviewFragment.VIEW_TYPE_WALLET);
|
extras.putString(GenerateReviewFragment.REQUEST_TYPE, GenerateReviewFragment.VIEW_TYPE_WALLET);
|
||||||
replaceFragment(new GenerateReviewFragment(), null, extras);
|
|
||||||
|
if (needVerifyIdentity) {
|
||||||
|
Helper.promptPassword(WalletActivity.this, getWallet().getName(), true, new Helper.PasswordAction() {
|
||||||
|
@Override
|
||||||
|
public void action(String walletName, String password, boolean fingerprintUsed) {
|
||||||
|
replaceFragment(new GenerateReviewFragment(), null, extras);
|
||||||
|
needVerifyIdentity = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
replaceFragment(new GenerateReviewFragment(), null, extras);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DialogInterface.BUTTON_NEGATIVE:
|
case DialogInterface.BUTTON_NEGATIVE:
|
||||||
// do nothing
|
// do nothing
|
||||||
@@ -798,9 +863,8 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean verifyWalletPassword(String password) {
|
public boolean verifyWalletPassword(String password) {
|
||||||
String walletPath = new File(Helper.getStorageRoot(this),
|
String walletPassword = Helper.getWalletPassword(getApplicationContext(), getWalletName(), password);
|
||||||
getWalletName() + ".keys").getAbsolutePath();
|
return walletPassword != null;
|
||||||
return WalletManager.getInstance().verifyWalletPassword(walletPath, password, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -37,16 +37,16 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.layout.TransactionInfoAdapter;
|
import com.m2049r.aeonwallet.layout.TransactionInfoAdapter;
|
||||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
import com.m2049r.aeonwallet.model.TransactionInfo;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.service.exchange.api.ExchangeApi;
|
import com.m2049r.aeonwallet.service.exchange.api.ExchangeApi;
|
||||||
import com.m2049r.xmrwallet.service.exchange.api.ExchangeCallback;
|
import com.m2049r.aeonwallet.service.exchange.api.ExchangeCallback;
|
||||||
import com.m2049r.xmrwallet.service.exchange.api.ExchangeRate;
|
import com.m2049r.aeonwallet.service.exchange.api.ExchangeRate;
|
||||||
import com.m2049r.xmrwallet.service.exchange.kraken.ExchangeApiImpl;
|
import com.m2049r.aeonwallet.service.exchange.kraken.ExchangeApiImpl;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.OkHttpClientSingleton;
|
import com.m2049r.aeonwallet.util.OkHttpClientSingleton;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -352,7 +352,7 @@ public class WalletFragment extends Fragment
|
|||||||
setProgress(x);
|
setProgress(x);
|
||||||
ivSynced.setVisibility(View.GONE);
|
ivSynced.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
sync = getString(R.string.status_synced) + formatter.format(wallet.getBlockChainHeight());
|
sync = getString(R.string.status_synced) + " " + formatter.format(wallet.getBlockChainHeight());
|
||||||
ivSynced.setVisibility(View.VISIBLE);
|
ivSynced.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
@@ -14,18 +14,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet;
|
package com.m2049r.aeonwallet;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
|
||||||
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class XmrWalletApplication extends Application {
|
public class XmrWalletApplication extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Timber.plant(new Timber.DebugTree());
|
Timber.plant(new Timber.DebugTree());
|
||||||
}
|
}
|
@@ -14,13 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.data;
|
package com.m2049r.aeonwallet.data;
|
||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
|
||||||
import com.m2049r.xmrwallet.util.BitcoinAddressValidator;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -28,15 +26,12 @@ import java.util.Map;
|
|||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class BarcodeData {
|
public class BarcodeData {
|
||||||
public static final String XMR_SCHEME = "monero:";
|
public static final String XMR_SCHEME = "aeon:";
|
||||||
public static final String XMR_PAYMENTID = "tx_payment_id";
|
public static final String XMR_PAYMENTID = "tx_payment_id";
|
||||||
public static final String XMR_AMOUNT = "tx_amount";
|
public static final String XMR_AMOUNT = "tx_amount";
|
||||||
|
|
||||||
static final String BTC_SCHEME = "bitcoin:";
|
|
||||||
static final String BTC_AMOUNT = "amount";
|
|
||||||
|
|
||||||
public enum Asset {
|
public enum Asset {
|
||||||
XMR, BTC
|
XMR
|
||||||
}
|
}
|
||||||
|
|
||||||
public Asset asset = null;
|
public Asset asset = null;
|
||||||
@@ -69,14 +64,6 @@ public class BarcodeData {
|
|||||||
if (bcData == null) {
|
if (bcData == null) {
|
||||||
bcData = parseMoneroNaked(qrCode);
|
bcData = parseMoneroNaked(qrCode);
|
||||||
}
|
}
|
||||||
// check for btc uri
|
|
||||||
if (bcData == null) {
|
|
||||||
bcData = parseBitcoinUri(qrCode);
|
|
||||||
}
|
|
||||||
// check for naked btc addres
|
|
||||||
if (bcData == null) {
|
|
||||||
bcData = parseBitcoinNaked(qrCode);
|
|
||||||
}
|
|
||||||
return bcData;
|
return bcData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,57 +131,4 @@ public class BarcodeData {
|
|||||||
|
|
||||||
return new BarcodeData(Asset.XMR, address);
|
return new BarcodeData(Asset.XMR, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bitcoin:mpQ84J43EURZHkCnXbyQ4PpNDLLBqdsMW2?amount=0.01
|
|
||||||
static public BarcodeData parseBitcoinUri(String uri) {
|
|
||||||
Timber.d("parseBitcoinUri=%s", uri);
|
|
||||||
|
|
||||||
if (uri == null) return null;
|
|
||||||
|
|
||||||
if (!uri.startsWith(BTC_SCHEME)) return null;
|
|
||||||
|
|
||||||
String noScheme = uri.substring(BTC_SCHEME.length());
|
|
||||||
Uri bitcoin = Uri.parse(noScheme);
|
|
||||||
Map<String, String> parms = new HashMap<>();
|
|
||||||
String query = bitcoin.getQuery();
|
|
||||||
if (query != null) {
|
|
||||||
String[] args = query.split("&");
|
|
||||||
for (String arg : args) {
|
|
||||||
String[] namevalue = arg.split("=");
|
|
||||||
if (namevalue.length == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
parms.put(Uri.decode(namevalue[0]).toLowerCase(),
|
|
||||||
namevalue.length > 1 ? Uri.decode(namevalue[1]) : "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String address = bitcoin.getPath();
|
|
||||||
String amount = parms.get(BTC_AMOUNT);
|
|
||||||
if (amount != null) {
|
|
||||||
try {
|
|
||||||
Double.parseDouble(amount);
|
|
||||||
} catch (NumberFormatException ex) {
|
|
||||||
Timber.d(ex.getLocalizedMessage());
|
|
||||||
return null; // we have an amount but its not a number!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!BitcoinAddressValidator.validate(address, WalletManager.getInstance().isTestNet())) {
|
|
||||||
Timber.d("address invalid");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new BarcodeData(BarcodeData.Asset.BTC, address, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
static public BarcodeData parseBitcoinNaked(String address) {
|
|
||||||
Timber.d("parseBitcoinNaked=%s", address);
|
|
||||||
|
|
||||||
if (address == null) return null;
|
|
||||||
|
|
||||||
if (!BitcoinAddressValidator.validate(address, WalletManager.getInstance().isTestNet())) {
|
|
||||||
Timber.d("address invalid");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new BarcodeData(BarcodeData.Asset.BTC, address);
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -14,9 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.data;
|
package com.m2049r.aeonwallet.data;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.model.PendingTransaction;
|
import com.m2049r.aeonwallet.model.PendingTransaction;
|
||||||
|
|
||||||
public class PendingTx {
|
public class PendingTx {
|
||||||
final public PendingTransaction.Status status;
|
final public PendingTransaction.Status status;
|
@@ -14,13 +14,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.data;
|
package com.m2049r.aeonwallet.data;
|
||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.model.PendingTransaction;
|
import com.m2049r.aeonwallet.model.PendingTransaction;
|
||||||
import com.m2049r.xmrwallet.util.UserNotes;
|
import com.m2049r.aeonwallet.util.UserNotes;
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
112
app/src/main/java/com/m2049r/aeonwallet/data/WalletNode.java
Normal file
112
app/src/main/java/com/m2049r/aeonwallet/data/WalletNode.java
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 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.aeonwallet.data;
|
||||||
|
|
||||||
|
import com.m2049r.aeonwallet.model.NetworkType;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketAddress;
|
||||||
|
|
||||||
|
public class WalletNode {
|
||||||
|
private final String name;
|
||||||
|
private final String host;
|
||||||
|
private final int port;
|
||||||
|
private final String user;
|
||||||
|
private final String password;
|
||||||
|
private final NetworkType networkType;
|
||||||
|
|
||||||
|
public WalletNode(String walletName, String daemon, NetworkType networkType) {
|
||||||
|
if ((daemon == null) || daemon.isEmpty())
|
||||||
|
throw new IllegalArgumentException("daemon is empty");
|
||||||
|
this.name = walletName;
|
||||||
|
String daemonAddress;
|
||||||
|
String a[] = daemon.split("@");
|
||||||
|
if (a.length == 1) { // no credentials
|
||||||
|
daemonAddress = a[0];
|
||||||
|
user = "";
|
||||||
|
password = "";
|
||||||
|
} else if (a.length == 2) { // credentials
|
||||||
|
String userPassword[] = a[0].split(":");
|
||||||
|
if (userPassword.length != 2)
|
||||||
|
throw new IllegalArgumentException("User:Password invalid");
|
||||||
|
user = userPassword[0];
|
||||||
|
if (!user.isEmpty()) {
|
||||||
|
password = userPassword[1];
|
||||||
|
} else {
|
||||||
|
password = "";
|
||||||
|
}
|
||||||
|
daemonAddress = a[1];
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Too many @");
|
||||||
|
}
|
||||||
|
|
||||||
|
String da[] = daemonAddress.split(":");
|
||||||
|
if ((da.length > 2) || (da.length < 1))
|
||||||
|
throw new IllegalArgumentException("Too many ':' or too few");
|
||||||
|
host = da[0];
|
||||||
|
if (da.length == 2) {
|
||||||
|
try {
|
||||||
|
port = Integer.parseInt(da[1]);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
throw new IllegalArgumentException("Port not numeric");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (networkType) {
|
||||||
|
case NetworkType_Mainnet:
|
||||||
|
port = 11181;
|
||||||
|
break;
|
||||||
|
case NetworkType_Testnet:
|
||||||
|
port = 21181;
|
||||||
|
break;
|
||||||
|
case NetworkType_Stagenet:
|
||||||
|
port = 31181;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
port = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.networkType = networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NetworkType getNetworkType() {
|
||||||
|
return networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return host + ":" + port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SocketAddress getSocketAddress() {
|
||||||
|
return new InetSocketAddress(host, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid() {
|
||||||
|
return !host.isEmpty();
|
||||||
|
}
|
||||||
|
}
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.dialog;
|
package com.m2049r.aeonwallet.dialog;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -29,8 +29,8 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.BuildConfig;
|
import com.m2049r.aeonwallet.BuildConfig;
|
||||||
import com.m2049r.xmrwallet.R;
|
import com.m2049r.aeonwallet.R;
|
||||||
|
|
||||||
public class AboutFragment extends DialogFragment {
|
public class AboutFragment extends DialogFragment {
|
||||||
static final String TAG = "AboutFragment";
|
static final String TAG = "AboutFragment";
|
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.dialog;
|
package com.m2049r.aeonwallet.dialog;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -30,14 +30,14 @@ import android.view.View;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.R;
|
import com.m2049r.aeonwallet.R;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
|
|
||||||
public class DonationFragment extends DialogFragment {
|
public class CreditsFragment extends DialogFragment {
|
||||||
static final String TAG = "DonationFragment";
|
static final String TAG = "DonationFragment";
|
||||||
|
|
||||||
public static DonationFragment newInstance() {
|
public static CreditsFragment newInstance() {
|
||||||
return new DonationFragment();
|
return new CreditsFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void display(FragmentManager fm) {
|
public static void display(FragmentManager fm) {
|
||||||
@@ -47,14 +47,14 @@ public class DonationFragment extends DialogFragment {
|
|||||||
ft.remove(prev);
|
ft.remove(prev);
|
||||||
}
|
}
|
||||||
|
|
||||||
DonationFragment.newInstance().show(ft, TAG);
|
CreditsFragment.newInstance().show(ft, TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_donation, null);
|
final View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_credits, null);
|
||||||
|
|
||||||
((TextView) view.findViewById(R.id.tvCredits)).setText(Html.fromHtml(getString(R.string.donation_credits)));
|
((TextView) view.findViewById(R.id.tvCredits)).setText(Html.fromHtml(getString(R.string.credits_text)));
|
||||||
|
|
||||||
(view.findViewById(R.id.bCopyAddress)).
|
(view.findViewById(R.id.bCopyAddress)).
|
||||||
setOnClickListener(new View.OnClickListener() {
|
setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -62,7 +62,7 @@ public class DonationFragment extends DialogFragment {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Helper.clipBoardCopy(getActivity(), getString(R.string.label_copy_address),
|
Helper.clipBoardCopy(getActivity(), getString(R.string.label_copy_address),
|
||||||
((TextView) view.findViewById(R.id.tvWalletAddress)).getText().toString());
|
((TextView) view.findViewById(R.id.tvWalletAddress)).getText().toString());
|
||||||
Toast.makeText(getActivity(), getString(R.string.message_copy_address), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.message_copy_donation), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -77,5 +77,4 @@ public class DonationFragment extends DialogFragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}}
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user