diff --git a/app/app.iml b/app/app.iml
index 195a5432..70e090c0 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -75,6 +75,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 69b5e55d..0277e09e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -9,7 +9,7 @@ model {
applicationId = "eu.faircode.netguard"
minSdkVersion.apiLevel = 21
targetSdkVersion.apiLevel = 23
- versionCode = 2015120201
+ versionCode = 2015120202
versionName = "0.48"
archivesBaseName = "NetGuard-v$versionName-$versionCode"
}
diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java
index f7229cb0..a2a3a8da 100644
--- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java
+++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java
@@ -102,9 +102,9 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
Receiver.upgrade(initialized, this);
if (enabled)
- SinkholeService.start(this);
+ SinkholeService.start("UI", this);
else
- SinkholeService.stop(this);
+ SinkholeService.stop("UI", this);
// Action bar
View actionView = getLayoutInflater().inflate(R.layout.action, null);
@@ -168,7 +168,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
} else {
Log.i(TAG, "Switch off");
prefs.edit().putBoolean("enabled", false).apply();
- SinkholeService.stop(ActivityMain.this);
+ SinkholeService.stop("switch off", ActivityMain.this);
}
}
});
@@ -290,7 +290,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean("enabled", resultCode == RESULT_OK).apply();
if (resultCode == RESULT_OK)
- SinkholeService.start(this);
+ SinkholeService.start("prepared", this);
} else if (requestCode == REQUEST_IAB) {
// Handle IAB result
@@ -318,7 +318,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_ROAMING)
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "permission granted", this);
}
@Override
diff --git a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java
index 7bf819a5..b78d4d75 100644
--- a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java
+++ b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java
@@ -70,8 +70,9 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
private static final int REQUEST_EXPORT = 1;
private static final int REQUEST_IMPORT = 2;
- private static final int REQUEST_ROAMING_NATIONAL = 3;
- private static final int REQUEST_ROAMING_INTERNATIONAL = 4;
+ private static final int REQUEST_METERED = 3;
+ private static final int REQUEST_ROAMING_NATIONAL = 4;
+ private static final int REQUEST_ROAMING_INTERNATIONAL = 5;
private static final Intent INTENT_VPN_SETTINGS = new Intent("android.net.vpn.SETTINGS");
protected void onCreate(Bundle savedInstanceState) {
@@ -95,10 +96,22 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
// Check if permission was revoked
- if (prefs.getBoolean("national_roaming", false) && !Util.hasPhoneStatePermission(this)) {
- prefs.edit().putBoolean("national_roaming", false).apply();
- refreshScreen();
- }
+ if (!prefs.getBoolean("metered_2g", true) ||
+ !prefs.getBoolean("metered_3g", true) ||
+ !prefs.getBoolean("metered_4g", true))
+ if (!Util.hasPhoneStatePermission(this)) {
+ prefs.edit().putBoolean("metered_2g", true).apply();
+ prefs.edit().putBoolean("metered_3g", true).apply();
+ prefs.edit().putBoolean("metered_4g", true).apply();
+ refreshScreen();
+ }
+
+ // Check if permission was revoked
+ if (prefs.getBoolean("national_roaming", false))
+ if (!Util.hasPhoneStatePermission(this)) {
+ prefs.edit().putBoolean("national_roaming", false).apply();
+ refreshScreen();
+ }
// Listen for preference changes
prefs.registerOnSharedPreferenceChangeListener(this);
@@ -116,7 +129,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
if (Util.hasPhoneStatePermission(this)) {
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
- tm.listen(phoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
+ tm.listen(phoneStateListener, PhoneStateListener.LISTEN_DATA_CONNECTION_STATE | PhoneStateListener.LISTEN_SERVICE_STATE);
phone_state = true;
}
}
@@ -190,33 +203,45 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
public void onSharedPreferenceChanged(SharedPreferences prefs, String name) {
if ("whitelist_wifi".equals(name) ||
"screen_wifi".equals(name))
- SinkholeService.reload("wifi", this);
+ SinkholeService.reload("wifi", "setting changed", this);
else if ("whitelist_other".equals(name) ||
"screen_other".equals(name))
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "setting changed", this);
else if ("whitelist_roaming".equals(name)) {
if (prefs.getBoolean(name, false)) {
if (Util.hasPhoneStatePermission(this))
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "setting changed", this);
else
requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_ROAMING_INTERNATIONAL);
} else
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "setting changed", this);
+
+ } else if ("metered_2g".equals(name) ||
+ "metered_3g".equals(name) ||
+ "metered_4g".equals(name)) {
+ if (prefs.getBoolean(name, true))
+ SinkholeService.reload("other", "setting changed", this);
+ else {
+ if (Util.hasPhoneStatePermission(this))
+ SinkholeService.reload("other", "setting changed", this);
+ else
+ requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_METERED);
+ }
} else if ("national_roaming".equals(name)) {
if (prefs.getBoolean(name, false)) {
if (Util.hasPhoneStatePermission(this))
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "setting changed", this);
else
requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_ROAMING_NATIONAL);
} else
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "setting changed", this);
} else if ("use_metered".equals(name) ||
"manage_system".equals(name))
- SinkholeService.reload(null, this);
+ SinkholeService.reload(null, "setting changed", this);
else if ("dark_theme".equals(name))
recreate();
@@ -224,9 +249,20 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
- if (requestCode == REQUEST_ROAMING_NATIONAL)
+ if (requestCode == REQUEST_METERED)
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "permission granted", this);
+ else {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ prefs.edit().putBoolean("metered_2g", true).apply();
+ prefs.edit().putBoolean("metered_3g", true).apply();
+ prefs.edit().putBoolean("metered_4g", true).apply();
+ refreshScreen();
+ }
+
+ else if (requestCode == REQUEST_ROAMING_NATIONAL)
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
+ SinkholeService.reload("other", "permission granted", this);
else {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean("national_roaming", false).apply();
@@ -235,7 +271,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
else if (requestCode == REQUEST_ROAMING_INTERNATIONAL)
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
- SinkholeService.reload("other", this);
+ SinkholeService.reload("other", "permission granted", this);
else {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean("whitelist_roaming", false).apply();
@@ -260,9 +296,13 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
};
private PhoneStateListener phoneStateListener = new PhoneStateListener() {
+ @Override
+ public void onDataConnectionStateChanged(int state) {
+ updateTechnicalInfo();
+ }
+
@Override
public void onServiceStateChanged(ServiceState serviceState) {
- super.onServiceStateChanged(serviceState);
updateTechnicalInfo();
}
};
@@ -291,7 +331,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
.append(ni.getSubtypeName())
.append(" ").append(ni.getDetailedState())
.append(TextUtils.isEmpty(ni.getExtraInfo()) ? "" : " " + ni.getExtraInfo())
- .append(ni.getType() == ConnectivityManager.TYPE_MOBILE ? " " + getNetworkGeneration(ni.getSubtype()) : "")
+ .append(ni.getType() == ConnectivityManager.TYPE_MOBILE ? " " + Util.getNetworkGeneration(ni.getSubtype()) : "")
.append(ni.isRoaming() ? " R" : "")
.append("\r\n");
}
@@ -299,34 +339,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
pref_technical.setSummary(sb.toString());
}
- private static String getNetworkGeneration(int networkType) {
- switch (networkType) {
- case TelephonyManager.NETWORK_TYPE_1xRTT:
- case TelephonyManager.NETWORK_TYPE_CDMA:
- case TelephonyManager.NETWORK_TYPE_EDGE:
- case TelephonyManager.NETWORK_TYPE_GPRS:
- case TelephonyManager.NETWORK_TYPE_IDEN:
- return "2G";
-
- case TelephonyManager.NETWORK_TYPE_EHRPD:
- case TelephonyManager.NETWORK_TYPE_EVDO_0:
- case TelephonyManager.NETWORK_TYPE_EVDO_A:
- case TelephonyManager.NETWORK_TYPE_EVDO_B:
- case TelephonyManager.NETWORK_TYPE_HSDPA:
- case TelephonyManager.NETWORK_TYPE_HSPA:
- case TelephonyManager.NETWORK_TYPE_HSPAP:
- case TelephonyManager.NETWORK_TYPE_HSUPA:
- case TelephonyManager.NETWORK_TYPE_UMTS:
- return "3G";
-
- case TelephonyManager.NETWORK_TYPE_LTE:
- return "4G";
-
- default:
- return "?G";
- }
- }
-
@Override
protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
Log.i(TAG, "onActivityResult request=" + requestCode + " result=" + requestCode + " ok=" + (resultCode == RESULT_OK));
@@ -490,7 +502,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
private void xmlImport(InputStream in) throws IOException, SAXException, ParserConfigurationException {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean("enabled", false).apply();
- SinkholeService.stop(this);
+ SinkholeService.stop("import", this);
XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
XmlImportHandler handler = new XmlImportHandler();
diff --git a/app/src/main/java/eu/faircode/netguard/Receiver.java b/app/src/main/java/eu/faircode/netguard/Receiver.java
index e1cb3950..b27ed590 100644
--- a/app/src/main/java/eu/faircode/netguard/Receiver.java
+++ b/app/src/main/java/eu/faircode/netguard/Receiver.java
@@ -58,7 +58,7 @@ public class Receiver extends BroadcastReceiver {
if (prefs.getBoolean("enabled", false))
try {
if (VpnService.prepare(context) == null)
- SinkholeService.start(context);
+ SinkholeService.start("receiver", context);
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
Util.sendCrashReport(ex, context);
diff --git a/app/src/main/java/eu/faircode/netguard/RuleAdapter.java b/app/src/main/java/eu/faircode/netguard/RuleAdapter.java
index ff56405c..68e7e6f6 100644
--- a/app/src/main/java/eu/faircode/netguard/RuleAdapter.java
+++ b/app/src/main/java/eu/faircode/netguard/RuleAdapter.java
@@ -230,7 +230,7 @@ public class RuleAdapter extends RecyclerView.Adapter im
}
// Apply updated rule
- SinkholeService.reload(network, context);
+ SinkholeService.reload(network, "rule changed", context);
}
};
@@ -317,7 +317,7 @@ public class RuleAdapter extends RecyclerView.Adapter im
}
// Apply updated rule
- SinkholeService.reload(null, context);
+ SinkholeService.reload(null, "rule changed", context);
}
});
@@ -348,7 +348,7 @@ public class RuleAdapter extends RecyclerView.Adapter im
}
// Apply updated rule
- SinkholeService.reload(null, context);
+ SinkholeService.reload(null, "rule changed", context);
}
});
@@ -378,7 +378,7 @@ public class RuleAdapter extends RecyclerView.Adapter im
}
// Apply updated rule
- SinkholeService.reload(null, context);
+ SinkholeService.reload(null, "rule changed", context);
// Request permissions
if (isChecked && !Util.hasPhoneStatePermission(context))
diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java
index 294dcc08..973fb0c3 100644
--- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java
+++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java
@@ -57,10 +57,9 @@ import java.nio.ByteOrder;
public class SinkholeService extends VpnService {
private static final String TAG = "NetGuard.Service";
- private boolean last_connected;
- private boolean last_metered;
+ private boolean last_connected = false;
+ private boolean last_metered = true;
private boolean phone_state = false;
- private String last_operator = null;
private ParcelFileDescriptor vpn = null;
private boolean debug = false;
private Thread debugThread = null;
@@ -72,6 +71,7 @@ public class SinkholeService extends VpnService {
private static final int NOTIFY_DISABLED = 2;
private static final String EXTRA_COMMAND = "Command";
+ private static final String EXTRA_REASON = "Reason";
private enum Command {start, reload, stop}
@@ -117,12 +117,13 @@ public class SinkholeService extends VpnService {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
Command cmd = (Command) intent.getSerializableExtra(EXTRA_COMMAND);
- Log.i(TAG, "Executing intent=" + intent + " command=" + cmd + " vpn=" + (vpn != null));
+ String reason = intent.getStringExtra(EXTRA_REASON);
+ Log.i(TAG, "Executing intent=" + intent + " command=" + cmd + " reason=" + reason + " vpn=" + (vpn != null));
// Check phone state listener
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (!phone_state && Util.hasPhoneStatePermission(SinkholeService.this)) {
- tm.listen(phoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
+ tm.listen(phoneStateListener, PhoneStateListener.LISTEN_DATA_CONNECTION_STATE | PhoneStateListener.LISTEN_SERVICE_STATE);
phone_state = true;
Log.i(TAG, "Listening to service state changes");
}
@@ -198,6 +199,10 @@ public class SinkholeService extends VpnService {
boolean wifi = Util.isWifiActive(this);
boolean metered = Util.isMeteredNetwork(this);
boolean useMetered = prefs.getBoolean("use_metered", false);
+ String generation = Util.getNetworkGeneration(this);
+ boolean metered_2g = prefs.getBoolean("metered_2g", true);
+ boolean metered_3g = prefs.getBoolean("metered_3g", true);
+ boolean metered_4g = prefs.getBoolean("metered_4g", true);
boolean roaming = Util.isRoaming(SinkholeService.this);
boolean national = prefs.getBoolean("national_roaming", false);
boolean interactive = Util.isInteractive(this);
@@ -209,6 +214,12 @@ public class SinkholeService extends VpnService {
// Update metered state
if (wifi && (!useMetered || !telephony))
metered = false;
+ if (!metered_2g && "2G".equals(generation))
+ metered = false;
+ if (!metered_3g && "3G".equals(generation))
+ metered = false;
+ if (!metered_4g && "4G".equals(generation))
+ metered = false;
if (!last_connected)
metered = true;
last_metered = metered;
@@ -221,6 +232,7 @@ public class SinkholeService extends VpnService {
" wifi=" + wifi +
" metered=" + metered +
" telephony=" + telephony +
+ " generation=" + generation +
" roaming=" + roaming +
" interactive=" + interactive);
@@ -364,7 +376,7 @@ public class SinkholeService extends VpnService {
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "Received " + intent);
Util.logExtras(intent);
- reload(null, SinkholeService.this);
+ reload(null, "interactive state changed", SinkholeService.this);
}
};
@@ -380,7 +392,7 @@ public class SinkholeService extends VpnService {
// Reload rules when coming from idle mode
if (!pm.isDeviceIdleMode())
- reload(null, SinkholeService.this);
+ reload(null, "idle state changed", SinkholeService.this);
}
};
@@ -395,20 +407,47 @@ public class SinkholeService extends VpnService {
// Reload rules
Log.i(TAG, "Received " + intent);
Util.logExtras(intent);
- reload(null, SinkholeService.this);
+ reload(null, "connectivity changed", SinkholeService.this);
}
};
private PhoneStateListener phoneStateListener = new PhoneStateListener() {
+ private String last_generation = null;
+ private String last_operator = null;
+
+ @Override
+ public void onDataConnectionStateChanged(int state, int networkType) {
+ if (state == TelephonyManager.DATA_CONNECTED) {
+ String current_generation = Util.getNetworkGeneration(networkType);
+ Log.i(TAG, "Data connected type=" + Util.getNetworkType(networkType) + " generation=" + current_generation);
+
+ if (last_generation == null || !last_generation.equals(current_generation)) {
+ Log.i(TAG, "New network generation=" + current_generation);
+ last_generation = current_generation;
+
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
+ if (!prefs.getBoolean("metered_2g", true) ||
+ !prefs.getBoolean("metered_3g", true) ||
+ !prefs.getBoolean("metered_4g", true))
+ reload("other", "data connection state changed", SinkholeService.this);
+ }
+ }
+ }
+
@Override
public void onServiceStateChanged(ServiceState serviceState) {
if (serviceState.getState() == ServiceState.STATE_IN_SERVICE) {
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String current_operator = tm.getNetworkOperator();
+ Log.i(TAG, "In service country=" + tm.getNetworkCountryIso() + " operator=" + current_operator);
+
if (last_operator == null || !last_operator.equals(current_operator)) {
Log.i(TAG, "New network operator=" + current_operator);
last_operator = current_operator;
- reload(null, SinkholeService.this);
+
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
+ if (prefs.getBoolean("national_roaming", false))
+ reload(null, "service state changed", SinkholeService.this);
}
}
}
@@ -419,7 +458,7 @@ public class SinkholeService extends VpnService {
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "Received " + intent);
Util.logExtras(intent);
- reload(null, SinkholeService.this);
+ reload(null, "package added", SinkholeService.this);
}
};
@@ -478,7 +517,8 @@ public class SinkholeService extends VpnService {
}
Command cmd = (Command) intent.getSerializableExtra(EXTRA_COMMAND);
- Log.i(TAG, "Start intent=" + intent + " command=" + cmd + " vpn=" + (vpn != null));
+ String reason = intent.getStringExtra(EXTRA_REASON);
+ Log.i(TAG, "Start intent=" + intent + " command=" + cmd + " reason=" + reason + " vpn=" + (vpn != null));
// Queue command
Message msg = mServiceHandler.obtainMessage();
@@ -576,13 +616,14 @@ public class SinkholeService extends VpnService {
NotificationManagerCompat.from(this).cancel(NOTIFY_DISABLED);
}
- public static void start(Context context) {
+ public static void start(String reason, Context context) {
Intent intent = new Intent(context, SinkholeService.class);
intent.putExtra(EXTRA_COMMAND, Command.start);
+ intent.putExtra(EXTRA_REASON, reason);
context.startService(intent);
}
- public static void reload(String network, Context context) {
+ public static void reload(String network, String reason, Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("enabled", false)) {
boolean wifi = Util.isWifiActive(context);
@@ -592,14 +633,16 @@ public class SinkholeService extends VpnService {
if (network == null || ("wifi".equals(network) ? !metered : metered)) {
Intent intent = new Intent(context, SinkholeService.class);
intent.putExtra(EXTRA_COMMAND, Command.reload);
+ intent.putExtra(EXTRA_REASON, reason);
context.startService(intent);
}
}
}
- public static void stop(Context context) {
+ public static void stop(String reason, Context context) {
Intent intent = new Intent(context, SinkholeService.class);
intent.putExtra(EXTRA_COMMAND, Command.stop);
+ intent.putExtra(EXTRA_REASON, reason);
context.startService(intent);
}
}
diff --git a/app/src/main/java/eu/faircode/netguard/Util.java b/app/src/main/java/eu/faircode/netguard/Util.java
index 63847fc3..fb17eb07 100644
--- a/app/src/main/java/eu/faircode/netguard/Util.java
+++ b/app/src/main/java/eu/faircode/netguard/Util.java
@@ -93,6 +93,84 @@ public class Util {
return cm.isActiveNetworkMetered();
}
+ public static String getNetworkGeneration(int networkType) {
+ switch (networkType) {
+ case TelephonyManager.NETWORK_TYPE_1xRTT:
+ case TelephonyManager.NETWORK_TYPE_CDMA:
+ case TelephonyManager.NETWORK_TYPE_EDGE:
+ case TelephonyManager.NETWORK_TYPE_GPRS:
+ case TelephonyManager.NETWORK_TYPE_IDEN:
+ return "2G";
+
+ case TelephonyManager.NETWORK_TYPE_EHRPD:
+ case TelephonyManager.NETWORK_TYPE_EVDO_0:
+ case TelephonyManager.NETWORK_TYPE_EVDO_A:
+ case TelephonyManager.NETWORK_TYPE_EVDO_B:
+ case TelephonyManager.NETWORK_TYPE_HSDPA:
+ case TelephonyManager.NETWORK_TYPE_HSPA:
+ case TelephonyManager.NETWORK_TYPE_HSPAP:
+ case TelephonyManager.NETWORK_TYPE_HSUPA:
+ case TelephonyManager.NETWORK_TYPE_UMTS:
+ return "3G";
+
+ case TelephonyManager.NETWORK_TYPE_LTE:
+ return "4G";
+
+ default:
+ return "?G";
+ }
+ }
+
+
+ public static String getNetworkType(int networkType) {
+ switch (networkType) {
+ // 2G
+ case TelephonyManager.NETWORK_TYPE_1xRTT:
+ return "1xRTT";
+ case TelephonyManager.NETWORK_TYPE_CDMA:
+ return "CDMA";
+ case TelephonyManager.NETWORK_TYPE_EDGE:
+ return "EDGE";
+ case TelephonyManager.NETWORK_TYPE_GPRS:
+ return "GPRS";
+ case TelephonyManager.NETWORK_TYPE_IDEN:
+ return "IDEN";
+
+ // 3G
+ case TelephonyManager.NETWORK_TYPE_EHRPD:
+ return "EHRPD";
+ case TelephonyManager.NETWORK_TYPE_EVDO_0:
+ return "EVDO_0";
+ case TelephonyManager.NETWORK_TYPE_EVDO_A:
+ return "EVDO_A";
+ case TelephonyManager.NETWORK_TYPE_EVDO_B:
+ return "EVDO_B";
+ case TelephonyManager.NETWORK_TYPE_HSDPA:
+ return "HSDPA";
+ case TelephonyManager.NETWORK_TYPE_HSPA:
+ return "HSPA";
+ case TelephonyManager.NETWORK_TYPE_HSPAP:
+ return "HSPAP";
+ case TelephonyManager.NETWORK_TYPE_HSUPA:
+ return "HSUPA";
+ case TelephonyManager.NETWORK_TYPE_UMTS:
+ return "UMTS";
+
+ // 4G
+ case TelephonyManager.NETWORK_TYPE_LTE:
+ return "LTE";
+
+ default:
+ return Integer.toString(networkType);
+ }
+ }
+
+ public static String getNetworkGeneration(Context context) {
+ ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo ni = cm.getActiveNetworkInfo();
+ return (ni != null && ni.getType() == ConnectivityManager.TYPE_MOBILE ? getNetworkGeneration(ni.getSubtype()) : null);
+ }
+
public static boolean isRoaming(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
return tm.isNetworkRoaming();
diff --git a/app/src/main/java/eu/faircode/netguard/Widget.java b/app/src/main/java/eu/faircode/netguard/Widget.java
index f6bfae6d..a22afc41 100644
--- a/app/src/main/java/eu/faircode/netguard/Widget.java
+++ b/app/src/main/java/eu/faircode/netguard/Widget.java
@@ -53,13 +53,13 @@ public class Widget extends AppWidgetProvider {
if (INTENT_OFF.equals(intent.getAction())) {
prefs.edit().putBoolean("enabled", false).apply();
- SinkholeService.stop(context);
+ SinkholeService.stop("widget", context);
} else if (INTENT_ON.equals(intent.getAction()))
try {
if (VpnService.prepare(context) == null) {
prefs.edit().putBoolean("enabled", true).apply();
- SinkholeService.start(context);
+ SinkholeService.start("widget", context);
}
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
diff --git a/app/src/main/res/values-af/strings.xml b/app/src/main/res/values-af/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-af/strings.xml
+++ b/app/src/main/res/values-af/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
index c0ee84d4..a883c59a 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
استخدام الثيم الداكن
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
هل أنت متأكد؟
Enforcing rules
diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-bg/strings.xml
+++ b/app/src/main/res/values-bg/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index b490d909..71ad04a4 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -19,6 +19,9 @@ Das wird von Fehlern in Android oder in Software vom Hersteller verursacht. Bitt
Mobilfunk immer erlauben, wenn Bildschirm eingeschaltet ist
Roaming standardmäßig blockieren
Gemessenes WLAN-Netzwerk handhaben
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Nationales Roaming ignorieren
System-Apps anzeigen
Dunkles Thema verwenden
@@ -30,6 +33,9 @@ Das wird von Fehlern in Android oder in Software vom Hersteller verursacht. Bitt
Technische information
Regeln für System-Apps definieren (für Experten)
Mobilfunk-Regeln gemessenen (bezahlten, tethered) WLAN-Netzwerken anwenden
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Roaming-Regeln nicht anwenden, wenn die Nationalität für SIM und mobiles Netzwerk identisch sind
Sind Sie sicher?
Regeln werden angewendet
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index dd6c9232..a9111ae8 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Default allow mobile when screen is on
Block roaming by default
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 60b033df..1ef0bde5 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -20,6 +20,9 @@ Estos problemas son causados por errores en Android, o en el software provisto p
Por defecto permitir red móvil cuando la pantalla está encendida
Bloquear roaming por defecto
Manejo de redes Wi-Fi de uso medido
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Administrar aplicaciones de sistema
Usar tema oscuro
@@ -31,6 +34,9 @@ Estos problemas son causados por errores en Android, o en el software provisto p
Información técnica
Definir reglas para aplicaciones de sistema (para expertos)
Aplicar reglas de red móvil a redes Wi-Fi de uso medido (pagas, por anclaje)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
¿Estás seguro?
Aplicando reglas
diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-et/strings.xml
+++ b/app/src/main/res/values-et/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-eu/strings.xml
+++ b/app/src/main/res/values-eu/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 8a8e0228..37453fc6 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -20,6 +20,9 @@ Ceci est causé par des bugs dans Android, ou dans le logiciel fourni par le con
Autoriser données mobiles si écran allumé
Bloquer itinérance par défaut
Gérer les réseaux Wi-Fi mesurés
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignorer l\'itinérance nationale
Gérer les applications système
Utiliser le thème sombre
@@ -31,6 +34,9 @@ Ceci est causé par des bugs dans Android, ou dans le logiciel fourni par le con
Informations techniques
Définir les règles pour les applications système (Pour experts)
Appliquer les règles de réseaux mobiles aux réseaux Wi-Fi mesurés (payants, partagés)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Ne pas appliquer les règles d\'itinérance lorsque la SIM et le réseau mobile du pays sont les mêmes
Êtes-vous sûr ?
Application des règles
diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-he/strings.xml
+++ b/app/src/main/res/values-he/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-hr/strings.xml
+++ b/app/src/main/res/values-hr/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 6527d23e..d5342e7e 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -21,6 +21,9 @@ Ció è causato da alcuni bug contenuti in Android, o in programmi forniti dal p
Permetti reti mobili di default quando lo schermo è accesso
Blocca roaming di default
Gestisci reti Wi-Fi a consumo
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignora roaming nazionale
Gestisci applicazioni di sistema
Usa il tema scuro
@@ -32,6 +35,9 @@ Ció è causato da alcuni bug contenuti in Android, o in programmi forniti dal p
Informazioni tecniche
Definisci regole per le applicazioni di sistema (solo per esperti)
Applica le regole per le reti cellulari anche alle reti Wi-Fi a consumo (a pagamento, condivise)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Non applicare le regole di roaming quando il paese della carta SIM e della rete mobile è lo stesso
Sei sicuro?
Regole applicate
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 5941f061..a970d033 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -20,6 +20,9 @@
Allow mobile when screen on
デフォルトでローミングをブロック
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
システムアプリケーションの管理
ダークテーマを使用する
@@ -31,6 +34,9 @@
Technical information
システムアプリケーションのルールを定義します (エキスパート向け)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
よろしいですか?
Enforcing rules
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 18329073..384bd349 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
어두운 테마 사용
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
계속 하시겠습니까?
Enforcing rules
diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-lt/strings.xml
+++ b/app/src/main/res/values-lt/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-lv/strings.xml
+++ b/app/src/main/res/values-lv/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index ccabe252..4a84ded0 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Sta mobiel toe als scherm aan
Blokkeer roaming
Behandel gemeten Wi-Fi netwerken
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Negeer nationaal roaming
Beheer systeemapplicaties
Gebruik donker thema
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technische informatie
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Weet u het zeker?
Regels worden afgedwongen
diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-no/strings.xml
+++ b/app/src/main/res/values-no/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 1f6ede86..a0cbe1b9 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -20,6 +20,9 @@ Problemy te są spowodowane błędami w samym Androidzie, lub oprogramowaniu dos
Domyślnie zezwól na mobilne przy włączonym ekranie
Domyślnie blokuj roaming
Obsługuj taryfowe sieci Wi-Fi
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignoruj roaming krajowy
Zarządzaj aplikacjami systemowymi
Użyj ciemnej skórki
@@ -31,6 +34,9 @@ Problemy te są spowodowane błędami w samym Androidzie, lub oprogramowaniu dos
Informacje techniczne
Stwórz reguły dla aplikacji systemowych (zaawansowane)
Zastosuj reguły z danych mobilnych, do taryfowych sieci Wi-FI (tethering, prepaid)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Nie stosuj ustawień dotyczących roamingu, gdy karta SIM oraz sieć komórkowa są z tego samego kraju
Na pewno?
Wymuś Reguły
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index bfbd5f58..67113006 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -20,6 +20,9 @@ Esses problemas são causados por bugs/falhas no Android ou no sotfware fornecid
Por padrão, ao ligar a tela, permitir Dados Móveis
Por padrão, bloquear Roaming
Manipular redes Wi-Fi Limitadas
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignorar Roaming nacional
Administrar aplicativos do sistema
Ativa tema escuro
@@ -31,6 +34,9 @@ Esses problemas são causados por bugs/falhas no Android ou no sotfware fornecid
Informações técnicas
Definir regras para aplicativos do sistema (usuários experientes)
Aplicar regras de Dados Móveis a redes Wi-Fi limitadas (pagas, compartilhadas)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Não aplicar regras de Roaming quando o chip SIM e a rede móvel forem do mesmo país
Tem certeza?
Impondo regras
diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml
index 6e808c0f..7d537c41 100644
--- a/app/src/main/res/values-pt-rPT/strings.xml
+++ b/app/src/main/res/values-pt-rPT/strings.xml
@@ -20,6 +20,9 @@ Esses problemas são causados por bugs/falhas no Android ou no sotfware fornecid
Por padrão, ao ligar a tela, permitir Dados Móveis
Por padrão, bloquear Roaming
Manipular redes Wi-Fi Limitadas
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignorar Roaming nacional
Administrar aplicativos do sistema
Ativa tema escuro
@@ -31,6 +34,9 @@ Esses problemas são causados por bugs/falhas no Android ou no sotfware fornecid
Informações técnicas
Definir regras para aplicativos do sistema (usuários experientes)
Aplicar regras de Dados Móveis a redes Wi-Fi compartilhadas (pagas, limitadas)
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Não aplicar regras de Roaming quando o chip SIM e a rede móvel forem do mesmo país
Tem certeza?
Impondo regras
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 01b5c43e..a5bbb10a 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -20,6 +20,9 @@ Acest lucru este cauzat de bug-uri in Android sau in software-ul pus la dispozit
Permite date mobile cu ecranul pornit
Blocheaza in roaming
Gestionati conexiunile Wi-Fi contorizate
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignora roamingul national
Gestionati aplicatiile de sistem
Foloseste tema intunecata
@@ -31,6 +34,9 @@ Acest lucru este cauzat de bug-uri in Android sau in software-ul pus la dispozit
Informatii tehnice
Defineste reguli pentru aplicatiile de sistem (setare expert)
Trateaza conexiunile Wi-Fi contorizate (cu plata, hot-spot) precum date mobile
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Nu folosi regulile de roaming atunci cand tara de origine a SIM-ului si tara retelei mobile sunt identice
Esti sigur(a)?
Limitari activate
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index a4e8ece2..996dcd8a 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -17,6 +17,9 @@
Разрешить моб. сеть при вкл. экране по умолч.
Блокировать роуминг по умолч.
Регулировать огранич. Wi-Fi сети
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Игнорировать роуминг внутри страны
Управлять сист. приложениями
Использовать темную тему
@@ -28,6 +31,9 @@
Техническая информация
Определить правила для системных приложений (для профи)
Применить правила для лимитированных (платных, ограниченных) Wi-Fi сетей
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Не применять правила роуминга, если SIM-карта и мобильная сеть из одной страны
Вы уверены?
Определить правила
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index 7e87072c..c746449f 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -20,6 +20,9 @@ Je to spôsobené chybami v Androide alebo v softvéri poskytovanom výrobcom, p
Allow mobile when screen on
Predvolene blokovať roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Spravovať systémové aplikácie
Použiť tmavú tému
@@ -31,6 +34,9 @@ Je to spôsobené chybami v Androide alebo v softvéri poskytovanom výrobcom, p
Technical information
Určiť pravidlá pre systémové pravidlá (pre expertov)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Ste si istý?
Pravidlá vynútenia
diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-sl/strings.xml
+++ b/app/src/main/res/values-sl/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-sr/strings.xml
+++ b/app/src/main/res/values-sr/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-sv-rSE/strings.xml
+++ b/app/src/main/res/values-sv-rSE/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 0b8f78bb..7cc7cbfd 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Varsayılan olarak dolaşımı blokla
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ulusal dolaşımı yoksay
Sistem uygulamaları yönet
Karanlık Temayı Kullan
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Teknik bilgiler
Sistem uygulamaları kuralları tanımlayın (uzman için)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Emin misiniz?
Kuralları zorla
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 02b916a2..83b71424 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -16,6 +16,9 @@
Дозволити типово мобільні мережі, коли екран активний
Блокувати типово у роумінгу
Регулювати лімітовані Wi-Fi мережі
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ігнорувати національний роумінг
Керувати системними додатками
Використовувати темну тему
@@ -27,6 +30,9 @@
Технічна інформація
Визначити правила для системних додатків (для експертів)
Застосувати правила до лімітованих (платних, обмежених) Wi-Fi мереж
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Не застосовувати правила роумінгу, якщо SIM-карта з однієї країни
Ви впевнені?
Визначити правила
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 7e13c121..a68b44be 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -20,6 +20,9 @@
亮屏时默认允许移动网络
默认阻止漫游
控制按流量计费Wi-Fi网络
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
管理系统应用
使用暗色主题
@@ -31,6 +34,9 @@
技术信息
定义系统应用规则, 仅供专业用户
将移动网络规则应用于按流量计费的 (付费, 共享) Wi-Fi网络
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
是否确认?
规则加载中
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index c0b9c4d7..8e6b4fcf 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -20,6 +20,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -31,6 +34,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Technical information
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
Enforcing rules
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 33767b0e..6fb08972 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -21,6 +21,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Allow mobile when screen on
Block roaming
Handle metered Wi-Fi networks
+ Consider 2G metered
+ Consider 3G metered
+ Consider LTE metered
Ignore national roaming
Manage system applications
Use dark theme
@@ -33,6 +36,9 @@ These issues are caused by bugs in Android, or in the software provided by the m
Define rules for system applications (for experts)
Apply mobile network rules to metered (paid, tethered) Wi-Fi networks
+ Apply Wi-Fi network rules for 2G data connections when turned off
+ Apply Wi-Fi network rules for 3G data connections when turned off
+ Apply Wi-Fi network rules for LTE data connections when turned off
Do not apply roaming rules when the SIM and mobile network country are the same
Are you sure?
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 389f8522..460c651d 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -41,6 +41,21 @@
android:key="use_metered"
android:summary="@string/summary_metered"
android:title="@string/setting_metered" />
+
+
+