Skip to content

Register the serial proxy service on Android 10 and below - #793

Merged
JingMatrix merged 2 commits into
masterfrom
fix-pre-r-proxy-service
Jul 27, 2026
Merged

Register the serial proxy service on Android 10 and below#793
JingMatrix merged 2 commits into
masterfrom
fix-pre-r-proxy-service

Conversation

@JingMatrix

@JingMatrix JingMatrix commented Jul 25, 2026

Copy link
Copy Markdown
Owner

On Android 10 the Zygisk module never finds the proxy that the daemon claims to have registered, as reported in #773:

[ 2026-06-24T20:42:05.732        0:  1651:  1651 D/VectorSystemServer ] Registering bridge service for `system_server` with name `serial`.
[ 2026-06-24T20:42:05.888     1000:  2202:  2202 W/VectorNative    ] Failed to get system server binder via serial, will retry in 1 second...
[ 2026-06-24T20:42:15.894     1000:  2202:  2202 E/VectorNative    ] Failed to get system server binder after 10 attempts. Aborting.
[ 2026-06-24T20:42:25.151        0:  1651:  1651 E/VectorDaemon    ] Failed to inject VectorService into system_server

The daemon prints Waiting system service: package on every second between those attempts, so it is alive: this is not the startup race of #648, the name is simply never registered. registerProxyService needs the version check only for IServiceManager.registerForNotifications, which arrived in Android R, and #648 moved ServiceManager.addService into that same branch, leaving API 27 to 29 without a proxy.

We keep only registerForNotifications behind the check. On pre-R we cannot capture the real service, but its own registration replaces our proxy in servicemanager anyway.

The reporter confirmed that the Manager now opens, but only once. The follow-up log in #773 shows a second pre-R gap behind that:

java.lang.NoSuchMethodError: No interface method startActivityAsUserWithFeature(...)
    at org.matrix.vector.daemon.ipc.ManagerService.startActivityAsUserWithFeature(ManagerService.kt:379)
    at org.lsposed.lspd.ILSPManagerService$Stub.onTransact(ILSPManagerService.java:377)
E/VectorDaemon: Uncaught exception in Daemon
I/lspd: System.exit called, status: 1

IActivityManager.startActivityAsUserWithFeature also arrived in Android R, and our stub already marks it @RequiresApi(30), but both call sites used it unconditionally. openManager hid the error inside runCatching, while the binder override did not, so it escaped onTransact and killed the daemon. The Manager is then left in the shell host process with nothing to hand it an intent, which is the BugreportWarningActivity NPE further down the same log.

The second commit routes both call sites through startActivityAsUserCompat, shaped like the existing registerReceiverCompat: pick the signature the platform provides, and report a failure as a negative result instead of letting an unchecked error escape a binder transaction.

Close #773 as fixed.

The Zygisk module polls `ServiceManager.getService("serial")` while
specializing `system_server`, but since #648 the matching
`ServiceManager.addService` call sits inside the `SDK_INT >= R` branch that
exists only for `IServiceManager.registerForNotifications`. On Android 8.1 to
10 nothing claims the name, so the module aborts the injection after ten
attempts.

Keep only `registerForNotifications` behind the version check. Without the
callback we cannot capture the real service, but its own registration replaces
our proxy in servicemanager anyway.
@JingMatrix
JingMatrix force-pushed the fix-pre-r-proxy-service branch from 015ead4 to 38c839e Compare July 25, 2026 21:36
@JingMatrix JingMatrix changed the title Register the system_server proxy service on Android 10 and below Register the serial proxy service on Android 10 and below Jul 25, 2026
`IActivityManager.startActivityAsUserWithFeature` only arrived in Android R,
but both call sites used it unconditionally, so on Android 10 the manager
opened once and then took the daemon down, as reported in #773:

    java.lang.NoSuchMethodError: No interface method startActivityAsUserWithFeature(...)
        at org.matrix.vector.daemon.ipc.ManagerService.startActivityAsUserWithFeature(ManagerService.kt:379)
        at org.lsposed.lspd.ILSPManagerService$Stub.onTransact(ILSPManagerService.java:377)
    E/VectorDaemon: Uncaught exception in Daemon

The error escaped the binder transaction because that call site was not
guarded, and the manager was then left in the shell host process without a
daemon, which is where the `BugreportWarningActivity` crash comes from.

Route both call sites through `startActivityAsUserCompat`, following the
`registerReceiverCompat` pattern: pick the signature the platform provides
and turn a failure into a negative result instead of an uncaught error.
@JingMatrix
JingMatrix merged commit 7b4688f into master Jul 27, 2026
1 check passed
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.

Action button fails to open when Vector used (works OK on lsposed v1.11) on same device

1 participant