Skip to content

synonymdev/bitkit-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,012 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitkit Android (Native)

About

This repository contains the native Android app for Bitkit.

Development

Prerequisites

1. Firebase Configuration

Download google-services.json from the Firebase Console for each of the following build flavor groups,:

  • dev/tnet/mainnetDebug: Place in app/google-services.json
  • mainnetRelease: Place in app/src/mainnetRelease/google-services.json

Note: Each flavor requires its own Firebase project configuration. The mainnet flavor will fail to build without its dedicated google-services.json file.

2. GitHub Packages setup

Some internal libraries are distributed via GitHub Packages. Configure credentials so Gradle can resolve them.

  1. Create a GitHub token with read:packages scope.

  2. Provide credentials for Gradle (choose one):

    • Environment variables

      • GITHUB_ACTOR (your username)
      • GITHUB_TOKEN (token with read:packages)
    • PROJECT_ROOT/local.properties or ~/.gradle/gradle.properties

      • gpr.user=YOUR_GITHUB_USERNAME
      • gpr.key=YOUR_GITHUB_TOKEN

See also:

References

Lint

This project uses detekt with default ktlint and compose-rules for android code linting.

IDE Plugins

The following IDE plugins are recommended for development with Android Studio or IntelliJ IDEA:

Commands

./gradlew detekt # run analysis + formatting check
./gradlew detekt --auto-correct # auto-fix formatting issues

Reports are generated in: app/build/reports/detekt/.

Test

Commands

./gradlew testDevDebugUnitTest # run unit tests

# run android tests:
./gradlew installDevDebug # install
./gradlew connectedDevDebugAndroidTest # run

Localization

Pulling Translations

To pull the latest translations from Transifex:

  1. Install Transifex CLI (if not already installed):

  2. Authenticate with Transifex (if not already configured):

    • Set the TX_TOKEN environment variable with your API token:
      export TX_TOKEN="YOUR_API_TOKEN_HERE"
    • You can get your API token from Transifex account settings
    • Add it to ~/.zshrc or other shell rc file to persist across sessions
  3. Pull translations:

    ./scripts/pull-translations.sh

Pushing Source Strings

When you add or modify translation keys in the EN source file, push them to Transifex:

tx push --source

Translation Workflow

  1. Add/modify strings in app/src/main/res/values/strings.xml
  2. Push to Transifex: tx push --source
  3. Translators work on translations in Transifex
  4. Pull translations: ./scripts/pull-translations.sh
  5. Commit the updated translation files

Build

Bitcoin Networks

The build config supports building 3 different apps for the 3 bitcoin networks (mainnet, testnet, regtest) via the 3 build flavors:

  • dev flavour = regtest
  • mainnet flavour = mainnet
  • tnet flavour = testnet

Build for Internal Testing

Prerequisites
Setup the signing config:

  • Add the keystore file to root dir (i.e. internal.keystore)
  • Setup keystore.properties file in root dir (cp keystore.properties.template keystore.properties)

Routine

Increment versionCode and versionName in app/build.gradle.kts, then run:

./gradlew assembleDevRelease
# ./gradlew assembleRelease # for all flavors

APK is generated in app/build/outputs/apk/_flavor_/release. (_flavor_ can be any of 'dev', 'mainnet', 'tnet'). Example for dev: app/build/outputs/apk/dev/release

Build for Release

To build the mainnet flavor for release run:

./gradlew assembleMainnetRelease

Android App Bundle (AAB)

For Play Store submission, build an AAB instead of APK:

./gradlew bundleMainnetRelease

AAB is generated in app/build/outputs/bundle/mainnetRelease/.

Build for E2E Testing

Pass E2E=true and build any flavor. By default, E2E uses a local Electrum override.

E2E=true ./gradlew assembleDevRelease

Use Network Electrum (Staging/Mainnet)

Set E2E_BACKEND=network to use the network Electrum based on the build flavor:

# regtest (dev flavor)
E2E=true E2E_BACKEND=network ./gradlew assembleDevRelease
# testnet (tnet flavor)
E2E=true E2E_BACKEND=network ./gradlew assembleTnetRelease
# mainnet
E2E=true E2E_BACKEND=network ./gradlew assembleMainnetRelease

Disable Geoblocking Checks

By default, geoblocking checks via API are enabled. To disable at build time, use the GEO environment variable:

GEO=false E2E=true ./gradlew assembleDevRelease

Contributing

AI Code Review with Claude

This repository has Claude Code integrated for on-demand AI assistance on issues and pull requests.

How to Use

Mention @claude in any PR comment, issue, or review to trigger Claude:

Command Description
@claude review Request a code review of the PR
@claude /review Same as above (slash command)
@claude review focus on security Review with specific focus
@claude explain this change Ask questions about the code
@claude fix the null pointer issue Request Claude to implement a fix
@claude /help Show available commands

Notes

  • Claude follows the project guidelines defined in CLAUDE.md
  • Automatic reviews run on every PR open and push (updates same comment)
  • On-demand assistance via @claude mentions in comments/issues
  • Claude can read CI results to provide context-aware feedback
  • For implementation requests, Claude will create commits on your branch

Example

@claude review

Please focus on:
- Kotlin idioms and best practices
- Potential memory leaks
- Thread safety in coroutines

Local Development Setup (YOLO Mode)

To enable auto-approved permissions for Claude Code during local development:

cp .claude/settings.local.template.json .claude/settings.local.json

This reduces confirmation prompts for common operations (Bash, Read, Edit, Write, etc.). Destructive operations like rm -rf, git commit, and git push still require confirmation.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Packages

No packages published

Contributors 9

Languages