Thank you for your interest in contributing to FlashCore! We welcome contributions, bug reports, documentation enhancements, and hardware test reports.
FlashCore is an open-source USB flashing utility where reliability is paramount. Corrupting a user's USB flash drive or creating an unbootable OS image damages trust.
Therefore:
- We prioritize correctness, safety, and testability over rapid accumulation of features.
- We value automated tests and physical hardware validation above speculative implementations.
- Every contribution touching block devices, partition tables, filesystems, or flashing strategies must include automated test coverage using the
BlockDeviceabstraction.
- Java Development Kit: JDK 21 (Eclipse Temurin or OpenJDK recommended)
- Android SDK: Platform API Level 36, Build-Tools 36+
- IDE: Android Studio Ladybug (or newer), or VS Code with Kotlin and Gradle extensions
- Build System: Gradle 9.7+ (via
./gradlewwrapper)
# Clone the repository
git clone https://github.com/ashishsinghbora/Flashcore.git
cd Flashcore
# Set up environment variables (adjust paths as needed)
export JAVA_HOME=/path/to/jdk-21
export ANDROID_HOME=/path/to/android-sdkBefore submitting any Pull Request, you MUST run and pass the following three verification steps locally:
# 1. Static code analysis and Android lint checks
./gradlew lint
# 2. Complete unit, Robolectric, and Roborazzi test suite
./gradlew test
# 3. Assemble debug APK
./gradlew assembleDebugAll automated unit tests (109 unit/Robolectric tests) must pass with zero failures. If modifying code that affects UI screenshots, update Roborazzi test baselines accordingly.
When contributing code, adhere strictly to the layered architecture described in ARCHITECTURE.md:
- No Hardware Direct Access in UI: The UI and ViewModel layers must never reference
UsbMassStorageDriver,UsbEndpoint, or raw SCSI CDBs directly. They communicate exclusively through theFlashEngineStrategyandBlockDeviceinterfaces. - Mock-First Hardware I/O: Any logic that writes or reads sectors must work against the
BlockDeviceinterface. UseMemoryBlockDeviceorFaultInjectingBlockDevicein unit tests. - No Unbounded Memory Allocations: ISO images can range from 1 GB to 64 GB+. Never load whole files into memory. Stream data in bounded chunks (e.g. 64 KiB – 1 MiB) via
DirectRingBufferor streaming channels. - Resilient Cancellation: Long-running I/O operations must poll the cooperative
cancellationSignalperiodically and gracefully abort without leaving lingering background threads.
Hardware validation on physical USB flash drives and PC motherboards is vital to the project. If you have tested FlashCore on real hardware, please submit a Hardware Compatibility Report using our issue template:
- Android Device: Model name, manufacturer, Android OS version.
- OTG Adapter: Brand and type (Type-C, Micro-USB, powered hub).
- USB Drive: Vendor, model, capacity, USB controller (e.g. Phison, SMI, SanDisk, Samsung).
- Target OS Tested: ISO name, version, architecture (x86_64, ARM64).
- Host PC Boot Result: Motherboard model, BIOS/UEFI mode, boot success/failure details.
- Fork the Repository: Create your own fork and branch from
main. - Branch Naming:
fix/issue-descriptionfor bug fixes.feat/feature-namefor enhancements.docs/topicfor documentation updates.test/test-descriptionfor test additions.
- Commit Messages:
- Use clear, concise commit messages following Conventional Commits (e.g.,
feat(scsi): add SCSI WRITE_16 command support,fix(fat32): fix cluster allocation off-by-one).
- Use clear, concise commit messages following Conventional Commits (e.g.,
- PR Checklist:
-
./gradlew lintpasses with 0 errors. -
./gradlew testpasses with 100% success rate. -
./gradlew assembleDebugcompiles cleanly. - Unit tests added or updated for new functionality.
- Relevant documentation updated (
README.md,ARCHITECTURE.md,LIMITATIONS.md). - Pull request description links any relevant GitHub issue.
-
All contributors are expected to adhere to our Code of Conduct. Please be respectful and constructive in discussions, code reviews, and issue threads.