summaryrefslogtreecommitdiff
path: root/wipfel-droid/build.sh
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 18:28:26 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 18:28:26 +0100
commita41c1ff25746874fa5a1eed5e62352a28d7515f9 (patch)
tree0c4fb28c846a51fb0740ee40c320416fbeaf5ef3 /wipfel-droid/build.sh
parenta159551d058606a673b14c5568aa72cf538f9934 (diff)
wipfel-droid: Android wrapper APK (WebView + ACCESS_MEDIA_LOCATION)
Thin wrapper so wipfel can read original photo bytes: browsers cannot declare ACCESS_MEDIA_LOCATION, so the OS always redacts GPS EXIF from images they read. Our own app declares and requests it (plus READ_MEDIA_IMAGES) and gets the intact files. - WebView served from a loopback AssetServer (fetch/WASM need a real HTTP origin; file:// is blocked) - file picker wired through WebChromeClient (accepts any file type) - zero androidx dependencies, plain Activity, minSdk 29 - build.sh: wasm release site -> assets -> assembleDebug (~3MB APK) - loader: fall back to plain gipfel.dat (aapt gunzips .gz assets)
Diffstat (limited to 'wipfel-droid/build.sh')
-rwxr-xr-xwipfel-droid/build.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/wipfel-droid/build.sh b/wipfel-droid/build.sh
new file mode 100755
index 0000000..c724374
--- /dev/null
+++ b/wipfel-droid/build.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# Build the wipfel Android wrapper: wasm site -> assets -> debug APK.
+# Requires: wasm32 target + wasm-bindgen (cargo), Android SDK, JDK 17+.
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+repo="$(cd "$here/.." && pwd)"
+
+export ANDROID_HOME="${ANDROID_HOME:-$HOME/android-sdk}"
+export PATH="$PATH:$HOME/.cargo/bin"
+
+echo "==> building wipfel release site"
+( cd "$repo/crates/wipfel" && ./build-release.sh >/dev/null )
+
+echo "==> staging assets"
+mkdir -p "$here/app/src/main/assets/www"
+rm -f "$here/app/src/main/assets/www/"*
+cp "$repo/dist/wipfel/"* "$here/app/src/main/assets/www/"
+
+echo "==> gradle assembleDebug"
+( cd "$here" && ./gradlew assembleDebug --no-daemon -q )
+
+apk="$here/app/build/outputs/apk/debug/app-debug.apk"
+echo "==> done: $apk ($(stat -c%s "$apk") bytes)"
+echo " install: adb install -r $apk"