• Stars
    star
    554
  • Rank 80,342 (Top 2 %)
  • Language
    Kotlin
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blockchain Android Wallet

My-Wallet-V3-Android

CircleCI

Next-generation HD (BIP32, BIP39, BIP44) bitcoin, ethereum and bitcoin cash wallet.

Getting started

Install Android Studio

Download from Android Studio. Make sure to install the command line tools as well. After installing AS, open it and install API 28 (current compileSdkVersion) and 29 (current targetSdkVersion) from Preferences -> Appearance & Behavior -> System Settings -> Android SDK. Install Oracle JDK for Gradle command line tools.

Required: Run the quickstart script from a bash terminal at the base of the project; ./scripts/quick_start.sh this will install the necessary dependencies for the project to compile successfully.

Optional: Run the bootstrap script from terminal via scripts/bootstrap.sh. This will install the Google Java code style as well as the official Android Kotlin code style and remove any file header templates. The script may indicate that you need to restart Android Studio for it's changes to take effect.

Install homebrew

https://brew.sh/

Setting up SSH for GitHub

Follow this for generating your SSH key and adding it to your GitHub account.

Automatic Git Commit Signing

Install System Packages

# Install GPG
brew install gpg

# Install Pinentry for storing the passphrase in the keychain
brew install pinentry-mac

Generate the key via gpg --full-generate-key When asked:

  • press enter to choose RSA / DSA (default)
  • Key size 4096
  • Key valid for 0 (indefinitely)
  • Add your name on GitHub
  • Add your blockchain email address

Configuring Git to sign automatically

Take the second line below โ€œpubโ€, i.e. long string with hex string (this is the key_id)

git config --global user.signingKey key_id
git config --global commit.gpgSign true
git config --global gpg.program gpg

# Setting up the gpg agent to use the keychain
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf

# You may need to restart the agent
gpgconf --kill gpg-agent

Configuring Github to recognize the key

Go to GitHub -> Profile -> Settings -> SSH and GPG keys -> new GPG key Get your public key by running

# where key_id as before
gpg --armor --export key_id | pbcopy

Install XCode command line tools

This is required in order to be able to use fastlane bundle commands

xcode-select --install

Setting up fastlane

We use fastlane for automating building, signing, testing and uploading to Appcenter and to the Play Store. The settings are stored in the fastlane directory. The preferred way of installing fastlane is via the Gemfile

[sudo] bundle install

To update fastlane use

[sudo] bundle update fastlane

after which you need to commit the changes (typically the Gemfile, Gemfile.lock and the configuration files in the fastlane directory).

Alternatively you can install it via Homebrew

brew install fastlane

fastlane init

Once fastlane is setup, you can find the available lane commands and their description in ./fastlane/README.md file.

Using fastlane

You can run any of the lane tasks defined in the ./fastlane/FastFile (summary in the fastlane README.md)

# The <options> are given in the format of key1:value1 key2:value2 and so on
bundle exec fastlane <lane> <options>

# For all the available options run
bundle exec fastlane

# Alternative, the bundle is preferred
fastlane <lane> <options>

Running builds

# Staging and Debug are the default arguments for <environment> and <build_type>.
# Use environment:<environment> and build_type:<build_type> for specific builds.
bundle exec fastlane build

# Use <environment>_<build_type> for building staging and prod debug and release builds like:
bundle exec fastlane prod_release

Running the unit tests

# Staging and Debug are the default arguments for <environment> and <build_type>.
# Use environment:<environment> and build_type:<build_type> for specific test executions (app module only).
bundle exec fastlane test

# Use <module> and  <test_name> to run tests for a single class only (or to run a single test). Example:
bundle exec fastlane test module:sunriver test_name:com.blockchain.sunriver.HorizonOperationMappingTest

Troubleshooting

Sometimes the XCode developer tools doesn't find the relevant headers to build and install the necessary gems. In this case use the following command to compile the required gem:

sudo xcrun gem install <gem_name> -v <gem_version> --source 'https://rubygems.org/'

Example:

sudo xcrun gem install unf_ext -v '0.0.7.7' --source 'https://rubygems.org/'

Building

Clone the Android Repository. Make sure your repository is on develop. Import it as an Android Studio project (File -> Open).

Configuration files

The following files can be found in Android Configuration Files:

  • Secrets properties file - Contains API keys and the various combinations of production/staging/testnet/dev URLs.
  • Environment files - root env folder and total of 3 google-services.json files.

You can get the latest configuration files by running

 bundle exec fastlane credentials

Or manually cloning the Android Configuration Files repository and then moving the secrets.properties (file extension should be properties only) into ./app as well as unzipping the env.zip file, deleting ./app/src/env and then moving the unzipped env folder to ./app/src/.

Select the envStagingDebug variant from Build Variants (bottom left corner in AS) since dev is quite unstable, then hit Build -> Make Project. For Dev and Staging access you'll need VPN access.

Common Errors

Execution failed for task :app:processEnv...GoogleServices

  • Make sure to delete ./app/src/env and then move the unzipped env folder to ./app/src/.
  • Make sure ./app/src/env/ only contains directories (there shouldn't be any json file there)

Contributions and Code Style

All new code must be in Kotlin. We are using the official Kotlin style guide, which can be applied in Android Studio via Preferences -> Editor -> Code Style -> Kotlin -> Set from -> Predefined style -> Kotlin Style Guide. It should be noted that this is not currently the default in Android Studio, so please configure this if you have recently reinstalled AS. Alternatively, simply run the bootstrap script and ktlint will configure your IDE for you.

All code must be tested if possible, and must pass CI. Therefore it must introduce no new Lint errors, and must pass Ktlint. Before committing any new Kotlin code it is recommended formatting your files in Android Studio with CMD + ALT + L and running ./gradlew ktlint locally. You can if you so wish run ./gradlew ktlintFormat which will fix any style violations. Be aware that this may need to be run twice to apply all fixes as of 0.20.

Commit message style

Use git change log style.

Where you have access to Jira, you should apply the git hooks with ./gradlew installGitHooks. This enforces the git change log style with Jira references.

Security

Security issues can be reported to us in the following venues:

More Repositories

1

service-my-wallet-v3

Blockchain Wallet API Service
JavaScript
887
star
2

blockchain-wallet-v4-frontend

Blockchain.com's open source, non-custodial Wallet
TypeScript
758
star
3

thunder

Off-Chain Bitcoin payments using smart contracts
Java
531
star
4

My-Wallet-V3

Blockchain Web Wallet Library - https://support.blockchain.com
JavaScript
405
star
5

My-Wallet-V3-iOS

Blockchain iOS Wallet
Swift
369
star
6

receive-payments-demos

Blockchain.info Receive Payments API V2 Demos
PHP
271
star
7

My-Wallet-V3-Frontend

Blockchain Web Wallet Frontend
JavaScript
207
star
8

unused-My-Wallet

Legacy Blockchain Web Wallet - current version is at https://github.com/blockchain/My-Wallet-V3-Frontend
JavaScript
207
star
9

unused-My-Wallet-iPhone

For latest source, please see: https://github.com/blockchain/My-Wallet-V3-iOS
Assembly
127
star
10

lib-exchange-client

C#
124
star
11

Blockchain-Known-Pools

Blockchain Known Pools Tracking Info
109
star
12

my-wallet-backup-decryption-tool

JavaScript
49
star
13

unused-My-Wallet-V3-jar

Deprecated. Now lives here: https://github.com/blockchain/My-Wallet-V3-Android/tree/master/wallet
Java
34
star
14

Checksum-Wallet

Wallet checksums
32
star
15

bc-phone-number

An AngularJS international phone input directive
JavaScript
32
star
16

coin-definitions

Python
31
star
17

My-Wallet-Chrome-Extension

Chrome Extension For Blockchain.info Wallets
Shell
25
star
18

components

Components library for the Blockchain.com ecosystem ๐Ÿ’ ๐Ÿ”ฅ
JavaScript
24
star
19

bc-countries

A convenient Javascript countries utilities (e.g: dial codes, country codes, names)
JavaScript
18
star
20

wallet-options

JavaScript
17
star
21

bitcoin-exchange-client

JavaScript
16
star
22

bitcoin-coinify-client

JavaScript
14
star
23

constellation

TypeScript
13
star
24

bitcoin-sfox-client

JavaScript
12
star
25

OpenQuestDB

High performance, low latency multi-value SQL database optimised for time series
Java
10
star
26

Checksum-Explorer

Explorer checksums
9
star
27

My-Wallet-V3-Bower

9
star
28

sre-rust-tss-esapi

Rust
9
star
29

bitcoin-unocoin-client

JavaScript
8
star
30

cashaddrj

Java
8
star
31

api-v1-client-java

Blockchain Bitcoin Developer APIs - Java
Java
7
star
32

digits-trie

Fast prefix operations for strings of digits
JavaScript
6
star
33

bc-css-flags

Countries flags styles using only one picture
CSS
5
star
34

android_tech_dependencies

Empty Android project with standard dependencies
Kotlin
2
star