"""Experimental Quest 20230907 independent login; requires server platform-7 guard. Preserves Quest VR setup before switching account initialization to standalone. Redirects auth parameters, platform enum, and title-screen error-page navigation. Produces an UNSIGNED APK. Does not assert that login/gameplay is supported. The v1 full-initializer replacement failed with error 3 and no usable hands. This v3 experiment restores SetVRDisplayMode, the password page, and Quest input. Error navigation currently applies to all title-screen errors; not release-ready. """ import argparse import hashlib import struct import zipfile from pathlib import Path EXPECTED = 'd9a72f2906ecee6cd292fa094fa57df8904b125dee161a04887603a3d0d3449e' LIB = 'lib/arm64-v8a/libil2cpp.so' REDIRECTS = ( ('GetAuthParams', 0x3d0a930, 0x396ad48), ('get_CurrentPlatform', 0x3d096fc, 0x43d6eb8), ('Title-screen error to password page', 0x39c0f40, 0x39bbd80), ('Saved-account auto-login error to password page', 0x39c67e0, 0x39bbd80), ) def patch(data): if hashlib.sha256(data).hexdigest() != EXPECTED: raise ValueError('Unknown IL2CPP binary; refusing to patch') result = bytearray(data) phoff = struct.unpack_from(' 0x{dst:x}') # Preserve the original prologue and Quest-specific VR display setup through # 0x3d09f14. Then run independent initialization and restore the original frame. start = 0x3d09f18 words = [0xaa1303e0, 0xaa1f03e1, 0x94000000 | (((0x43d6f0c - (start + 8)) // 4) & 0x3ffffff)] for addr in (0x3d0a124, 0x3d0a12c, 0x3d0a130, 0x3d0a138): words.append(struct.unpack_from('