Hot fix for detecting MagiskHide

This commit is contained in:
topjohnwu 2017-10-15 03:12:13 +08:00
parent aa0b9e2db2
commit f742bb1c47
4 changed files with 9 additions and 4 deletions

View File

@ -8,7 +8,7 @@ android {
applicationId "com.topjohnwu.magisk"
minSdkVersion 21
targetSdkVersion 26
versionCode 56
versionCode 57
versionName "5.4.0"
ndk {
moduleName 'zipadjust'

View File

@ -20,6 +20,7 @@ import com.topjohnwu.magisk.components.AlertDialogBuilder;
import java.io.IOException;
import java.io.InputStream;
import java.util.Locale;
import butterknife.BindView;
import butterknife.ButterKnife;
@ -57,7 +58,7 @@ public class AboutActivity extends Activity {
ab.setDisplayHomeAsUpEnabled(true);
}
appVersionInfo.setSummary(BuildConfig.VERSION_NAME);
appVersionInfo.setSummary(String.format(Locale.US, "%s (%d)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
String changes = null;
try (InputStream is = getAssets().open("changelog.html")) {

View File

@ -312,7 +312,11 @@ public class MagiskManager extends Application {
} catch (NumberFormatException e) {
disabled = false;
}
ret = shell.sh("getprop " + MAGISKHIDE_PROP);
if (magiskVersionCode > 1435) {
ret = shell.su("resetprop -p " + MAGISKHIDE_PROP);
} else {
ret = shell.sh("getprop " + MAGISKHIDE_PROP);
}
try {
magiskHide = !Utils.isValidShellResponse(ret) || Integer.parseInt(ret.get(0)) != 0;
} catch (NumberFormatException e) {

View File

@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta7'
classpath 'com.android.tools.build:gradle:3.0.0-rc1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files