- Slint 1.18.1 (backend-android-activity-06), cargo-apk2 packaging - Manifest permissions: READ_MEDIA_IMAGES, READ_EXTERNAL_STORAGE (maxSdk 32), MANAGE_EXTERNAL_STORAGE - android_main with permission-aware init_with_event_listener hook and AndroidApp clone stash for JNI (storage flow, later BLE/etc.) - scripts/build.sh: release/debug x86_64 + aarch64, sign, adb install - HANDOFF.md: full dev plan (architecture, thumbnail pipeline, milestones, gotchas, perf targets) from the Slint/eframe evaluation - Verified: builds, installs, runs on pad_avd emulator (API 35)
40 lines
1.4 KiB
Bash
Executable File
40 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the gallery Android APK (and optionally install it).
|
|
#
|
|
# ./scripts/build.sh # release x86_64 (emulator) + install
|
|
# ./scripts/build.sh aarch64 # release aarch64 (real device) + install
|
|
# ./scripts/build.sh debug # debug x86_64 + install (faster builds)
|
|
# ./scripts/build.sh <arch> no-install
|
|
#
|
|
# Desktop (Linux): cargo run (needs libfontconfig1 + pkg-config)
|
|
# Desktop (macOS): cargo run (pure Rust, nothing extra)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
export ANDROID_HOME=$HOME/android-sdk
|
|
export ANDROID_NDK_ROOT=$HOME/android-sdk/ndk/27.0.12077973
|
|
export PATH="$HOME/.cargo/bin:$ANDROID_HOME/platform-tools:$PATH"
|
|
# Debug-keystore signing is fine for personal use / Play internal testing.
|
|
export CARGO_APK_RELEASE_KEYSTORE=$HOME/.android/debug.keystore
|
|
export CARGO_APK_RELEASE_KEYSTORE_PASSWORD=android
|
|
|
|
arg1=${1:-x86_64}
|
|
arg2=${2:-install}
|
|
|
|
profile=--release
|
|
case $arg1 in
|
|
debug) target=x86_64-linux-android; profile="" ;;
|
|
x86_64) target=x86_64-linux-android ;;
|
|
aarch64) target=aarch64-linux-android ;;
|
|
*) echo "unknown arch: $arg1" >&2; exit 1 ;;
|
|
esac
|
|
|
|
cargo apk2 build $profile --target "$target" --lib
|
|
apk=$(ls target/*/apk/gallery.apk | head -1)
|
|
echo "APK: $apk ($(du -h "$apk" | cut -f1))"
|
|
|
|
if [ "$arg2" = install ] && command -v adb >/dev/null; then
|
|
adb install -r "$apk"
|
|
adb shell am start -n wow.gmp.gallery/android.app.NativeActivity || true
|
|
fi
|