You need to have the following Android developer tools installed:
- "Android SDK Platform-tools" version 24.0.4 recommended
- "Android SDK Tools" version 25.2.2 recommended
- "Android SDK Build-tools" version 24.0.3 recommended
- "Android Support Library" version 23.2.1 recommended
- "Android Support Repository" version 38.0.0 recommended
- "Android NDK" version r13 recommended
The above tools can be installed from the Android SDK manager.
GreenBits uses libwally which requires the following to be installed for building:
- SWIG. Most Linux distributions have this packaged,
for example on debian
sudo apt-get install swig
should work.
git clone https://github.com/greenaddress/GreenBits.git
cd GreenBits
This step requires the environment variables ANDROID_NDK
and JAVA_HOME
to
be set correctly.
cd app && ./prepare_fdroid.sh && cd ..
./gradlew build
This will build both MAINNET and TESTNET builds
For TESTNET only run ./gradlew assembleBtctestnetDebug
Checkpoint files reduce the amount of data that SPV has to download. The checkpoint data is rebuilt periodically but you may wish to update it if you will be making and testing changes.
To rebuild, start both MAINNET and TESTNET instances of bitcoind on localhost. Make sure they are fully synchronized and have finished booting (verifying blocks, etc).
On MAINNET:
./gradlew --project-dir=bitcoinj/tools buildMainnetCheckpoints && mv bitcoinj/tools/checkpoints app/src/production/assets/checkpoints
On TESTNET:
./gradlew --project-dir=bitcoinj/tools buildTestnetCheckpoints && mv bitcoinj/tools/checkpoints-testnet app/src/btctestnet/assets/checkpoints
Or to build both at once, run:
./buildCheckpoints.sh
Thanks to Bitcoin Wallet for Android for their QR scanning activity source code!
Thanks to Riccardo Casatta for code and big UX contributions!