From 161a0d02b1b0d74f13b4b7c625d020a464b4a5d3 Mon Sep 17 00:00:00 2001
From: "Lauren N. Liberda" <lauren@selfisekai.rocks>
Date: Thu, 10 Aug 2023 02:39:58 +0200
Subject: [PATCH] Revert "build: Add webrtc again but with fixed rpath version"

This reverts commit cb9d731b809fbea9759f025689ba260a242990ea.
---
 linux/flutter/generated_plugin_registrant.cc |  4 ----
 linux/flutter/generated_plugins.cmake        |  1 -
 pubspec.lock                                 | 19 ++++++++++---------
 pubspec.yaml                                 |  4 +++-
 snap/snapcraft.yaml                          |  7 -------
 5 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc
index 710031b18..a270c0fcd 100644
--- a/linux/flutter/generated_plugin_registrant.cc
+++ b/linux/flutter/generated_plugin_registrant.cc
@@ -12,7 +12,6 @@
 #include <emoji_picker_flutter/emoji_picker_flutter_plugin.h>
 #include <file_selector_linux/file_selector_plugin.h>
 #include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
-#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
 #include <handy_window/handy_window_plugin.h>
 #include <pasteboard/pasteboard_plugin.h>
 #include <record_linux/record_linux_plugin.h>
@@ -38,9 +37,6 @@ void fl_register_plugins(FlPluginRegistry* registry) {
   g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
       fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
   flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
-  g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar =
-      fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin");
-  flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar);
   g_autoptr(FlPluginRegistrar) handy_window_registrar =
       fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
   handy_window_plugin_register_with_registrar(handy_window_registrar);
diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake
index 88981ef6f..488e850ee 100644
--- a/linux/flutter/generated_plugins.cmake
+++ b/linux/flutter/generated_plugins.cmake
@@ -9,7 +9,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
   emoji_picker_flutter
   file_selector_linux
   flutter_secure_storage_linux
-  flutter_webrtc
   handy_window
   pasteboard
   record_linux
diff --git a/pubspec.lock b/pubspec.lock
index d82756890..9313ccd73 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -269,10 +269,10 @@ packages:
     dependency: transitive
     description:
       name: dart_webrtc
-      sha256: "3f581ea799829fabd6e0b99bd2210146e4d107c7b3ac8495af3510737a5c5c1a"
+      sha256: a34e59ac1559cac954e48c9fe156164992163d2f4b7e75d5b0e927ee2f1e4922
       url: "https://pub.dev"
     source: hosted
-    version: "1.1.1"
+    version: "1.0.16"
   dbus:
     dependency: transitive
     description:
@@ -757,11 +757,12 @@ packages:
   flutter_webrtc:
     dependency: "direct main"
     description:
-      name: flutter_webrtc
-      sha256: "6a26a2ca8e1759fe60705d745444184e384508b82feb68547d66d411dbc4ad2d"
-      url: "https://pub.dev"
-    source: hosted
-    version: "0.9.37"
+      path: "."
+      ref: HEAD
+      resolved-ref: "2c041f15b729157bc9ffcea9cd57cdcc7ba9e951"
+      url: "https://github.com/krille-chan/flutter-webrtc.git"
+    source: git
+    version: "0.9.31"
   fuchsia_remote_debug_protocol:
     dependency: transitive
     description: flutter
@@ -2191,10 +2192,10 @@ packages:
     dependency: "direct main"
     description:
       name: webrtc_interface
-      sha256: "0dd96f4d7fb6ba9895930644cebd3f1adb5179caa83cb1760061b2fe9cba5aad"
+      sha256: "0ac4693f921c81005edefd2f43b9fe84b0ed54481474fe1ee16b789b0c84a77c"
       url: "https://pub.dev"
     source: hosted
-    version: "1.1.0"
+    version: "1.0.13"
   win32:
     dependency: transitive
     description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 79f755376..fa18df225 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -49,7 +49,7 @@ dependencies:
   flutter_secure_storage: ^8.0.0
   flutter_typeahead: ^4.3.2
   flutter_web_auth_2: ^2.1.1
-  flutter_webrtc: ^0.9.37
+  flutter_webrtc: ^0.9.35
   future_loading_dialog: ^0.2.3
   geolocator: ^7.6.2
   handy_window: ^0.3.1
@@ -149,6 +149,8 @@ msix_config:
   install_certificate: false
 
 dependency_overrides:
+  flutter_webrtc:
+    git: https://github.com/krille-chan/flutter-webrtc.git
   geolocator_android:
     hosted:
       name: geolocator_android
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 6dfa41d8b..030430786 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -100,10 +100,3 @@ apps:
       - password-manager-service
     slots:
       - dbus-svc
-    # Workaround for:
-    # https://github.com/flutter-webrtc/flutter-webrtc/issues/1212#issuecomment-1611899344
-    environment:
-      XDG_DATA_HOME: $SNAP_USER_DATA
-      XDG_DATA_DIRS: $SNAP/usr/share
-      GDK_GL: gles
-      LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"
\ No newline at end of file
-- 
2.41.0

