Fix AdjustThreadVisibilityCounter inline

This commit is contained in:
LoveSy 2023-10-10 11:22:24 +08:00
parent 780cbe09a3
commit a4f6979c28
No known key found for this signature in database

View File

@ -127,6 +127,12 @@ private:
RestoreBackup(nullptr, self); RestoreBackup(nullptr, self);
}); });
CREATE_MEM_HOOK_STUB_ENTRY(
"_ZN3art11ClassLinker26VisiblyInitializedCallback22MarkVisiblyInitializedEPNS_6ThreadE",
void, MarkVisiblyInitialized, (void *thiz, Thread* self), {
backup(thiz, self);
RestoreBackup(nullptr, self);
});
public: public:
static bool Init(const HookHandler &handler) { static bool Init(const HookHandler &handler) {
int sdk_int = GetAndroidApiLevel(); int sdk_int = GetAndroidApiLevel();
@ -150,7 +156,7 @@ public:
if (sdk_int >= __ANDROID_API_R__) { if (sdk_int >= __ANDROID_API_R__) {
if constexpr (GetArch() != Arch::kX86 && GetArch() != Arch::kX86_64) { if constexpr (GetArch() != Arch::kX86 && GetArch() != Arch::kX86_64) {
// fixup static trampoline may have been inlined // fixup static trampoline may have been inlined
HookSyms(handler, AdjustThreadVisibilityCounter); HookSyms(handler, AdjustThreadVisibilityCounter, MarkVisiblyInitialized);
} }
} }