Skip to content

Hook Android 17 Zygote signatures on GrapheneOS - #150

Merged
JingMatrix merged 1 commit into
masterfrom
graphene-17-zygote-signatures
Jul 31, 2026
Merged

Hook Android 17 Zygote signatures on GrapheneOS#150
JingMatrix merged 1 commit into
masterfrom
graphene-17-zygote-signatures

Conversation

@JingMatrix

Copy link
Copy Markdown
Owner

GrapheneOS 17 reworked the app-specialize native methods. extraLongArgs moved from the last parameter to the first in both nativeForkAndSpecialize and nativeSpecializeAppProcess, and nativeForkAndSpecialize also gained a useFifoUi boolean.

Our existing GrapheneOS entries encode the older layout (extraLongArgs last), so on 17 those descriptors no longer resolve. hook_jni_methods then skips both app-specialize methods, leaving only nativeForkSystemServer (signature unchanged) hooked. Injection into app processes breaks — most visibly on the USAP path via nativeSpecializeAppProcess, which has no other interception point, so the process is specialized with no module callback and, for the parasitic manager, aborts on the SELinux context set.

Changes

  • Add grapheneos_17 variants of nativeForkAndSpecialize and nativeSpecializeAppProcess to gen_jni_hooks.py (leading extraLongArgs, plus the extra use_fifo_ui boolean on fork), and regenerate jni_hooks.hpp.
  • Warn in hook_zygote_jni when none of a Zygote fork/specialize method's variants resolve, instead of skipping silently. A signature bump should surface as a log line, not as a downstream SIGABRT.

Context: JingMatrix/Vector#786.

GrapheneOS 17 reworked the app-specialize native methods: extraLongArgs
moved from the last parameter to the first in both nativeForkAndSpecialize
and nativeSpecializeAppProcess, and nativeForkAndSpecialize gained a
use_fifo_ui boolean. The existing GrapheneOS entries encode the older
layout with extraLongArgs last, so on 17 the descriptors no longer resolve.
Both app-specialize hooks are then skipped and only nativeForkSystemServer
stays hooked, which breaks injection into app processes (the USAP path in
particular has no other interception point).

Add the Android 17 variants for both methods, and warn when a Zygote
fork/specialize method fails to resolve to any signature instead of
skipping it silently.
@JingMatrix
JingMatrix merged commit cb7e89c into master Jul 31, 2026
1 check passed
HSSkyBoy pushed a commit to HSSkyBoy/NyaZygisk that referenced this pull request Aug 2, 2026
GrapheneOS 17 reworked the app-specialize native methods: extraLongArgs moved from the last parameter to the first in both nativeForkAndSpecialize and nativeSpecializeAppProcess, and nativeForkAndSpecialize gained a use_fifo_ui boolean. The existing GrapheneOS entries encode the older layout with extraLongArgs last, so on 17 the descriptors no longer resolve.

Both app-specialize hooks are then skipped and only nativeForkSystemServer stays hooked, which breaks injection into app processes (the USAP path in particular has no other interception point). Add the Android 17 variants for both methods, and warn when a Zygote fork/specialize method fails to resolve to any signature instead of skipping it silently.
@JingMatrix
JingMatrix deleted the graphene-17-zygote-signatures branch August 8, 2026 14:17
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