mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
Stores: Epic games get the EOS overlay, and their web links open on Android
Metalstorm's EOS sign-in asked for a one-time consent, could not load an overlay to show it, and fell back to a browser flow that never finished. Epic's own overlay component (the mechanism from Legendary's lfs/eos.py; credits in EpicOverlay.kt) is now downloaded once with the account's token into the runtime, after an Epic library sync or at the first launch that finds it missing. At each launch droiddeck-store-launch writes the one pointer, HKCU Software\Epic Games\EOS OverlayPath, into the game's prefix, appended to user.reg as the DirectAudio key is, and the app logs epic overlay installed=<build> prefix=<appid>. Wine's browser is set to xdg-open, and on a game's PATH a small xdg-open hands http(s) addresses to the app, which opens them in Android's browser, so a device-code sign-in can be finished on the phone.
This commit is contained in:
1 parent
78e4cb8369
commit
97a0f1553f
9 files changed
+294
-3
No files matched your search
@@ -23,6 +23,14 @@ def load(name):
|
||||
|
||||
|
||||
store = load('droiddeck-store-launch')
|
||||
|
||||
|
||||
def load_path(path, name):
|
||||
loader = importlib.machinery.SourceFileLoader(name, str(path))
|
||||
spec = importlib.util.spec_from_loader(name, loader)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
loader.exec_module(module)
|
||||
return module
|
||||
compat = load('steam-compatibility')
|
||||
|
||||
|
||||
@@ -103,6 +111,54 @@ class Asking(unittest.TestCase):
|
||||
self.assertFalse(code.exists())
|
||||
|
||||
|
||||
class Prefix(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
root = Path(self.tmp.name)
|
||||
self.compat = root / 'compatdata/3785150007'
|
||||
(self.compat / 'pfx').mkdir(parents=True)
|
||||
self.reg = self.compat / 'pfx/user.reg'
|
||||
self.reg.write_text('WINE REGISTRY Version 2\n\n[Software\\\\Wine] 1\n"Version"="win10"\n')
|
||||
self.overlay = root / 'epic-overlay'
|
||||
self.overlay.mkdir()
|
||||
|
||||
def tearDown(self):
|
||||
self.tmp.cleanup()
|
||||
|
||||
def test_the_overlay_pointer_names_the_shared_copy_through_z(self):
|
||||
(self.overlay / store.OVERLAY_DLL).write_bytes(b'MZ')
|
||||
(self.overlay / 'droiddeck-version').write_text('1.0.42')
|
||||
self.assertEqual('overlay-set', store.provision_prefix(str(self.compat), str(self.overlay)))
|
||||
text = self.reg.read_text()
|
||||
self.assertIn('[Software\\\\Epic Games\\\\EOS] ', text)
|
||||
self.assertIn('"OverlayPath"="Z:' + str(self.overlay).replace('/', '\\\\') + '"', text)
|
||||
self.assertIn('"Browsers"="xdg-open"', text)
|
||||
# A second launch adds nothing: the last word already says so.
|
||||
store.provision_prefix(str(self.compat), str(self.overlay))
|
||||
self.assertEqual(text, self.reg.read_text())
|
||||
self.assertEqual('1.0.42', store.overlay_version(str(self.overlay)))
|
||||
|
||||
def test_no_overlay_yet_or_no_prefix_yet(self):
|
||||
self.assertEqual('overlay-missing', store.provision_prefix(str(self.compat), str(self.overlay)))
|
||||
self.assertNotIn('OverlayPath', self.reg.read_text())
|
||||
self.assertEqual('prefix-not-created', store.provision_prefix(self.tmp.name + '/compatdata/1', str(self.overlay)))
|
||||
self.assertEqual('no-prefix', store.provision_prefix('', str(self.overlay)))
|
||||
|
||||
|
||||
class Browser(unittest.TestCase):
|
||||
def test_a_web_address_is_handed_to_the_app(self):
|
||||
xdg = load_path(BIN.parent / 'lib/droiddeck/browser/xdg-open', 'xdg_open')
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
os.environ['BL_LAUNCH_DIR'] = root
|
||||
try:
|
||||
self.assertEqual(0, xdg.main(['https://www.epicgames.com/activate']))
|
||||
finally:
|
||||
del os.environ['BL_LAUNCH_DIR']
|
||||
reqs = list((Path(root) / 'stores/req').glob('*.json'))
|
||||
self.assertEqual(1, len(reqs))
|
||||
self.assertEqual({'op': 'open-url', 'url': 'https://www.epicgames.com/activate'}, json.loads(reqs[0].read_text()))
|
||||
|
||||
|
||||
class Launchers(unittest.TestCase):
|
||||
def test_both_proton_launchers_ask_before_proton_starts(self):
|
||||
sh = compat.LAUNCHER_SH
|
||||
|
||||
Reference in new issue
Block a user