Luma/scripts/make-update-manifest.py
Elijah 6a08aa242c Release 1.1.13: fix app movement and add launcher actions
Keep the displayed app order intact until the grid reuse comparison, and retain selection during rebuilds so D-pad rearranging visibly moves the chosen tile. Add Android-confirmed uninstall for user apps and a foreground-only Wi-Fi/Ethernet shortcut with separate TV-input spacing. Remove the duplicate Personalize footer.

Use an explicitly authorized replacement signing identity after loss of the original key. Document the one-time reinstall and preserve signature verification. Add a portable build using ignored signing configuration and regression checks for movement, lifecycle, native network settings, and cancel/confirm uninstall.

Validated on the authorized onn 4K Plus: original failing move reproduction now passes, HomeActions/GridReuse/WakeRegression/Navigation instrumentation passes, and native settings/uninstall checks pass. Input-header availability was simulated; physical Ethernet and input switching were not exercised. Restore prior visible settings and Home override; remove the disposable test APK.
2026-10-25 12:08:46 -07:00

28 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Generate the small feed committed beside the signed APK; URLs resolve inside one Git commit."""
import hashlib
import json
import os
import re
import subprocess
import xml.etree.ElementTree as ET
from pathlib import Path
root = Path(__file__).resolve().parents[1]
ns = '{http://schemas.android.com/apk/res/android}'
manifest = ET.parse(root / 'app/src/main/AndroidManifest.xml').getroot()
code = int(manifest.get(ns + 'versionCode'))
name = manifest.get(ns + 'versionName')
apk = root / 'output/Luma.apk'
badging = subprocess.check_output([os.environ.get('AAPT2', str(root / '.tools/sdk/build-tools/34.0.0/aapt2')), 'dump', 'badging', str(apk)], text=True)
assert f"versionCode='{code}'" in badging and f"versionName='{name}'" in badging, 'Rebuild the APK before generating its update manifest'
gradle = (root / 'app/build.gradle').read_text()
assert re.search(r'versionCode\s+' + str(code) + r'\b', gradle), 'Manifest and Gradle version codes differ'
assert "versionName '" + name + "'" in gradle, 'Manifest and Gradle version names differ'
feed = dict(schema=1, packageName='tv.luma.launcher', versionCode=code, versionName=name,
minSdk=int(manifest.find('uses-sdk').get(ns + 'minSdkVersion')), apk='Luma.apk',
size=apk.stat().st_size, sha256=hashlib.sha256(apk.read_bytes()).hexdigest(),
notes=(root / 'docs/UPDATE_NOTES.md').read_text().strip())
assert len(feed['notes']) <= 4000
(root / 'output/update.json').write_text(json.dumps(feed, indent=2) + '\n')
print('Generated output/update.json for Luma ' + name)