Skip to content

Commit

Permalink
Merge pull request android-hacker#936 from lianglixin/vxp
Browse files Browse the repository at this point in the history
Fix Provider Hook On Android 11
  • Loading branch information
tiann authored Nov 23, 2020
2 parents 0cb6a5a + 24e3b78 commit 79f4be9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,15 @@ public Object invoke(Object proxy, Method method, Object... args) throws Throwab
}
MethodBox methodBox = new MethodBox(method, mBase, args);
int start = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? 1 : 0;

// Android 11.
if(Build.VERSION.SDK_INT >= 30) start = 2;
try {
String name = method.getName();
if ("call".equals(name)) {
if (BuildCompat.isQ()) {
// Android 11
if(Build.VERSION.SDK_INT >= 30)
start = 3;
else if (BuildCompat.isQ()) {
start = 2;
}
String methodName = (String) args[start];
Expand Down

0 comments on commit 79f4be9

Please sign in to comment.