From 30b049807c18bb406e59a8aefe6269e1a246979b Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 16 Jul 2024 16:02:29 +0200 Subject: [PATCH 1/5] refactor: remove tests placeholders --- .../java/net/ivpn/core/SecureStorageTest.java | 63 ----- .../ivpn/core/common/ProfileStorageTest.java | 27 -- .../prefs/PreferenceContentGenerator.java | 8 - .../core/common/prefs/PreferenceTest.java | 247 ------------------ .../ivpn/core/common/prefs/SettingsTest.java | 155 ----------- .../untrustedwifi/ItemWifiViewModelTest.java | 42 --- .../UntrustedWifiViewModelTest.java | 91 ------- .../net/ivpn/core/vpn/VPNControllerTest.java | 246 ----------------- .../common/distance/DistanceProviderTest.kt | 53 ---- .../ivpn/client/ExampleInstrumentedTest.kt | 24 -- .../java/net/ivpn/client/ExampleUnitTest.kt | 17 -- .../ivpn/client/ExampleInstrumentedTest.kt | 24 -- .../java/net/ivpn/client/ExampleUnitTest.kt | 17 -- .../net/ivpn/core/ExampleInstrumentedTest.kt | 24 -- .../java/net/ivpn/core/ExampleUnitTest.kt | 17 -- 15 files changed, 1055 deletions(-) delete mode 100644 core/src/androidTest/java/net/ivpn/core/SecureStorageTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/common/ProfileStorageTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceContentGenerator.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/common/prefs/SettingsTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/ItemWifiViewModelTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/UntrustedWifiViewModelTest.java delete mode 100644 core/src/androidTest/java/net/ivpn/core/vpn/VPNControllerTest.java delete mode 100644 core/src/test/java/net/ivpn/core/common/distance/DistanceProviderTest.kt delete mode 100644 fdroid/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt delete mode 100644 fdroid/src/test/java/net/ivpn/client/ExampleUnitTest.kt delete mode 100644 site/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt delete mode 100644 site/src/test/java/net/ivpn/client/ExampleUnitTest.kt delete mode 100644 store/src/androidTest/java/net/ivpn/core/ExampleInstrumentedTest.kt delete mode 100644 store/src/test/java/net/ivpn/core/ExampleUnitTest.kt diff --git a/core/src/androidTest/java/net/ivpn/core/SecureStorageTest.java b/core/src/androidTest/java/net/ivpn/core/SecureStorageTest.java deleted file mode 100644 index 7bf6a1791..000000000 --- a/core/src/androidTest/java/net/ivpn/core/SecureStorageTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.ivpn.core; - -public class SecureStorageTest { - -// private static final String FIELD1 = "FIELD1"; -// private static final String FIELD2 = "FIELD2"; -// -// private static final String FIELD1_VALUE = "FIELD1_VALUE"; -// private static final String FIELD2_VALUE = "FIELD2_VALUE"; -// -// private SecureStorage store; -// private Context context; -// -// @Before -// public void setup() { -// context = InstrumentationRegistry.getTargetContext(); -// store = SecureStorage.INSTANCE; -// } -// -// @Test() -// public void fieldNotExistIfStoreEmpty() throws Exception { -// store.init(context); -// -// boolean results = store.isFieldsExist(FIELD1); -// -// assertFalse(results); -// } -// -// @Test(timeout = 5000) -// public void putAndCheckForExistingTwoDifferentFields() throws InterruptedException { -// store.init(context); -// store.putString(FIELD1, FIELD1_VALUE); -// -// boolean result = store.isFieldsExist(FIELD1, FIELD2); -// -// assertFalse(result); -// } -// -// @Test(timeout = 5000) -// public void putAndGetTwoDifferentFields() throws InterruptedException { -// store.init(context); -// store.putString(FIELD1, FIELD1_VALUE); -// store.putString(FIELD2, FIELD2_VALUE); -// -// boolean result = store.isFieldsExist(FIELD1, FIELD2); -// -// assertTrue(result); -// -// String value1 = store.getString(FIELD1); -// String value2 = store.getString(FIELD2); -// -// assertNotNull(value1); -// assertNotNull(value2); -// -// assertEquals(FIELD1_VALUE, value1); -// assertEquals(FIELD2_VALUE, value2); -// } -// -// @After -// public void release() { -// store.clear(); -// } -} diff --git a/core/src/androidTest/java/net/ivpn/core/common/ProfileStorageTest.java b/core/src/androidTest/java/net/ivpn/core/common/ProfileStorageTest.java deleted file mode 100644 index 68419aba5..000000000 --- a/core/src/androidTest/java/net/ivpn/core/common/ProfileStorageTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.ivpn.core.common; - -import org.junit.Test; -import static org.junit.Assert.*; -import de.blinkt.openvpn.VpnProfile; - -public class ProfileStorageTest { - - final String profileName = "TestVpnProfile"; - - @Test - public void writeAndReadValidProfile() { - VpnProfile profile = new VpnProfile(profileName); - - ProfileStorage.writeProfile(profile); - VpnProfile profileFromStorage = ProfileStorage.readProfile(); - assertEquals(profile, profileFromStorage); - assertEquals(profileName, profileFromStorage.mName); - } - - @Test - public void writeAndReadNullProfile() { - ProfileStorage.writeProfile(null); - VpnProfile profileFromStorage = ProfileStorage.readProfile(); - assertNull(profileFromStorage); - } -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceContentGenerator.java b/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceContentGenerator.java deleted file mode 100644 index 058225c56..000000000 --- a/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceContentGenerator.java +++ /dev/null @@ -1,8 +0,0 @@ -package net.ivpn.core.common.prefs; - -public class PreferenceContentGenerator { - public static String getStubWifiSSID() { - return "IVPN"; - } - -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceTest.java b/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceTest.java deleted file mode 100644 index d4ce8410e..000000000 --- a/core/src/androidTest/java/net/ivpn/core/common/prefs/PreferenceTest.java +++ /dev/null @@ -1,247 +0,0 @@ -package net.ivpn.core.common.prefs; - -import org.junit.After; - -import static org.hamcrest.CoreMatchers.hasItem; - -public class PreferenceTest { - - @After - public void clear() { - Preference.INSTANCE.removeAll(); - } - -// @Test -// public void writeReadLoggingSettings() { -// Preference.INSTANCE.putSettingLogging(false); -// assertFalse(Preference.INSTANCE.getSettingLogging()); -// -// Preference.INSTANCE.putSettingLogging(true); -// assertTrue(Preference.INSTANCE.getSettingLogging()); -// } -// -// @Test -// public void writeReadMultiHopSettings() { -// Preference.INSTANCE.putSettingMultiHop(false); -// assertFalse(Preference.INSTANCE.getSettingMultiHop()); -// -// Preference.INSTANCE.putSettingMultiHop(true); -// assertTrue(Preference.INSTANCE.getSettingMultiHop()); -// } -// -// @Test -// public void writeReadKillSwitchSettings() { -// Preference.INSTANCE.putSettingKillSwitch(false); -// assertFalse(Preference.INSTANCE.getSettingKillSwitch()); -// -// Preference.INSTANCE.putSettingKillSwitch(true); -// assertTrue(Preference.INSTANCE.getSettingKillSwitch()); -// } -// -// @Test -// public void writeReadStartOnBootSettings() { -// Preference.INSTANCE.putSettingStartOnBoot(false); -// assertFalse(Preference.INSTANCE.getSettingStartOnBoot()); -// -// Preference.INSTANCE.putSettingStartOnBoot(true); -// assertTrue(Preference.INSTANCE.getSettingStartOnBoot()); -// } -// -// @Test -// public void writeReadAdvancedKillSwitchSettings() { -// Preference.INSTANCE.putSettingAdvancedKillSwitch(false); -// assertFalse(Preference.INSTANCE.getIsAdvancedKillSwitchDialogEnabled()); -// -// Preference.INSTANCE.putSettingAdvancedKillSwitch(true); -// assertTrue(Preference.INSTANCE.getIsAdvancedKillSwitchDialogEnabled()); -// } -// -// @Test -// public void writeReadNewForPrivateEmailsSettings() { -// Preference.INSTANCE.putIsNewForPrivateEmails(false); -// assertFalse(Preference.INSTANCE.getIsNewForPrivateEmails()); -// -// Preference.INSTANCE.putIsNewForPrivateEmails(true); -// assertTrue(Preference.INSTANCE.getIsNewForPrivateEmails()); -// } -// -// @Test -// public void writeReadPortSettings() { -// Preference.INSTANCE.setPort(77); -// assertEquals(Preference.INSTANCE.getPort(), 77); -// } -// -// @Test -// public void writeReadCurrentServerValid() { -// Server entryServer = new Server(); -// entryServer.setGateway("fr.gw.ivpn.net"); -// -// Server exitServer = new Server(); -// exitServer.setGateway("de.gw.ivpn.net"); -// -// Preference.INSTANCE.setCurrentServer(ServerType.ENTRY, entryServer); -// Preference.INSTANCE.setCurrentServer(ServerType.EXIT, exitServer); -// -// assertEquals(entryServer, Preference.INSTANCE.getCurrentServer(ServerType.ENTRY)); -// assertEquals(exitServer, Preference.INSTANCE.getCurrentServer(ServerType.EXIT)); -// -// //invalid params should be ignored -// Preference.INSTANCE.setCurrentServer(null, entryServer); -// Preference.INSTANCE.setCurrentServer(ServerType.ENTRY, null); -// Preference.INSTANCE.setCurrentServer(ServerType.EXIT, null); -// Preference.INSTANCE.getCurrentServer(null); -// -// assertEquals(entryServer, Preference.INSTANCE.getCurrentServer(ServerType.ENTRY)); -// assertEquals(exitServer, Preference.INSTANCE.getCurrentServer(ServerType.EXIT)); -// } -// -// @Test -// public void writeReadServerList() { -// List list = new ArrayList<>(); -// Server server1 = new Server(); -// server1.setGateway("fr.gw.ivpn.net"); -// -// Server server2 = new Server(); -// server2.setGateway("de.gw.ivpn.net"); -// -// Server server3 = new Server(); -// server3.setGateway("uk.gw.ivpn.net"); -// -// list.add(server1); -// list.add(server2); -// list.add(server3); -// -// Preference.INSTANCE.putServerList(list); -// List listFromPref = Preference.INSTANCE.getServersList(); -// assertNotNull(listFromPref); -// assertEquals(listFromPref.size(), list.size()); -// for (Server server : listFromPref) { -// assertThat(list, hasItem(server)); -// } -// } -// -// @Test -// public void writeReadFavouriteServerList() { -// Server server1 = new Server(); -// server1.setGateway("fr.gw.ivpn.net"); -// -// Server server2 = new Server(); -// server2.setGateway("de.gw.ivpn.net"); -// -// Server server3 = new Server(); -// server3.setGateway("uk.gw.ivpn.net"); -// -// Preference.INSTANCE.addFavouriteServer(server1); -// List favListFromPref = Preference.INSTANCE.getFavouritesServersList(); -// assertNotNull(favListFromPref); -// assertEquals(favListFromPref.size(), 1); -// -// //invalid params and same server should be ignored -// Preference.INSTANCE.addFavouriteServer(server1); -// Preference.INSTANCE.addFavouriteServer(null); -// -// favListFromPref = Preference.INSTANCE.getFavouritesServersList(); -// assertNotNull(favListFromPref); -// assertEquals(favListFromPref.size(), 1); -// -// Preference.INSTANCE.addFavouriteServer(server2); -// Preference.INSTANCE.addFavouriteServer(server3); -// -// favListFromPref = Preference.INSTANCE.getFavouritesServersList(); -// assertNotNull(favListFromPref); -// assertEquals(favListFromPref.size(), 3); -// assertThat(favListFromPref, hasItem(server1)); -// assertThat(favListFromPref, hasItem(server2)); -// assertThat(favListFromPref, hasItem(server3)); -// -// Preference.INSTANCE.removeFavouriteServer(server1); -// Preference.INSTANCE.removeFavouriteServer(server2); -// favListFromPref = Preference.INSTANCE.getFavouritesServersList(); -// assertNotNull(favListFromPref); -// assertEquals(favListFromPref.size(), 1); -// assertThat(favListFromPref, hasItem(server3)); -// -// //invalid params and same server should be ignored -// Preference.INSTANCE.removeFavouriteServer(null); -// Preference.INSTANCE.removeFavouriteServer(server1); -// assertNotNull(favListFromPref); -// assertEquals(favListFromPref.size(), 1); -// assertThat(favListFromPref, hasItem(server3)); -// } -// -// @Test -// public void allowDisallowApps() { -// Set disallowedApps = new HashSet<>(); -// disallowedApps.add("com.ninegag.android.app"); -// disallowedApps.add("com.google.android.gm"); -// disallowedApps.add("com.facebook.katana"); -// -// Preference.INSTANCE.disallowAllPackages(disallowedApps); -// Set disallowedAppsFromPref = Preference.INSTANCE.getDisallowedPackages(); -// assertNotNull(disallowedAppsFromPref); -// assertEquals(disallowedAppsFromPref.size(), disallowedApps.size()); -// for (String packageName : disallowedApps) { -// assertThat(disallowedAppsFromPref, hasItem(packageName)); -// } -// -// //invalid params should be ignored -// Preference.INSTANCE.allowPackage("com.google.android.youtube"); -// Preference.INSTANCE.allowPackage("com.snapchat.android"); -// Preference.INSTANCE.allowPackage(null); -// -// disallowedAppsFromPref = Preference.INSTANCE.getDisallowedPackages(); -// assertNotNull(disallowedAppsFromPref); -// assertEquals(disallowedAppsFromPref.size(), disallowedApps.size()); -// for (String packageName : disallowedApps) { -// assertThat(disallowedAppsFromPref, hasItem(packageName)); -// } -// -// Preference.INSTANCE.allowAllPackages(); -// disallowedAppsFromPref = Preference.INSTANCE.getDisallowedPackages(); -// assertNotNull(disallowedAppsFromPref); -// assertEquals(disallowedAppsFromPref.size(), 0); -// -// Preference.INSTANCE.disallowPackage(null); -// Preference.INSTANCE.disallowPackage("com.google.android.youtube"); -// Preference.INSTANCE.disallowPackage("com.snapchat.android"); -// disallowedAppsFromPref = Preference.INSTANCE.getDisallowedPackages(); -// assertNotNull(disallowedAppsFromPref); -// assertEquals(disallowedAppsFromPref.size(), 2); -// } -// -// @Test -// public void shouldReturnCorrectDefaultUntrustedWifiSetting() { -// assertFalse(Preference.INSTANCE.getSettingNetworkRules()); -// } -// -// @Test -// public void shouldReturnUntrustedWifiSetting() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// assertTrue(Preference.INSTANCE.getSettingNetworkRules()); -// } -// -// @Test -// public void shouldSaveWifiSSID() { -// String wifiSSID = PreferenceContentGenerator.getStubWifiSSID(); -// Preference.INSTANCE.markWifiAsTrusted(wifiSSID); -// Set trustedWifiSSID = Preference.INSTANCE.getTrustedWifiList(); -// assertThat(trustedWifiSSID, hasItem(wifiSSID)); -// } -// -// @Test -// public void shouldIgnoreInvalidWifiSSID() { -// Preference.INSTANCE.markWifiAsTrusted(null); -// Set trustedWifiSSID = Preference.INSTANCE.getTrustedWifiList(); -// assertNotNull(trustedWifiSSID); -// assertTrue(trustedWifiSSID.isEmpty()); -// } -// -// @Test -// public void shouldRemoveWifiSSID() { -// String wifiSSID = PreferenceContentGenerator.getStubWifiSSID(); -// Preference.INSTANCE.markWifiAsTrusted(wifiSSID); -// Preference.INSTANCE.removeMarkWifiAsTrusted(wifiSSID); -// Set trustedWifiSSID = Preference.INSTANCE.getTrustedWifiList(); -// assertTrue(trustedWifiSSID.isEmpty()); -// } -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/common/prefs/SettingsTest.java b/core/src/androidTest/java/net/ivpn/core/common/prefs/SettingsTest.java deleted file mode 100644 index 1b2a47c80..000000000 --- a/core/src/androidTest/java/net/ivpn/core/common/prefs/SettingsTest.java +++ /dev/null @@ -1,155 +0,0 @@ -package net.ivpn.core.common.prefs; - -import androidx.test.filters.LargeTest; -import androidx.test.runner.AndroidJUnit4; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -@RunWith(AndroidJUnit4.class) -@LargeTest -public class SettingsTest { - - private static final String STANDARD_DNS = "1.1.1.1"; - private static final String STANDARD_DNS_MULTI_HOP = "2.2.2.2"; - private static final String HARDCORE_DNS = "3.3.3.3"; - private static final String HARDCORE_DNS_MULTI_HOP = "4.4.4.4"; - private static final String CUSTOM_DNS = "5.5.5.5"; - - @Before - public void setUp() { - initSettings(); - } - - @Test - public void getDNS1() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(true); - Settings.INSTANCE.enableCustomDNS(true); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, HARDCORE_DNS_MULTI_HOP); - } - - @Test - public void getDNS2() { - Settings.INSTANCE.enableAntiSurveillance(false); - Settings.INSTANCE.enableAntiSurveillanceHardcore(true); - Settings.INSTANCE.enableCustomDNS(true); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, CUSTOM_DNS); - } - - @Test - public void getDNS3() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(true); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, STANDARD_DNS_MULTI_HOP); - } - - @Test - public void getDNS4() { - Settings.INSTANCE.enableAntiSurveillance(false); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(true); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, CUSTOM_DNS); - } - - @Test - public void getDNS5() { - Settings.INSTANCE.enableAntiSurveillance(false); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, null); - } - - @Test - public void getDNS6() { - Settings.INSTANCE.enableAntiSurveillance(false); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(false); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, null); - } - - @Test - public void getDNS7() { - Settings.INSTANCE.enableAntiSurveillance(false); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(true); - Settings.INSTANCE.enableMultiHop(false); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, CUSTOM_DNS); - } - - @Test - public void getDNS8() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(true); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, HARDCORE_DNS_MULTI_HOP); - } - - @Test - public void getDNS9() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(true); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(false); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, HARDCORE_DNS); - } - - @Test - public void getDNS10() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(false); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, STANDARD_DNS); - } - - @Test - public void getDNS11() { - Settings.INSTANCE.enableAntiSurveillance(true); - Settings.INSTANCE.enableAntiSurveillanceHardcore(false); - Settings.INSTANCE.enableCustomDNS(false); - Settings.INSTANCE.enableMultiHop(true); - - String dns = Settings.INSTANCE.getDNS(); - assertSame(dns, STANDARD_DNS_MULTI_HOP); - } - - private void initSettings() { - Settings.INSTANCE.setAntiTrackerDefaultDNS(STANDARD_DNS); - Settings.INSTANCE.setAntiTrackerDefaultDNSMulti(STANDARD_DNS_MULTI_HOP); - Settings.INSTANCE.setAntiTrackerHardcoreDNS(HARDCORE_DNS); - Settings.INSTANCE.setAntiTrackerHardcoreDNSMulti(HARDCORE_DNS_MULTI_HOP); - Settings.INSTANCE.setCustomDNSValue(CUSTOM_DNS); - } -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/ItemWifiViewModelTest.java b/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/ItemWifiViewModelTest.java deleted file mode 100644 index 26ace51e9..000000000 --- a/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/ItemWifiViewModelTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.ivpn.core.ui.untrustedwifi; - -import net.ivpn.core.common.prefs.Preference; - -import org.junit.After; - -import static org.hamcrest.CoreMatchers.hasItem; - -public class ItemWifiViewModelTest { - - private final String wifiSsid = "Wifi1"; - - @After - public void release() { - Preference.INSTANCE.removeAll(); - } - -// @Test -// public void shouldSaveAsTrustedInPrefs() { -// WifiItem item = new WifiItem(wifiSsid, false); -// ItemWifiViewModel viewModel = new ItemWifiViewModel(item); -// -// viewModel.onItemClick(); -// assertTrue(viewModel.isChecked()); -// -// Set trustedWifiList = Preference.INSTANCE.getTrustedWifiList(); -// assertThat(trustedWifiList, hasItem(item.getSsid())); -// } -// -// @Test -// public void shouldRemoveFromTrustedInPrefs() { -// Preference.INSTANCE.markWifiAsTrusted(wifiSsid); -// WifiItem item = new WifiItem(wifiSsid, true); -// ItemWifiViewModel viewModel = new ItemWifiViewModel(item); -// -// viewModel.onItemClick(); -// assertFalse(viewModel.isChecked()); -// -// Set trustedWifiList = Preference.INSTANCE.getTrustedWifiList(); -// assertFalse(trustedWifiList.contains(wifiSsid)); -// } -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/UntrustedWifiViewModelTest.java b/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/UntrustedWifiViewModelTest.java deleted file mode 100644 index d63788cad..000000000 --- a/core/src/androidTest/java/net/ivpn/core/ui/untrustedwifi/UntrustedWifiViewModelTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package net.ivpn.core.ui.untrustedwifi; - -public class UntrustedWifiViewModelTest { - -// private static final String wifiSsid1 = "Wifi C"; -// private static final String wifiSsid2 = "Wifi A"; -// private static final String wifiSsid3 = "Wifi B"; -// -// @Rule -// public ActivityTestRule activityTestRule -// = new ActivityTestRule<>(WifiActivity.class); -// -// @After -// public void release() { -// Preference.INSTANCE.removeAll(); -// } -// -// @Test -// public void shouldSettingApply() { -// activityTestRule.launchActivity(new Intent()); -// onView(withId(R.id.wifi_main_switcher)).check(matches(isDisplayed())).perform(click()); -// assertTrue(Preference.INSTANCE.getSettingNetworkRules()); -// } -// -// @Test -// public void shouldCommonSwitcherEnabled() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// activityTestRule.launchActivity(new Intent()); -// onView(withId(R.id.wifi_main_switcher)).check(matches(isChecked())); -// } -// -// @Test -// public void shouldSettingsApplyDefaultsCorrect() { -// WifiViewModel viewModel = new WifiViewModel(getWifiManager()); -// assertEquals(viewModel.isUntrustedWifiEnabled.get(), Preference.INSTANCE.getSettingNetworkRules()); -// } -// -// @Test -// public void shouldSettingsApplyCorrect() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// WifiViewModel viewModel = new WifiViewModel(getWifiManager()); -// assertEquals(viewModel.isUntrustedWifiEnabled.get(), Preference.INSTANCE.getSettingNetworkRules()); -// } -// -// @Test -// public void shouldBeSortedByTitles() { -// WifiViewModel viewModel = new WifiViewModel(getWifiManager()); -// List itemList = new ArrayList<>(viewModel.wifiItemList); -// Collections.sort(itemList, new Comparator() { -// @Override -// public int compare(WifiItem item1, WifiItem item2) { -// return item1.getTitle().compareToIgnoreCase(item2.getTitle()); -// } -// }); -// assertArrayEquals(itemList.toArray(), viewModel.wifiItemList.toArray()); -// } -// -// @Test -// public void shouldBeMarkedAsTrusted() { -// Preference.INSTANCE.markWifiAsTrusted(wifiSsid2); -// WifiViewModel viewModel = new WifiViewModel(getWifiManager()); -// for (WifiItem item : viewModel.wifiItemList) { -// if (item.getSsid().equals(wifiSsid2)) { -// assertTrue(item.isTrusted()); -// } else { -// assertFalse(item.isTrusted()); -// } -// } -// } -// -// private WifiManager getWifiManager() { -// List wifiConfigurationList = new ArrayList<>(); -// WifiConfiguration wifi1 = mock(WifiConfiguration.class); -// wifi1.SSID = wifiSsid1; -// -// WifiConfiguration wifi2 = mock(WifiConfiguration.class); -// wifi2.SSID = wifiSsid2; -// -// WifiConfiguration wifi3 = mock(WifiConfiguration.class); -// wifi3.SSID = wifiSsid3; -// -// wifiConfigurationList.add(wifi1); -// wifiConfigurationList.add(wifi2); -// wifiConfigurationList.add(wifi3); -// -// WifiManager wifiManager = mock(WifiManager.class); -// when(wifiManager.getConfiguredNetworks()).thenReturn(wifiConfigurationList); -// -// return wifiManager; -// } -} \ No newline at end of file diff --git a/core/src/androidTest/java/net/ivpn/core/vpn/VPNControllerTest.java b/core/src/androidTest/java/net/ivpn/core/vpn/VPNControllerTest.java deleted file mode 100644 index 9e6489d80..000000000 --- a/core/src/androidTest/java/net/ivpn/core/vpn/VPNControllerTest.java +++ /dev/null @@ -1,246 +0,0 @@ -package net.ivpn.core.vpn; - -import org.junit.Before; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class VPNControllerTest { - - private static final String TAG = VPNControllerTest.class.getSimpleName(); - - private final String connected = "CONNECTED"; - private final String disconnected = "DISCONNECTED"; - private final String msg = ""; - - - @Before - public void init() { -// Intents.init(); -// // Block any intent -// Instrumentation.ActivityMonitor monitor = new Instrumentation.ActivityMonitor((IntentFilter) null, null, true); -// InstrumentationRegistry.getInstrumentation().addMonitor(monitor); - - } - -// @After -// public void release() { -// Intents.release(); -// Preference.INSTANCE.removeAll(); -// GlobalBehaviorController.INSTANCE.release(); -// VpnStatus.updateStateString(disconnected, msg); -// } -// -// @Test -// public void shouldBeNoneAppState() { -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(VPNState.NONE, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldBeVpnAppState() { -// VpnStatus.updateStateString(connected, msg); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(VPNState.VPN, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldBeGuardAppState() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldBeBothAppState() { -// VpnStatus.updateStateString(connected, msg); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldBeNoneGuardState() { -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(GuardState.NONE, GlobalBehaviorController.INSTANCE.getGuardState()); -// } -// -// @Test -// public void shouldBeKillSwitchGuardState() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(GuardState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getGuardState()); -// } -// -// @Test -// public void shouldBeWifiWatcherGuardState() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(GuardState.WIFI_WATCHER, GlobalBehaviorController.INSTANCE.getGuardState()); -// } -// -// @Test -// public void shouldBeBothGuardState() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// } -// -// @Test -// public void shouldEnableKillSwitch() { -// GlobalBehaviorController.INSTANCE.init(); -// assertFalse(GlobalBehaviorController.INSTANCE.isKillSwitchShouldBeStarted()); -// } -// -// @Test -// public void shouldEnableKillSwitch2() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// GlobalBehaviorController.INSTANCE.init(); -// assertTrue(GlobalBehaviorController.INSTANCE.isKillSwitchShouldBeStarted()); -// } -// -// @Test -// public void shouldApplyKillSwitchSetting() { -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableKillSwitch(); -// assertEquals(GuardState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldApplyKillSwitchSetting2() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// VpnStatus.updateStateString(connected, msg); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableKillSwitch(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldApplyKillSwitchSetting3() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableKillSwitch(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableKillSwitch() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableKillSwitch(); -// assertEquals(GuardState.NONE, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.NONE, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableKillSwitch2() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableKillSwitch(); -// assertEquals(GuardState.WIFI_WATCHER, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableKillSwitch3() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// VpnStatus.updateStateString(connected, msg); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableKillSwitch(); -// assertEquals(GuardState.WIFI_WATCHER, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldApplyWifiWatcherSetting() { -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableWifiWatcher(); -// assertEquals(GuardState.WIFI_WATCHER, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldApplyWifiWatcherSetting2() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableWifiWatcher(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldApplyWifiWatcherSetting3() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// VpnStatus.updateStateString(connected, msg); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.enableWifiWatcher(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableWifiWatcher() { -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableWifiWatcher(); -// assertEquals(GuardState.NONE, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.NONE, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableWifiWatcher2() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableWifiWatcher(); -// assertEquals(GuardState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldDisableWifiWatcher3() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// VpnStatus.updateStateString(connected, msg); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.disableWifiWatcher(); -// assertEquals(GuardState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldStartVpn() { -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.startVPN(); -//// intended(hasComponent(new ComponentName(IVPNApplication.getApplication(), IVPNService.class))); -//// intended(toPackage("net.ivpn.client")); -// assertEquals(GuardState.NONE, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.VPN, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldStartVpn2() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.startVPN(); -// assertEquals(GuardState.KILL_SWITCH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -// -// @Test -// public void shouldStartVpn3() { -// Preference.INSTANCE.putSettingKillSwitch(true); -// Preference.INSTANCE.putSettingsNetworkRules(true); -// GlobalBehaviorController.INSTANCE.init(); -// GlobalBehaviorController.INSTANCE.startVPN(); -// assertEquals(GuardState.BOTH, GlobalBehaviorController.INSTANCE.getGuardState()); -// assertEquals(VPNState.BOTH, GlobalBehaviorController.INSTANCE.getState()); -// } -} \ No newline at end of file diff --git a/core/src/test/java/net/ivpn/core/common/distance/DistanceProviderTest.kt b/core/src/test/java/net/ivpn/core/common/distance/DistanceProviderTest.kt deleted file mode 100644 index 7f6db3dc0..000000000 --- a/core/src/test/java/net/ivpn/core/common/distance/DistanceProviderTest.kt +++ /dev/null @@ -1,53 +0,0 @@ -package net.ivpn.core.common.distance - -import org.junit.Assert.* -import org.junit.Test - -class DistanceProviderTest { - - - companion object { - const val DISTANCE_DELTA = 1.0f - } - - @Test - fun testCorrectResult() { - val parisCoordinates = Pair(48.85341f, 2.3488f) - val kyivCoordinates = Pair(50.450001f, 30.523333f) - - val correctDistance = 2023.71f - - assertEquals( - correctDistance, - DistanceProvider.getDistanceBetween(parisCoordinates, kyivCoordinates), - DISTANCE_DELTA - ) - } - - @Test - fun testCorrectEdgeCase() { - val somePointCoordinates = Pair(-90.0f, 180.0f) - val kyivCoordinates = Pair(50.450001f, 30.523333f) - - val correctDistance = 15616.58f - - assertEquals( - DistanceProvider.getDistanceBetween(somePointCoordinates, kyivCoordinates), - correctDistance, - DISTANCE_DELTA - ) - } - - @Test - fun testSameCoordinateCase() { - val kyivCoordinates = Pair(50.450001f, 30.523333f) - - val correctDistance = 0.0f - - assertEquals( - DistanceProvider.getDistanceBetween(kyivCoordinates, kyivCoordinates), - correctDistance, - DISTANCE_DELTA - ) - } -} \ No newline at end of file diff --git a/fdroid/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt b/fdroid/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt deleted file mode 100644 index 4b09f3860..000000000 --- a/fdroid/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package net.ivpn.client - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("net.ivpn.client", appContext.packageName) - } -} \ No newline at end of file diff --git a/fdroid/src/test/java/net/ivpn/client/ExampleUnitTest.kt b/fdroid/src/test/java/net/ivpn/client/ExampleUnitTest.kt deleted file mode 100644 index 0ef243427..000000000 --- a/fdroid/src/test/java/net/ivpn/client/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package net.ivpn.client - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/site/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt b/site/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt deleted file mode 100644 index 4b09f3860..000000000 --- a/site/src/androidTest/java/net/ivpn/client/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package net.ivpn.client - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("net.ivpn.client", appContext.packageName) - } -} \ No newline at end of file diff --git a/site/src/test/java/net/ivpn/client/ExampleUnitTest.kt b/site/src/test/java/net/ivpn/client/ExampleUnitTest.kt deleted file mode 100644 index 0ef243427..000000000 --- a/site/src/test/java/net/ivpn/client/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package net.ivpn.client - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/store/src/androidTest/java/net/ivpn/core/ExampleInstrumentedTest.kt b/store/src/androidTest/java/net/ivpn/core/ExampleInstrumentedTest.kt deleted file mode 100644 index 8334ad41f..000000000 --- a/store/src/androidTest/java/net/ivpn/core/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package net.ivpn.core - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("net.ivpn.client", appContext.packageName) - } -} \ No newline at end of file diff --git a/store/src/test/java/net/ivpn/core/ExampleUnitTest.kt b/store/src/test/java/net/ivpn/core/ExampleUnitTest.kt deleted file mode 100644 index fe0dbe676..000000000 --- a/store/src/test/java/net/ivpn/core/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package net.ivpn.core - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file From 32b4d01a45fae1d3ceb1a19f342a27b9318aa0b4 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 16 Jul 2024 16:19:23 +0200 Subject: [PATCH 2/5] refactor: update MapView.kt --- core/src/main/java/net/ivpn/core/v2/map/MapView.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/net/ivpn/core/v2/map/MapView.kt b/core/src/main/java/net/ivpn/core/v2/map/MapView.kt index 59493e8e0..3ae9fafe4 100644 --- a/core/src/main/java/net/ivpn/core/v2/map/MapView.kt +++ b/core/src/main/java/net/ivpn/core/v2/map/MapView.kt @@ -96,7 +96,7 @@ class MapView @JvmOverloads constructor( } override fun onScroll( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float @@ -109,8 +109,10 @@ class MapView @JvmOverloads constructor( } override fun onFling( - e1: MotionEvent, e2: MotionEvent, - velocityX: Float, velocityY: Float + e1: MotionEvent?, + e2: MotionEvent, + velocityX: Float, + velocityY: Float ): Boolean { fling((-velocityX).toInt(), (-velocityY).toInt()) return true From b54af830d4057e70ff105979130e46511a6af0ad Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 16 Jul 2024 17:31:01 +0200 Subject: [PATCH 3/5] build: update build.gradle --- core/build.gradle | 6 +++--- fdroid/build.gradle | 4 ++-- liboqs-android/build.gradle | 4 ++-- site/build.gradle | 6 +++--- store/build.gradle | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index b10d3e808..6a793fa3b 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -26,10 +26,10 @@ android { } } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 131 versionName "2.10.8" ndkVersion "25.1.8937393" @@ -279,7 +279,7 @@ dependencies { implementation project(path: ':liboqs-android') // For crash logging. - implementation 'io.sentry:sentry-android:4.3.0' + implementation 'io.sentry:sentry-android:6.13.1' implementation "androidx.multidex:multidex:2.0.1" } diff --git a/fdroid/build.gradle b/fdroid/build.gradle index cf284c5ae..f2851435c 100644 --- a/fdroid/build.gradle +++ b/fdroid/build.gradle @@ -25,12 +25,12 @@ android { } } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "net.ivpn.client" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 131 versionName "2.10.8" ndkVersion "25.1.8937393" diff --git a/liboqs-android/build.gradle b/liboqs-android/build.gradle index 6ce3bf91a..ba40fc0a7 100644 --- a/liboqs-android/build.gradle +++ b/liboqs-android/build.gradle @@ -5,10 +5,10 @@ plugins { android { namespace "net.ivpn.liboqs" - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 131 versionName "2.10.8" ndkVersion "25.1.8937393" diff --git a/site/build.gradle b/site/build.gradle index 2763e588d..9031a2601 100644 --- a/site/build.gradle +++ b/site/build.gradle @@ -25,12 +25,12 @@ android { } } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "net.ivpn.client" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 131 versionName "2.10.8" ndkVersion "25.1.8937393" @@ -115,7 +115,7 @@ dependencies { implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version" // For crash logging. - implementation 'io.sentry:sentry-android:4.3.0' + implementation 'io.sentry:sentry-android:6.13.1' implementation "androidx.multidex:multidex:2.0.1" diff --git a/store/build.gradle b/store/build.gradle index b61d23528..5201699e1 100644 --- a/store/build.gradle +++ b/store/build.gradle @@ -26,12 +26,12 @@ android { } } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "net.ivpn.client" minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 131 versionName "2.10.8" ndkVersion "25.1.8937393" @@ -97,7 +97,7 @@ dependencies { implementation 'com.squareup.retrofit2:retrofit:2.6.2' // Purchases - implementation 'com.android.billingclient:billing:6.0.0' + implementation 'com.android.billingclient:billing:6.1.0' // Dagger kapt "com.google.dagger:dagger-compiler:$dagger_version" @@ -119,9 +119,9 @@ dependencies { implementation "androidx.multidex:multidex:2.0.1" // For crash logging. - implementation 'io.sentry:sentry-android:4.3.0' + implementation 'io.sentry:sentry-android:6.13.1' testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' } \ No newline at end of file From 0ecc1f55cc3f6d10a66b61475b8462a4e4f289b4 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 16 Jul 2024 18:00:37 +0200 Subject: [PATCH 4/5] refactor: update AndroidManifest.xml --- core/src/main/AndroidManifest.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 34fdb9a39..5ea2e096c 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -27,6 +27,9 @@ + + + - + android:permission="android.permission.BIND_VPN_SERVICE" + android:foregroundServiceType="specialUse" /> + + android:permission="android.permission.BIND_VPN_SERVICE" + android:foregroundServiceType="specialUse" /> + android:exported="false" + android:foregroundServiceType="specialUse" /> Date: Wed, 17 Jul 2024 11:28:55 +0200 Subject: [PATCH 5/5] chore: update app version and build number --- core/build.gradle | 4 ++-- fdroid/build.gradle | 4 ++-- liboqs-android/build.gradle | 4 ++-- site/build.gradle | 4 ++-- store/build.gradle | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 6a793fa3b..5088ad651 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -30,8 +30,8 @@ android { defaultConfig { minSdkVersion 23 targetSdkVersion 34 - versionCode 131 - versionName "2.10.8" + versionCode 132 + versionName "2.10.9" ndkVersion "25.1.8937393" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/fdroid/build.gradle b/fdroid/build.gradle index f2851435c..2f22adb75 100644 --- a/fdroid/build.gradle +++ b/fdroid/build.gradle @@ -31,8 +31,8 @@ android { applicationId "net.ivpn.client" minSdkVersion 23 targetSdkVersion 34 - versionCode 131 - versionName "2.10.8" + versionCode 132 + versionName "2.10.9" ndkVersion "25.1.8937393" manifestPlaceholders = [SENTRY_DSN: keystoreProperties['sentry.dsn']] diff --git a/liboqs-android/build.gradle b/liboqs-android/build.gradle index ba40fc0a7..2e078a89d 100644 --- a/liboqs-android/build.gradle +++ b/liboqs-android/build.gradle @@ -9,8 +9,8 @@ android { defaultConfig { minSdkVersion 23 targetSdkVersion 34 - versionCode 131 - versionName "2.10.8" + versionCode 132 + versionName "2.10.9" ndkVersion "25.1.8937393" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/site/build.gradle b/site/build.gradle index 9031a2601..4903c0f3c 100644 --- a/site/build.gradle +++ b/site/build.gradle @@ -31,8 +31,8 @@ android { applicationId "net.ivpn.client" minSdkVersion 23 targetSdkVersion 34 - versionCode 131 - versionName "2.10.8" + versionCode 132 + versionName "2.10.9" ndkVersion "25.1.8937393" manifestPlaceholders = [SENTRY_DSN: keystoreProperties['sentry.dsn']] diff --git a/store/build.gradle b/store/build.gradle index 5201699e1..97b5b7830 100644 --- a/store/build.gradle +++ b/store/build.gradle @@ -32,8 +32,8 @@ android { applicationId "net.ivpn.client" minSdkVersion 23 targetSdkVersion 34 - versionCode 131 - versionName "2.10.8" + versionCode 132 + versionName "2.10.9" ndkVersion "25.1.8937393" manifestPlaceholders = [SENTRY_DSN: keystoreProperties['sentry.dsn']]