A sample Android wallet using the [Hush Android SDK](https://git.hush.is/hush/hush-android-wallet-sdk) which is based on the [Zcash Android SDK](https://github.com/zcash/zcash-android-wallet-sdk).
### Motivation
@ -23,24 +23,39 @@ This a sample wallet for the following set of features:
- [Android Studio](https://developer.android.com/studio/index.html) last tested with Android Studio Dolphin | 2021.3.1 Patch 1 or [adb](https://www.xda-developers.com/what-is-adb/)
- An Android device or emulator. Android 10 or higher is recommended.
# Building the App
To run, clone the repo, open it in Android Studio and press play. It should just work.™
2. Add any new checkpoints to the SDK - Checkpoints are located in ```hush-android-wallet-sdk\sdk-lib\src\main\assets\co.electriccoin.zcash\checkpoint\mainnet``` You may use the [sda_checkpoints.pl](https://git.hush.is/hush/hush3/src/branch/dev/contrib/sda_checkpoints.pl) script and modify the start and end block heights accordingly.
By default, this script will generate many checkpoints in a single file IE: ```./contrib/sda_checkpoints.pl > newcheckpoints.json```. You may then copy/paste to individual .json files named as the block height the checkpoint is for or modify this script to save individual .json files for each block height.
3. Compile and publish the SDK locally as the app's code currently relies on mavenLocal for the SDK.
5. Open the app in Android Studio and press play to install and run on connected device. It should just work.™
6. If you want to build APKs instead of installing on a device or emulator, select Build > Build Bundle(s) / APK(s) > Build APK(s)
## Install from Android Studio
1. [Install Android Studio](https://developer.android.com/studio/install) and setup an emulator
1a. If using a device, be sure to [put it in developer mode](https://developer.android.com/studio/debug/dev-options) to enable side-loading apps
2. `Import` the hush-android-wallet folder.
2. `Import` the SilentDragonAndroid folder.
It will be recognized as an Android project.
3. Press play (once it is done opening and indexing)
## OR Install from the command line
To build from the command line, [setup ADB](https://www.xda-developers.com/install-adb-windows-macos-linux/) and connect your device. Then simply run this and it will both build and install the app:
```bash
cd /path/to/hush-android-wallet
cd /path/to/SilentDragonAndroid
./gradlew
```
Note: The lack of an explicit Gradle task is not a typo. A default task is configured via [build.gradle.kts](build.gradle.kts).
@ -49,20 +64,20 @@ Tip: On macOS and Linux, Gradle is invoked with `./gradlew`. On Windows, Gradle
# Included builds
To simplify implementation of SDK features in conjunction with changes to the app, a Gradle [Included Build](https://docs.gradle.org/current/userguide/composite_builds.html) can be configured.
These notes are included from upstream and for reference only if looking to create an included build. To simplify implementation of SDK features in conjunction with changes to the app, a Gradle [Included Build](https://docs.gradle.org/current/userguide/composite_builds.html) can be configured.
1. Check out the SDK to a directory path of `../hush-android-sdk` relative to the root of this app's repo. For example:
1. Check out the SDK to a directory path of `../hush-android-wallet-sdk` relative to the root of this app's repo. For example:
parent/
hush-android-wallet/
hush-android-sdk/
SilentDragonAndroid/
hush-android-wallet-sdk/
1. Verify that the `hush-android-sdk` builds correctly on its own
1. Build `hush-android-wallet`, setting the Gradle property `IS_SDK_INCLUDED_BUILD=true`
1. Verify that the `hush-android-wallet-sdk` builds correctly on its own
1. Build `SilentDragonAndroid`, setting the Gradle property `IS_SDK_INCLUDED_BUILD=true`
There are some limitations of included builds:
1. Properties from `hush-android-wallet` will override those set in `hush-android-sdk` with the same name
1. Modules in each project cannot share the same name. For this reason, build-conventions have different names in each repo (`hush-android-sdk/build-conventions` vs `other-android-wallet/build-convention`)
1. Properties from `SilentDragonAndroid` will override those set in `hush-android-wallet-sdk` with the same name
1. Modules in each project cannot share the same name. For this reason, build-conventions have different names in each repo (`hush-android-wallet-sdk/build-conventions` vs `other-android-wallet/build-convention`)
1. Kotlin and KSP versions will need to be coordinated between the two projects, because KSP is tightly coupled to the Kotlin version
# Contributing
@ -75,7 +90,7 @@ Contact us on [Telegram](https://hush.is/tg) or [Matrix](https://hush.is/matrix)
// .setMessage("To make full use of this wallet, deposit funds to your address or tap the faucet to trigger a tiny automatic deposit.\n\nFaucet funds are made available for the community by the community for testing. So please be kind enough to return what you borrow!")
<stringname="translated_seed_restore">Restaurando desde frase de respaldo</string>
<stringname="translated_seed_restoretext">Deberás ingresar todas las 24 palabras de tu frase semilla en orden</string>
<stringname="translated_seed_reminder">¡Tus fondos están en riesgo!</string>
<stringname="translated_seed_remindertext">Recuerda, en Zcash tu eres el banco. Cualquiera que tenga tu frase semilla podrá acceder a tu wallet</string>
<stringname="translated_seed_remindertext">Recuerda, en HUSH tu eres el banco. Cualquiera que tenga tu frase semilla podrá acceder a tu wallet</string>
<stringname="translated_seed_remindertext2">Deberías respaldar tu wallet inmediatamente. Solo tú puedes hacerlo.</string>
<stringname="translated_seed_birthdaytext">Estamos buscando transacciones de tu wallet en la blockchain. Si nos provees una fecha inicial de tu wallet podemos hacerlo más rápido.</string>
@ -22,7 +22,7 @@
<stringname="translated_button_skip">Omitir por ahora</string>
<stringname="translated_balance_screen">Pantalla de Balance</string>
<stringname="translated_balance_amounttosend">Ingresar un monto para enviar</string>
<stringname="translated_balance_expecting">esperando XX ZEC</string>
<stringname="translated_balance_expecting">esperando XX HUSH</string>
<stringname="translated_button_skip">Salta per ora</string>
<stringname="translated_button_wallethistory">cronologia del wallet</string>
<stringname="translated_feedback_default">Inserisci un indirizzo Zcash valido</string>
<stringname="translated_feedback_default">Inserisci un indirizzo HUSH valido</string>
<stringname="translated_feedback_invalidaddress">Attenzione, questo indirizzo non è valido!</string>
<stringname="translated_feedback_sameaddress">Attenzione, sembra che questo sia il tuo indirizzo!</string>
<stringname="translated_feedback_shieldedaddress">Questo è un indirizzo blindato valido</string>
@ -39,7 +39,7 @@
<stringname="translated_seed_birthdaytext">Stiamo cercando transazioni dal tuo wallet sulla blockchain. Se ci fornisci una data iniziale del tuo Wallet, possiamo farlo più velocemente.</string>
<stringname="translated_seed_remindertext">Помните, что с Zcash Вы сами находитесь в роли банка. Любой, кто владеет фразой восстановления, получает полный доступ к кошельку.</string>
<stringname="translated_seed_remindertext">Помните, что с HUSH Вы сами находитесь в роли банка. Любой, кто владеет фразой восстановления, получает полный доступ к кошельку.</string>
<stringname="translated_seed_remindertext2">Вам следует незамедлительно создать резервную копию, так она позволит восстановить доступ к Вашему кошельку.</string>
<stringname="translated_seed_accepted">Фраза восстановления принята, идёт сканирование блокчейна!</string>
<stringname="translated_seed_birthdaytext">Мы сканируем блокчейн на предмет транзакций, которые относятся к вашему кошельку. Если вы можете указать дату создания данного кошелька, процесс ускорится.</string>
<stringname="translated_seed_birthdaytext">We are scanning the blockchain for transactions pertaining to your wallet. If you can provide a birthday date for this wallet we can speed it up.</string>
@ -22,7 +22,7 @@
<stringname="translated_button_skip">Skip for now</string>
<stringname="translated_server_note">NOTE: You must fully close and restart the app for a server change to take effect. Entering and updating a server here will cause that server to be set in encrypted preferences and used all the time, otherwise a random server is chosen by default on startup.</string>
<stringname="translated_street_mode">Street Mode (Hides balance and wallet history for extra privacy)</string>
constvalversionCode=1_00_00// last digits are alpha(0XX) beta(2XX) rc(4XX) release(8XX). Ex: 1_08_04_401 is an release candidate build of version 1.8.4 and 1_08_04_800 would be the final release.
constvaltargetSdkVersion=30
constvalversionName="1.0.4"
constvalversionCode=1_04_00// last digits are alpha(0XX) beta(2XX) rc(4XX) release(8XX). Ex: 1_08_04_401 is an release candidate build of version 1.8.4 and 1_08_04_800 would be the final release.