Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion core/src/main/java/org/lsposed/lspd/impl/LSPosedContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,16 @@ public <T> boolean deoptimize(@NonNull Constructor<T> constructor) {

@Nullable
@Override
public Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException {
public Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException {
return HookBridge.invokeOriginalMethod(method, thisObject, args);
}

@Override
public <T> void invokeOrigin(@NonNull Constructor<T> constructor, @NonNull T thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException {
// The bridge returns an Object (null for void/constructors), which we discard.
HookBridge.invokeOriginalMethod(constructor, thisObject, args);
}

private static char getTypeShorty(Class<?> type) {
if (type == int.class) {
return 'I';
Expand Down Expand Up @@ -257,6 +263,11 @@ public Object invokeSpecial(@NonNull Method method, @NonNull Object thisObject,
return HookBridge.invokeSpecialMethod(method, getExecutableShorty(method), method.getDeclaringClass(), thisObject, args);
}

@Override
public <T> void invokeSpecial(@NonNull Constructor<T> constructor, @NonNull T thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException {
HookBridge.invokeSpecialMethod(constructor, getExecutableShorty(constructor), constructor.getDeclaringClass(), thisObject, args);
}

@NonNull
@Override
public <T> T newInstanceOrigin(@NonNull Constructor<T> constructor, Object... args) throws InvocationTargetException, IllegalAccessException, InstantiationException {
Expand Down