Skip to content

Commit

Permalink
Add conscrypt to fix soundcloud mediacc not working on Jellybean Kitk…
Browse files Browse the repository at this point in the history
…at devices

Huge thanks to @evermind-zz for BraveNewPipeLegacy Conscrypt implementation

Co-Authored-By: evermind-zz <[email protected]>
  • Loading branch information
ShareASmile and evermind-zz committed Jan 1, 2024
1 parent da5b7e9 commit 71b0a91
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ dependencies {
// Date and time formatting
implementation "org.ocpsoft.prettytime:prettytime:5.0.7.Final"

// conscrypt libraries
implementation "org.conscrypt:conscrypt-android:2.5.2"

/** Debugging **/
// Memory leak detection
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"
Expand Down
4 changes: 4 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
}

# conscrypt rules
-dontwarn com.android.org.conscrypt.SSLParametersImpl
-dontwarn org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
4 changes: 4 additions & 0 deletions app/src/main/java/org/schabi/newpipelegacy/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.acra.config.ACRAConfigurationException;
import org.acra.config.CoreConfiguration;
import org.acra.config.CoreConfigurationBuilder;
import org.conscrypt.Conscrypt;
import org.schabi.newpipelegacy.error.ErrorActivity;
import org.schabi.newpipelegacy.error.ErrorInfo;
import org.schabi.newpipelegacy.error.ReCaptchaActivity;
Expand All @@ -34,6 +35,7 @@

import java.io.IOException;
import java.io.InterruptedIOException;
import java.security.Security;
import java.net.SocketException;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -90,6 +92,8 @@ public void onCreate() {

app = this;

Security.insertProviderAt(Conscrypt.newProvider(), 1);

// Initialize settings first because others inits can use its values
SettingsActivity.initSettings(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Socket createSocket(final InetAddress address, final int port,

private Socket enableTLSOnSocket(final Socket socket) {
if (socket instanceof SSLSocket) {
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"});
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2", "TLSv1.3"});
}
return socket;
}
Expand Down

0 comments on commit 71b0a91

Please sign in to comment.