Skip to content

Add per-app ART inline hook compatibility mode - #921

Open
lzup333 wants to merge 1 commit into
JingMatrix:masterfrom
lzup333:master
Open

Add per-app ART inline hook compatibility mode#921
lzup333 wants to merge 1 commit into
JingMatrix:masterfrom
lzup333:master

Conversation

@lzup333

@lzup333 lzup333 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

Adds a per-app switch to disable Vector's ART inline hooks for compatibility. Per the review feedback, the setting now lives as a toggle in the package action drawer opened by long-pressing an app in a module's scope page — not a dedicated screen.

Changes

  • native: art_inline_hook_cleanup.cpp + core/art_inline_hook_invalidation.h — a routine that restores libart.so's file-backed executable image and the process's pre-injection modifications after framework bootstrap, leaving LSPlant/Dobby metadata intact.
  • zygisk: module.cpp records/forgets invalidation targets via MakeArtHookInitInfo() and runs InvalidateArtInlineHooksIfEnabled() after forkCommon; ipc_bridge adds ShouldInvalidateArtInlineHooks.
  • daemon: new InlineHookProcessPolicy, PreferenceStore hooks, FrameworkService transaction handler, ManagerService impl. The system UI process (system:ui) is covered via the virtual system package.
  • AIDL: IManagerService adds getInvalidateArtInlineHookPackages/setInvalidateArtInlineHooks (PROTOCOL_VERSION 1→2).
  • manager UI: PackageActionSheet (long-press drawer) gains an "ART inline hook compatibility mode" toggle for hook targets, showing the stored value on open.
  • Translations: all 18 shipped languages.

Verification

  • Rebased on current upstream master.
  • :manager, :daemon, and :zygisk (native, all 4 ABIs) compile; new native symbols are linked into libzygisk.so.

@JingMatrix

Copy link
Copy Markdown
Owner

Have you tested on devices ? And does it help anything mentioned in #641 ?

@lzup333

lzup333 commented Aug 17, 2026

Copy link
Copy Markdown
Author

Yes, I tested it on my device, and it worked as expected.It might be able to improve #641's situation

@JingMatrix

Copy link
Copy Markdown
Owner

Please test some apps and tell what it actually mitigates for their detections.

@lzup333

lzup333 commented Aug 17, 2026

Copy link
Copy Markdown
Author

When I enable a mod(it is based on Xposed) for Terraria,The game crashed( because some detections) ,but when i use lsposed,lsposed provide a option named "还原内联钩子", when i enable the option for Terraria,The game doesn't crash,and the mod running expected, and i tested duck detector.
图片
图片
图片

@lzup333

lzup333 commented Aug 17, 2026

Copy link
Copy Markdown
Author

It is from 7 to 1.

@JingMatrix

Copy link
Copy Markdown
Owner

@lzup333 Rebase on master, and put the setting as one of drawer option (a toggle) when we long press on an application (in the scope page of a module).

Use AI to prepare translatiions in all language, otherwise you cannot pass CI.

Adds a per-package switch to disable Vector's ART inline hooks in
selected apps for compatibility. Long-pressing an app in a module's
scope now offers the toggle in the package action sheet, instead of a
dedicated screen.

The native routine restores libart.so's file-backed executable image and
the process's pre-injection modifications after framework bootstrap,
leaving LSPlant/Dobby metadata intact; it applies to the app the next
time it starts. The daemon stores the configured set per package
(including the system UI as "system"), keyed through a new preference,
and the manager reads and writes it over AIDL.

Included translations for all shipped languages.
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.

​[Feature Request] Implement "Invalidate inline hooks" to bypass detection points

2 participants