You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Refactor, cleanup, backstack works
This commit is contained in:
@@ -55,7 +55,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
||||
if (null == view) {
|
||||
LayoutInflater layoutInflater = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
view = layoutInflater.inflate(R.layout.app_list_row, null);
|
||||
view = layoutInflater.inflate(R.layout.list_item_app, null);
|
||||
}
|
||||
|
||||
ApplicationInfo applicationInfo = appsList.get(position);
|
||||
@@ -81,7 +81,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
||||
if (null == view) {
|
||||
LayoutInflater layoutInflater = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
view = layoutInflater.inflate(R.layout.app_list_row, null);
|
||||
view = layoutInflater.inflate(R.layout.list_item_app, null);
|
||||
}
|
||||
ApplicationInfo applicationInfo = appsList.get(position);
|
||||
if (null != applicationInfo) {
|
||||
|
||||
@@ -97,9 +97,9 @@ public class Utils {
|
||||
return Boolean.parseBoolean(ret.get(0));
|
||||
}
|
||||
|
||||
public static boolean autoRootEnabled(Context context) {
|
||||
public static boolean autoToggleEnabled(Context context) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
Log.d("Magisk", "AutoRootEnableCheck is " + preferences.getBoolean("autoRootEnable", false));
|
||||
Logger.dh("Utils: AutoRootEnableCheck is " + preferences.getBoolean("autoRootEnable", false));
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("autoRootEnable", false);
|
||||
|
||||
}
|
||||
@@ -232,7 +232,7 @@ public class Utils {
|
||||
int mIcon;
|
||||
switch (mRootsState) {
|
||||
case 2:
|
||||
mLabelString = "Auto-root";
|
||||
mLabelString = mContext.getString(R.string.auto_toggle);
|
||||
mIcon = mAutoRootIcon;
|
||||
intent = autoBroadcast;
|
||||
break;
|
||||
@@ -360,7 +360,7 @@ public class Utils {
|
||||
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
|
||||
|
||||
public static int CheckRootsState(Context mContext) {
|
||||
if (autoRootEnabled(mContext)) {
|
||||
if (autoToggleEnabled(mContext)) {
|
||||
return 2;
|
||||
} else {
|
||||
if (rootEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user