009: publish AXPR23 final source and public documentation

This commit is contained in:
sunfish-admin committed 2026-11-06 21:11:35 +01:00
1 parent 72930e0fd6
commit 2c714d8d34
35 files changed
+2498 -403

No files matched your search

@@ -0,0 +1,37 @@
#!/usr/bin/env python3
"""009: ship a single WebView engine (AXPR AosmiumWebView only).
The AOSP/Lineage `webview` prebuilt (~255 MB) is added by
build/make/target/product/media_product.mk, which is inherited later than
vendor/sunfish-a16/apps.mk, so a PRODUCT_PACKAGES filter there has no effect.
Remove the package from the media_product list instead.
The provider allowlist (config_webview_packages.xml) still declares
com.android.webview and the Google providers, so they can be installed and
selected later; they are simply not preinstalled.
Idempotent: guarded by a marker comment.
"""
from pathlib import Path
TREE = Path(__file__).resolve().parents[4]
MEDIA = TREE / "build/make/target/product/media_product.mk"
MARKER = "# sunfish-a16-009-single-webview"
LINE = " webview \\\n"
if not MEDIA.is_file():
raise SystemExit(f"FAIL: missing {MEDIA}")
text = MEDIA.read_text()
if MARKER in text:
print(f"already applied: {MEDIA} (single-webview)")
raise SystemExit(0)
if LINE not in text:
raise SystemExit(f"FAIL: expected 'webview' entry not found in {MEDIA}")
text = text.replace(LINE, "", 1)
text = text.rstrip("\n") + f"\n\n{MARKER}: AosmiumWebView is the only shipped WebView.\n"
MEDIA.write_text(text)
print(f"patched: {MEDIA} (webview package removed)")