Skip to content

Start serial registration in early daemon initialization#648

Merged
JingMatrix merged 2 commits intomasterfrom
serial
Apr 9, 2026
Merged

Start serial registration in early daemon initialization#648
JingMatrix merged 2 commits intomasterfrom
serial

Conversation

@JingMatrix
Copy link
Copy Markdown
Owner

On Xiaomi Android 12 [Xiaomi/toco_ru/toco:12/RKQ1.210614.002/V13.0.4.0.SFNRUXM:user/release-keys], it is observed that daemon is not started even the zygisk module in system_server has been waiting for 3 seconds.

We also increase the IPC waiting retries to ensure the communication.

@JingMatrix JingMatrix linked an issue Apr 8, 2026 that may be closed by this pull request
1 task
On some devices (e.g., Xiaomi Android 12 [Xiaomi/toco_ru/toco:12/RKQ1.210614.002/V13.0.4.0.SFNRUXM:user/release-keys]), the daemon takes longer to initialize, causing the Zygisk module in system_server to time out after the default 3 seconds while waiting for the proxy service.

We address the race condition with the following changes:
- Move proxy service registration (`SystemServerService.registerProxyService`) to the earliest possible phase in daemon initialization, before environmental setup and DEX preloading.
- Increase the Zygisk IPC waiting retries in `ipc_bridge.cpp` from 3 to 10 seconds to ensure successful communication on slower ROMs.
- Refactor `SystemServerService` into a singleton object.
- Move `system_server` crash recovery and restart logic directly into `VectorDaemon.kt` to better manage retry states during reinjection.
- Clean up variable usage and improve code comments to accurately reflect the proxy replacement lifecycle.
@JingMatrix JingMatrix merged commit 9d89508 into master Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSPosed Manager won't open. Android 12 (MIUI)

1 participant