This project was patched in an environment with no Android SDK, no Gradle, no Kotlin compiler and no network, so none of the commands below have been run against it yet. Treat the first build as the real test, and read “If the first build fails” below. A successful CI run from a clean checkout (with the Gradle wrapper committed) is the proof the audit asks for; nothing else is.
gradle/wrapper/gradle-wrapper.properties is in the repository, but the wrapper jar and scripts are not (they are binaries that could not be produced where this project was patched). The independent audit requires them to be committed, because a repository that cannot be built with ./gradlew from a clean checkout cannot be verified.
gradle wrapper --gradle-version 8.9 # needs Gradle 8.9 installed once; Android Studio does the same on import
git add gradlew gradlew.bat gradle/wrapper/gradle-wrapper.jar gradle/wrapper/gradle-wrapper.properties
git commit -m "Add Gradle wrapper"
No Gradle locally? Push to GitHub: the CI job generates a temporary wrapper, builds everything, uploads it as the gradle-wrapper artifact, and then fails on purpose until you commit those files. Optionally pin the Gradle download with distributionSha256Sum in gradle-wrapper.properties (value from https://gradle.org/release-checksums/), and keep gradle/actions/wrapper-validation in CI, which checks the committed jar against Gradle’s official releases.
Point local.properties at your SDK if needed: sdk.dir=/path/to/Android/Sdk.
./gradlew clean :app:testDebugUnitTest # 91 unit tests (JVM, Linux/macOS)
./gradlew :app:lintDebug # report: app/build/reports/lint-results-debug.html
./gradlew :app:lintDebug -PstrictLint # same, but lint errors FAIL the build (CI uses this)
./gradlew :app:assembleDebug # app/build/outputs/apk/debug/app-debug.apk
./gradlew :app:assembleRelease # app/build/outputs/apk/release/app-release-unsigned.apk (or app-release.apk if signed)
Rename outputs to CleanForge-debug.apk / CleanForge-release.apk if you like; the build uses Gradle’s default names.
Unit tests use the JDK “unix” file-attribute view, so run them on Linux/macOS/WSL (or in the included CI).
keytool -genkeypair -v -keystore cleanforge-release.jks -alias cleanforge \
-keyalg RSA -keysize 4096 -validity 10000
Create keystore.properties in the project root (git-ignored):
storeFile=cleanforge-release.jks
storePassword=...
keyAlias=cleanforge
keyPassword=...
Without it, assembleRelease produces an unsigned APK that Android will not install. Keep the keystore safe: losing it means you can never ship an update.
Verify a signed APK: apksigner verify --print-certs app/build/outputs/apk/release/app-release.apk
adb install -r app/build/outputs/apk/debug/app-debug.apk
Then grant All-files access (and Shizuku permission if you use it). See README.md.
.github/workflows/build.yml compiles, tests, lints (strict, non-blocking until the first clean baseline: then delete continue-on-error) and builds both APKs on GitHub’s runners and uploads them (plus reports) as artifacts. Push the project to a GitHub repository and open the Actions tab. It runs the exact commands above through ./gradlew.
Library versions were chosen without registry access (AGP 8.7.2, Kotlin 2.0.21, KSP 2.0.21-1.0.27, Hilt 2.56, Compose BOM 2024.11.00, Shizuku 13.1.5). If Gradle cannot resolve one, bump it in gradle/libs.versions.toml (keep KSP’s prefix equal to the Kotlin version).
The places most likely to need a small adjustment because they touch APIs I could not check against a compiler:
core/shizuku/ShizukuFileServiceConnector.kt: Shizuku.UserServiceArgs builder methods, bindUserService / unbindUserService(args, connection, remove) signatures.core/shizuku/ShizukuManager.kt: Shizuku listener signatures, getVersion(), shouldShowRequestPermissionRationale().
2a. aidl/.../IFileService.aidl: the in String[] argument and the appended methods 6 to 12 must generate cleanly.
2b. core/shizuku/AidlPrivilegedFileApi.kt: DeadObjectException, TransactionTooLargeException, RemoteException handling.di/AppModule.kt and the @HiltViewModel: Hilt/KSP generation errors are verbose; fix the first one listed.ui/*: Material 3 parameter names if you bump the Compose BOM.app/src/main/aidl/.../IFileService.aidl: explicit transaction ids (= 16777114) need AGP’s AIDL support enabled (buildFeatures.aidl = true, already set).After it compiles, run the tests; a failing test is information about a real behaviour, not noise, because every test encodes a safety rule from SECURITY.md.
./gradlew :app:testDebugUnitTest runs, among others, FileServiceCoreTest, WireCodecTest, PrivilegedExecutorTest,
CapabilityRegistryTest, MaintenanceModelTest, ScanRepositoryTest, the extended CleaningEngineTest,
ScannerEvidenceTest and PolicyGuardTest. They run the real service logic over a fake filesystem and a fake service.
PrivilegedExecutorTest and CapabilityRegistryTest use real time on purpose (deadlines of 150 to 750 ms). They do not
cover Binder, the AIDL stub, ShizukuFileServiceConnector, ShizukuManager or AidlPrivilegedFileApi; those need the
device checklist in docs/SHIZUKU_CAPABILITY_MATRIX.md (section 8).