diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-10-27 18:28:26 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-10-27 18:28:26 +0100 |
| commit | a41c1ff25746874fa5a1eed5e62352a28d7515f9 (patch) | |
| tree | 0c4fb28c846a51fb0740ee40c320416fbeaf5ef3 /crates/wipfel/src | |
| parent | a159551d058606a673b14c5568aa72cf538f9934 (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 'crates/wipfel/src')
| -rw-r--r-- | crates/wipfel/src/app.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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}")) |
