mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
parent
77845e02f2
commit
e0774471d4
2 changed files with 4 additions and 8 deletions
|
@ -1049,7 +1049,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
|
||||
@Override
|
||||
protected List<Rule> doInBackground(Object... arg) {
|
||||
return Rule.getRules(false, true, ActivityMain.this);
|
||||
return Rule.getRules(false, ActivityMain.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -201,10 +201,6 @@ public class Rule {
|
|||
}
|
||||
|
||||
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()) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences wifi = context.getSharedPreferences("wifi", Context.MODE_PRIVATE);
|
||||
|
@ -344,15 +340,15 @@ public class Rule {
|
|||
for (PackageInfo info : listPI)
|
||||
try {
|
||||
// Skip self
|
||||
if (!self && info.applicationInfo.uid == Process.myUid())
|
||||
if (info.applicationInfo.uid == Process.myUid())
|
||||
continue;
|
||||
|
||||
Rule rule = new Rule(dh, info, context);
|
||||
|
||||
if (pre_system.containsKey(info.packageName))
|
||||
rule.system = pre_system.get(info.packageName);
|
||||
//if (info.applicationInfo.uid == Process.myUid())
|
||||
// rule.system = true;
|
||||
if (info.applicationInfo.uid == Process.myUid())
|
||||
rule.system = true;
|
||||
|
||||
if (all ||
|
||||
((rule.system ? show_system : show_user) &&
|
||||
|
|
Loading…
Reference in a new issue