mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 11:01:07 +00:00
* chore(i18n): translate every missing string in all locales Adds the 87 strings the bottom-screen Dashboard and in-game stats pages introduced to all 32 locales, plus the 51 older settings strings Japanese and the 50 Chinese locales were still missing. Every locale now has all 3456 translatable strings with the same placeholders as English. Also translates 36 entries that were still English where the language does not use the English word, and makes es-419 touch_app_id use the same %1$s placeholder as English. * chore(patches): drop comments from the lines downstream patches add Removes comment lines and trailing comments from lines our patches add, with hunk headers recounted. Lines that a later patch uses as context and the upstream backport 0123 are left as they are. The gamescope, FEX, proot and xodus series still apply to their pinned sources, and the patched trees differ only in those comments. test_hud_frames now finds the HUD writer by its first declaration. * docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix These were credited only in source headers and NOTICE files. * chore: remove source comments and unused functions Removes explanatory comments from first-party Kotlin, Java, C, C++, Rust, TypeScript, Python, shell, Gradle, CMake and workflow files. License and attribution headers stay, and vendored third-party trees, generated files and license files are untouched. A shellcheck directive is kept, and udevmon's fallthrough comments became fallthrough attributes. Syntax trees and token streams match the previous sources apart from the comments and Python docstrings. Module docstrings that argparse prints are kept, and device-smoke.sh prints the same --help text from a heredoc. Also removes 37 functions and 4 fields that nothing referenced. * chore: remove comments from the Syncthing integration and the latest main sources * docs: credit Syncthing and the syncthing-android fork * chore(i18n): translate the Syncthing strings in all locales The 107 strings the Syncthing integration added are now in all 32 locales. sync_web_path_locked names the Syncthing tab by its label. * docs: credit @xXJSONDeruloXx for the HUD metric readers The CPU, GPU load, thermal and battery readers come from their PerformanceHudView pull requests #777, #877, #991, #1406 and #1573. The FusionHUD credit line is unchanged. * docs: credit the HUD metric readers to @xXJSONDeruloXx's work
56 lines
2.1 KiB
Python
Executable File
56 lines
2.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
import shutil
|
|
import sys
|
|
import tarfile
|
|
import urllib.request
|
|
|
|
recipe = Path(__file__).resolve().parent
|
|
lock = json.loads((recipe / 'runtime.lock.json').read_text())
|
|
cache = Path(sys.argv[1]); output = Path(sys.argv[2])
|
|
cache.mkdir(parents=True, exist_ok=True)
|
|
output.mkdir(parents=True, exist_ok=True)
|
|
url = 'https://github.com/' + lock['repository'] + '/releases/download/' + lock['tag'] + '/'
|
|
|
|
def download(name, expected, algorithm):
|
|
target = cache / name
|
|
def matches():
|
|
if not target.is_file():
|
|
return False
|
|
digest = hashlib.new(algorithm)
|
|
with target.open('rb') as file:
|
|
for block in iter(lambda: file.read(1024 * 1024), b''):
|
|
digest.update(block)
|
|
return digest.hexdigest() == expected
|
|
if not matches():
|
|
part = target.with_suffix(target.suffix + '.part')
|
|
with urllib.request.urlopen(url + name, timeout=90) as response, part.open('wb') as file:
|
|
shutil.copyfileobj(response, file)
|
|
part.replace(target)
|
|
if not matches():
|
|
raise RuntimeError('Xbox runtime checksum mismatch: ' + name)
|
|
return target
|
|
|
|
archive = download(lock['archive'], lock['sha512'], 'sha512')
|
|
source = lock['source']
|
|
download(source['name'], source['sha256'], 'sha256')
|
|
remaining = set(lock['dlls'])
|
|
with tarfile.open(archive) as tar:
|
|
for member in tar:
|
|
name = Path(member.name).name
|
|
if '/files/lib/wine/x86_64-windows/' not in member.name or name not in remaining:
|
|
continue
|
|
if not member.isfile() or member.size > 32 * 1024 * 1024:
|
|
raise RuntimeError('Invalid Xbox Windows runtime module')
|
|
data = tar.extractfile(member).read()
|
|
if hashlib.sha256(data).hexdigest() != lock['dlls'][name] or data[:2] != b'MZ':
|
|
raise RuntimeError('Xbox Windows runtime module checksum mismatch')
|
|
if data[64:80] == b'Wine builtin DLL':
|
|
data = data[:64] + b'DroidDeck native' + data[80:]
|
|
(output / name).write_bytes(data)
|
|
remaining.remove(name)
|
|
if remaining:
|
|
raise RuntimeError('Missing Xbox runtime modules')
|