diff options
author | Mats Wahlberg <rcxslinger@gmail.com> | 2020-04-21 17:41:24 +0200 |
---|---|---|
committer | Mats Wahlberg <rcxslinger@gmail.com> | 2020-09-30 13:52:31 +0200 |
commit | 4c24d1c29a726a67eabf86a9f9866e5daeca4ae8 (patch) | |
tree | ffe194b3ec02125947e2ea6c902d570604b83359 /core/src/free | |
parent | 746190106f9293fb60b4821de8590d7c132f56b7 (diff) | |
download | AntennaPod-4c24d1c29a726a67eabf86a9f9866e5daeca4ae8.zip |
Bundle Conscrypt security provider for Free builds
This fixes protocol and cipher errors on older versions of android
without requiring Google API/Services (which are non-free) to replace
the security provider from the OS. No changes are made to Play builds.
The value of conscryptVersion in build.gradle should be updated
regularly to keep the bundled version of conscrypt up to date (or
changed to "latest.release", which will cause issues with verifying
reproducible builds).
Fixes: #2814 (for users of free builds)
Diffstat (limited to 'core/src/free')
-rw-r--r-- | core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java | 10 |
1 files changed, 9 insertions, 1 deletions
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 824a4fae3..aff8081e2 100644 --- a/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java @@ -1,6 +1,13 @@ package de.danoeh.antennapod.core; import android.content.Context; +import java.security.Security; + +/* + * If you get an error here ("package org.conscrypt does not exist"), you are probably doing a free + * build and didn't pass -PfreeBuild to gradle (e.g. ./gradlew assembleFreeRelease -PfreeBuild). + */ +import org.conscrypt.Conscrypt; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.SleepTimerPreferences; @@ -55,6 +62,7 @@ public class ClientConfig { } private static void installSslProvider(Context context) { - // ProviderInstaller is a closed-source Google library + // Insert bundled conscrypt as highest security provider (overrides OS version). + Security.insertProviderAt(Conscrypt.newProvider(), 1); } } |