1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-25 07:32:46 +00:00

Added mediaserver to application list

This commit is contained in:
M66B 2016-02-06 07:35:02 +01:00
parent fd022f4065
commit 4fd1333358
2 changed files with 21 additions and 2 deletions

View file

@ -27,6 +27,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.XmlResourceParser;
import android.net.TrafficStats;
import android.os.Build;
import android.os.Process;
import android.os.SystemClock;
import android.preference.PreferenceManager;
@ -86,6 +87,12 @@ public class Rule {
this.internet = true;
this.enabled = true;
this.intent = null;
} else if (info.applicationInfo.uid == 1013) {
this.name = context.getString(R.string.title_mediaserver);
this.system = true;
this.internet = true;
this.enabled = true;
this.intent = null;
} else {
this.name = info.applicationInfo.loadLabel(pm).toString();
this.system = Util.isSystem(info.packageName, context);
@ -180,15 +187,26 @@ public class Rule {
List<PackageInfo> listPI = context.getPackageManager().getInstalledPackages(0);
// Add root
PackageInfo root = new PackageInfo();
root.packageName = "root";
root.versionCode = 0;
root.versionName = "0";
root.versionCode = Build.VERSION.SDK_INT;
root.versionName = Build.VERSION.RELEASE;
root.applicationInfo = new ApplicationInfo();
root.applicationInfo.uid = 0;
root.applicationInfo.icon = 0;
listPI.add(root);
// Add mediaserver
PackageInfo media = new PackageInfo();
media.packageName = "android.media";
media.versionCode = Build.VERSION.SDK_INT;
media.versionName = Build.VERSION.RELEASE;
media.applicationInfo = new ApplicationInfo();
media.applicationInfo.uid = 1013;
media.applicationInfo.icon = 0;
listPI.add(media);
for (PackageInfo info : listPI) {
Rule rule = new Rule(info, context);

View file

@ -153,6 +153,7 @@ Your internet traffic is not being sent to a remote VPN server.</string>
<string name="title_allow">Allow</string>
<string name="title_block">Block</string>
<string name="title_root">root</string>
<string name="title_mediaserver">mediaserver</string>
<string name="title_notify">Notify internet access attempts</string>
<string name="title_log_whois">Whois %1$s</string>