diff --git a/app/build.gradle b/app/build.gradle index d6b6a697..dda1d5b5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { targetSdkVersion 33 - versionCode 323 - versionName '2.5.1' + versionCode 324 + versionName '2.5.2' multiDexEnabled true diff --git a/app/src/main/java/com/prey/net/UtilConnection.java b/app/src/main/java/com/prey/net/UtilConnection.java index 26c3ea56..65fe77cb 100644 --- a/app/src/main/java/com/prey/net/UtilConnection.java +++ b/app/src/main/java/com/prey/net/UtilConnection.java @@ -557,39 +557,7 @@ public static int uploadFile(PreyConfig preyConfig,String page, File file,long t * @return available */ public static boolean isInternetAvailable(Context context) { - try { - boolean isTimeNextPing = PreyConfig.getPreyConfig(context).isTimeNextPing(); - if (isTimeNextPing) { - return true; - } - boolean isInternetAvailable = false; - ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - if (connectivity != null) { - NetworkInfo[] info = connectivity.getAllNetworkInfo(); - if (info != null) { - for (int i = 0; i < info.length; i++) { - if (info[i].getState() == NetworkInfo.State.CONNECTED) { - try { - HttpURLConnection urlGoogle = (HttpURLConnection) (new URL("http://www.google.com").openConnection()); - urlGoogle.setRequestProperty("User-Agent", "Test"); - urlGoogle.setRequestProperty("Connection", "close"); - urlGoogle.setConnectTimeout(500); //choose your own timeframe - urlGoogle.setReadTimeout(500); //choose your own timeframe - urlGoogle.connect(); - isInternetAvailable = (urlGoogle.getResponseCode() == HttpsURLConnection.HTTP_OK); - } catch (IOException e) { - PreyLogger.e(String.format("isInternetAvailable error:%s", e.getMessage()), e); - isInternetAvailable = false; //connectivity exists, but no internet. - } - } - } - } - } - return isInternetAvailable; - } catch (Exception e) { - PreyLogger.e(String.format("isInternetAvailable error:%s", e.getMessage()), e); - } - return false; + return true; } private static boolean isInternet() {