diff options
author | cyberta <cyberta@riseup.net> | 2020-01-31 22:46:24 -0800 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2020-01-31 22:46:24 -0800 |
commit | 0e8f40e75eb1a5fe2d3c212b5939fdbf427ec0f5 (patch) | |
tree | f6b0adef18755cc8c107897e625595614e5dce36 /app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java | |
parent | 721d222a457ec0dfec28bc4ee4908b50f04904fc (diff) | |
parent | b8ba423d997f5dbb2541b4f4542a2b6b30400485 (diff) |
Merge branch 'implement_tethering_for_rooted_devices' into 'master'
Implement tethering for rooted devices
See merge request leap/bitmask_android!98
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java b/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java new file mode 100644 index 00000000..8ef237c6 --- /dev/null +++ b/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java @@ -0,0 +1,45 @@ +package se.leap.bitmaskclient.tethering; + +public class TetheringState implements Cloneable { + public boolean isWifiTetheringEnabled; + public boolean isUsbTetheringEnabled; + public boolean isBluetoothTetheringEnabled; + public boolean isVpnWifiTetheringAllowed; + public boolean isVpnUsbTetheringAllowed; + public boolean isVpnBluetoothTetheringAllowed; + public String wifiInterface = ""; + public String lastSeenWifiInterface = ""; + public String wifiAddress = ""; + public String lastSeenWifiAddress = ""; + public String usbInterface = ""; + public String lastSeenUsbInterface = ""; + public String usbAddress = ""; + public String lastSeenUsbAddress = ""; + public String bluetoothInterface = ""; + public String lastSeenBluetoothInterface = ""; + public String bluetoothAddress = ""; + public String lastSeenBluetoothAddress = ""; + + + public boolean tetherWifiVpn() { + return isWifiTetheringEnabled && isVpnWifiTetheringAllowed; + } + + public boolean tetherUsbVpn() { + return isUsbTetheringEnabled && isVpnUsbTetheringAllowed; + } + + public boolean tetherBluetoothVpn() { + return isBluetoothTetheringEnabled && isVpnBluetoothTetheringAllowed; + } + + public boolean hasAnyDeviceTetheringEnabled() { + return isBluetoothTetheringEnabled || isUsbTetheringEnabled || isWifiTetheringEnabled; + } + + public boolean hasAnyVpnTetheringAllowed() { + return isVpnWifiTetheringAllowed || isVpnUsbTetheringAllowed || isVpnBluetoothTetheringAllowed; + } + + +} |