diff --git a/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java index 3c1eda242..824a4fae3 100644 --- a/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java @@ -45,6 +45,7 @@ public class ClientConfig { UserPreferences.init(context); UsageStatistics.init(context); PlaybackPreferences.init(context); + installSslProvider(context); NetworkUtils.init(context); AntennapodHttpClient.setCacheDirectory(new File(context.getCacheDir(), "okhttp")); SleepTimerPreferences.init(context); @@ -53,7 +54,7 @@ public class ClientConfig { initialized = true; } - public static void installSslProvider(Context context) { + private static void installSslProvider(Context context) { // ProviderInstaller is a closed-source Google library } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/ProviderInstallerInterceptor.java b/core/src/main/java/de/danoeh/antennapod/core/service/ProviderInstallerInterceptor.java deleted file mode 100644 index 4fa1fc3d7..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/service/ProviderInstallerInterceptor.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.danoeh.antennapod.core.service; - -import androidx.annotation.NonNull; -import okhttp3.Interceptor; -import okhttp3.Response; - -import java.io.IOException; - -public class ProviderInstallerInterceptor implements Interceptor { - public static Runnable installer = () -> { }; - - @Override - @NonNull - public Response intercept(Chain chain) throws IOException { - installer.run(); - return chain.proceed(chain.request()); - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index d0484f2a2..e0c23bdac 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -32,7 +32,6 @@ import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.ProviderInstallerInterceptor; import de.danoeh.antennapod.core.service.UserAgentInterceptor; import de.danoeh.antennapod.core.storage.DBWriter; import okhttp3.Cache; @@ -117,7 +116,6 @@ public class AntennapodHttpClient { } return response; }); - builder.interceptors().add(new ProviderInstallerInterceptor()); builder.interceptors().add(new BasicAuthorizationInterceptor()); builder.networkInterceptors().add(new UserAgentInterceptor()); diff --git a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java index 09d9f4623..7d38aedc2 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java @@ -12,7 +12,6 @@ import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.SleepTimerPreferences; import de.danoeh.antennapod.core.preferences.UsageStatistics; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.ProviderInstallerInterceptor; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.NetworkUtils; @@ -55,6 +54,7 @@ public class ClientConfig { UserPreferences.init(context); UsageStatistics.init(context); PlaybackPreferences.init(context); + installSslProvider(context); NetworkUtils.init(context); // Don't initialize Cast-related logic unless it is enabled, to avoid the unnecessary // Google Play Service usage. @@ -65,18 +65,6 @@ public class ClientConfig { } else { Log.v(TAG, "Cast is disabled. All Cast-related initialization will be skipped."); } - ProviderInstaller.installIfNeededAsync(context, new ProviderInstaller.ProviderInstallListener() { - @Override - public void onProviderInstalled() { - Log.e(TAG, "onProviderInstalled"); - } - - @Override - public void onProviderInstallFailed(int i, Intent intent) { - Log.e(TAG, "onProviderInstallFailed"); - } - }); - ProviderInstallerInterceptor.installer = () -> installSslProvider(context); AntennapodHttpClient.setCacheDirectory(new File(context.getCacheDir(), "okhttp")); SleepTimerPreferences.init(context); RxJavaErrorHandlerSetup.setupRxJavaErrorHandler(); @@ -84,7 +72,7 @@ public class ClientConfig { initialized = true; } - public static void installSslProvider(Context context) { + private static void installSslProvider(Context context) { try { ProviderInstaller.installIfNeeded(context); } catch (GooglePlayServicesRepairableException e) {