Skip to content

Building from Source

yybam edited this page Oct 7, 2026 · 1 revision

Building from Source

Prerequisites

  • JDK 17 and the Android SDK (Android Studio bundles both)
  • A device/emulator on Android 8.0+ (API 26+)
  • A Firebase project with Firestore + Auth enabled, and its google-services.json in app/
  • For deploying the console: Node.js + Firebase CLI (npm install -g firebase-tools)

Clone & build

git clone https://github.com/yybam/coremdm.git
cd coremdm

export ANDROID_HOME=~/AppData/Local/Android/Sdk   # your SDK path
export JAVA_HOME=/path/to/jdk17

./gradlew assembleRelease
# → app/build/outputs/apk/release/app-release.apk

Use assembleDebug for a quick debug build.

Signing

app/build.gradle.kts chooses the signing key like this:

  • Locally, with no CI env vars set, it falls back to the Android debug keystore (~/.android/debug.keystore). Fine for testing, but such a build won't install over a CI release and won't have working Google Sign-In.
  • In CI, it reads the permanent release key from environment variables provided by the workflow:
    • RELEASE_KEYSTORE_FILE — path to the .p12 keystore
    • RELEASE_KEYSTORE_PASSWORD
    • RELEASE_KEY_ALIAS (defaults to coremdm)

See Releases and Signing for how the CI secrets are set up.

Project layout

app/                     Android app (Kotlin, Jetpack Compose)
public/index.html        Web console (single-file SPA)
backend/                 Node.js + Express/WebSocket (WebRTC screen control)
admin-backend/           Kotlin + Spring Boot 3 service
.github/workflows/       build-apk, deploy-hosting, deploy-firestore
firestore.rules          Security rules
firebase.json            Hosting config (site: coremdm)
seed.js                  Firestore seed helper (firebase-admin)

The app's key source files are described in Architecture.

Firebase config

The app needs app/google-services.json for your Firebase project. If you fork this, replace it with your own project's file and update:

  • .firebaserc — your project ID
  • public/index.html — the firebaseConfig object near the top
  • firestore.rules — the super-admin email in isSuperAdmin()

Deploy the console & rules

firebase login
firebase deploy --only hosting:coremdm     # web console
firebase deploy --only firestore:rules     # security rules

In this repo both deploy automatically via GitHub Actions — see CI-CD and Deployment.

Build the release APK via CI instead

You don't need to build locally to cut a release. Push a tag and GitHub builds and publishes a signed APK:

git tag -a v0.5.0 -m "CoreMDM v0.5.0: ..."
git push origin v0.5.0

See Releases and Signing.

Clone this wiki locally