# Kitchen Store 2 for Android

A small, dependency-free Android WebView app for:

https://admin.self-service.sg/bigbait/kitchen.php?store=2

Requires Android 11 or newer and a working internet connection. Uses the device's Android System WebView. No PHP files or database schemas are changed.

## Install and use

1. Copy `dist/Kitchen-Store2-1.0.1.apk` to the Android device, or download it through a trusted transfer method.
2. Open the APK. If prompted, allow installation from the browser or file manager you used, then tap Install.
3. Open **Kitchen Store 2**. To add it to the home screen, drag its icon from the app drawer (the exact gesture depends on the launcher).
4. The app opens Store 2 in landscape with no URL or title bar and keeps the screen awake while visible.
5. Tap the page's **Enable sound** once after opening to enable new-order alerts.
6. Tap **Exit**, then **Exit** in the confirmation, to return to the home screen. Android Back opens the same confirmation.

The Exit link is inserted into the kitchen toolbar at runtime; it does not modify the server page. On older layouts without that toolbar, it appears in the top-left corner.

Version 1.0.1 replaces the launcher icon with the supplied red company logo on white. It uses the same package and signing identity as 1.0.0: install it as an update without uninstalling the existing app. The KDS behavior is unchanged.

A short press of the device power button usually sleeps the screen. It does not close the app. The app does not start itself at boot or lock the device to one app. Android system bars can be revealed by an edge swipe. Existing KDS status updates, payment clearing, and history behavior remain controlled by the website.

If the initial page cannot load, a Retry/Exit screen appears. This is not an offline order system and does not add ongoing connection monitoring to the website. Update Android System WebView/Chrome if the device has rendering issues. If the production URL redirects to employee login, upload the previously updated `kitchen.php` first; this app opens only the confirmed Store 2 kitchen URL.

## Source and build

Open this folder in Android Studio as a Gradle project (Android Gradle Plugin 9.3.1, Gradle 9.5.0). The project uses only platform APIs, with no runtime library dependencies. `./gradlew :app:assembleDebug` produces a debug build; Android Studio can also run it.

The supplied release APK is built with `build.py`, directly using the installed SDK tools, so rebuilding it does not require Gradle downloads. Requirements: Python 3, a JDK (the bundled Android Studio JDK works), Android SDK platform 36.1, and Build Tools 36.0.0. The minimum runtime is API 30 / Android 11; the target is API 35. No native libraries are included, so the same APK supports ARM and x86 devices.

```sh
python3 build.py --signing-dir /path/to/private/kitchen-signing
```

Use `--sdk /path/to/android-sdk` and `--java-home /path/to/jdk` to override discovery. macOS defaults use `~/Library/Android/sdk` and Android Studio's bundled JDK.

For a brand-new signing identity only, add `--create-key`. For updates, reuse the original signing directory and increase `versionCode` and `versionName` in `version.properties`. **Do not create another signing key to update an existing installation.** Keep the `.p12` keystore and password file together in a private backup outside the website directory. Neither is included in the APK or source ZIP. A Gradle release build is unsigned until you sign it with this same key.

The build runs navigation-policy checks, compiles resources/Java/DEX, aligns and signs the APK, verifies its signature and package metadata, and creates a source ZIP plus SHA-256 checksums in `dist/`.

The app is restricted to the fixed HTTPS Store 2 page for top-level navigation. Page assets and API requests still work normally. The app does not expose a native JavaScript bridge, bypass HTTPS certificate errors, or request camera, microphone, storage, device administrator, or background-service permissions.

## Verification scope

Compilation, navigation-policy checks, APK alignment, metadata, and signature checks can be run here. Actual Android 11 installation, rendering, speaker output, and device-specific fullscreen behavior need the physical device. No production orders are created or updated by the build checks.
