Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions runtime/jni_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2413,7 +2413,7 @@ class JNI {
<< c->GetDexCache()->GetLocation()->ToModifiedUtf8();
ThrowNoSuchMethodError(soa, c, name, sig, "static or non-static");
return JNI_ERR;
} else if (!m->IsNative()) {
} else if (!m->IsNative() && !(m->IsXposedHookedMethod() && m->GetXposedOriginalMethod()->IsNative())) {
LOG(return_errors ? ERROR : FATAL) << "Failed to register non-native method "
<< PrettyDescriptor(c) << "." << name << sig
<< " as native";
Expand All @@ -2438,14 +2438,14 @@ class JNI {
size_t unregistered_count = 0;
for (size_t i = 0; i < c->NumDirectMethods(); ++i) {
mirror::ArtMethod* m = c->GetDirectMethod(i);
if (m->IsNative()) {
if (m->IsNative() || (m->IsXposedHookedMethod() && m->GetXposedOriginalMethod()->IsNative())) {
m->UnregisterNative(soa.Self());
unregistered_count++;
}
}
for (size_t i = 0; i < c->NumVirtualMethods(); ++i) {
mirror::ArtMethod* m = c->GetVirtualMethod(i);
if (m->IsNative()) {
if (m->IsNative() || (m->IsXposedHookedMethod() && m->GetXposedOriginalMethod()->IsNative())) {
m->UnregisterNative(soa.Self());
unregistered_count++;
}
Expand Down