Compare commits
8 Commits
v1.11.2
...
aeon-0.1.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
67f24673b1 | ||
![]() |
1b9aac7526 | ||
![]() |
b68c425bae | ||
![]() |
cf58072c6c | ||
![]() |
6960347014 | ||
![]() |
cc5a8969d6 | ||
![]() |
c0ebf6c318 | ||
![]() |
4aa46d8cf9 |
@@ -3,13 +3,11 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
working_directory: ~/code
|
working_directory: ~/code
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/android:api-28-ndk
|
- image: bitriseio/android-ndk
|
||||||
environment:
|
environment:
|
||||||
JVM_OPTS: -Xmx3200m
|
JVM_OPTS: -Xmx3200m
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: yes | sdkmanager --licenses || exit 0
|
|
||||||
- run: yes | sdkmanager --update || exit 0
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
||||||
- run:
|
- run:
|
||||||
|
7
.gitignore
vendored
@@ -6,11 +6,4 @@
|
|||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/app/build
|
|
||||||
/app/release
|
/app/release
|
||||||
/app/alpha
|
|
||||||
/app/prod
|
|
||||||
/app/alphaMainnet
|
|
||||||
/app/prodMainnet
|
|
||||||
/app/alphaStagenet
|
|
||||||
/app/prodStagenet
|
|
||||||
|
18
.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<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" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
12
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
38
README.md
@@ -1,30 +1,24 @@
|
|||||||
# Monerujo
|
# MonerujoAE
|
||||||
Another Android Monero Wallet for Monero
|
The Android AEON Wallet
|
||||||
**(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
|
- Alternatively add our F-Droid repo https://aeon.monerujo.io/fdroid/repo with fingerpint ```F8 20 2E E7 A8 D0 2D 07 AF B1 3D 5A 14 F2 9F 39 04 8C 4D 2D B3 87 76 11 03 5E F9 EA 20 6A 55 5D``` 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 ```aeonwallet``` (created first time App is started)
|
||||||
- See the [FAQ](doc/FAQ.md)
|
- See the [FAQ](doc/FAQ.md)
|
||||||
|
|
||||||
## Translations
|
## 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.
|
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 AEON if you use this App.
|
||||||
|
|
||||||
### Random Notes
|
### Random Notes
|
||||||
- works on the mainnet & stagenet
|
- Based off aeon v0.12.0
|
||||||
|
- works on the stagenet & mainnet
|
||||||
- use your own daemon - it's easy
|
- use your own daemon - it's easy
|
||||||
- Monerujo means "Monero Wallet" according to https://www.reddit.com/r/Monero/comments/3exy7t/esperanto_corner/
|
- screen stays on until first sync is complete
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
- see taiga.getmonero.org & issues on github
|
- see taiga.getmonero.org & issues on github
|
||||||
@@ -32,18 +26,14 @@ You may lose all your Moneroj if you use this App. Be cautious when spending on
|
|||||||
### 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
|
- 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.
|
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 "aeonwallet" 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
|
||||||
of the "real" testnet. After creating a new wallet, make a **new** one by recovering from the seed.
|
of the "real" stagenet. After creating a new wallet, make a **new** one by recovering from the seed.
|
||||||
The official monero client shows the same behaviour.
|
The official client shows the same behaviour.
|
||||||
|
|
||||||
### HOW TO BUILD
|
### HOW TO BUILD
|
||||||
|
Check out [the instructions](doc/BUILDING-external-libs.md)
|
||||||
See [the instructions](doc/BUILDING-external-libs.md)
|
|
||||||
|
|
||||||
Then, fire up Android Studio and build the APK.
|
|
||||||
|
|
||||||
### Donations
|
### Donations
|
||||||
- Address: 4AdkPJoxn7JCvAby9szgnt93MSEwdnxdhaASxbTBm6x5dCwmsDep2UYN4FhStDn5i11nsJbpU7oj59ahg8gXb1Mg3viqCuk
|
- Address: WmsfCJfmd6QQ84Rfb2mD1y7ryBzvTiQ8MMngmgRjxDMCCkeuChA9B9ZRNZyQyjgH1zdQMBXeQB9vZhUwPHmLGhyo2nMoE2ARv
|
||||||
- Viewkey: b1aff2a12191723da0afbe75516f94dd8b068215f6e847d8da57aca5f1f98e0c
|
|
||||||
|
3
app/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.externalNativeBuild
|
||||||
|
build
|
||||||
|
app.iml
|
@@ -7,14 +7,6 @@ add_library( monerujo
|
|||||||
|
|
||||||
set(EXTERNAL_LIBS_DIR ${CMAKE_SOURCE_DIR}/../external-libs)
|
set(EXTERNAL_LIBS_DIR ${CMAKE_SOURCE_DIR}/../external-libs)
|
||||||
|
|
||||||
############
|
|
||||||
# libsodium
|
|
||||||
############
|
|
||||||
|
|
||||||
add_library(sodium STATIC IMPORTED)
|
|
||||||
set_target_properties(sodium PROPERTIES IMPORTED_LOCATION
|
|
||||||
${EXTERNAL_LIBS_DIR}/libsodium/lib/${ANDROID_ABI}/libsodium.a)
|
|
||||||
|
|
||||||
############
|
############
|
||||||
# OpenSSL
|
# OpenSSL
|
||||||
############
|
############
|
||||||
@@ -68,84 +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
|
# Aeon
|
||||||
#############
|
#############
|
||||||
|
|
||||||
add_library(wallet_api STATIC IMPORTED)
|
add_library(wallet_api STATIC IMPORTED)
|
||||||
set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION
|
set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libwallet_api.a)
|
${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)
|
add_library(ringct_basic STATIC IMPORTED)
|
||||||
set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION
|
set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libringct_basic.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libringct_basic.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(checkpoints STATIC IMPORTED)
|
add_library(checkpoints STATIC IMPORTED)
|
||||||
set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
|
set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libcheckpoints.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libcheckpoints.a)
|
||||||
|
|
||||||
add_library(device STATIC IMPORTED)
|
add_library(device STATIC IMPORTED)
|
||||||
set_target_properties(device PROPERTIES IMPORTED_LOCATION
|
set_target_properties(device PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libdevice.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libdevice.a)
|
||||||
|
|
||||||
add_library(multisig STATIC IMPORTED)
|
add_library(multisig STATIC IMPORTED)
|
||||||
set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
|
set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libmultisig.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libmultisig.a)
|
||||||
|
|
||||||
add_library(version STATIC IMPORTED)
|
add_library(version STATIC IMPORTED)
|
||||||
set_target_properties(version PROPERTIES IMPORTED_LOCATION
|
set_target_properties(version PROPERTIES IMPORTED_LOCATION
|
||||||
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libversion.a)
|
${EXTERNAL_LIBS_DIR}/aeon/lib/${ANDROID_ABI}/libversion.a)
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# System
|
# System
|
||||||
@@ -153,7 +145,7 @@ set_target_properties(version 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})
|
||||||
|
|
||||||
@@ -192,7 +184,5 @@ target_link_libraries( monerujo
|
|||||||
ssl
|
ssl
|
||||||
crypto
|
crypto
|
||||||
|
|
||||||
sodium
|
|
||||||
|
|
||||||
${log-lib}
|
${log-lib}
|
||||||
)
|
)
|
||||||
|
@@ -1,15 +1,14 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 25
|
||||||
buildToolsVersion '28.0.3'
|
buildToolsVersion '27.0.3'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.m2049r.xmrwallet"
|
applicationId "com.m2049r.aeonwallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 25
|
||||||
versionCode 172
|
versionCode 12
|
||||||
versionName "1.11.2 'Chernushka'"
|
versionName "0.1.2 'Rebase RC2'"
|
||||||
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
@@ -19,26 +18,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions 'type', 'net'
|
|
||||||
productFlavors {
|
|
||||||
mainnet {
|
|
||||||
dimension 'net'
|
|
||||||
}
|
|
||||||
stagenet {
|
|
||||||
dimension 'net'
|
|
||||||
applicationIdSuffix '.stage'
|
|
||||||
versionNameSuffix ' (stage)'
|
|
||||||
}
|
|
||||||
alpha {
|
|
||||||
dimension 'type'
|
|
||||||
applicationIdSuffix '.alpha'
|
|
||||||
versionNameSuffix ' (alpha)'
|
|
||||||
}
|
|
||||||
prod {
|
|
||||||
dimension 'type'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
@@ -48,7 +27,6 @@ android {
|
|||||||
applicationIdSuffix ".debug"
|
applicationIdSuffix ".debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
path "CMakeLists.txt"
|
path "CMakeLists.txt"
|
||||||
@@ -67,58 +45,37 @@ android {
|
|||||||
// Map for the version code that gives each ABI a value.
|
// Map for the version code that gives each ABI a value.
|
||||||
def abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]
|
def abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]
|
||||||
|
|
||||||
// Enumerate translated locales
|
|
||||||
def availableLocales = ["en"]
|
|
||||||
new File("app/src/main/res/").eachFileMatch(~/^values-.*/) { file ->
|
|
||||||
def languageTag = file.name.substring(7).replace("-r", "-")
|
|
||||||
availableLocales.add(languageTag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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 ->
|
||||||
// Update string resource: available_locales
|
|
||||||
variant.resValue("string", "available_locales", availableLocales.join(","))
|
|
||||||
// Assigns a different version code for each output APK.
|
// Assigns a different version code for each output APK.
|
||||||
variant.outputs.all {
|
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
|
||||||
//def flavor = output.getFilter(flavor)
|
|
||||||
|
|
||||||
if (abiName == null) abiName = "universal"
|
if (abiName == null) abiName = "universal"
|
||||||
def v = "${variant.versionName}".replaceFirst(" '.*' ?", "")
|
def v = "${variant.versionName}".replaceFirst(" .*\$", "").replace(".", "x")
|
||||||
.replace(".", "x")
|
|
||||||
.replace("(", "-")
|
|
||||||
.replace(")", "")
|
|
||||||
outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk"
|
outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
|
implementation 'com.android.support:appcompat-v7:25.4.0'
|
||||||
implementation "com.android.support:design:$rootProject.ext.supportVersion"
|
implementation 'com.android.support:design:25.4.0'
|
||||||
implementation "com.android.support:support-v4:$rootProject.ext.supportVersion"
|
implementation 'com.android.support:support-v4:25.4.0'
|
||||||
implementation "com.android.support:recyclerview-v7:$rootProject.ext.supportVersion"
|
implementation 'com.android.support:recyclerview-v7:25.4.0'
|
||||||
implementation "com.android.support:cardview-v7:$rootProject.ext.supportVersion"
|
implementation 'com.android.support:cardview-v7:25.4.0'
|
||||||
implementation "com.android.support:swiperefreshlayout:$rootProject.ext.supportVersion"
|
|
||||||
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
||||||
|
|
||||||
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
|
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
|
||||||
implementation "com.burgstaller:okhttp-digest:1.18"
|
|
||||||
implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
|
implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
|
||||||
|
|
||||||
implementation 'com.nulab-inc:zxcvbn:1.2.3'
|
implementation 'com.nulab-inc:zxcvbn:1.2.3'
|
||||||
|
|
||||||
implementation 'dnsjava:dnsjava:2.1.8'
|
|
||||||
implementation 'org.jitsi:dnssecjava:1.1.3'
|
|
||||||
implementation 'org.slf4j:slf4j-nop:1.7.25'
|
|
||||||
implementation 'com.github.brnunes:swipeablerecyclerview:1.0.2'
|
|
||||||
|
|
||||||
testImplementation "junit:junit:$rootProject.ext.junitVersion"
|
testImplementation "junit:junit:$rootProject.ext.junitVersion"
|
||||||
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
|
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
|
||||||
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
|
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
|
||||||
testImplementation 'org.json:json:20180813'
|
testImplementation 'org.json:json:20140107'
|
||||||
testImplementation 'net.jodah:concurrentunit:0.4.4'
|
testImplementation 'net.jodah:concurrentunit:0.4.2'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 47 KiB |
4
app/src/debug/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name" translatable="false">monerujoAE</string>
|
||||||
|
</resources>
|
@@ -1,82 +1,46 @@
|
|||||||
<?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_BIOMETRIC" />
|
|
||||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
<uses-permission android:name="android.permission.NFC" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".XmrWalletApplication"
|
android:allowBackup="true"
|
||||||
android:allowBackup="false"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/MyMaterialTheme"
|
android:name=".XmrWalletApplication"
|
||||||
android:usesCleartextTraffic="true">
|
android:theme="@style/MyMaterialTheme">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".WalletActivity"
|
android:name=".WalletActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:label="@string/wallet_activity_name"
|
android:label="@string/wallet_activity_name"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="behind" />
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:launchMode="singleTop"
|
android:screenOrientation="portrait">
|
||||||
android:screenOrientation="locked">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter android:label="@string/app_name">
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<data android:scheme="monero" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter android:label="@string/app_name">
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<data android:scheme="bitcoin" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
|
|
||||||
android:resource="@xml/usb_device_filter" />
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
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" />
|
||||||
|
|
||||||
<provider
|
|
||||||
android:name="android.support.v4.content.FileProvider"
|
|
||||||
android:authorities="${applicationId}.fileprovider"
|
|
||||||
android:exported="false"
|
|
||||||
android:grantUriPermissions="true">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
||||||
android:resource="@xml/filepaths" />
|
|
||||||
</provider>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@@ -1,88 +0,0 @@
|
|||||||
// Copyright (c) 2017-2018, The Monero Project
|
|
||||||
//
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without modification, are
|
|
||||||
// permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
// conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
// of conditions and the following disclaimer in the documentation and/or other
|
|
||||||
// materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
|
||||||
// used to endorse or promote products derived from this software without specific
|
|
||||||
// prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
||||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
|
||||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
||||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
|
|
||||||
#if defined(HAVE_MONERUJO)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief LedgerFind - find Ledger Device and return it's name
|
|
||||||
* @param buffer - buffer for name of found device
|
|
||||||
* @param len - length of buffer
|
|
||||||
* @return 0 - success
|
|
||||||
* -1 - no device connected / found
|
|
||||||
* -2 - JVM not found
|
|
||||||
*/
|
|
||||||
int LedgerFind(char *buffer, size_t len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief LedgerExchange - exchange data with Ledger Device
|
|
||||||
* @param command - buffer for data to send
|
|
||||||
* @param cmd_len - length of send to send
|
|
||||||
* @param response - buffer for received data
|
|
||||||
* @param max_resp_len - size of receive buffer
|
|
||||||
*
|
|
||||||
* @return length of received data in response or -1 if error
|
|
||||||
*/
|
|
||||||
int LedgerExchange(unsigned char *command, unsigned int cmd_len, unsigned char *response, unsigned int max_resp_len);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "device_io.hpp"
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace hw {
|
|
||||||
namespace io {
|
|
||||||
class device_io_monerujo: device_io {
|
|
||||||
public:
|
|
||||||
device_io_monerujo() {};
|
|
||||||
~device_io_monerujo() {};
|
|
||||||
|
|
||||||
void init() {};
|
|
||||||
void release() {};
|
|
||||||
|
|
||||||
void connect(void *params) {};
|
|
||||||
void disconnect() {};
|
|
||||||
bool connected() const {return true;}; // monerujo is always connected before it gets here
|
|
||||||
|
|
||||||
// returns number of bytes read or -1 on error
|
|
||||||
int exchange(unsigned char *command, unsigned int cmd_len, unsigned char *response, unsigned int max_resp_len) {
|
|
||||||
return LedgerExchange(command, cmd_len, response, max_resp_len);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //#if defined(HAVE_MONERUJO)
|
|
@@ -60,14 +60,9 @@ enum {
|
|||||||
HASH_DATA_AREA = 136
|
HASH_DATA_AREA = 136
|
||||||
};
|
};
|
||||||
|
|
||||||
void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int prehashed, uint64_t height);
|
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) {
|
inline void slow_hash(const void *data, const size_t length, char *hash) {
|
||||||
cn_slow_hash(data, length, hash, 0 /*variant*/, 0 /*prehashed*/, 0 /*height*/);
|
cn_slow_hash(data, length, hash, 0 /*light*/, 0 /* variant */, 0/*prehashed*/);
|
||||||
}
|
|
||||||
|
|
||||||
inline void slow_hash_broken(const void *data, char *hash, int variant) {
|
|
||||||
cn_slow_hash(data, 200 /*sizeof(union hash_state)*/, hash, variant, 1 /*prehashed*/, 0 /*height*/);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 67 KiB |
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
*******************************************************************************
|
|
||||||
* BTChip Bitcoin Hardware Wallet Java API
|
|
||||||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn
|
|
||||||
*
|
|
||||||
* 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.btchip;
|
|
||||||
|
|
||||||
public class BTChipException extends Exception {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 5512803003827126405L;
|
|
||||||
|
|
||||||
public BTChipException(String reason) {
|
|
||||||
super(reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BTChipException(String reason, Throwable cause) {
|
|
||||||
super(reason, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BTChipException(String reason, int sw) {
|
|
||||||
super(reason);
|
|
||||||
this.sw = sw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSW() {
|
|
||||||
return sw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
if (sw == 0) {
|
|
||||||
return "BTChip Exception : " + getMessage();
|
|
||||||
} else {
|
|
||||||
return "BTChip Exception : " + getMessage() + " " + Integer.toHexString(sw);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int sw;
|
|
||||||
|
|
||||||
}
|
|
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
*******************************************************************************
|
|
||||||
* BTChip Bitcoin Hardware Wallet Java API
|
|
||||||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn
|
|
||||||
* (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.btchip.comm;
|
|
||||||
|
|
||||||
import com.btchip.BTChipException;
|
|
||||||
|
|
||||||
public interface BTChipTransport {
|
|
||||||
byte[] exchange(byte[] command);
|
|
||||||
|
|
||||||
void close();
|
|
||||||
|
|
||||||
void setDebug(boolean debugFlag);
|
|
||||||
}
|
|
@@ -1,126 +0,0 @@
|
|||||||
/*
|
|
||||||
*******************************************************************************
|
|
||||||
* BTChip Bitcoin Hardware Wallet Java API
|
|
||||||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn
|
|
||||||
* (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.btchip.comm;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
|
|
||||||
public class LedgerHelper {
|
|
||||||
|
|
||||||
private static final int TAG_APDU = 0x05;
|
|
||||||
|
|
||||||
public static byte[] wrapCommandAPDU(int channel, byte[] command, int packetSize) {
|
|
||||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
||||||
if (packetSize < 3) {
|
|
||||||
throw new IllegalArgumentException("Can't handle Ledger framing with less than 3 bytes for the report");
|
|
||||||
}
|
|
||||||
int sequenceIdx = 0;
|
|
||||||
int offset = 0;
|
|
||||||
output.write(channel >> 8);
|
|
||||||
output.write(channel);
|
|
||||||
output.write(TAG_APDU);
|
|
||||||
output.write(sequenceIdx >> 8);
|
|
||||||
output.write(sequenceIdx);
|
|
||||||
sequenceIdx++;
|
|
||||||
output.write(command.length >> 8);
|
|
||||||
output.write(command.length);
|
|
||||||
int blockSize = (command.length > packetSize - 7 ? packetSize - 7 : command.length);
|
|
||||||
output.write(command, offset, blockSize);
|
|
||||||
offset += blockSize;
|
|
||||||
while (offset != command.length) {
|
|
||||||
output.write(channel >> 8);
|
|
||||||
output.write(channel);
|
|
||||||
output.write(TAG_APDU);
|
|
||||||
output.write(sequenceIdx >> 8);
|
|
||||||
output.write(sequenceIdx);
|
|
||||||
sequenceIdx++;
|
|
||||||
blockSize = (command.length - offset > packetSize - 5 ? packetSize - 5 : command.length - offset);
|
|
||||||
output.write(command, offset, blockSize);
|
|
||||||
offset += blockSize;
|
|
||||||
}
|
|
||||||
if ((output.size() % packetSize) != 0) {
|
|
||||||
byte[] padding = new byte[packetSize - (output.size() % packetSize)];
|
|
||||||
output.write(padding, 0, padding.length);
|
|
||||||
}
|
|
||||||
return output.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] unwrapResponseAPDU(int channel, byte[] data, int packetSize) {
|
|
||||||
ByteArrayOutputStream response = new ByteArrayOutputStream();
|
|
||||||
int offset = 0;
|
|
||||||
int responseLength;
|
|
||||||
int sequenceIdx = 0;
|
|
||||||
if ((data == null) || (data.length < 7 + 5)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (data[offset++] != (channel >> 8)) {
|
|
||||||
throw new IllegalArgumentException("Invalid channel");
|
|
||||||
}
|
|
||||||
if (data[offset++] != (channel & 0xff)) {
|
|
||||||
throw new IllegalArgumentException("Invalid channel");
|
|
||||||
}
|
|
||||||
if (data[offset++] != TAG_APDU) {
|
|
||||||
throw new IllegalArgumentException("Invalid tag");
|
|
||||||
}
|
|
||||||
if (data[offset++] != 0x00) {
|
|
||||||
throw new IllegalArgumentException("Invalid sequence");
|
|
||||||
}
|
|
||||||
if (data[offset++] != 0x00) {
|
|
||||||
throw new IllegalArgumentException("Invalid sequence");
|
|
||||||
}
|
|
||||||
responseLength = ((data[offset++] & 0xff) << 8);
|
|
||||||
responseLength |= (data[offset++] & 0xff);
|
|
||||||
if (data.length < 7 + responseLength) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
int blockSize = (responseLength > packetSize - 7 ? packetSize - 7 : responseLength);
|
|
||||||
response.write(data, offset, blockSize);
|
|
||||||
offset += blockSize;
|
|
||||||
while (response.size() != responseLength) {
|
|
||||||
sequenceIdx++;
|
|
||||||
if (offset == data.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (data[offset++] != (channel >> 8)) {
|
|
||||||
throw new IllegalArgumentException("Invalid channel");
|
|
||||||
}
|
|
||||||
if (data[offset++] != (channel & 0xff)) {
|
|
||||||
throw new IllegalArgumentException("Invalid channel");
|
|
||||||
}
|
|
||||||
if (data[offset++] != TAG_APDU) {
|
|
||||||
throw new IllegalArgumentException("Invalid tag");
|
|
||||||
}
|
|
||||||
if (data[offset++] != (sequenceIdx >> 8)) {
|
|
||||||
throw new IllegalArgumentException("Invalid sequence");
|
|
||||||
}
|
|
||||||
if (data[offset++] != (sequenceIdx & 0xff)) {
|
|
||||||
throw new IllegalArgumentException("Invalid sequence");
|
|
||||||
}
|
|
||||||
blockSize = (responseLength - response.size() > packetSize - 5 ? packetSize - 5 : responseLength - response.size());
|
|
||||||
if (blockSize > data.length - offset) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
response.write(data, offset, blockSize);
|
|
||||||
offset += blockSize;
|
|
||||||
}
|
|
||||||
return response.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,145 +0,0 @@
|
|||||||
/*
|
|
||||||
*******************************************************************************
|
|
||||||
* BTChip Bitcoin Hardware Wallet Java API
|
|
||||||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn
|
|
||||||
* (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.btchip.comm.android;
|
|
||||||
|
|
||||||
import android.hardware.usb.UsbConstants;
|
|
||||||
import android.hardware.usb.UsbDevice;
|
|
||||||
import android.hardware.usb.UsbDeviceConnection;
|
|
||||||
import android.hardware.usb.UsbEndpoint;
|
|
||||||
import android.hardware.usb.UsbInterface;
|
|
||||||
import android.hardware.usb.UsbManager;
|
|
||||||
import android.hardware.usb.UsbRequest;
|
|
||||||
|
|
||||||
import com.btchip.BTChipException;
|
|
||||||
import com.btchip.comm.BTChipTransport;
|
|
||||||
import com.btchip.comm.LedgerHelper;
|
|
||||||
import com.btchip.utils.Dump;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import timber.log.Timber;
|
|
||||||
|
|
||||||
public class BTChipTransportAndroidHID implements BTChipTransport {
|
|
||||||
|
|
||||||
public static UsbDevice getDevice(UsbManager manager) {
|
|
||||||
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
|
|
||||||
for (UsbDevice device : deviceList.values()) {
|
|
||||||
Timber.d("%04X:%04X %s, %s", device.getVendorId(), device.getProductId(), device.getManufacturerName(), device.getProductName());
|
|
||||||
if ((device.getVendorId() == VID) && (device.getProductId() == PID_HID)) {
|
|
||||||
return device;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BTChipTransport open(UsbManager manager, UsbDevice device) throws IOException {
|
|
||||||
UsbDeviceConnection connection = manager.openDevice(device);
|
|
||||||
if (connection == null) throw new IOException("Device not connected");
|
|
||||||
// Must only be called once permission is granted (see http://developer.android.com/reference/android/hardware/usb/UsbManager.html)
|
|
||||||
// Important if enumerating, rather than being awaken by the intent notification
|
|
||||||
UsbInterface dongleInterface = device.getInterface(0);
|
|
||||||
UsbEndpoint in = null;
|
|
||||||
UsbEndpoint out = null;
|
|
||||||
for (int i = 0; i < dongleInterface.getEndpointCount(); i++) {
|
|
||||||
UsbEndpoint tmpEndpoint = dongleInterface.getEndpoint(i);
|
|
||||||
if (tmpEndpoint.getDirection() == UsbConstants.USB_DIR_IN) {
|
|
||||||
in = tmpEndpoint;
|
|
||||||
} else {
|
|
||||||
out = tmpEndpoint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connection.claimInterface(dongleInterface, true);
|
|
||||||
return new BTChipTransportAndroidHID(connection, dongleInterface, in, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int VID = 0x2C97;
|
|
||||||
private static final int PID_HID = 0x0001;
|
|
||||||
|
|
||||||
private UsbDeviceConnection connection;
|
|
||||||
private UsbInterface dongleInterface;
|
|
||||||
private UsbEndpoint in;
|
|
||||||
private UsbEndpoint out;
|
|
||||||
private byte transferBuffer[];
|
|
||||||
private boolean debug;
|
|
||||||
|
|
||||||
public BTChipTransportAndroidHID(UsbDeviceConnection connection, UsbInterface dongleInterface, UsbEndpoint in, UsbEndpoint out) {
|
|
||||||
this.connection = connection;
|
|
||||||
this.dongleInterface = dongleInterface;
|
|
||||||
this.in = in;
|
|
||||||
this.out = out;
|
|
||||||
transferBuffer = new byte[HID_BUFFER_SIZE];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public byte[] exchange(byte[] command) {
|
|
||||||
ByteArrayOutputStream response = new ByteArrayOutputStream();
|
|
||||||
byte[] responseData = null;
|
|
||||||
int offset = 0;
|
|
||||||
if (debug) {
|
|
||||||
Timber.d("=> %s", Dump.dump(command));
|
|
||||||
}
|
|
||||||
command = LedgerHelper.wrapCommandAPDU(LEDGER_DEFAULT_CHANNEL, command, HID_BUFFER_SIZE);
|
|
||||||
UsbRequest requestOut = new UsbRequest();
|
|
||||||
requestOut.initialize(connection, out);
|
|
||||||
while (offset != command.length) {
|
|
||||||
int blockSize = (command.length - offset > HID_BUFFER_SIZE ? HID_BUFFER_SIZE : command.length - offset);
|
|
||||||
System.arraycopy(command, offset, transferBuffer, 0, blockSize);
|
|
||||||
requestOut.queue(ByteBuffer.wrap(transferBuffer), HID_BUFFER_SIZE);
|
|
||||||
connection.requestWait();
|
|
||||||
offset += blockSize;
|
|
||||||
}
|
|
||||||
requestOut.close();
|
|
||||||
ByteBuffer responseBuffer = ByteBuffer.allocate(HID_BUFFER_SIZE);
|
|
||||||
UsbRequest requestIn = new UsbRequest();
|
|
||||||
requestIn.initialize(connection, in);
|
|
||||||
while ((responseData = LedgerHelper.unwrapResponseAPDU(LEDGER_DEFAULT_CHANNEL, response.toByteArray(), HID_BUFFER_SIZE)) == null) {
|
|
||||||
responseBuffer.clear();
|
|
||||||
requestIn.queue(responseBuffer, HID_BUFFER_SIZE);
|
|
||||||
connection.requestWait();
|
|
||||||
responseBuffer.rewind();
|
|
||||||
responseBuffer.get(transferBuffer, 0, HID_BUFFER_SIZE);
|
|
||||||
response.write(transferBuffer, 0, HID_BUFFER_SIZE);
|
|
||||||
}
|
|
||||||
requestIn.close();
|
|
||||||
if (debug) {
|
|
||||||
Timber.d("<= %s", Dump.dump(responseData));
|
|
||||||
}
|
|
||||||
return responseData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
connection.releaseInterface(dongleInterface);
|
|
||||||
connection.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDebug(boolean debugFlag) {
|
|
||||||
this.debug = debugFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int HID_BUFFER_SIZE = 64;
|
|
||||||
private static final int LEDGER_DEFAULT_CHANNEL = 1;
|
|
||||||
private static final int SW1_DATA_AVAILABLE = 0x61;
|
|
||||||
}
|
|
@@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
*******************************************************************************
|
|
||||||
* BTChip Bitcoin Hardware Wallet Java API
|
|
||||||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn
|
|
||||||
*
|
|
||||||
* 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.btchip.utils;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
|
|
||||||
public class Dump {
|
|
||||||
|
|
||||||
public static String dump(byte[] buffer, int offset, int length) {
|
|
||||||
String result = "";
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
String temp = Integer.toHexString((buffer[offset + i]) & 0xff);
|
|
||||||
if (temp.length() < 2) {
|
|
||||||
temp = "0" + temp;
|
|
||||||
}
|
|
||||||
result += temp;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String dump(byte[] buffer) {
|
|
||||||
return dump(buffer, 0, buffer.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] hexToBin(String src) {
|
|
||||||
ByteArrayOutputStream result = new ByteArrayOutputStream();
|
|
||||||
int i = 0;
|
|
||||||
while (i < src.length()) {
|
|
||||||
char x = src.charAt(i);
|
|
||||||
if (!((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || (x >= 'a' && x <= 'f'))) {
|
|
||||||
i++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
result.write(Integer.valueOf("" + src.charAt(i) + src.charAt(i + 1), 16));
|
|
||||||
i += 2;
|
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result.toByteArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@@ -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.Context;
|
import android.content.Context;
|
||||||
@@ -39,13 +39,13 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
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.FingerprintHelper;
|
import com.m2049r.aeonwallet.util.FingerprintHelper;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.KeyStoreHelper;
|
import com.m2049r.aeonwallet.util.KeyStoreHelper;
|
||||||
import com.m2049r.xmrwallet.util.RestoreHeight;
|
import com.m2049r.aeonwallet.util.RestoreHeight;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
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;
|
||||||
|
|
||||||
@@ -61,7 +61,6 @@ public class GenerateFragment extends Fragment {
|
|||||||
static final String TYPE_NEW = "new";
|
static final String TYPE_NEW = "new";
|
||||||
static final String TYPE_KEY = "key";
|
static final String TYPE_KEY = "key";
|
||||||
static final String TYPE_SEED = "seed";
|
static final String TYPE_SEED = "seed";
|
||||||
static final String TYPE_LEDGER = "ledger";
|
|
||||||
static final String TYPE_VIEWONLY = "view";
|
static final String TYPE_VIEWONLY = "view";
|
||||||
|
|
||||||
private TextInputLayout etWalletName;
|
private TextInputLayout etWalletName;
|
||||||
@@ -85,16 +84,17 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_generate, container, false);
|
View view = inflater.inflate(R.layout.fragment_generate, container, false);
|
||||||
|
|
||||||
etWalletName = view.findViewById(R.id.etWalletName);
|
etWalletName = (TextInputLayout) view.findViewById(R.id.etWalletName);
|
||||||
etWalletPassword = view.findViewById(R.id.etWalletPassword);
|
etWalletPassword = (TextInputLayout) view.findViewById(R.id.etWalletPassword);
|
||||||
llFingerprintAuth = view.findViewById(R.id.llFingerprintAuth);
|
llFingerprintAuth = (LinearLayout) view.findViewById(R.id.llFingerprintAuth);
|
||||||
etWalletMnemonic = view.findViewById(R.id.etWalletMnemonic);
|
etWalletMnemonic = (TextInputLayout) view.findViewById(R.id.etWalletMnemonic);
|
||||||
etWalletAddress = view.findViewById(R.id.etWalletAddress);
|
etWalletAddress = (TextInputLayout) view.findViewById(R.id.etWalletAddress);
|
||||||
etWalletViewKey = view.findViewById(R.id.etWalletViewKey);
|
etWalletViewKey = (TextInputLayout) view.findViewById(R.id.etWalletViewKey);
|
||||||
etWalletSpendKey = view.findViewById(R.id.etWalletSpendKey);
|
etWalletSpendKey = (TextInputLayout) view.findViewById(R.id.etWalletSpendKey);
|
||||||
etWalletRestoreHeight = view.findViewById(R.id.etWalletRestoreHeight);
|
etWalletRestoreHeight = (TextInputLayout) view.findViewById(R.id.etWalletRestoreHeight);
|
||||||
bGenerate = view.findViewById(R.id.bGenerate);
|
bGenerate = (Button) view.findViewById(R.id.bGenerate);
|
||||||
|
|
||||||
|
etWalletMnemonic.getEditText().setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
etWalletAddress.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
etWalletAddress.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||||
etWalletViewKey.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
etWalletViewKey.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||||
etWalletSpendKey.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
etWalletSpendKey.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||||
@@ -144,8 +144,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
etWalletName.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletName.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
if (checkName()) {
|
if (checkName()) {
|
||||||
etWalletPassword.requestFocus();
|
etWalletPassword.requestFocus();
|
||||||
} // otherwise ignore
|
} // otherwise ignore
|
||||||
@@ -183,8 +182,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
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() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
|
|
||||||
Helper.hideKeyboard(getActivity());
|
Helper.hideKeyboard(getActivity());
|
||||||
generateWallet();
|
generateWallet();
|
||||||
return true;
|
return true;
|
||||||
@@ -192,23 +190,10 @@ public class GenerateFragment extends Fragment {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (type.equals(TYPE_LEDGER)) {
|
|
||||||
etWalletPassword.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
|
|
||||||
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
|
||||||
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
|
|
||||||
etWalletRestoreHeight.requestFocus();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (type.equals(TYPE_SEED)) {
|
} else if (type.equals(TYPE_SEED)) {
|
||||||
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
etWalletMnemonic.requestFocus();
|
etWalletMnemonic.requestFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -218,8 +203,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
etWalletMnemonic.setVisibility(View.VISIBLE);
|
etWalletMnemonic.setVisibility(View.VISIBLE);
|
||||||
etWalletMnemonic.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletMnemonic.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
if (checkMnemonic()) {
|
if (checkMnemonic()) {
|
||||||
etWalletRestoreHeight.requestFocus();
|
etWalletRestoreHeight.requestFocus();
|
||||||
}
|
}
|
||||||
@@ -231,8 +215,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
} else if (type.equals(TYPE_KEY) || type.equals(TYPE_VIEWONLY)) {
|
} else if (type.equals(TYPE_KEY) || type.equals(TYPE_VIEWONLY)) {
|
||||||
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
etWalletAddress.requestFocus();
|
etWalletAddress.requestFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -244,8 +227,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
{
|
{
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
if (checkAddress()) {
|
if (checkAddress()) {
|
||||||
etWalletViewKey.requestFocus();
|
etWalletViewKey.requestFocus();
|
||||||
}
|
}
|
||||||
@@ -257,8 +239,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
etWalletViewKey.setVisibility(View.VISIBLE);
|
etWalletViewKey.setVisibility(View.VISIBLE);
|
||||||
etWalletViewKey.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletViewKey.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
if (checkViewKey()) {
|
if (checkViewKey()) {
|
||||||
if (type.equals(TYPE_KEY)) {
|
if (type.equals(TYPE_KEY)) {
|
||||||
etWalletSpendKey.requestFocus();
|
etWalletSpendKey.requestFocus();
|
||||||
@@ -278,8 +259,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
{
|
{
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
|
|
||||||
if (checkSpendKey()) {
|
if (checkSpendKey()) {
|
||||||
etWalletRestoreHeight.requestFocus();
|
etWalletRestoreHeight.requestFocus();
|
||||||
}
|
}
|
||||||
@@ -293,8 +273,7 @@ public class GenerateFragment extends Fragment {
|
|||||||
etWalletRestoreHeight.setVisibility(View.VISIBLE);
|
etWalletRestoreHeight.setVisibility(View.VISIBLE);
|
||||||
etWalletRestoreHeight.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etWalletRestoreHeight.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
|
|
||||||
Helper.hideKeyboard(getActivity());
|
Helper.hideKeyboard(getActivity());
|
||||||
generateWallet();
|
generateWallet();
|
||||||
return true;
|
return true;
|
||||||
@@ -412,31 +391,24 @@ public class GenerateFragment extends Fragment {
|
|||||||
// is it a date?
|
// is it a date?
|
||||||
SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
parser.setLenient(false);
|
parser.setLenient(false);
|
||||||
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
parser.parse(restoreHeight);
|
||||||
} catch (ParseException ex) {
|
height = RestoreHeight.getInstance().getHeight(restoreHeight);
|
||||||
}
|
} catch (ParseException exPE) {
|
||||||
if (height <= 0)
|
|
||||||
try {
|
|
||||||
// is it a date without dashes?
|
|
||||||
SimpleDateFormat parser = new SimpleDateFormat("yyyyMMdd");
|
|
||||||
parser.setLenient(false);
|
|
||||||
height = RestoreHeight.getInstance().getHeight(parser.parse(restoreHeight));
|
|
||||||
} catch (ParseException ex) {
|
|
||||||
}
|
|
||||||
if (height <= 0)
|
|
||||||
try {
|
try {
|
||||||
// or is it a height?
|
// or is it a height?
|
||||||
height = Long.parseLong(restoreHeight);
|
height = Long.parseLong(restoreHeight);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException exNFE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Timber.d("Using Restore Height = %d", height);
|
Timber.d("Using Restore Height = %d", height);
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
@@ -506,12 +478,6 @@ public class GenerateFragment extends Fragment {
|
|||||||
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
||||||
}
|
}
|
||||||
activityCallback.onGenerate(name, crazyPass, seed, height);
|
activityCallback.onGenerate(name, crazyPass, seed, height);
|
||||||
} else if (type.equals(TYPE_LEDGER)) {
|
|
||||||
bGenerate.setEnabled(false);
|
|
||||||
if (fingerprintAuthAllowed) {
|
|
||||||
KeyStoreHelper.saveWalletUserPass(getActivity(), name, password);
|
|
||||||
}
|
|
||||||
activityCallback.onGenerateLedger(name, crazyPass, 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);
|
||||||
@@ -550,8 +516,6 @@ public class GenerateFragment extends Fragment {
|
|||||||
return getString(R.string.generate_wallet_type_new);
|
return getString(R.string.generate_wallet_type_new);
|
||||||
case TYPE_SEED:
|
case TYPE_SEED:
|
||||||
return getString(R.string.generate_wallet_type_seed);
|
return getString(R.string.generate_wallet_type_seed);
|
||||||
case TYPE_LEDGER:
|
|
||||||
return getString(R.string.generate_wallet_type_ledger);
|
|
||||||
case TYPE_VIEWONLY:
|
case TYPE_VIEWONLY:
|
||||||
return getString(R.string.generate_wallet_type_view);
|
return getString(R.string.generate_wallet_type_view);
|
||||||
default:
|
default:
|
||||||
@@ -569,8 +533,6 @@ public class GenerateFragment extends Fragment {
|
|||||||
|
|
||||||
void onGenerate(String name, String password, String address, String viewKey, String spendKey, long height);
|
void onGenerate(String name, String password, String address, String viewKey, String spendKey, long height);
|
||||||
|
|
||||||
void onGenerateLedger(String name, String password, long height);
|
|
||||||
|
|
||||||
void setTitle(String title);
|
void setTitle(String title);
|
||||||
|
|
||||||
void setToolbarButton(int type);
|
void setToolbarButton(int type);
|
||||||
@@ -606,9 +568,6 @@ public class GenerateFragment extends Fragment {
|
|||||||
case TYPE_SEED:
|
case TYPE_SEED:
|
||||||
inflater.inflate(R.menu.create_wallet_seed, menu);
|
inflater.inflate(R.menu.create_wallet_seed, menu);
|
||||||
break;
|
break;
|
||||||
case TYPE_LEDGER:
|
|
||||||
inflater.inflate(R.menu.create_wallet_ledger, menu);
|
|
||||||
break;
|
|
||||||
case TYPE_VIEWONLY:
|
case TYPE_VIEWONLY:
|
||||||
inflater.inflate(R.menu.create_wallet_view, menu);
|
inflater.inflate(R.menu.create_wallet_view, menu);
|
||||||
break;
|
break;
|
@@ -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.Context;
|
import android.content.Context;
|
||||||
@@ -43,16 +43,16 @@ import android.widget.Switch;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.ledger.Ledger;
|
import com.m2049r.aeonwallet.model.NetworkType;
|
||||||
import com.m2049r.xmrwallet.ledger.LedgerProgressDialog;
|
import com.m2049r.aeonwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.NetworkType;
|
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.FingerprintHelper;
|
import com.m2049r.aeonwallet.util.KeyStoreHelper;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.aeonwallet.util.MoneroThreadPoolExecutor;
|
||||||
import com.m2049r.xmrwallet.util.KeyStoreHelper;
|
import com.m2049r.aeonwallet.widget.Toolbar;
|
||||||
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
|
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import java.io.File;
|
||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
@@ -76,9 +76,6 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
private ImageButton bCopyAddress;
|
private ImageButton bCopyAddress;
|
||||||
private LinearLayout llAdvancedInfo;
|
private LinearLayout llAdvancedInfo;
|
||||||
private LinearLayout llPassword;
|
private LinearLayout llPassword;
|
||||||
private LinearLayout llMnemonic;
|
|
||||||
private LinearLayout llSpendKey;
|
|
||||||
private LinearLayout llViewKey;
|
|
||||||
private Button bAdvancedInfo;
|
private Button bAdvancedInfo;
|
||||||
private Button bAccept;
|
private Button bAccept;
|
||||||
|
|
||||||
@@ -91,22 +88,19 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_review, container, false);
|
View view = inflater.inflate(R.layout.fragment_review, container, false);
|
||||||
|
|
||||||
scrollview = view.findViewById(R.id.scrollview);
|
scrollview = (ScrollView) view.findViewById(R.id.scrollview);
|
||||||
pbProgress = view.findViewById(R.id.pbProgress);
|
pbProgress = (ProgressBar) view.findViewById(R.id.pbProgress);
|
||||||
tvWalletPassword = view.findViewById(R.id.tvWalletPassword);
|
tvWalletPassword = (TextView) view.findViewById(R.id.tvWalletPassword);
|
||||||
tvWalletAddress = view.findViewById(R.id.tvWalletAddress);
|
tvWalletAddress = (TextView) view.findViewById(R.id.tvWalletAddress);
|
||||||
tvWalletViewKey = view.findViewById(R.id.tvWalletViewKey);
|
tvWalletViewKey = (TextView) view.findViewById(R.id.tvWalletViewKey);
|
||||||
tvWalletSpendKey = view.findViewById(R.id.tvWalletSpendKey);
|
tvWalletSpendKey = (TextView) view.findViewById(R.id.tvWalletSpendKey);
|
||||||
tvWalletMnemonic = view.findViewById(R.id.tvWalletMnemonic);
|
tvWalletMnemonic = (TextView) view.findViewById(R.id.tvWalletMnemonic);
|
||||||
bCopyAddress = view.findViewById(R.id.bCopyAddress);
|
bCopyAddress = (ImageButton) view.findViewById(R.id.bCopyAddress);
|
||||||
bAdvancedInfo = view.findViewById(R.id.bAdvancedInfo);
|
bAdvancedInfo = (Button) view.findViewById(R.id.bAdvancedInfo);
|
||||||
llAdvancedInfo = view.findViewById(R.id.llAdvancedInfo);
|
llAdvancedInfo = (LinearLayout) view.findViewById(R.id.llAdvancedInfo);
|
||||||
llPassword = view.findViewById(R.id.llPassword);
|
llPassword = (LinearLayout) view.findViewById(R.id.llPassword);
|
||||||
llMnemonic = view.findViewById(R.id.llMnemonic);
|
|
||||||
llSpendKey = view.findViewById(R.id.llSpendKey);
|
|
||||||
llViewKey = view.findViewById(R.id.llViewKey);
|
|
||||||
|
|
||||||
bAccept = view.findViewById(R.id.bAccept);
|
bAccept = (Button) view.findViewById(R.id.bAccept);
|
||||||
|
|
||||||
boolean allowCopy = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet;
|
boolean allowCopy = WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet;
|
||||||
tvWalletMnemonic.setTextIsSelectable(allowCopy);
|
tvWalletMnemonic.setTextIsSelectable(allowCopy);
|
||||||
@@ -148,6 +142,7 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showDetails() {
|
void showDetails() {
|
||||||
|
showProgress();
|
||||||
tvWalletPassword.setText(null);
|
tvWalletPassword.setText(null);
|
||||||
new AsyncShow().executeOnExecutor(MoneroThreadPoolExecutor.MONERO_THREAD_POOL_EXECUTOR, walletPath);
|
new AsyncShow().executeOnExecutor(MoneroThreadPoolExecutor.MONERO_THREAD_POOL_EXECUTOR, walletPath);
|
||||||
}
|
}
|
||||||
@@ -193,21 +188,6 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
boolean isWatchOnly;
|
boolean isWatchOnly;
|
||||||
Wallet.Status status;
|
Wallet.Status status;
|
||||||
|
|
||||||
boolean dialogOpened = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPreExecute() {
|
|
||||||
super.onPreExecute();
|
|
||||||
showProgress();
|
|
||||||
if ((walletPath != null)
|
|
||||||
&& (WalletManager.getInstance().queryWalletDevice(walletPath + ".keys", getPassword())
|
|
||||||
== Wallet.Device.Device_Ledger)
|
|
||||||
&& (progressCallback != null)) {
|
|
||||||
progressCallback.showLedgerProgressDialog(LedgerProgressDialog.TYPE_RESTORE);
|
|
||||||
dialogOpened = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(String... params) {
|
protected Boolean doInBackground(String... params) {
|
||||||
if (params.length != 1) return false;
|
if (params.length != 1) return false;
|
||||||
@@ -232,16 +212,7 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
|
|
||||||
address = wallet.getAddress();
|
address = wallet.getAddress();
|
||||||
seed = wallet.getSeed();
|
seed = wallet.getSeed();
|
||||||
switch (wallet.getDeviceType()) {
|
|
||||||
case Device_Ledger:
|
|
||||||
viewKey = Ledger.Key();
|
|
||||||
break;
|
|
||||||
case Device_Software:
|
|
||||||
viewKey = wallet.getSecretViewKey();
|
viewKey = wallet.getSecretViewKey();
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new IllegalStateException("Hardware backing not supported. At all!");
|
|
||||||
}
|
|
||||||
spendKey = isWatchOnly ? getActivity().getString(R.string.label_watchonly) : wallet.getSecretSpendKey();
|
spendKey = isWatchOnly ? getActivity().getString(R.string.label_watchonly) : wallet.getSecretSpendKey();
|
||||||
isWatchOnly = wallet.isWatchOnly();
|
isWatchOnly = wallet.isWatchOnly();
|
||||||
if (closeWallet) wallet.close();
|
if (closeWallet) wallet.close();
|
||||||
@@ -251,8 +222,6 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Boolean result) {
|
protected void onPostExecute(Boolean result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
if (dialogOpened)
|
|
||||||
progressCallback.dismissProgressDialog();
|
|
||||||
if (!isAdded()) return; // never mind
|
if (!isAdded()) return; // never mind
|
||||||
walletName = name;
|
walletName = name;
|
||||||
if (result) {
|
if (result) {
|
||||||
@@ -263,22 +232,10 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
llPassword.setVisibility(View.VISIBLE);
|
llPassword.setVisibility(View.VISIBLE);
|
||||||
tvWalletPassword.setText(getPassword());
|
tvWalletPassword.setText(getPassword());
|
||||||
tvWalletAddress.setText(address);
|
tvWalletAddress.setText(address);
|
||||||
if (!seed.isEmpty()) {
|
|
||||||
llMnemonic.setVisibility(View.VISIBLE);
|
|
||||||
tvWalletMnemonic.setText(seed);
|
tvWalletMnemonic.setText(seed);
|
||||||
}
|
|
||||||
boolean showAdvanced = false;
|
|
||||||
if (isKeyValid(viewKey)) {
|
|
||||||
llViewKey.setVisibility(View.VISIBLE);
|
|
||||||
tvWalletViewKey.setText(viewKey);
|
tvWalletViewKey.setText(viewKey);
|
||||||
showAdvanced = true;
|
|
||||||
}
|
|
||||||
if (isKeyValid(spendKey)) {
|
|
||||||
llSpendKey.setVisibility(View.VISIBLE);
|
|
||||||
tvWalletSpendKey.setText(spendKey);
|
tvWalletSpendKey.setText(spendKey);
|
||||||
showAdvanced = true;
|
bAdvancedInfo.setVisibility(View.VISIBLE);
|
||||||
}
|
|
||||||
if (showAdvanced) bAdvancedInfo.setVisibility(View.VISIBLE);
|
|
||||||
bCopyAddress.setClickable(true);
|
bCopyAddress.setClickable(true);
|
||||||
bCopyAddress.setImageResource(R.drawable.ic_content_copy_black_24dp);
|
bCopyAddress.setImageResource(R.drawable.ic_content_copy_black_24dp);
|
||||||
activityCallback.setTitle(name, getString(R.string.details_title));
|
activityCallback.setTitle(name, getString(R.string.details_title));
|
||||||
@@ -310,8 +267,6 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
public interface ProgressListener {
|
public interface ProgressListener {
|
||||||
void showProgressDialog(int msgId);
|
void showProgressDialog(int msgId);
|
||||||
|
|
||||||
void showLedgerProgressDialog(int mode);
|
|
||||||
|
|
||||||
void dismissProgressDialog();
|
void dismissProgressDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,13 +436,13 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
|
||||||
alertDialogBuilder.setView(promptsView);
|
alertDialogBuilder.setView(promptsView);
|
||||||
|
|
||||||
final TextInputLayout etPasswordA = promptsView.findViewById(R.id.etWalletPasswordA);
|
final TextInputLayout etPasswordA = (TextInputLayout) promptsView.findViewById(R.id.etWalletPasswordA);
|
||||||
etPasswordA.setHint(getString(R.string.prompt_changepw, walletName));
|
etPasswordA.setHint(getString(R.string.prompt_changepw, walletName));
|
||||||
|
|
||||||
final TextInputLayout etPasswordB = promptsView.findViewById(R.id.etWalletPasswordB);
|
final TextInputLayout etPasswordB = (TextInputLayout) promptsView.findViewById(R.id.etWalletPasswordB);
|
||||||
etPasswordB.setHint(getString(R.string.prompt_changepwB, walletName));
|
etPasswordB.setHint(getString(R.string.prompt_changepwB, walletName));
|
||||||
|
|
||||||
LinearLayout llFingerprintAuth = promptsView.findViewById(R.id.llFingerprintAuth);
|
LinearLayout llFingerprintAuth = (LinearLayout) promptsView.findViewById(R.id.llFingerprintAuth);
|
||||||
final Switch swFingerprintAllowed = (Switch) llFingerprintAuth.getChildAt(0);
|
final Switch swFingerprintAllowed = (Switch) llFingerprintAuth.getChildAt(0);
|
||||||
if (FingerprintHelper.isDeviceSupported(getActivity())) {
|
if (FingerprintHelper.isDeviceSupported(getActivity())) {
|
||||||
llFingerprintAuth.setVisibility(View.VISIBLE);
|
llFingerprintAuth.setVisibility(View.VISIBLE);
|
||||||
@@ -600,8 +555,7 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
// accept keyboard "ok"
|
// accept keyboard "ok"
|
||||||
etPasswordB.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
etPasswordB.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
|
||||||
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
|
|
||||||
String newPasswordA = etPasswordA.getEditText().getText().toString();
|
String newPasswordA = etPasswordA.getEditText().getText().toString();
|
||||||
String newPasswordB = etPasswordB.getEditText().getText().toString();
|
String newPasswordB = etPasswordB.getEditText().getText().toString();
|
||||||
// disallow empty passwords
|
// disallow empty passwords
|
||||||
@@ -623,10 +577,4 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
return openDialog;
|
return openDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isKeyValid(String key) {
|
|
||||||
return (key != null) && (key.length() == 64)
|
|
||||||
&& !key.equals("0000000000000000000000000000000000000000000000000000000000000000")
|
|
||||||
&& !key.toLowerCase().equals("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
||||||
// ledger implmenetation returns the spend key as f's
|
|
||||||
}
|
|
||||||
}
|
}
|