Skip to content

Commit

Permalink
Fixed su namespace on Android >=11
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopotediosi committed Nov 12, 2022
1 parent 71b3fc5 commit efc58d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -28,12 +28,12 @@ android {
keyPassword keystoreAliasPSW
}
}
compileSdk 32
compileSdk 33

defaultConfig {
applicationId "com.jacopomii.googledialermod"
minSdk 21
targetSdk 29 // Target >= Android 11 give Scoped Storage problems
targetSdk 33
versionCode 103
versionName "1.03"
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/jacopomii/googledialermod/Utils.java
Expand Up @@ -35,7 +35,7 @@ public static boolean checkIsDialerInstalled(Context context) {
} catch (PackageManager.NameNotFoundException e) {
return false;
}
return true;
return runSuWithCmd("test -d /data/data/com.google.android.dialer; echo $?").getInputStreamLog().equals("0");
}

public static boolean checkIsPhenotypeDBInstalled() {
Expand Down Expand Up @@ -93,7 +93,7 @@ public static StreamLogs runSuWithCmd(String cmd) {
streamLogs.setOutputStreamLog(cmd);

try {
Process su = Runtime.getRuntime().exec("su");
Process su = Runtime.getRuntime().exec("su --mount-master");
outputStream = new DataOutputStream(su.getOutputStream());
inputStream = su.getInputStream();
errorStream = su.getErrorStream();
Expand Down

0 comments on commit efc58d5

Please sign in to comment.