Skip to content

Make the system-framework scope spelling a harmless legacy instead of a silent one - #1104

Open
McTr0 wants to merge 1 commit into
JingMatrix:masterfrom
McTr0:fix/system-framework-scope-alias
Open

McTr0 wants to merge 1 commit into
JingMatrix:masterfrom
McTr0:fix/system-framework-scope-alias

Conversation

@McTr0

@McTr0 McTr0 commented Nov 22, 2026

Copy link
Copy Markdown

Standalone half of the investigation behind #1101, following the classification there into #1061 and the guidance comment ("for cli usage, use the name system ... still a history legacy we have to bear for a while"). The daemon shadow-escape half is in #1103 and does not depend on this.

The trap today

The framework scope answers to two spellings depending on where the row comes from:

  • the manager stores system (ScopeViewModel.SYSTEM_FRAMEWORK_PACKAGE);
  • the libxposed API, modules asking for a scope through it, and the CLI (which stores what the user typed — vector-cli scope add <module> android/0) all use android;
  • ModuleDatabase.systemServerModuleRows() — the one query that serves system_server — matches only app_pkg_name = 'system'.

So a row written under the android spelling matches no reader at all: getModules() returns an empty list to system_server, nothing loads, onSystemServerStarting dispatches over an empty set, and no log anywhere says why — on every clean boot, because it is not a race. That is what #1061/#1101 hit: the row on that device was written through the CLI with the spelling the libxposed API itself uses.

This PR does not change the documented guidance — system via CLI and system_server in the UI keep working exactly as before — it makes the legacy spelling stop being a silent failure: writes are normalized at the storage boundary (setModuleScope, the libxposed scope-request approval, getModuleScope's read-back), the system_server reader accepts both spellings (deduped, since both rows can exist), removal clears both, and the cache expansion treats the alias the same way. The unresolved-apkPath skip in getModulesForSystemServer also logs now instead of silently dropping a module.

Verification (HyperOS 2.0 / Android 15, beryl, KernelSU + Zygisk Next)

Built from this branch (debug) and deployed with the scope row left stored as android (no other changes):

  • modules log gains the previously missing entry: Loading module io.github.varma322.gpssetter ... successfully. under uid 1000/pid of system_server;
  • onSystemServerStarting dispatches (activeModules=1) and the module's hooks install;
  • dumpsys location shows provider-level (gps + fused) spoofing at the module's configured coordinates — previously last location=null throughout;
  • boot completes with no PMS exception (the shadow half of that device's boot loop is separately fixed in Keep the daemon's resource-cache shadow inside its own mount namespace #1103).

The classloader-capture chain the original reports traced is healthy on this ROM — an instrumented build showed handleSystemServerProcess's post-hook finding a valid context classloader and the hooks firing as designed; the empty module list was the whole story.

Happy to drop this if you would rather keep the legacy as documented-only.

The manager stores the System Framework scope as `system`, but the libxposed
API, the modules asking for a scope through it, and the CLI all use `android`
for the same target - and the rows were stored verbatim. The one query that
serves system_server only matched `system`, so a module scoped through any
spelling but the manager's was silently absent from the module list: nothing
loaded into system_server, onSystemServerStarting dispatched over an empty
set, and the modules log showed no system_server entries at all. That is the
never-dispatched half of JingMatrix#1101, and it reproduced on clean boot cycles
because it was not a race.

Writes are normalized at the storage boundary (setModuleScope, the scope
request approval, and getModuleScope's read-back), the system_server reader
accepts both spellings (deduped, since both rows can exist), removal clears
both, and the cache expansion treats the alias the same way. The unresolved
apkPath skip in getModulesForSystemServer also stops being silent.

Verified on HyperOS 2.0 (Android 15, beryl): with a scope row stored as
`android`, system_server now loads the module and dispatches
onSystemServerStarting on the first soft reboot after this change.

Fixes the dispatch half of JingMatrix#1101.
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.

1 participant