This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Gem Wallet is an open-source, multi-chain cryptocurrency wallet for Android built with Kotlin/Compose. The app provides secure self-custody wallet functionality with support for multiple blockchains including Ethereum, Bitcoin, Solana, and many others.
Key Technologies:
- Frontend: Kotlin, Jetpack Compose, Android SDK
- Backend: Rust Core library for cryptographic operations
- Build System: Gradle with Kotlin DSL
- Task Runner: Just (justfile)
- Docker: Multi-stage builds for CI/CD
gem-android/
├── app/ # Main Android application module
├── core/ # Rust core library (submodule)
├── gemcore/ # JNI bindings for Rust core
├── ui/ # UI components and screens
├── data/ # Data layer (repositories, services)
├── blockchain/ # Blockchain-specific implementations
├── features/ # Feature modules (NFT, recipient, etc.)
├── flavors/ # Build flavors (Google, Samsung, etc.)
├── Dockerfile # Base Docker image for Android development
├── reproducible/ # Reproducible build tooling (Dockerfile, verify script, docs)
└── justfile # Task definitions
- Android Studio (latest version)
- JDK 17 (preferably via SDKMAN)
- Just task runner (
brew install just) - GitHub Personal Access Token with
read:packagespermission
# Install development dependencies
just bootstrap
# Generate GitHub token and add to local.properties:
echo "gpr.username=<your-github-username>" >> local.properties
echo "gpr.token=<your-github-personal-token>" >> local.properties
# Generate models (optional)
just generate# List all available commands
just list
# Bootstrap development environment
just bootstrap
# Generate TypeShare models from Rust
just generate
# Generate models only
just generate-models
# Update core submodule
just core-upgrade
# Localize strings
just localize# Build debug APK
./gradlew assembleGoogleDebug
# Build release bundle (unsigned)
just unsigned-release
# Build all release variants
just release
# Extract universal APK from bundle
just extract-universal-apk
# Clean build
./gradlew clean# Run unit tests
./gradlew test
# Run specific test suite
./gradlew :app:testGoogleDebugUnitTest
# Build test APK
./gradlew assembleGoogleDebugAndroidTest
# Run connected Android tests
./gradlew connectedGoogleDebugAndroidTest
# Run all tests
./gradlew check# Build base Docker image
just build-base-image
# Build app Docker image
just build-app-image
# Build with specific tag
TAG=feature-branch just build-app-image
# Build app artifacts inside Docker (uses the image above)
just build-app-in-docker# Run lint checks
./gradlew lint
# Run detekt static analysis
./gradlew detekt
# Format code
./gradlew ktlintFormat- app/: Main application module with Activities and Application class
- ui/: Shared UI components, themes, and Compose screens
- data/: Repository pattern implementation, database, network services
- gemcore/: JNI bindings to Rust core library
- blockchain/: Blockchain-specific implementations and models
- features/: Modular features (NFT management, recipient handling, etc.)
- google: Google Play Store version with Firebase/FCM
- huawei: Huawei AppGallery version
- samsung: Samsung Galaxy Store version
- solana: Solana-focused variant
- universal: Universal build
- Jetpack Compose: Modern UI toolkit
- Hilt: Dependency injection
- Room: Local database
- Retrofit: Network layer
- WalletConnect: dApp connectivity via Reown SDK
- Rust Core: Cryptographic operations via JNI
- Wallet Core: TrustWallet core library for blockchain operations
- Gemstone: Internal library for additional functionality
- Coil: Image loading
- Ktor: WebSocket client for real-time data
- ci.yml: Main CI pipeline (tests, lint, build)
- docker.yml: Docker image builds for releases
- Base Image: Built from
Dockerfilewith Android SDK, NDK, JDK - App Image: Built from
reproducible/Dockerfileusing base image - Artifacts: APK/AAB files uploaded to GitHub releases
- Follow Kotlin coding conventions
- Use Jetpack Compose for UI development
- Implement repository pattern for data access
- Use Hilt for dependency injection
- Write unit tests for business logic
- Main Branch:
main(stable releases) - Feature Branches:
feature/descriptionorfix/description - Commit Messages: Follow Conventional Commits
- Never commit secrets or API keys
- Use
local.propertiesfor sensitive configuration - Follow Android security best practices
- Implement proper key management
Build Failures:
# Clean and rebuild
./gradlew clean
just bootstrap
./gradlew buildNDK Issues:
# Reinstall NDK
just install-ndk
# Install Rust toolchains
just install-toolchainsSubmodule Issues:
# Update core submodule
git submodule update --init --recursive
just core-upgradeDocker Build Issues:
- Ensure Docker has sufficient memory (8GB+ recommended)
- Check base image availability
- Verify GitHub token permissions
- Discord: Gem Wallet Discord
- Telegram: Developer Chat
- Issues: GitHub Issues
- Main Activity:
app/src/main/kotlin/com/gemwallet/android/MainActivity.kt - Build Config:
app/build.gradle.kts - Core Dependencies:
gradle/libs.versions.toml - Localization:
ui/src/main/res/values/ - Assets:
app/src/main/assets/
- Rust Core: Heavy cryptographic operations are offloaded to Rust
- Memory: Configure Android Studio with sufficient heap size
- Build Cache: Gradle build cache is enabled for faster builds
- Docker: Multi-stage builds optimize image size and build speed
- You will use only gradle for tests and build
- Always run tests
- remember not write comments to code
- on each modification clean imports