fix: ship Windows executables as add-on packs and keep them out of the APK (#2676)

* fix(rockstar): ship the launcher service as an add-on pack, not inside the APK

* fix: ship the DiRT ws2_32 stand-in as an add-on pack and reject Windows executables in the APK

* fix(release): reject APK entries under a packed path even when the manifest omits them

* fix(dirt): fetch the ws2_32 stand-in pack once the Linux runtime is installed
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-15 13:28:38 -05:00
1 parent 946e9c41e0
commit 9375ed0948
17 files changed
+185 -38

No files matched your search

+44
View File
@@ -36,6 +36,10 @@ class RuntimeInputsTest(unittest.TestCase):
service = self.root / 'app/src/main/assets/linuxfs/usr/local/lib/droiddeck-ubisoft/droiddeck-upc.exe'
service.parent.mkdir(parents=True)
service.write_bytes(b'MZ service')
rockstar = self.root / 'app/src/main/assets/linuxfs/usr/local/lib/droiddeck-rockstar'
rockstar.mkdir(parents=True)
(rockstar / 'Launcher32.exe').write_bytes(b'MZ launcher 32')
(rockstar / 'Launcher64.exe').write_bytes(b'MZ launcher 64')
self.audio(['pactl', 'modules/arm64/module-aaudio-sink.so', 'modules/arm64/module-directaudio-native-sink.so'])
self.packs()
@@ -189,6 +193,46 @@ class RuntimeInputsTest(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'ubisoft pack provides'):
runtime.check_apk(apk, self.root)
def test_an_apk_still_carrying_the_rockstar_service_is_rejected(self):
name = 'assets/linuxfs/usr/local/lib/droiddeck-rockstar/Launcher32.exe'
self.assertIn(name, runtime.outputs(self.root))
apk = self.current_apk(self.root / 'bundled.apk', {name: b'MZ launcher 32'})
with self.assertRaisesRegex(ValueError, 'rockstar pack provides'):
runtime.check_apk(apk, self.root)
def test_a_packed_file_the_manifest_does_not_list_is_rejected(self):
name = 'assets/linuxfs/usr/local/lib/droiddeck-rockstar/Unlisted.bin'
self.assertNotIn(name, runtime.outputs(self.root))
apk = self.current_apk(self.root / 'bundled.apk', {name: b'helper data'})
with self.assertRaisesRegex(ValueError, 'Unlisted.bin, which the rockstar pack provides'):
runtime.check_apk(apk, self.root)
def test_a_stale_rockstar_pack_is_rejected(self):
apk = self.current_apk(self.root / 'current.apk')
self.pack('rockstar', {'Launcher32.exe': b'MZ older launcher', 'Launcher64.exe': b'MZ launcher 64'})
with self.assertRaisesRegex(ValueError, 'rockstar is missing or has a stale'):
runtime.check_apk(apk, self.root)
def test_an_apk_carrying_any_windows_executable_is_rejected(self):
for name in ('assets/linuxfs/usr/local/lib/new-helper/helper.exe', 'assets/anything/renamed.bin', 'res/raw/x.dll'):
with self.subTest(name=name):
apk = self.current_apk(self.root / 'windows.apk', {name: b'MZ helper'})
with self.assertRaisesRegex(ValueError, 'Windows executables.*' + name):
runtime.check_apk(apk, self.root)
def test_an_apk_still_carrying_the_dirt_stand_in_is_rejected(self):
dirt = self.root / 'app/src/main/assets/linuxfs/usr/local/lib/droiddeck-dirt'
dirt.mkdir(parents=True)
(dirt / 'ws2_32.dll').write_bytes(b'MZ droiddeck-dirt-ws2_32')
self.packs()
name = 'assets/linuxfs/usr/local/lib/droiddeck-dirt/ws2_32.dll'
self.assertIn(name, runtime.outputs(self.root))
self.assertEqual('dirt', runtime.PACKED['assets/linuxfs/usr/local/lib/droiddeck-dirt/'])
apk = self.current_apk(self.root / 'bundled.apk', {name: b'MZ droiddeck-dirt-ws2_32'})
with self.assertRaisesRegex(ValueError, 'dirt pack provides'):
runtime.check_apk(apk, self.root)
runtime.check_apk(self.current_apk(self.root / 'current.apk'), self.root)
def test_an_apk_still_carrying_the_powervr_runtime_is_rejected(self):
apk = self.current_apk(self.root / 'bundled.apk', {'assets/hybris/runtime.tzst': b'runtime'})
with self.assertRaisesRegex(ValueError, 'powervr pack provides'):
+35
View File
@@ -165,6 +165,41 @@ class RockstarLaunch(unittest.TestCase):
self.assertEqual('rockstar-launch', requests[0]['op'])
self.assertEqual(b'compiled-helper', path.with_name('Launcher.exe').read_bytes())
def test_a_missing_service_is_fetched_from_the_app_before_launch(self):
with tempfile.TemporaryDirectory() as root:
folder, sidecar, prefix, service, answer = self.setup_game(root)
helper = (service / 'Launcher32.exe').read_bytes()
(service / 'Launcher32.exe').unlink()
requests = []
def ask(channel, request, timeout):
requests.append(request)
if request['op'] == 'store-service':
(service / 'Launcher32.exe').write_bytes(helper)
return {'ok': True}
return answer
with patch.object(store, 'ROCKSTAR_SERVICE', service), patch.object(store, 'rockstar_registry', return_value=True):
result = store.prepare_rockstar(folder, sidecar, str(prefix), str(Path(root) / 'channel'), ask_app=ask)
self.assertEqual('ready', result)
self.assertEqual([{'op': 'store-service', 'store': 'rockstar'}], requests[:1])
self.assertEqual('rockstar-launch', requests[1]['op'])
def test_an_unavailable_service_does_not_request_account_data(self):
with tempfile.TemporaryDirectory() as root:
folder, sidecar, prefix, service, _ = self.setup_game(root)
(service / 'Launcher32.exe').unlink()
requests = []
def ask(channel, request, timeout):
requests.append(request)
return {'ok': False, 'reason': 'service-unavailable'}
with patch.object(store, 'ROCKSTAR_SERVICE', service), patch.object(store, 'rockstar_registry', return_value=True):
result = store.prepare_rockstar(folder, sidecar, str(prefix), str(Path(root) / 'channel'), ask_app=ask)
self.assertEqual('no-service', result)
self.assertEqual(['store-service'], [request['op'] for request in requests])
def test_rejected_or_expired_sessions_cannot_reuse_stale_material(self):
for update in ({'ok': False, 'reason': 'not-owned'}, {'material': 'A' * 641}, {'expiresAt': 1}):
with self.subTest(update=update), tempfile.TemporaryDirectory() as root: