This commit is contained in:
Alexey 2026-03-17 13:08:38 +03:00
commit 41cc0560d0
15 changed files with 87 additions and 64 deletions

View file

@ -1,32 +0,0 @@
#
# Generated file, do not edit.
#
import lldb
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
base = frame.register["x0"].GetValueAsAddress()
page_len = frame.register["x1"].GetValueAsUnsigned()
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
# first page to see if handled it correctly. This makes diagnosing
# misconfiguration (e.g. missing breakpoint) easier.
data = bytearray(page_len)
data[0:8] = b'IHELPED!'
error = lldb.SBError()
frame.GetThread().GetProcess().WriteMemory(base, data, error)
if not error.Success():
print(f'Failed to write into {base}[+{page_len}]', error)
return
def __lldb_init_module(debugger: lldb.SBDebugger, _):
target = debugger.GetDummyTarget()
# Caveat: must use BreakpointCreateByRegEx here and not
# BreakpointCreateByName. For some reasons callback function does not
# get carried over from dummy target for the later.
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
bp.SetAutoContinue(True)
print("-- LLDB integration loaded --")

View file

@ -1,5 +0,0 @@
#
# Generated file, do not edit.
#
command script import --relative-to-command-file flutter_lldb_helper.py

View file

@ -8,6 +8,7 @@ import 'package:flutter/semantics.dart';
import 'package:collection/collection.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_vodozemac/flutter_vodozemac.dart' as vod;
import 'package:just_audio_media_kit/just_audio_media_kit.dart';
import 'package:matrix/matrix.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_html/universal_html.dart' as web;
@ -46,6 +47,8 @@ void main() async {
// widget bindings are initialized already.
WidgetsFlutterBinding.ensureInitialized();
JustAudioMediaKit.ensureInitialized(linux: true);
final store = await AppSettings.init();
Logs().i('Welcome to ${AppSettings.applicationName.value} <3');

View file

@ -8,8 +8,6 @@ import 'package:matrix/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/setting_keys.dart';
import 'package:fluffychat/utils/file_description.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/event_extension.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/url_launcher.dart';
import 'package:fluffychat/widgets/blur_hash.dart';
import 'package:fluffychat/widgets/mxc_image.dart';
@ -33,8 +31,6 @@ class EventVideoPlayer extends StatelessWidget {
@override
Widget build(BuildContext context) {
final supportsVideoPlayer = PlatformInfos.supportsVideoPlayer;
final blurHash =
(event.infoMap as Map<String, dynamic>).tryGet<String>(
'xyz.amorgan.blurhash',
@ -63,8 +59,7 @@ class EventVideoPlayer extends StatelessWidget {
color: Colors.black,
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: InkWell(
onTap: () => supportsVideoPlayer
? showDialog(
onTap: () => showDialog(
context: context,
builder: (_) => ImageViewer(
event,
@ -72,7 +67,6 @@ class EventVideoPlayer extends StatelessWidget {
outerContext: context,
),
)
: event.saveFile(context),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: SizedBox(
width: width,
@ -104,9 +98,7 @@ class EventVideoPlayer extends StatelessWidget {
),
Center(
child: CircleAvatar(
child: supportsVideoPlayer
? const Icon(Icons.play_arrow_outlined)
: const Icon(Icons.file_download_outlined),
child: const Icon(Icons.play_arrow_outlined),
),
),
if (duration != null)

View file

@ -38,7 +38,7 @@ class ImageViewerController extends State<ImageViewer> {
(event) => {
MessageTypes.Image,
MessageTypes.Sticker,
if (PlatformInfos.supportsVideoPlayer) MessageTypes.Video,
MessageTypes.Video,
}.contains(event.messageType),
)
.toList()

View file

@ -9,8 +9,6 @@ import 'package:path_provider/path_provider.dart';
import 'package:video_player/video_player.dart';
import 'package:fluffychat/utils/localized_exception_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/event_extension.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/blur_hash.dart';
import '../../../utils/error_reporter.dart';
import '../../widgets/mxc_image.dart';
@ -30,16 +28,7 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
double? _downloadProgress;
// The video_player package only doesn't support Windows and Linux.
final _supportsVideoPlayer =
!PlatformInfos.isWindows && !PlatformInfos.isLinux;
Future<void> _downloadAction() async {
if (!_supportsVideoPlayer) {
widget.event.saveFile(context);
return;
}
try {
final fileSize = widget.event.content
.tryGetMap<String, Object?>('info')

View file

@ -30,14 +30,11 @@ abstract class PlatformInfos {
static bool get usesTouchscreen => !isMobile;
static bool get supportsVideoPlayer =>
!PlatformInfos.isWindows && !PlatformInfos.isLinux;
static bool get supportsCustomImageResizer =>
PlatformInfos.isWeb || PlatformInfos.isMobile;
/// Web could also record in theory but currently only wav which is too large
static bool get platformCanRecord => (isMobile || isMacOS || isWeb);
static bool get platformCanRecord => (isMobile || isMacOS || isWeb || isLinux);
static String get clientName =>
'${AppSettings.applicationName.value} ${isWeb ? 'web' : Platform.operatingSystem}${kReleaseMode ? '' : 'Debug'}';

View file

@ -17,6 +17,7 @@ permittedLicenses:
- MIT
- MPL-2.0
- Zlib
- Unlicense
packageLicenseOverride:
dependency_validator: Apache-2.0

View file

@ -13,7 +13,10 @@
#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 <fvp/fvp_plugin.h>
#include <gtk/gtk_plugin.h>
#include <handy_window/handy_window_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <record_linux/record_linux_plugin.h>
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
#include <sqlcipher_flutter_libs/sqlite3_flutter_libs_plugin.h>
@ -44,9 +47,18 @@ void fl_register_plugins(FlPluginRegistry* registry) {
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) fvp_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FvpPlugin");
fvp_plugin_register_with_registrar(fvp_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_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);
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
g_autoptr(FlPluginRegistrar) record_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin");
record_linux_plugin_register_with_registrar(record_linux_registrar);

View file

@ -10,7 +10,10 @@ list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
flutter_secure_storage_linux
flutter_webrtc
fvp
gtk
handy_window
media_kit_libs_linux
record_linux
screen_retriever_linux
sqlcipher_flutter_libs

View file

@ -18,6 +18,7 @@ import flutter_new_badger
import flutter_secure_storage_darwin
import flutter_web_auth_2
import flutter_webrtc
import fvp
import geolocator_apple
import just_audio
import package_info_plus
@ -48,6 +49,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin"))
FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin"))
FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin"))
FvpPlugin.register(with: registry.registrar(forPlugin: "FvpPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))

View file

@ -669,6 +669,19 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.0"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
fvp:
dependency: "direct main"
description:
name: fvp
sha256: e03c4ba02c367cde8610c09325d085c9b1efe4f7d98a563950993a1fee17a28b
url: "https://pub.dev"
source: hosted
version: "0.35.2"
geoclue:
dependency: transitive
description:
@ -941,6 +954,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.10.5"
just_audio_media_kit:
dependency: "direct main"
description:
name: just_audio_media_kit
sha256: f3cf04c3a50339709e87e90b4e841eef4364ab4be2bdbac0c54cc48679f84d23
url: "https://pub.dev"
source: hosted
version: "2.1.0"
just_audio_platform_interface:
dependency: transitive
description:
@ -1069,6 +1090,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.2.0"
media_kit:
dependency: transitive
description:
name: media_kit
sha256: ae9e79597500c7ad6083a3c7b7b7544ddabfceacce7ae5c9709b0ec16a5d6643
url: "https://pub.dev"
source: hosted
version: "1.2.6"
media_kit_libs_linux:
dependency: "direct main"
description:
name: media_kit_libs_linux
sha256: "2b473399a49ec94452c4d4ae51cfc0f6585074398d74216092bf3d54aac37ecf"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
meta:
dependency: transitive
description:
@ -1461,6 +1498,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.28.0"
safe_local_storage:
dependency: transitive
description:
name: safe_local_storage
sha256: "287ea1f667c0b93cdc127dccc707158e2d81ee59fba0459c31a0c7da4d09c755"
url: "https://pub.dev"
source: hosted
version: "2.0.3"
safe_url_check:
dependency: transitive
description:
@ -1898,6 +1943,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.0"
uri_parser:
dependency: transitive
description:
name: uri_parser
sha256: "051c62e5f693de98ca9f130ee707f8916e2266945565926be3ff20659f7853ce"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
url_launcher:
dependency: "direct main"
description:

View file

@ -38,6 +38,7 @@ dependencies:
flutter_vodozemac: ^0.5.0
flutter_web_auth_2: ^5.0.1
flutter_webrtc: ^1.3.1
fvp: ^0.35.2
geolocator: ^14.0.2
go_router: ^17.1.0
handy_window: ^0.4.2
@ -48,8 +49,11 @@ dependencies:
image_picker: ^1.2.1
intl: any
just_audio: ^0.10.5
just_audio_media_kit: ^2.1.0
latlong2: ^0.9.1
matrix: ^6.2.0
linkify: ^5.0.0
media_kit_libs_linux: ^1.2.1
mime: ^2.0.0
native_imaging: ^0.4.0
opus_caf_converter_dart: ^1.0.1
@ -118,4 +122,4 @@ dependency_overrides:
webcrypto:
git:
url: https://github.com/google/webcrypto.dart.git
ref: master
ref: master

View file

@ -13,6 +13,7 @@
#include <file_selector_windows/file_selector_windows.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
#include <fvp/fvp_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h>
#include <record_windows/record_windows_plugin_c_api.h>
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
@ -38,6 +39,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
FlutterWebRTCPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterWebRTCPlugin"));
FvpPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FvpPluginCApi"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
RecordWindowsPluginCApiRegisterWithRegistrar(

View file

@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
flutter_secure_storage_windows
flutter_webrtc
fvp
geolocator_windows
record_windows
screen_retriever_windows