mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-10-14 19:27:09 -04:00
* Fix runtime removal races and show removal progress * Bootstrap Steam from the selected client channel * Show runtime progress below its Setup row * Always stage current session helpers and verify APK assets * Initialize Steam UI scale once using the handheld default
32 lines
1011 B
Python
32 lines
1011 B
Python
"""Reject an APK with missing or stale session helpers, including cached local bundles."""
|
|
from pathlib import Path
|
|
import sys
|
|
from zipfile import ZipFile
|
|
|
|
|
|
OVERLAY = Path(__file__).resolve().parents[1] / 'linuxfs/overlay'
|
|
|
|
|
|
def check(apk, overlay=OVERLAY):
|
|
sources = list((overlay / 'usr/local/bin').glob('bannerlator-*'))
|
|
sources += [path for path in (overlay / 'usr/bin').rglob('*') if path.is_file()]
|
|
errors = []
|
|
with ZipFile(apk) as package:
|
|
for source in sources:
|
|
asset = 'assets/linuxfs/' + source.relative_to(overlay).as_posix()
|
|
try:
|
|
content = package.read(asset)
|
|
except KeyError:
|
|
errors.append('missing ' + asset)
|
|
continue
|
|
if content != source.read_bytes():
|
|
errors.append('stale ' + asset)
|
|
return errors
|
|
|
|
|
|
if __name__ == '__main__':
|
|
errors = check(sys.argv[1])
|
|
if errors:
|
|
sys.exit('\n'.join(errors))
|
|
print('APK session helpers match source')
|