Skip to content

Commit c6e9e05

Browse files
author
tiann
committed
FIX: tweak provider hook for Android Q.
1 parent feaea9e commit c6e9e05

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

VirtualApp/lib/src/main/java/com/lody/virtual/client/hook/providers/ProviderHook.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.os.ParcelFileDescriptor;
1111

1212
import com.lody.virtual.client.hook.base.MethodBox;
13+
import com.lody.virtual.helper.compat.BuildCompat;
1314
import com.lody.virtual.helper.utils.VLog;
1415

1516
import java.lang.reflect.InvocationHandler;
@@ -151,13 +152,11 @@ public Object invoke(Object proxy, Method method, Object... args) throws Throwab
151152
e.printStackTrace();
152153
}
153154
MethodBox methodBox = new MethodBox(method, mBase, args);
154-
int start = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? 1 : 0;
155+
int start = BuildCompat.isQ() ? 2 : (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? 1 : 0);
156+
155157
try {
156158
String name = method.getName();
157159
if ("call".equals(name)) {
158-
if (!(args[start + 2] instanceof Bundle)) {
159-
start++;
160-
}
161160
String methodName = (String) args[start];
162161
String arg = (String) args[start + 1];
163162
Bundle extras = (Bundle) args[start + 2];

0 commit comments

Comments
 (0)