List self

It's fake, but it will prevent 1-star ratings
This commit is contained in:
M66B 2023-11-05 18:31:16 +01:00
parent 8ef3e87cb1
commit 4a9b16ee1e
2 changed files with 8 additions and 4 deletions

View File

@ -1049,7 +1049,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
@Override @Override
protected List<Rule> doInBackground(Object... arg) { protected List<Rule> doInBackground(Object... arg) {
return Rule.getRules(false, ActivityMain.this); return Rule.getRules(false, true, ActivityMain.this);
} }
@Override @Override

View File

@ -201,6 +201,10 @@ public class Rule {
} }
public static List<Rule> getRules(final boolean all, Context context) { public static List<Rule> getRules(final boolean all, Context context) {
return getRules(all, false, context);
}
public static List<Rule> getRules(final boolean all, boolean self, Context context) {
synchronized (context.getApplicationContext()) { synchronized (context.getApplicationContext()) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences wifi = context.getSharedPreferences("wifi", Context.MODE_PRIVATE); SharedPreferences wifi = context.getSharedPreferences("wifi", Context.MODE_PRIVATE);
@ -340,15 +344,15 @@ public class Rule {
for (PackageInfo info : listPI) for (PackageInfo info : listPI)
try { try {
// Skip self // Skip self
if (info.applicationInfo.uid == Process.myUid()) if (!self && info.applicationInfo.uid == Process.myUid())
continue; continue;
Rule rule = new Rule(dh, info, context); Rule rule = new Rule(dh, info, context);
if (pre_system.containsKey(info.packageName)) if (pre_system.containsKey(info.packageName))
rule.system = pre_system.get(info.packageName); rule.system = pre_system.get(info.packageName);
if (info.applicationInfo.uid == Process.myUid()) //if (info.applicationInfo.uid == Process.myUid())
rule.system = true; // rule.system = true;
if (all || if (all ||
((rule.system ? show_system : show_user) && ((rule.system ? show_system : show_user) &&