diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 4c791f803..a8fa0863f 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -16,6 +16,22 @@ dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286 } + +// Workaround for https://pub.dev/packages/unifiedpush#the-build-fails-because-of-duplicate-classes +configurations.all { + // Use the latest version published: https://central.sonatype.com/artifact/com.google.crypto.tink/tink-android + val tink = "com.google.crypto.tink:tink-android:1.17.0" + // You can also use the library declaration catalog + // val tink = libs.google.tink + resolutionStrategy { + force(tink) + dependencySubstitution { + substitute(module("com.google.crypto.tink:tink")).using(module(tink)) + } + } +} + + android { namespace = "com.talktolearn.chat" compileSdk = flutter.compileSdkVersion diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 12d15f6a7..cd9cca6a2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -171,20 +171,6 @@ - - - - - - - - - - - - { L10n.of(widget.context).foregroundServiceRunning, ), iosNotificationOptions: const IOSNotificationOptions(), - foregroundTaskOptions: const ForegroundTaskOptions(), + foregroundTaskOptions: ForegroundTaskOptions( + eventAction: ForegroundTaskEventAction.nothing(), + ), ); FlutterForegroundTask.startService( notificationTitle: L10n.of(widget.context).screenSharingTitle, diff --git a/lib/pages/settings_emotes/settings_emotes.dart b/lib/pages/settings_emotes/settings_emotes.dart index cd1db0518..cf8cf73af 100644 --- a/lib/pages/settings_emotes/settings_emotes.dart +++ b/lib/pages/settings_emotes/settings_emotes.dart @@ -290,9 +290,9 @@ class EmotesSettingsController extends State { if (result.isEmpty) return null; - final buffer = InputStream(await result.first.readAsBytes()); + final buffer = InputMemoryStream(await result.first.readAsBytes()); - final archive = ZipDecoder().decodeBuffer(buffer); + final archive = ZipDecoder().decodeStream(buffer); return archive; }, @@ -342,8 +342,6 @@ class EmotesSettingsController extends State { '${pack.pack.displayName ?? client.userID?.localpart ?? 'emotes'}.zip'; final output = ZipEncoder().encode(archive); - if (output == null) return; - MatrixFile( name: fileName, bytes: Uint8List.fromList(output), diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 35d186455..a976a47b4 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -135,7 +135,7 @@ class BackgroundPush { if (Platform.isAndroid) { await UnifiedPush.initialize( onNewEndpoint: _newUpEndpoint, - onRegistrationFailed: _upUnregistered, + onRegistrationFailed: (_, i) => _upUnregistered(i), onUnregistered: _upUnregistered, onMessage: _onUpMessage, ); @@ -519,7 +519,8 @@ class BackgroundPush { .registerAppWithDialog(); } - Future _newUpEndpoint(String newEndpoint, String i) async { + Future _newUpEndpoint(PushEndpoint newPushEndpoint, String i) async { + final newEndpoint = newPushEndpoint.url; upAction = true; if (newEndpoint.isEmpty) { await _upUnregistered(i); @@ -579,7 +580,8 @@ class BackgroundPush { } } - Future _onUpMessage(Uint8List message, String i) async { + Future _onUpMessage(PushMessage pushMessage, String i) async { + final message = pushMessage.content; upAction = true; final data = Map.from( json.decode(utf8.decode(message))['notification'], @@ -613,7 +615,7 @@ class UPFunctions extends UnifiedPushFunctions { @override Future registerApp(String instance) async { - await UnifiedPush.registerApp(instance, features); + await UnifiedPush.register(instance: instance, features: features); } @override diff --git a/pubspec.lock b/pubspec.lock index c23b51f44..9f9bc0802 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -101,10 +101,10 @@ packages: dependency: "direct main" description: name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "4.0.7" args: dependency: transitive description: @@ -501,10 +501,10 @@ packages: dependency: "direct main" description: name: dynamic_color - sha256: eae98052fa6e2826bdac3dd2e921c6ce2903be15c6b7f8b6d8a5d49b5086298d + sha256: "43a5a6679649a7731ab860334a5812f2067c2d9ce6452cf069c5e0c25336c17c" url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.1" emoji_picker_flutter: dependency: "direct main" description: @@ -540,10 +540,11 @@ packages: excel: dependency: "direct main" description: - name: excel - sha256: "1a15327dcad260d5db21d1f6e04f04838109b39a2f6a84ea486ceda36e468780" - url: "https://pub.dev" - source: hosted + path: "." + ref: efd70f3086d12105dad0029f71663e6a4ed295f2 + resolved-ref: efd70f3086d12105dad0029f71663e6a4ed295f2 + url: "https://github.com/busslina/excel.git" + source: git version: "4.0.6" fake_async: dependency: transitive @@ -758,10 +759,10 @@ packages: dependency: "direct main" description: name: flutter_foreground_task - sha256: "6cf10a27f5e344cd2ecad0752d3a5f4ec32846d82fda8753b3fe2480ebb832a3" + sha256: "9f1b25a81db95d7119d2c5cffc654048cbdd49d4056183e1beadc1a6a38f3e29" url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "9.1.0" flutter_highlighter: dependency: "direct main" description: @@ -1269,10 +1270,10 @@ packages: dependency: "direct main" description: name: image - sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d + sha256: "492bd52f6c4fbb6ee41f781ff27765ce5f627910e1e0cbecfa3d9add5562604c" url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "4.7.2" image_picker: dependency: "direct main" description: @@ -1935,6 +1936,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" pretty_qr_code: dependency: "direct main" description: @@ -2568,26 +2577,26 @@ packages: dependency: "direct main" description: name: unifiedpush - sha256: "6dbed5a6305ca33f1865c7a3d814ae39476b79a2d23ca76a5708f023f405730f" + sha256: "1418375efb580af9640de4eaf4209cb6481f9a48792648ced3051f30e67d9568" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "6.0.2" unifiedpush_android: dependency: transitive description: name: unifiedpush_android - sha256: "7443dece0a850ae956514f809983eb2b39fc518c2c7d24dbfe817198bec89134" + sha256: "2f25db8eb2fc3183bf2e43db89fff20b2587adc1c361e1d1e06b223a0d45b50a" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "3.1.1" unifiedpush_platform_interface: dependency: transitive description: name: unifiedpush_platform_interface - sha256: dd588d78a8b2bfc10430e30035526e98caa543d0b7364a6344b5eb4815721c6d + sha256: bb49d2748211520e35e0374ab816faa8a2c635267e71909d334ad868d532eba5 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.1" unifiedpush_ui: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 3acc95233..952b5a0a3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ environment: dependencies: animations: ^2.0.11 app_links: ^6.3.3 - archive: ^3.4.10 + archive: ^4.0.7 async: ^2.11.0 badges: ^3.1.2 blurhash_dart: ^1.2.1 @@ -29,14 +29,14 @@ dependencies: desktop_notifications: ^0.6.3 device_info_plus: ^11.5.0 diacritic: ^0.1.6 - dynamic_color: ^1.7.0 + dynamic_color: ^1.8.1 emoji_picker_flutter: ^4.3.0 emojis: ^0.9.9 file_picker: ^10.2.1 file_selector: ^1.0.3 flutter: sdk: flutter - flutter_foreground_task: ^6.1.3 + flutter_foreground_task: ^9.1.0 flutter_highlighter: ^0.1.1 flutter_linkify: ^6.0.0 flutter_local_notifications: ^19.4.0 @@ -94,7 +94,7 @@ dependencies: sqlcipher_flutter_libs: ^0.6.7 swipe_to_action: ^0.3.0 tor_detector_web: ^1.1.0 - unifiedpush: ^5.0.1 + unifiedpush: ^6.0.2 unifiedpush_ui: ^0.1.0 universal_html: ^2.2.4 url_launcher: ^6.3.2 @@ -111,7 +111,11 @@ dependencies: country_picker: ^2.0.25 csv: ^6.0.0 dropdown_button2: ^2.3.9 - excel: ^4.0.6 + # https://github.com/justkawal/excel/pull/409 + excel: + git: + url: https://github.com/busslina/excel.git + ref: efd70f3086d12105dad0029f71663e6a4ed295f2 firebase_analytics: ^11.0.1 firebase_core: ^3.1.0 firebase_messaging: ^15.1.5 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index dd8d407a8..9708e0f64 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,7 +1,7 @@ name: fluffychat title: FluffyChat base: core24 -adopt-info: fluffychat +version: 2.0.0 license: AGPL-3.0 summary: The cutest messenger in the Matrix network description: | @@ -82,8 +82,6 @@ parts: # Workaround for Flutter build error: rm -rf build - craftctl set version="$(yq e '.version' pubspec.yaml | sed 's/\(.*\)+.*/\1/')" - flutter build linux --release -v mkdir -p $CRAFT_PART_INSTALL/bin/ cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/ @@ -95,7 +93,6 @@ parts: - libpciaccess-dev build-snaps: - rustup - - yq stage-packages: - libsecret-1-0 - libjsoncpp25