From 834445eda3aba3c5329a1d61abc2b334895b1b4b Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 10 Nov 2025 13:07:58 +0600 Subject: [PATCH] chore: remove jsf as arm doesn't build --- .../youtube_engine/quickjs_solver.dart | 282 +++++++++--------- linux/flutter/generated_plugin_registrant.cc | 8 - linux/flutter/generated_plugins.cmake | 3 - macos/Flutter/GeneratedPluginRegistrant.swift | 4 - pubspec.lock | 66 +--- pubspec.yaml | 3 +- .../flutter/generated_plugin_registrant.cc | 6 - windows/flutter/generated_plugins.cmake | 3 - 8 files changed, 147 insertions(+), 228 deletions(-) diff --git a/lib/services/youtube_engine/quickjs_solver.dart b/lib/services/youtube_engine/quickjs_solver.dart index 4e8bfafb..a7c032f6 100644 --- a/lib/services/youtube_engine/quickjs_solver.dart +++ b/lib/services/youtube_engine/quickjs_solver.dart @@ -1,167 +1,167 @@ -import 'dart:async'; -import 'dart:collection'; -import 'dart:convert'; -import 'package:flutter/foundation.dart'; -import 'package:http/http.dart' as http; -import 'package:youtube_explode_dart/js_challenge.dart'; -// ignore: implementation_imports -import 'package:youtube_explode_dart/src/reverse_engineering/challenges/ejs/ejs.dart'; -import 'package:jsf/jsf.dart'; +// import 'dart:async'; +// import 'dart:collection'; +// import 'dart:convert'; +// import 'package:flutter/foundation.dart'; +// import 'package:http/http.dart' as http; +// import 'package:youtube_explode_dart/js_challenge.dart'; +// // ignore: implementation_imports +// import 'package:youtube_explode_dart/src/reverse_engineering/challenges/ejs/ejs.dart'; +// import 'package:jsf/jsf.dart'; -/// [WIP] -class QuickJSEJSSolver extends BaseJSChallengeSolver { - final _playerCache = {}; - final _sigCache = <(String, String, JSChallengeType), String>{}; - final QuickJSRuntime qjs; - QuickJSEJSSolver._(this.qjs); +// /// [WIP] +// class QuickJSEJSSolver extends BaseJSChallengeSolver { +// final _playerCache = {}; +// final _sigCache = <(String, String, JSChallengeType), String>{}; +// final QuickJSRuntime qjs; +// QuickJSEJSSolver._(this.qjs); - static Future init() async { - final modules = await EJSBuilder.getJSModules(); - final deno = await QuickJSRuntime.init(modules); - return QuickJSEJSSolver._(deno); - } +// static Future init() async { +// final modules = await EJSBuilder.getJSModules(); +// final deno = await QuickJSRuntime.init(modules); +// return QuickJSEJSSolver._(deno); +// } - @override - Future solve( - String playerUrl, JSChallengeType type, String challenge) async { - final key = (playerUrl, challenge, type); - if (_sigCache.containsKey(key)) { - return _sigCache[key]!; - } +// @override +// Future solve( +// String playerUrl, JSChallengeType type, String challenge) async { +// final key = (playerUrl, challenge, type); +// if (_sigCache.containsKey(key)) { +// return _sigCache[key]!; +// } - var playerScript = _playerCache[playerUrl]; - if (playerScript == null) { - final resp = await http.get(Uri.parse(playerUrl)); - playerScript = _playerCache[playerUrl] = resp.body; - } - final jsCall = EJSBuilder.buildJSCall(playerScript, { - type: [challenge], - }); +// var playerScript = _playerCache[playerUrl]; +// if (playerScript == null) { +// final resp = await http.get(Uri.parse(playerUrl)); +// playerScript = _playerCache[playerUrl] = resp.body; +// } +// final jsCall = EJSBuilder.buildJSCall(playerScript, { +// type: [challenge], +// }); - final result = await qjs.eval(jsCall); - // Trim the first and last characters (' delimiters of the JS string) - final data = json.decode(result.substring(1, result.length - 1)) - as Map; +// final result = await qjs.eval(jsCall); +// // Trim the first and last characters (' delimiters of the JS string) +// final data = json.decode(result.substring(1, result.length - 1)) +// as Map; - if (data['type'] != 'result') { - throw Exception('Unexpected response type: ${data['type']}'); - } - final response = data['responses'][0]; - if (response['type'] != 'result') { - throw Exception('Unexpected item response type: ${response['type']}'); - } - final decoded = response['data'][challenge]; - if (decoded == null) { - throw Exception('No data for challenge: $challenge'); - } +// if (data['type'] != 'result') { +// throw Exception('Unexpected response type: ${data['type']}'); +// } +// final response = data['responses'][0]; +// if (response['type'] != 'result') { +// throw Exception('Unexpected item response type: ${response['type']}'); +// } +// final decoded = response['data'][challenge]; +// if (decoded == null) { +// throw Exception('No data for challenge: $challenge'); +// } - _sigCache[key] = decoded; +// _sigCache[key] = decoded; - return decoded; - } +// return decoded; +// } - @override - void dispose() { - qjs.dispose(); - } -} +// @override +// void dispose() { +// qjs.dispose(); +// } +// } -class _EvalRequest { - final String code; - final Completer completer; +// class _EvalRequest { +// final String code; +// final Completer completer; - _EvalRequest(this.code, this.completer); -} +// _EvalRequest(this.code, this.completer); +// } -class QuickJSRuntime { - final JsRuntime _runtime; - final StreamController _stdoutController = - StreamController.broadcast(); +// class QuickJSRuntime { +// final JsRuntime _runtime; +// final StreamController _stdoutController = +// StreamController.broadcast(); - // Queue for incoming eval requests - final Queue<_EvalRequest> _evalQueue = Queue<_EvalRequest>(); - bool _isProcessing = false; // Flag to indicate if an eval is currently active +// // Queue for incoming eval requests +// final Queue<_EvalRequest> _evalQueue = Queue<_EvalRequest>(); +// bool _isProcessing = false; // Flag to indicate if an eval is currently active - QuickJSRuntime(this._runtime); +// QuickJSRuntime(this._runtime); - /// Disposes the Deno process. - void dispose() { - _stdoutController.close(); - _runtime.dispose(); - } +// /// Disposes the Deno process. +// void dispose() { +// _stdoutController.close(); +// _runtime.dispose(); +// } - /// Sends JavaScript code to Deno for evaluation. - /// Assumes single-line input produces single-line output. - Future eval(String code) { - final completer = Completer(); - final request = _EvalRequest(code, completer); - _evalQueue.addLast(request); // Add request to the end of the queue - _processQueue(); // Attempt to process the queue +// /// Sends JavaScript code to Deno for evaluation. +// /// Assumes single-line input produces single-line output. +// Future eval(String code) { +// final completer = Completer(); +// final request = _EvalRequest(code, completer); +// _evalQueue.addLast(request); // Add request to the end of the queue +// _processQueue(); // Attempt to process the queue - return completer.future; - } +// return completer.future; +// } - // Processes the eval queue. - void _processQueue() { - if (_isProcessing || _evalQueue.isEmpty) { - return; // Already processing or nothing in queue - } +// // Processes the eval queue. +// void _processQueue() { +// if (_isProcessing || _evalQueue.isEmpty) { +// return; // Already processing or nothing in queue +// } - _isProcessing = true; - final request = - _evalQueue.first; // Get the next request without removing it yet +// _isProcessing = true; +// final request = +// _evalQueue.first; // Get the next request without removing it yet - StreamSubscription? currentOutputSubscription; - Completer lineReceived = Completer(); +// StreamSubscription? currentOutputSubscription; +// Completer lineReceived = Completer(); - currentOutputSubscription = _stdoutController.stream.listen((data) { - if (!lineReceived.isCompleted) { - // Assuming single line output per eval. - // This will capture the first full line or chunk received after sending the code. - request.completer.complete(data.trim()); - lineReceived.complete(); - currentOutputSubscription - ?.cancel(); // Cancel subscription for this request - _evalQueue.removeFirst(); // Remove the processed request - _isProcessing = false; // Mark as no longer processing - _processQueue(); // Attempt to process next item in queue - } - }, onError: (e) { - if (!request.completer.isCompleted) { - request.completer.completeError(e); - lineReceived.completeError(e); - currentOutputSubscription?.cancel(); - _evalQueue.removeFirst(); - _isProcessing = false; - _processQueue(); - } - }, onDone: () { - if (!request.completer.isCompleted) { - request.completer.completeError( - StateError('Deno process closed while awaiting eval result.')); - lineReceived.completeError( - StateError('Deno process closed while awaiting eval result.')); - currentOutputSubscription?.cancel(); - _evalQueue.removeFirst(); - _isProcessing = false; - _processQueue(); - } - }); +// currentOutputSubscription = _stdoutController.stream.listen((data) { +// if (!lineReceived.isCompleted) { +// // Assuming single line output per eval. +// // This will capture the first full line or chunk received after sending the code. +// request.completer.complete(data.trim()); +// lineReceived.complete(); +// currentOutputSubscription +// ?.cancel(); // Cancel subscription for this request +// _evalQueue.removeFirst(); // Remove the processed request +// _isProcessing = false; // Mark as no longer processing +// _processQueue(); // Attempt to process next item in queue +// } +// }, onError: (e) { +// if (!request.completer.isCompleted) { +// request.completer.completeError(e); +// lineReceived.completeError(e); +// currentOutputSubscription?.cancel(); +// _evalQueue.removeFirst(); +// _isProcessing = false; +// _processQueue(); +// } +// }, onDone: () { +// if (!request.completer.isCompleted) { +// request.completer.completeError( +// StateError('Deno process closed while awaiting eval result.')); +// lineReceived.completeError( +// StateError('Deno process closed while awaiting eval result.')); +// currentOutputSubscription?.cancel(); +// _evalQueue.removeFirst(); +// _isProcessing = false; +// _processQueue(); +// } +// }); - debugPrint("[QuickJS Solver] Evaluate ${request.code}"); - final result = _runtime.eval(request.code); - debugPrint("[QuickJS Solver] Evaluation Result $result"); - _stdoutController.add(result); - } +// debugPrint("[QuickJS Solver] Evaluate ${request.code}"); +// final result = _runtime.eval(request.code); +// debugPrint("[QuickJS Solver] Evaluation Result $result"); +// _stdoutController.add(result); +// } - static Future init(String initCode) async { - debugPrint("[QuickJS Solver] Initializing"); - debugPrint("[QuickJS Solver] script $initCode"); +// static Future init(String initCode) async { +// debugPrint("[QuickJS Solver] Initializing"); +// debugPrint("[QuickJS Solver] script $initCode"); - final runtime = JsRuntime(); +// final runtime = JsRuntime(); - runtime.execInitScript(initCode); +// runtime.execInitScript(initCode); - return QuickJSRuntime(runtime); - } -} +// return QuickJSRuntime(runtime); +// } +// } diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 63e83265..8f5a71fe 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -12,13 +12,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -43,9 +41,6 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) gtk_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin"); gtk_plugin_register_with_registrar(gtk_registrar); - g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin"); - irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar); g_autoptr(FlPluginRegistrar) local_notifier_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "LocalNotifierPlugin"); local_notifier_plugin_register_with_registrar(local_notifier_registrar); @@ -61,9 +56,6 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) super_native_extensions_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "SuperNativeExtensionsPlugin"); - super_native_extensions_plugin_register_with_registrar(super_native_extensions_registrar); g_autoptr(FlPluginRegistrar) system_theme_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "SystemThemePlugin"); system_theme_plugin_register_with_registrar(system_theme_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 541826e6..1dd92b5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -9,13 +9,11 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_linux flutter_timezone gtk - irondash_engine_context local_notifier media_kit_libs_linux open_file_linux screen_retriever_linux sqlite3_flutter_libs - super_native_extensions system_theme tray_manager url_launcher_linux @@ -24,7 +22,6 @@ list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST flutter_discord_rpc - jsf metadata_god ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index d211f518..2931c1b4 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -18,7 +18,6 @@ import flutter_inappwebview_macos import flutter_new_pipe_extractor import flutter_secure_storage_macos import flutter_timezone -import irondash_engine_context import local_notifier import media_kit_libs_macos_audio import open_file_mac @@ -28,7 +27,6 @@ import screen_retriever_macos import shared_preferences_foundation import sqflite_darwin import sqlite3_flutter_libs -import super_native_extensions import system_theme import tray_manager import url_launcher_macos @@ -48,7 +46,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterNewPipeExtractorPlugin.register(with: registry.registrar(forPlugin: "FlutterNewPipeExtractorPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) FlutterTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterTimezonePlugin")) - IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin")) LocalNotifierPlugin.register(with: registry.registrar(forPlugin: "LocalNotifierPlugin")) MediaKitLibsMacosAudioPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosAudioPlugin")) OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin")) @@ -58,7 +55,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) - SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin")) SystemThemePlugin.register(with: registry.registrar(forPlugin: "SystemThemePlugin")) TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 7e53e91c..33275111 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -422,10 +422,10 @@ packages: dependency: transitive description: name: country_flags - sha256: "78a7bf8aabd7ae1a90087f0c517471ac9ebfe07addc652692f58da0f0f833196" + sha256: "714f2d415e74828eb08787d552a05e94cdf2cbe0607a5656f3e70087cd7bb7e0" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "4.1.0" coverage: dependency: transitive description: @@ -1399,22 +1399,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - irondash_engine_context: - dependency: transitive - description: - name: irondash_engine_context - sha256: "2bb0bc13dfda9f5aaef8dde06ecc5feb1379f5bb387d59716d799554f3f305d7" - url: "https://pub.dev" - source: hosted - version: "0.5.5" - irondash_message_channel: - dependency: transitive - description: - name: irondash_message_channel - sha256: b4101669776509c76133b8917ab8cfc704d3ad92a8c450b92934dd8884a2f060 - url: "https://pub.dev" - source: hosted - version: "0.7.0" jovial_misc: dependency: transitive description: @@ -1439,14 +1423,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" - jsf: - dependency: "direct main" - description: - name: jsf - sha256: "189ba3b9216702f9b6f2d8ea90fa5acaca13bbe5dd2f72fb38618005b41a737f" - url: "https://pub.dev" - source: hosted - version: "0.6.1" json_annotation: dependency: "direct main" description: @@ -1910,14 +1886,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.4" - pixel_snap: - dependency: transitive - description: - name: pixel_snap - sha256: "677410ea37b07cd37ecb6d5e6c0d8d7615a7cf3bd92ba406fd1ac57e937d1fb0" - url: "https://pub.dev" - source: hosted - version: "0.1.5" platform: dependency: transitive description: @@ -2107,10 +2075,10 @@ packages: dependency: "direct main" description: name: shadcn_flutter - sha256: af83de199b7c3a965ab24e293cfcafe2764c12b7f911f5b1a427c332029262d9 + sha256: "1fd4f798c39d6308dc8f7e94d9e870b5db39fbf417ea95c423c7555ce8227a1c" url: "https://pub.dev" source: hosted - version: "0.0.44" + version: "0.0.47" shared_preferences: dependency: "direct main" description: @@ -2428,22 +2396,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.3" - super_clipboard: - dependency: transitive - description: - name: super_clipboard - sha256: e73f3bb7e66cc9260efa1dc507f979138e7e106c3521e2dda2d0311f6d728a16 - url: "https://pub.dev" - source: hosted - version: "0.9.1" - super_native_extensions: - dependency: transitive - description: - name: super_native_extensions - sha256: b9611dcb68f1047d6f3ef11af25e4e68a21b1a705bbcc3eb8cb4e9f5c3148569 - url: "https://pub.dev" - source: hosted - version: "0.9.1" sync_http: dependency: transitive description: @@ -2460,14 +2412,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.4.0" - syntax_highlight: - dependency: transitive - description: - name: syntax_highlight - sha256: "4d3ba40658cadba6ba55d697f29f00b43538ebb6eb4a0ca0e895c568eaced138" - url: "https://pub.dev" - source: hosted - version: "0.5.0" system_theme: dependency: "direct main" description: @@ -2863,4 +2807,4 @@ packages: version: "1.0.0" sdks: dart: ">=3.9.0 <4.0.0" - flutter: ">=3.35.1" + flutter: ">=3.32.3" diff --git a/pubspec.yaml b/pubspec.yaml index 9b84196b..65cf4576 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -104,7 +104,7 @@ dependencies: ref: dart-3-support url: https://github.com/KRTirtho/scrobblenaut.git scroll_to_index: ^3.0.1 - shadcn_flutter: ^0.0.42 + shadcn_flutter: ^0.0.47 shared_preferences: ^2.2.3 shelf: ^1.4.1 shelf_router: ^1.1.4 @@ -161,7 +161,6 @@ dependencies: flutter_markdown_plus: ^1.0.3 pub_semver: ^2.2.0 change_case: ^1.1.0 - jsf: ^0.6.1 dev_dependencies: build_runner: ^2.4.13 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index ac2fd1e0..95f52491 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -15,13 +15,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -46,8 +44,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); FlutterTimezonePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterTimezonePluginCApi")); - IrondashEngineContextPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi")); LocalNotifierPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("LocalNotifierPlugin")); MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar( @@ -58,8 +54,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); Sqlite3FlutterLibsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); - SuperNativeExtensionsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi")); SystemThemePluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("SystemThemePlugin")); TrayManagerPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 53cd3667..51be79c2 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -12,13 +12,11 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_new_pipe_extractor flutter_secure_storage_windows flutter_timezone - irondash_engine_context local_notifier media_kit_libs_windows_audio permission_handler_windows screen_retriever_windows sqlite3_flutter_libs - super_native_extensions system_theme tray_manager url_launcher_windows @@ -27,7 +25,6 @@ list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST flutter_discord_rpc - jsf metadata_god smtc_windows )