Development and testing
Read the root contributor guide and the AGENTS.md chain for paths you will change. The repository uses Gradle’s Android application plugin and a version catalog; use its committed wrapper, not a globally installed Gradle.
Toolchain
- JDK 25 for the Gradle daemon and the Android SDK with API 36.1.
ANDROID_HOMEpointing to that SDK; platform-tools foradb.- An API 36 disposable emulator for device regressions, with hardware acceleration.
- A built KyDrive server for integration tests; CI builds a pinned public commit.
- mdBook 0.5.4 and Python 3 to build and check this manual.
Agent Android builds and emulator work run on the Major build host, each in a
memory-capped systemd-run scope. Reuse the toolchain’s normal caches. Do not run Gradle
on the owner’s workstation or switch test instances onto production push relays.
Set PUSH_RELAY_URL= and APNS_RELAY_URL= for throwaway instances.
Build and install
From the repository root on the build host:
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
The application ID is org.kysecurity.drive. Android displays the name KyDrive.
The debug APK uses the build host’s debug signing key. A production release signing
and distribution process has not been published; assembleRelease currently builds
an unsigned APK to exercise R8 and resource shrinking.
Required checks
./gradlew testDebugUnitTest lintDebug checkExportedComponentsDebug checkExportedComponentsRelease assembleRelease
git diff --exit-code -- gradle/verification-metadata.xml
scripts/check-no-binaries.sh
mdbook build docs
python3 scripts/check-docs.py
Record commands, results and skips in the PR. A plain JVM run skips RealServerTest
unless the server binary is supplied; it does not establish integration success.
Real server
KYDRIVE_SERVER_BIN=/absolute/path/to/kydrive-server ./gradlew testDebugUnitTest --tests '*RealServerTest'
Use a binary matching the commit pinned in .github/workflows/ci.yml when reproducing
CI. That job fails if the integration report contains skipped or zero tests.
Fuzzing
JAZZER_FUZZ=1 ./gradlew testDebugUnitTest --tests 'org.kysecurity.drive.core.LinkUriFuzzTest'
The fuzz run is bounded by maxDuration in the test. Ordinary unit runs replay the
committed seeds. Preserve a fixed finding as a regression input instead of claiming
that one clean fuzz run proves the parser has no bugs.
Device tests
./gradlew connectedDebugAndroidTest
Use a disposable emulator. LockRecreationTest checks lock gating across Activity
recreation. Certificate-floor device tests require a dedicated debug build trusting
their throwaway CA; their exact invocation and no-skip report checks are in
.github/workflows/ci.yml. Regular builds trust only system CAs. Test keys/certificates
must never enter a production APK.
The fixture CA’s private key is public in the repository. An APK explicitly built to trust it is for isolated synthetic tests only; never link a real account with that APK.
Dependency verification
Gradle verifies artifact SHA-256 values from gradle/verification-metadata.xml, and CI
fails if that file changes unexpectedly. Dependency updates require their own reviewed
metadata regeneration commit. Follow the clean-home procedure in AGENTS.md; do not
disable verification or add metadata writes to ordinary CI.
Screenshots
scripts/screenshots.sh creates phone/tablet captures in light/dark mode. A debug-only
allowScreenshots property permits those captures. With KYDRIVE_SERVER_BIN set, the
script starts a seeded throwaway server and trusts its generated CA through
-PscreenshotCa. Ordinary and release builds retain secure windows and system-CA trust.
Changed screens need matching light/dark phone/tablet captures in the PR. A source-only TLS change does not require inventing a new screen for documentation.
Build the documentation
mdbook build docs
python3 scripts/check-docs.py
Open docs/book/index.html from the build output. Navigation, search and the print
view are generated by mdBook. The documentation-book CI artifact contains the same
static book for review; it does not publish a production documentation site.