diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index 6c433bb3c34..5b0edb5398b 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.7.14 + +* Removes SSL workaround for API 19, which is no longer supported. +* ## 2.7.13 * When `AndroidVideoPlayer` attempts to operate on a `textureId` that is not diff --git a/packages/video_player/video_player_android/android/build.gradle b/packages/video_player/video_player_android/android/build.gradle index 5cadcf23b43..b8ceea25cd7 100644 --- a/packages/video_player/video_player_android/android/build.gradle +++ b/packages/video_player/video_player_android/android/build.gradle @@ -26,7 +26,7 @@ android { compileSdk 34 defaultConfig { - minSdkVersion 19 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java deleted file mode 100644 index 731bb9798f6..00000000000 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.videoplayer; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; - -// SSLSocketFactory does not have nullability annotations. -@SuppressWarnings("UnknownNullness") -public class CustomSSLSocketFactory extends SSLSocketFactory { - private final SSLSocketFactory sslSocketFactory; - - public CustomSSLSocketFactory() throws KeyManagementException, NoSuchAlgorithmException { - SSLContext context = SSLContext.getInstance("TLS"); - context.init(null, null, null); - sslSocketFactory = context.getSocketFactory(); - } - - @Override - public String[] getDefaultCipherSuites() { - return sslSocketFactory.getDefaultCipherSuites(); - } - - @Override - public String[] getSupportedCipherSuites() { - return sslSocketFactory.getSupportedCipherSuites(); - } - - @Override - public Socket createSocket() throws IOException { - return enableProtocols(sslSocketFactory.createSocket()); - } - - @Override - public Socket createSocket(Socket s, String host, int port, boolean autoClose) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(s, host, port, autoClose)); - } - - @Override - public Socket createSocket(String host, int port) throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port)); - } - - @Override - public Socket createSocket(String host, int port, InetAddress localHost, int localPort) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port, localHost, localPort)); - } - - @Override - public Socket createSocket(InetAddress host, int port) throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port)); - } - - @Override - public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(address, port, localAddress, localPort)); - } - - private Socket enableProtocols(Socket socket) { - if (socket instanceof SSLSocket) { - ((SSLSocket) socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"}); - } - return socket; - } -} diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index de2bf8cada6..d1911d8cc37 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -5,7 +5,6 @@ package io.flutter.plugins.videoplayer; import android.content.Context; -import android.os.Build; import android.util.LongSparseArray; import androidx.annotation.NonNull; import io.flutter.FlutterInjector; @@ -22,9 +21,6 @@ import io.flutter.plugins.videoplayer.Messages.TextureMessage; import io.flutter.plugins.videoplayer.Messages.VolumeMessage; import io.flutter.view.TextureRegistry; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import javax.net.ssl.HttpsURLConnection; /** Android platform implementation of the VideoPlayerPlugin. */ public class VideoPlayerPlugin implements FlutterPlugin, AndroidVideoPlayerApi { @@ -38,19 +34,6 @@ public VideoPlayerPlugin() {} @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - try { - HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory()); - } catch (KeyManagementException | NoSuchAlgorithmException e) { - Log.w( - TAG, - "Failed to enable TLSv1.1 and TLSv1.2 Protocols for API level 19 and below.\n" - + "For more information about Socket Security, please consult the following link:\n" - + "https://developer.android.com/reference/javax/net/ssl/SSLSocket", - e); - } - } - final FlutterInjector injector = FlutterInjector.instance(); this.flutterState = new FlutterState( diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index f22ffcb6e0e..0eee37495de 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_android description: Android implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.7.13 +version: 2.7.14 environment: sdk: ^3.5.0