fixed crash

This commit is contained in:
gdlbo
2022-10-05 15:33:34 +03:00
parent 98bbdf872b
commit 9ba210e166
2 changed files with 17 additions and 6 deletions
@@ -17,15 +17,22 @@ public class GithubList {
.b(url)
.a();
var response = mClient.a(link).execute().a().g();
try {
var response = mClient.a(link).execute().a().g();
if (!response.contains(":")) {
Log.d(proxyname, "No proxy found");
return null;
}
Log.d(proxyname, response);
return new ArrayList<>(Arrays.asList(response.split("\n")));
} catch (Exception e){
Log.d(proxyname, "Failed to fetch data, link: " + link);
if (!response.contains(":")) {
Log.d(proxyname, "No proxy found");
return null;
}
Log.d(proxyname, response);
return new ArrayList<>(Arrays.asList(response.split("\n")));
}
}
@@ -17,6 +17,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import com.vtosters.lite.data.Users;
@@ -31,6 +32,9 @@ public class Preferences {
public static String VERSIONNAME = "Beta";
public static void init(Application application) throws Exception {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
GmsUtils.fixGapps();
setProxy();
LifecycleUtils.registerActivities(application);