Skip to content

Commit

Permalink
Turn invokeOriginalMethodNative() into a fast native method
Browse files Browse the repository at this point in the history
It's not doing more than Method.invoke(), which is also marked as fast
native.
  • Loading branch information
rovo89 committed Nov 15, 2015
1 parent f61eb37 commit bbf9463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libxposed_art.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#endif
#include "mirror/object-inl.h"
#include "mirror/throwable.h"
#include "native/scoped_fast_native_object_access.h"
#include "reflection.h"
#include "scoped_thread_state_change.h"
#include "well_known_classes.h"
Expand Down Expand Up @@ -145,7 +146,7 @@ void XposedBridge_hookMethodNative(JNIEnv* env, jclass, jobject javaReflectedMet

jobject XposedBridge_invokeOriginalMethodNative(JNIEnv* env, jclass, jobject javaMethod,
jint, jobjectArray, jclass, jobject javaReceiver, jobjectArray javaArgs) {
ScopedObjectAccess soa(env);
ScopedFastNativeObjectAccess soa(env);
#if PLATFORM_SDK_VERSION >= 23
return InvokeMethod(soa, javaMethod, javaReceiver, javaArgs);
#else
Expand Down
2 changes: 1 addition & 1 deletion libxposed_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int register_natives_XposedBridge(JNIEnv* env, jclass clazz) {
NATIVE_METHOD(XposedBridge, hookMethodNative, "(Ljava/lang/reflect/Member;Ljava/lang/Class;ILjava/lang/Object;)V"),
#ifdef ART_TARGET
NATIVE_METHOD(XposedBridge, invokeOriginalMethodNative,
"(Ljava/lang/reflect/Member;I[Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;"),
"!(Ljava/lang/reflect/Member;I[Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;"),
#endif
NATIVE_METHOD(XposedBridge, setObjectClassNative, "(Ljava/lang/Object;Ljava/lang/Class;)V"),
NATIVE_METHOD(XposedBridge, dumpObjectNative, "(Ljava/lang/Object;)V"),
Expand Down

0 comments on commit bbf9463

Please sign in to comment.