Fix Android 16 ART Java bridge fast-path detection#389
Open
sec-staff-lilithgames wants to merge 1 commit intofrida:mainfrom
Open
Fix Android 16 ART Java bridge fast-path detection#389sec-staff-lilithgames wants to merge 1 commit intofrida:mainfrom
sec-staff-lilithgames wants to merge 1 commit intofrida:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
copied_methods_offset_discovery as a hard initialization gate on Android 16 ARTmethods_array header length instead of fromcopied_methods_offset_getModifiers()instead of raw ART access flagsWhy
On Android 16,
Java.performNow()was failing duringjava/lang/Threadprobing with:Unable to find copied methods in java/lang/Thread; please file a bugIn downstream runtime debugging on a Pixel 8a / Android 16 device, the
java/lang/Threadclass object'smethods_array header length was125, but there was no nearbyu16/u32 == 125candidate for the old heuristic. That lines up with current ART semantics wherecopied_methods_offset_is a start index, not a total method count.After bypassing that gate, the next failure was that
Thread.currentThread()was being classified as an instance method on the ART fast path. Using reflectedMethod.getModifiers()/Field.getModifiers()instead of raw ART access flags fixed the dispatch kind.Validation
Downstream, a repo-local bridge bundle built from these patched sources was exercised on
com.android.purebilibilion both attach and spawn, and passed:Thread.MAX_PRIORITYThread.currentThread()String.valueOf(int)ActivityThread.currentApplication()Java.enumerateMethodsJava.chooseThread.getName()andApplication.getPackageName()I also verified that the downstream existing demo/device baseline remained green after the fix.