From 01491aaba3556d601d06ca04f0cdfbb6b37d838b Mon Sep 17 00:00:00 2001 From: fekt Date: Wed, 31 May 2023 12:41:43 +0000 Subject: [PATCH] Adding some build notes/instructions --- README.md | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b05213f..28cc789 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# hush-android-wallet +# SilentDragonAndroid 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: - reply-to formatted memos # Prerequisites -- [The code](https://git.hush.is/hush/hush-android-wallet) -- [Android Studio](https://developer.android.com/studio/index.html) or [adb](https://www.xda-developers.com/what-is-adb/) +- [The app code](https://git.hush.is/hush/SilentDragonAndroid/) +- [The SDK code](https://git.hush.is/hush/hush-android-wallet-sdk) +- [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.™ +1. Clone the SDK: +```git clone https://git.hush.is/hush/hush-android-wallet-sdk.git``` +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. + ``` + ./gradlew clean + ./gradlew build + ./gradlew build publishToMavenLocal + ``` +4. Clone the app repo: +```git clone https://git.hush.is/hush/SilentDragonAndroid.git``` +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) # Copyright -Copyright 2016-2022 The Hush developers +Copyright 2016-2023 The Hush developers # License