From 3dd95efcfc1dc7a5a571b4474ed195eb4609c104 Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Mon, 16 Sep 2024 15:10:49 +0800 Subject: [PATCH] remove cronet but keep the security config --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 6 +++--- lib/service.dart | 10 +--------- linux/flutter/generated_plugins.cmake | 1 - pubspec.lock | 24 ------------------------ pubspec.yaml | 3 +-- windows/flutter/generated_plugins.cmake | 1 - 7 files changed, 6 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d0a143a..c6d5da5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: # - name: Run tests with nix (starts postgres and invidious server) # run: nix-shell --run './submodules/flutter/bin/flutter test' - run: ./submodules/flutter/bin/flutter pub run flutter_native_splash:create - - run: ./submodules/flutter/bin/flutter build apk --profile --split-per-abi --dart-define=cronetHttpNoPlay=true + - run: ./submodules/flutter/bin/flutter build apk --profile --split-per-abi - name: Archive build artifacts uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87daeeb8..8a6f8a74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,9 +57,9 @@ jobs: ./submodules/flutter/bin/flutter config --no-analytics ./submodules/flutter/bin/flutter pub get ./submodules/flutter/bin/flutter pub run flutter_native_splash:create - ./submodules/flutter/bin/flutter build apk --split-per-abi --dart-define=cronetHttpNoPlay=true - ./submodules/flutter/bin/flutter build apk --dart-define=cronetHttpNoPlay=true - ./submodules/flutter/bin/flutter build appbundle --dart-define=cronetHttpNoPlay=true + ./submodules/flutter/bin/flutter build apk --split-per-abi + ./submodules/flutter/bin/flutter build apk + ./submodules/flutter/bin/flutter build appbundle - name: Moving build artifacts run: | mkdir -p build/app/outputs/flutter-apk diff --git a/lib/service.dart b/lib/service.dart index d5b19cad..eb9d68c6 100644 --- a/lib/service.dart +++ b/lib/service.dart @@ -1,11 +1,9 @@ import 'dart:convert'; -import 'dart:io' show Platform; import 'package:flutter/foundation.dart'; import 'package:flutter_web_auth/flutter_web_auth.dart'; import 'package:http/http.dart' as http; import 'package:http/http.dart'; -import 'package:cronet_http/cronet_http.dart'; import 'package:invidious/channels/models/channel_sort_by.dart'; import 'package:invidious/extensions.dart'; import 'package:invidious/globals.dart'; @@ -81,13 +79,7 @@ class Service { final log = Logger('Service'); final Client httpClient; - Service() - : httpClient = Platform.isAndroid - ? CronetClient.fromCronetEngine( - CronetEngine.build( - cacheMode: CacheMode.memory, cacheMaxSize: 2 * 1024 * 1024), - closeEngine: true) - : http.Client(); + Service() : httpClient = http.Client(); String urlFormatForLog(Uri? uri) { return kDebugMode ? uri.toString() : '${uri?.replace(host: 'xxxxxxxxxx')}'; diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 76ac626b..7879666f 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -10,7 +10,6 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/pubspec.lock b/pubspec.lock index 2f0427a7..c38f775c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -326,14 +326,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.2" - cronet_http: - dependency: "direct main" - description: - name: cronet_http - sha256: "3af9c4d57bf07ef4b307e77b22be4ad61bea19ee6ff65e62184863f3a09f1415" - url: "https://pub.dev" - source: hosted - version: "1.3.2" cross_file: dependency: transitive description: @@ -732,14 +724,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - http_profile: - dependency: transitive - description: - name: http_profile - sha256: "7e679e355b09aaee2ab5010915c932cce3f2d1c11c3b2dc177891687014ffa78" - url: "https://pub.dev" - source: hosted - version: "0.1.0" image: dependency: transitive description: @@ -764,14 +748,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" - jni: - dependency: transitive - description: - name: jni - sha256: f377c585ea9c08d48b427dc2e03780af2889d1bb094440da853c6883c1acba4b - url: "https://pub.dev" - source: hosted - version: "0.10.1" js: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d830e422..7d96a3fa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: invidious -version: 1.21.0+4059 +version: 1.21.1+4060 publish_to: none description: A new Flutter project. environment: @@ -16,7 +16,6 @@ dependencies: cached_network_image: 3.4.1 carousel_slider: 5.0.0 copy_with_extension: 5.0.4 - cronet_http: 1.3.2 device_info_plus: 10.1.2 dio: 5.7.0 downloadsfolder: 1.1.0 diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 2d0310fd..d2f43e8d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -13,7 +13,6 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - jni ) set(PLUGIN_BUNDLED_LIBRARIES)