From 9857dff9a3ce63ef1ea3b6d9a08454d4e03b9a58 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 20 Jun 2022 15:58:14 -0700 Subject: [PATCH] upgraded to flutter 3, upgraded kotlin and gradle, some deps --- android/app/build.gradle | 4 +- .../app/FlutterMultiDexApplication.java | 9 +- .../kotlin/im/cwtch/flwtch/MainActivity.kt | 13 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 6 +- lib/cwtch/cwtchNotifier.dart | 1 - linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 141 ++++++++++-------- pubspec.yaml | 8 +- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 13 files changed, 118 insertions(+), 77 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4899ea9e..7fc72e37 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,7 +33,7 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -48,7 +48,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "im.cwtch.flwtch" minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java index 9213f130..752fc185 100644 --- a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java +++ b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -1,16 +1,21 @@ // Generated file. +// // If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. package io.flutter.app; +import android.app.Application; import android.content.Context; import androidx.annotation.CallSuper; import androidx.multidex.MultiDex; /** - * Extension of {@link io.flutter.app.FlutterApplication}, adding multidex support. + * Extension of {@link android.app.Application}, adding multidex support. */ -public class FlutterMultiDexApplication extends FlutterApplication { +public class FlutterMultiDexApplication extends Application { @Override @CallSuper protected void attachBaseContext(Context base) { diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt index 05e9f5ef..304c704e 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt @@ -536,10 +536,15 @@ class MainActivity: FlutterActivity() { Log.i("MainActivity.kt", "onResume") if (myReceiver == null) { Log.i("MainActivity.kt", "onResume registering local broadcast receiver / event bus forwarder") - val mc = MethodChannel(flutterEngine?.dartExecutor?.binaryMessenger, CWTCH_EVENTBUS) - val filter = IntentFilter("im.cwtch.flwtch.broadcast.SERVICE_EVENT_BUS") - myReceiver = MyBroadcastReceiver(mc) - LocalBroadcastManager.getInstance(applicationContext).registerReceiver(myReceiver!!, filter) + val bm = flutterEngine?.dartExecutor?.binaryMessenger; + if (bm != null) { + val mc = MethodChannel(bm, CWTCH_EVENTBUS) + + val filter = IntentFilter("im.cwtch.flwtch.broadcast.SERVICE_EVENT_BUS") + myReceiver = MyBroadcastReceiver(mc) + LocalBroadcastManager.getInstance(applicationContext) + .registerReceiver(myReceiver!!, filter) + } } // ReconnectCwtchForeground which will resync counters and settings... diff --git a/android/build.gradle b/android/build.gradle index 0827984d..23c86a79 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.5.31' repositories { google() // jCenter() no longer exists... https://blog.gradle.org/jcenter-shutdown diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..0f8346ef 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Mon Jun 20 10:33:21 PDT 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index f5f0f7d6..66abce25 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -176,7 +176,6 @@ class CwtchNotifier { seenMessageCallback!(data["ProfileOnion"]!, identifier, DateTime.now().toUtc()); } - print("New Message from peer..."); if (notification == "SimpleEvent") { notificationManager.notify(notificationSimple ?? "New Message", "", 0); } else if (notification == "ContactInfo") { diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 51e7cad4..0cacc750 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,10 +6,14 @@ #include "generated_plugin_registrant.h" +#include #include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) screen_retriever_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); + screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index ae841bb2..62f151fd 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + screen_retriever url_launcher_linux window_manager ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 14435a7d..ea7ef12c 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,6 +8,7 @@ import Foundation import flutter_local_notifications import package_info_plus_macos import path_provider_macos +import screen_retriever import url_launcher_macos import window_manager @@ -15,6 +16,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index f377f459..644a5885 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -15,13 +15,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.8.0" - ansicolor: - dependency: transitive - description: - name: ansicolor - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" archive: dependency: transitive description: @@ -35,7 +28,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: @@ -56,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.0" build_config: dependency: transitive description: @@ -70,7 +63,7 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.0" build_resolvers: dependency: transitive description: @@ -84,7 +77,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "2.1.11" build_runner_core: dependency: transitive description: @@ -105,7 +98,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.4" + version: "8.3.3" characters: dependency: transitive description: @@ -127,6 +120,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + cli_dialog: + dependency: transitive + description: + name: cli_dialog + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" cli_util: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" crypto: dependency: "direct main" description: @@ -175,7 +175,14 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" + dart_console: + dependency: transitive + description: + name: dart_console + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" dart_style: dependency: transitive description: @@ -189,7 +196,7 @@ packages: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.7.1" + version: "0.7.4" desktop_notifications: dependency: "direct main" description: @@ -210,7 +217,7 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.1" file: dependency: transitive description: @@ -224,7 +231,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "4.3.3" + version: "4.6.1" file_picker_desktop: dependency: "direct main" description: @@ -238,7 +245,7 @@ packages: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" flutter: dependency: "direct main" description: flutter @@ -288,7 +295,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" flutter_test: dependency: transitive description: flutter @@ -305,12 +312,19 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" fuchsia_remote_debug_protocol: dependency: transitive description: flutter source: sdk version: "0.0.0" + get_it: + dependency: transitive + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.0" gherkin: dependency: transitive description: @@ -324,7 +338,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" graphs: dependency: transitive description: @@ -345,21 +359,21 @@ packages: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" image: dependency: transitive description: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "3.2.0" integration_test: dependency: transitive description: flutter @@ -392,7 +406,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.5.0" logging: dependency: transitive description: @@ -427,14 +441,14 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" msix: dependency: "direct dev" description: name: msix url: "https://pub.dartlang.org" source: hosted - version: "2.8.3" + version: "3.6.2" nested: dependency: transitive description: @@ -448,21 +462,21 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.4.2" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" package_info_plus_macos: dependency: transitive description: @@ -483,14 +497,14 @@ packages: name: package_info_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" path: dependency: transitive description: @@ -504,56 +518,56 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.15" path_provider_ios: dependency: transitive description: name: path_provider_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.10" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.7" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.0.0" platform: dependency: transitive description: @@ -574,7 +588,7 @@ packages: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.5.1" process: dependency: transitive description: @@ -595,7 +609,7 @@ packages: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" pubspec_parse: dependency: transitive description: @@ -603,6 +617,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + screen_retriever: + dependency: transitive + description: + name: screen_retriever + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" scrollable_positioned_list: dependency: "direct main" description: @@ -616,14 +637,14 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" sky_engine: dependency: transitive description: flutter @@ -635,7 +656,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" source_span: dependency: transitive description: @@ -719,56 +740,56 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.18" + version: "6.1.3" url_launcher_android: dependency: transitive description: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.14" + version: "6.0.17" url_launcher_ios: dependency: transitive description: name: url_launcher_ios url: "https://pub.dartlang.org" source: hosted - version: "6.0.14" + version: "6.0.17" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.1" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.0" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.12" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.1" vector_math: dependency: transitive description: @@ -796,7 +817,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" webdriver: dependency: transitive description: @@ -810,7 +831,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.8" + version: "2.6.1" win_toast: dependency: "direct main" description: @@ -824,7 +845,7 @@ packages: name: window_manager url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.5" xdg_directories: dependency: transitive description: @@ -838,14 +859,14 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "6.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.1.1" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.12.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index f6f4a840..377ffae7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,23 +32,23 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 - ffi: ^1.0.0 + ffi: ^1.2.1 path_provider: ^2.0.0 crypto: 3.0.1 glob: any scrollable_positioned_list: ^0.3.2 file_picker: ^4.3.2 - file_picker_desktop: ^1.1.0 + file_picker_desktop: ^1.1.1 url_launcher: ^6.0.18 - window_manager: ^0.1.4 + window_manager: ^0.2.5 # notification plugins win_toast: ^0.0.2 flutter_local_notifications: ^9.6.1 desktop_notifications: ^0.6.3 dev_dependencies: - msix: ^2.1.3 + msix: ^3.6.2 flutter_gherkin: ^3.0.0-rc.9 build_runner: any # integration_test: any diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 0177b517..c253d427 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,11 +6,14 @@ #include "generated_plugin_registrant.h" +#include #include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + ScreenRetrieverPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); WinToastPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index aab3ee94..22680c99 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + screen_retriever url_launcher_windows win_toast window_manager