Initial re-add of hide fragment

This commit is contained in:
d8ahazard
2016-10-22 11:05:34 -05:00
committed by topjohnwu
parent 4a1e6dcc32
commit bbae93aa16
15 changed files with 645 additions and 3 deletions
@@ -13,6 +13,10 @@ import android.widget.Toast;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.receivers.DownloadReceiver;
import com.topjohnwu.magisk.receivers.PrivateBroadcastReceiver;
import com.topjohnwu.magisk.services.MonitorService;
import com.topjohnwu.magisk.services.TileServiceCompat;
import com.topjohnwu.magisk.services.TileServiceNewApi;
import java.io.File;
import java.io.UnsupportedEncodingException;
@@ -60,6 +64,13 @@ public class Utils {
return commandExists("su");
}
public static boolean autoToggleEnabled(Context context) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
Logger.dev("Utils: AutoRootEnableCheck is " + preferences.getBoolean("autoRootEnable", false));
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("autoRootEnable", false);
}
public static boolean createFile(String path) {
String command = "touch " + path + " 2>/dev/null; if [ -f " + path + " ]; then echo true; else echo false; fi";
return Shell.rootAccess() && Boolean.parseBoolean(Shell.su(command).get(0));