From a41c1ff25746874fa5a1eed5e62352a28d7515f9 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 18:28:26 +0100 Subject: 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) --- crates/wipfel/src/app.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/wipfel/src/app.rs') diff --git a/crates/wipfel/src/app.rs b/crates/wipfel/src/app.rs index 8ae78c4..78961fc 100644 --- a/crates/wipfel/src/app.rs +++ b/crates/wipfel/src/app.rs @@ -220,8 +220,12 @@ pub fn app() -> Html { use_effect_with((), move |_| { spawn_local(async move { let result = async { - let gz = bridge::fetch_bytes("gipfel.dat.gz").await?; - let raw = gunzip(&gz)?; + // aapt gunzips .gz assets, so an APK ships the plain + // gipfel.dat while the web dist ships gipfel.dat.gz + let raw = match bridge::fetch_bytes("gipfel.dat.gz").await { + Ok(gz) => gunzip(&gz)?, + Err(_) => bridge::fetch_bytes("gipfel.dat").await?, + }; pan.borrow_mut() .load_data_from_bytes(&raw) .map_err(|e| format!("load: {e}")) -- cgit v1.2.3