mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
Notify update for system apps which are user apps now
This commit is contained in:
parent
cb6a0e9610
commit
94617dbe74
4 changed files with 21 additions and 2 deletions
|
@ -75,6 +75,7 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||
|
|
|
@ -9,7 +9,7 @@ model {
|
|||
applicationId = "eu.faircode.netguard"
|
||||
minSdkVersion.apiLevel = 21
|
||||
targetSdkVersion.apiLevel = 23
|
||||
versionCode = 2016010301
|
||||
versionCode = 2016010307
|
||||
versionName = "0.65"
|
||||
archivesBaseName = "NetGuard-v$versionName-$versionCode"
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import android.os.PowerManager;
|
|||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.NotificationManagerCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
|
||||
|
@ -101,6 +100,9 @@ public class Receiver extends BroadcastReceiver {
|
|||
}
|
||||
|
||||
public static void notifyApplication(int uid, Context context) {
|
||||
if (uid < 0)
|
||||
return;
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
try {
|
||||
// Get application info
|
||||
|
@ -210,6 +212,13 @@ public class Receiver extends BroadcastReceiver {
|
|||
edit_screen_other.apply();
|
||||
|
||||
// TODO: delete unused
|
||||
} else if (oldVersion < 2016010307) {
|
||||
notifyApplication(Util.getSystemUid("com.facebook.katana", context), context);
|
||||
notifyApplication(Util.getSystemUid("com.facebook.orca", context), context);
|
||||
notifyApplication(Util.getSystemUid("com.google.android.youtube", context), context);
|
||||
notifyApplication(Util.getSystemUid("com.skype.raider", context), context);
|
||||
notifyApplication(Util.getSystemUid("com.twitter.android", context), context);
|
||||
notifyApplication(Util.getSystemUid("com.whatsapp", context), context);
|
||||
}
|
||||
} else {
|
||||
editor.putBoolean("whitelist_wifi", false);
|
||||
|
|
|
@ -84,6 +84,15 @@ public class Util {
|
|||
}
|
||||
}
|
||||
|
||||
public static int getSystemUid(String packageName, Context context) {
|
||||
try {
|
||||
PackageInfo pInfo = context.getPackageManager().getPackageInfo(packageName, 0);
|
||||
return ((pInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0 ? -1 : pInfo.applicationInfo.uid);
|
||||
} catch (PackageManager.NameNotFoundException ex) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasTelephony(Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
if (pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY))
|
||||
|
|
Loading…
Reference in a new issue