Skip to content

Conversation

@bisuhkfurio
Copy link

No description provided.

thestinger and others added 16 commits November 12, 2025 06:18
fd '.+\.(c|cpp|cc)$' --type file --exec sed -i 's/static JNINativeMethod/static const JNINativeMethod/'
Needed to load code from GmsCore Dynamite APK modules, which are available only by a file descriptor
reference.

/proc/self/fd paths are intentionally not used, see 260785f

13: 2e4ed71 260785f
Skipping them early improves accuracy of dexopt job progress reports.
At boot, packages might need to be optimized for one of the following reasons:
- this is a first reboot after OTA, which means user packages need to be reoptimized from
speed-profile to speed
- post-OTA optimization wasn't completed during previous boot
- device was rebooted before post-app-installation dexopt completed

This is not a full list.
This is needed for forcibly enabling memory tagging for apps that use custom crash handlers, which
ignore SIGSEGV in some cases. Even if SIGSEGV isn't ignored by such handler, it usually breaks
detection of memory tagging-related crashes (MTEAERR/MTESERR signal codes are consumed by them).
- use "speed" compiler filter by default for system packages, including SystemUI and Launcher
- allow to use "verify" instead of "speed" for system packages that have useEmbeddedDex=true
AndroidManifest attribute (e.g. Auditor app). AOT compilation results are not executed for such
packages, regardless of the used compiler filter
- remove "speed-profile" override for current launcher. This override made third-party launchers
use the interpreter-only mode if they didn't include a profile, since the ART JIT compiler is
disabled on GrapheneOS

Test for third-party launcher handling change:
LPKG=<current launcher package name>
- `adb shell pm delete-dexopt $LPKG` to delete its current optimized code, if any
- `adb shell pm compile -r bg-dexopt $LPKG` to re-optimize it
- `adb shell pm art dump $LPKG`. Observe that `status=speed`, not `speed-profile`
Properly adapting to the async pre-reboot dexopt requires extensive changes.
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.

3 participants