Final fixes

This commit is contained in:
topjohnwu 2017-02-06 08:16:48 +08:00
parent 6e28a26015
commit 45765e292d
4 changed files with 61 additions and 58 deletions

View File

@ -1,5 +1,6 @@
#!/system/bin/sh
[ -z $BOOTMODE ] && BOOTMODE=false
TMPDIR=/tmp
($BOOTMODE) && TMPDIR=/dev/tmp

View File

@ -82,6 +82,9 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
.setNegativeButton(R.string.no_thanks, null)
.show();
});
if (Global.Info.magiskVersion < 10.3) {
uninstallButton.setVisibility(View.GONE);
} else {
uninstallButton.setOnClickListener(vi -> {
Utils.getAlertDialogBuilder(getActivity())
.setTitle("Uninstall Magisk")
@ -120,6 +123,8 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
.setNegativeButton(R.string.no_thanks, null)
.show();
});
}
if (Global.Events.blockDetectionDone.isTriggered) {
updateUI();
}

View File

@ -16,14 +16,9 @@ public class SplashActivity extends AppCompatActivity {
// Init the info and configs and root shell
Global.init(getApplicationContext());
// Start MagiskHide if not started at boot
if (Global.Configs.magiskHide && !Global.Info.disabled && Global.Info.magiskVersion > 10.3)
new Async.MagiskHide().enable();
// Now fire all async tasks
new Async.LoadApps(getPackageManager()).exec();
new Async.GetBootBlocks().exec();
new Async.CheckUpdates().exec();
new Async.GetBootBlocks().exec();
new Async.LoadModules() {
@Override
protected void onPostExecute(Void v) {
@ -31,6 +26,7 @@ public class SplashActivity extends AppCompatActivity {
new Async.LoadRepos(getApplicationContext()).exec();
}
}.exec();
new Async.LoadApps(getPackageManager()).exec();
// Preparation done, now start main activity
Intent intent = new Intent(getApplicationContext(), MainActivity.class);

View File

@ -44,7 +44,6 @@ public class SuReceiver extends BroadcastReceiver {
SuLogEntry log = new SuLogEntry(policy);
if (policy.notification && Global.Configs.suNotificationType == TOAST) {
String message;
switch (action) {
case "allow":
@ -58,8 +57,10 @@ public class SuReceiver extends BroadcastReceiver {
default:
return;
}
if (policy.notification && Global.Configs.suNotificationType == TOAST)
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
if (policy.logging) {
toUid = intent.getIntExtra("to.uid", -1);
if (toUid < 0) return;