The native Android client for CBGPU, built with Kotlin and a Rust JNI core.
Version 1.0.13 / build 14 retains the existing application ID
com.cbgpu.cbgpu_app, signing identity and mobile website design. The Android
build has no Flutter Gradle plugin, Flutter engine or Dart runtime.
Kotlin owns the Android UI and platform integrations. Existing feature screens
load from https://app.cbgpu.com; native workspace tabs render the same labels,
Lucide SVG geometry, Pretendard typeface and theme colors supplied by the site.
Rust validates navigation and native bridge messages. Desktop CBGPU links are
redirected to the mobile workspace; external links use the system browser.
Install JDK 17, Node.js 22.18+, Rust, Android SDK 36/build tools 36.0.0, and NDK
28.2.13676358. Set ANDROID_HOME; do not commit local SDK paths or signing keys.
AGP 9 uses built-in Kotlin and Gradle 9.1. The checked-in Gradle wrapper and its
distribution use the official upstream checksums.
npm ci --ignore-scripts
npm run check
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
cargo test --manifest-path native-core/Cargo.toml --locked
./android/gradlew -p android assembleDebug assembleDebugAndroidTestThe Gradle build compiles Rust for ARM64, ARMv7 and x86_64 and compiles the small
TypeScript bridge into generated JavaScript assets. No Node.js or Rust compiler
is installed on the phone. android/version.properties is the Android version
source. Release builds require the existing private android/key.properties
and its keystore; there is no debug-signing fallback:
./android/gradlew -p android assembleReleaseThe APK is android/app/build/outputs/apk/release/app-release.apk.
node scripts/publish-android-release.mts verifies the existing APK certificate,
package/version and monotonic build without changing downloads. Only an explicit
--publish takes the publication lock, backs up the previous APK, atomically
replaces APK files and writes the update manifest last. Release CI additionally
requires a successful emulator CI run for the exact source commit. The signing
certificate must match the currently distributed APK before publishing an update.
The previous APK remains available privately for rollback. Release CI checks the
configured certificate, package/version and checksums before uploading assets.
Never advertise a version before its verified APK is available.
- Native themed workspace navigation, Android back navigation, deep links, file chooser and authenticated material download/share.
- System WebView cookies and origin storage retained across updates, including HttpOnly parent cookies used by CBGPU's same-origin login broker. Native code never reads shared cookies through JavaScript.
- Native session storage uses AES-GCM with AndroidKeyStore. The previous Flutter shared-preferences session can be migrated; cookie/browser data is not cleared.
- All twelve existing native bridge actions are implemented. AndroidX
WebMessageListenergrants the channel only tohttps://app.cbgpu.com, and dispatch additionally requires the main frame and current trusted URL. Tenant, notebook, LaTeX and external origins receive no privileged bridge. - Isolated official EduSet login, without a CBGPU bridge or copied CBGPU tokens. Session candidates are returned only while the original CBGPU owner remains signed in; the website verifies them with EduSet before storage.
- Native scheduled/repeating notifications, boot/update alarm restoration, notification/exact-alarm permission handling and Firebase push integration.
- Existing GPU, printer, laser, meal and timetable widgets keep their provider IDs, layouts and preferences, with native WorkManager refreshes. Private widget data is cleared at logout and cannot be committed by a different account's stale refresh.
SSL failures fail closed. File/cleartext access is restricted. Tokens, passwords and school sessions are not logged. Firebase's public Android configuration is included; service-account credentials and signing keys are not.
Rust policy tests exercise mobile routing, bridge origins and tab boundaries. Android CI builds all three JNI ABIs and runs WebView/JNI boundary tests on an Android emulator. A local signed build and a compiled instrumentation APK do not prove physical-device notification delivery, Doze behavior or every manufacturer's WebView behavior. Those require device validation before broad rollout.
The unused Flutter/Dart and unreleased desktop/iOS scaffolding has been retired from the current tree; previous source and released Android APKs remain in Git history and Releases. This repository does not provide a native iOS replacement. See CONTRIBUTING.md and SECURITY.md. Original code is Apache-2.0; bundled Pretendard retains its OFL license and dependencies retain their licenses.
Native push registration explicitly uses native_kind=android-native-v1. Deploy
the additive capability schema and owner-bound data-only sender before releasing
this APK. Legacy tokens retain their old delivery mode. The native handler checks
both the unexpired encrypted owner and the current WebView owner; foreign,
ownerless and signed-out messages are ignored. Token changes unregister the old
owner, retire the Firebase installation token, and register a fresh token; a
retirement failure never reassigns the old token to another account.
This source version is held for paired server verification; the current public brand release is 1.0.12 / build 13. The candidate authenticates widget requests, uses only the server-selected active verified school, labels timetable widgets with that school and invalidates old account/school cache leases. Other-school classes come from a successful in-app timetable selection; CBsh student widgets retain the verified student-number default. Native preferences never grant access.
Before distributing this version, deploy and verify the additive self-only
cbgpu_self_session_status() oracle, scoped school/timetable endpoints and the
thin legacy timetable Edge proxy. Missing RPCs, unknown school modes, mismatched
school IDs and suspended/expired membership fail closed. The scoped meal widget
also requires the central meal response to include the verified school_id;
an older unscoped response is rejected, rather than shown under another school's
label. Other-school GPU/fabrication services remain unavailable until their real
school resources are connected and authorized.
Older APKs cannot provide authenticated multi-school timetable context. While school mode is disabled, the compatibility proxy can still return public CBsh subjects with teacher fields redacted. Turning school mode on requires users to update for scoped widgets. No operating migration, Edge restart or APK publication is performed by these source changes.