Annotated. Everything here was either read directly while writing the chapter or is the canonical
place to check a claim the chapter makes. Where a source is wrong about something this chapter
measured, the annotation says so — that is more useful than a bare link.
Paths are from the AOSP tree and are stable. The behaviour claims beside them were verified
against the device's own /system/framework/framework.jar with dexdump, not against the browser.
The whole reflective path lives in one file: onCreate reads :android:show_fragment, switchToHeader dispatches, switchToHeaderInner calls isValidFragment and then Fragment.instantiate, and startPreferencePanel/startWithFragment are the in-app callers.
AndroidX: loadFragmentClass, instantiate, isFragmentClass. Read it, then disassemble it — the source and the bytecode disagree about where the type check happens.
AndroidX: the deprecated static instantiate(Context, String, Bundle), which still delegates to loadFragmentClass.
How to read the version on your own device, which is what this chapter did:
# host
adbpull/system/framework/framework.jar
python3-B-c"import zipfile;z=zipfile.ZipFile('framework.jar');[open(n,'wb').write(z.read(n)) for n in z.namelist() if n.endswith('.dex')]"$ANDROID_HOME/build-tools/35.0.1/dexdump-dclasses3.dex|grep-A35"name : 'isValidFragment'"
Deprecated at API 29, still shipping and still functional on API 35. EXTRA_SHOW_FRAGMENT and isValidFragment are both public API and both documented. The javadoc for isValidFragment says the subclass must "verify" — and nothing enforces it.
The 2013 disclosure of fragment injection in PreferenceActivity, from IBM's application-security research group
The origin of the bug class and the reason isValidFragment exists. Read it as history. Then check its reachability claims against README §3.9, because the mechanism half is unchanged and the "legacy apps are automatically vulnerable" half is now gated by an install floor that did not exist in 2013.
The ysoserial body of work on Java deserialisation gadget chains
The same defect in a different runtime: an attacker-chosen type name reaching a reflective constructor. README §4.5's ordering measurement is a gadget-hunting question, and the methodology transfers directly — the only difference is that here the classpath is the application rather than a library set.
"Towards Discovering and Understanding Task Hijacking in Android" — Ren, Zhang, Wang, Chen, Mao, USENIX Security 2015
Cited by 30-Activities, and the model for how to write about a UI-level attack family whose exploitability is device-dependent rather than absolute.
On CVE identifiers. This chapter deliberately cites none. Identifiers exist for specific vendor
instances of fragment injection, but a wrong identifier is worse than no identifier, and this
repository's rule is to describe the class rather than invent an ID. AOSP file paths are stable and
are cited freely above.
The workhorse of this chapter. dexdump -d classes.dex gives per-method disassembly with source line positions, which is how the crash stack and the bytecode were shown to agree.
baksmali (inside apktool's jar)
java -cp apktool.jar com.android.tools.smali.baksmali.Main d classes.dex -o out/. Use this, not jadx:jadx 1.5.3 on this machine produces no output for a bare classes.dex, exits 0, and hangs on a .jar.
javap -c (JDK)
The only way to see that AndroidX's generic cast is erased. Point it at the classes.jar inside fragment-*.aar.
DEX-structure scanner. Parses string_ids, type_ids, method_ids, class_defs, class_data and the instruction stream, and reports per method where external input reaches a reflective Fragment loader. Also classifies every isValidFragment override by the set of methods it calls. Validated against this chapter's own victim APK before being trusted.
Device probe: is the reflective path present on this build, what targetSdk threshold is compiled into the gate, what is the install floor, and which installed packages sit below it.
Frida: the gate, both loaders, both transaction classes, setArguments, a filtered ClassLoader.loadClass, and every Activity's extras. Reviewed and unrun — labelled in its own header and in README §7.4.