Skip to content

Commit

Permalink
Final fix for hiding from system apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikanoshi committed Sep 26, 2019
1 parent c6198fd commit c7d1e65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 128
versionName "1.28.2"
versionName "1.28.3"
}
buildTypes {
release {
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/sudocode/sudoHideModule/XposedMain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sudocode.sudoHideModule;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.ResolveInfo;
Expand Down Expand Up @@ -124,9 +125,10 @@ private boolean shouldBlock(Object thiz, String callingName, String queryName) {
return true;
}

// public ApplicationInfo getApplicationInfo(String packageName, int flags)
// need to bypass enforceCrossUserPermission
ApplicationInfo info = (ApplicationInfo)XposedHelpers.callMethod(thiz, "getApplicationInfo", callingName, 0);
Context mContext = (Context)XposedHelpers.getObjectField(thiz, "mContext");
Object mPM = XposedHelpers.getObjectField(thiz, "mPM");
if (mContext == null || mPM == null) return false;
ApplicationInfo info = (ApplicationInfo)XposedHelpers.callMethod(mPM, "getApplicationInfo", callingName, 0, XposedHelpers.callMethod(mContext, "getUserId"));
if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
logDebug(key + " true");
return true;
Expand Down

0 comments on commit c7d1e65

Please sign in to comment.