You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Vroom vroom!
Look at er go!
This commit is contained in:
@@ -70,7 +70,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
||||
appName.setText(applicationInfo.loadLabel(packageManager));
|
||||
packageName.setText(applicationInfo.packageName);
|
||||
iconview.setImageDrawable(applicationInfo.loadIcon(packageManager));
|
||||
if (CheckApp(applicationInfo.packageName,BLACKLIST_LIST)) {
|
||||
if (CheckApp(applicationInfo.packageName, BLACKLIST_LIST)) {
|
||||
statusview.setImageDrawable(this.context.getDrawable(R.drawable.root));
|
||||
} else {
|
||||
statusview.setImageDrawable(null);
|
||||
@@ -89,9 +89,9 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
||||
ApplicationInfo applicationInfo = appsList.get(position);
|
||||
if (null != applicationInfo) {
|
||||
ImageView statusview = (ImageView) view.findViewById(R.id.app_status);
|
||||
if (CheckApp(applicationInfo.packageName,BLACKLIST_LIST)) {
|
||||
if (CheckApp(applicationInfo.packageName, BLACKLIST_LIST)) {
|
||||
statusview.setImageDrawable(this.context.getDrawable(R.drawable.root));
|
||||
} else if (CheckApp(applicationInfo.packageName,WHITELIST_LIST)) {
|
||||
} else if (CheckApp(applicationInfo.packageName, WHITELIST_LIST)) {
|
||||
statusview.setImageDrawable(this.context.getDrawable(R.drawable.ic_stat_notification_autoroot_off));
|
||||
} else {
|
||||
statusview.setImageDrawable(null);
|
||||
@@ -100,20 +100,33 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
||||
|
||||
}
|
||||
|
||||
private boolean CheckApp(String appToCheck,int list) {
|
||||
private boolean CheckApp(String appToCheck, int list) {
|
||||
boolean starter = false;
|
||||
if (list == BLACKLIST_LIST) {
|
||||
Set<String> set = prefs.getStringSet("auto_blacklist", null);
|
||||
arrayList = new ArrayList<>(set);
|
||||
return arrayList.toString().contains(appToCheck);
|
||||
if (set != null) {
|
||||
arrayList = new ArrayList<>(set);
|
||||
for (String string : set) {
|
||||
if (string.equals(appToCheck)) {
|
||||
starter = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
Set<String> set = prefs.getStringSet("auto_whitelist", null);
|
||||
arrayList = new ArrayList<>(set);
|
||||
return arrayList.toString().contains(appToCheck);
|
||||
if (set != null) {
|
||||
arrayList = new ArrayList<>(set);
|
||||
for (String string : set) {
|
||||
if (string.equals(appToCheck)) {
|
||||
starter = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return starter;
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
|
||||
public class GitAgent {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.DownloadManager;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -396,7 +397,13 @@ public class Utils {
|
||||
public static boolean rootStatus() {
|
||||
try {
|
||||
String rootStatus = Shell.su("getprop magisk.root").toString();
|
||||
return Integer.valueOf(rootStatus).equals(1);
|
||||
String fuckyeah = Shell.sh("which su").toString();
|
||||
Log.d("Magisk","Utils: Rootstatus Checked, " + rootStatus + " and " + fuckyeah);
|
||||
if (rootStatus.contains("0") && !fuckyeah.contains("su")) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
@@ -404,6 +411,16 @@ public class Utils {
|
||||
|
||||
}
|
||||
|
||||
public static boolean isMyServiceRunning(Class<?> serviceClass, Context context) {
|
||||
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
||||
if (serviceClass.getName().equals(service.service.getClassName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String procFile(String value, Context context) {
|
||||
|
||||
String cryptoPass = context.getResources().getString(R.string.pass);
|
||||
|
||||
Reference in New Issue
Block a user