From f67a6d97bc43ae6ca1431397b85786ef41a3b109 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:06:10 -0700 Subject: [PATCH 1/7] fix: migrate gradle --- remote/android/app/build.gradle | 17 +++++++---------- remote/android/build.gradle | 14 -------------- remote/android/settings.gradle | 31 +++++++++++++++++++++++-------- remote/pubspec.lock | 24 ++++++++++++------------ 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/remote/android/app/build.gradle b/remote/android/app/build.gradle index f044ea3..9d09dad 100644 --- a/remote/android/app/build.gradle +++ b/remote/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,11 +27,6 @@ if (keystorePropertiesFile.exists()) { def vcode = (int)(((new Date().getTime()/1000) - 1610737340) / 10) -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -36,10 +37,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { compileSdkVersion 34 ndkVersion flutter.ndkVersion @@ -86,5 +83,5 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.21" } diff --git a/remote/android/build.gradle b/remote/android/build.gradle index a824819..8f31e8c 100644 --- a/remote/android/build.gradle +++ b/remote/android/build.gradle @@ -1,17 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.21' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' - } -} - allprojects { repositories { google() diff --git a/remote/android/settings.gradle b/remote/android/settings.gradle index 44e62bc..52e962b 100644 --- a/remote/android/settings.gradle +++ b/remote/android/settings.gradle @@ -1,11 +1,26 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.2.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.21" apply false + id "com.google.protobuf" version "0.8.12" apply false +} + +include ":app" diff --git a/remote/pubspec.lock b/remote/pubspec.lock index 8d057a4..3662b5a 100644 --- a/remote/pubspec.lock +++ b/remote/pubspec.lock @@ -268,18 +268,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -308,18 +308,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mobile_scanner: dependency: "direct main" description: @@ -553,10 +553,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" typed_data: dependency: transitive description: @@ -641,10 +641,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" web: dependency: transitive description: From 08f99de9711684578ca975507fc4de01bea9be68 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Wed, 21 May 2025 18:44:57 -0700 Subject: [PATCH 2/7] fix: app gradle --- remote/android/app/build.gradle | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/remote/android/app/build.gradle b/remote/android/app/build.gradle index 9d09dad..e931730 100644 --- a/remote/android/app/build.gradle +++ b/remote/android/app/build.gradle @@ -2,6 +2,8 @@ plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" + id "com.google.gms.google-services" + id "com.google.firebase.crashlytics" } def localProperties = new Properties() @@ -38,26 +40,27 @@ if (flutterVersionName == null) { } android { - compileSdkVersion 34 + namespace 'com.rtirl.kit' + compileSdkVersion 35 ndkVersion flutter.ndkVersion - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceSets { + main.java.srcDirs += 'src/main/kotlin' } - kotlinOptions { - jvmTarget = '1.8' + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + kotlinOptions { + jvmTarget = '17' } defaultConfig { applicationId "com.rtirl.kit" minSdkVersion 21 - targetSdkVersion 34 + targetSdkVersion 35 versionCode vcode versionName flutterVersionName } @@ -83,5 +86,5 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.21" + implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.0" } From 375401c8baab1e10bbf896b5d421192b762984b2 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Wed, 21 May 2025 20:00:34 -0700 Subject: [PATCH 3/7] fix: working build --- remote/android/app/build.gradle | 2 - .../gradle/wrapper/gradle-wrapper.properties | 2 +- remote/android/settings.gradle | 18 ++++++-- remote/lib/themes.dart | 8 ++-- remote/lib/urls.dart | 24 +++++++++- remote/pubspec.lock | 46 +++++++++++++------ remote/pubspec.yaml | 3 +- 7 files changed, 74 insertions(+), 29 deletions(-) diff --git a/remote/android/app/build.gradle b/remote/android/app/build.gradle index e931730..06079e0 100644 --- a/remote/android/app/build.gradle +++ b/remote/android/app/build.gradle @@ -2,8 +2,6 @@ plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" - id "com.google.gms.google-services" - id "com.google.firebase.crashlytics" } def localProperties = new Properties() diff --git a/remote/android/gradle/wrapper/gradle-wrapper.properties b/remote/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f..628d33c 100644 --- a/remote/android/gradle/wrapper/gradle-wrapper.properties +++ b/remote/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip diff --git a/remote/android/settings.gradle b/remote/android/settings.gradle index 52e962b..6ee74d8 100644 --- a/remote/android/settings.gradle +++ b/remote/android/settings.gradle @@ -14,13 +14,25 @@ pluginManagement { mavenCentral() gradlePluginPortal() } + + buildscript { + repositories { + mavenCentral() + maven { + url = uri("https://storage.googleapis.com/r8-releases/raw") + } + } + dependencies { + classpath("com.android.tools:r8:8.3.38") + } + } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.2.0" apply false - id "org.jetbrains.kotlin.android" version "1.9.21" apply false + id "com.android.application" version "8.4.0" apply false + id "org.jetbrains.kotlin.android" version "2.0.0" apply false id "com.google.protobuf" version "0.8.12" apply false } -include ":app" +include ":app" \ No newline at end of file diff --git a/remote/lib/themes.dart b/remote/lib/themes.dart index f766ba1..b07ad96 100644 --- a/remote/lib/themes.dart +++ b/remote/lib/themes.dart @@ -69,10 +69,10 @@ class Themes { listTileTheme: const ListTileThemeData(iconColor: Colors.white), canvasColor: backgroundColor, cardColor: backgroundColor, - dialogBackgroundColor: backgroundColor, - dialogTheme: const DialogTheme( - titleTextStyle: TextStyle(color: primaryTextColor), - ), + // dialogBackgroundColor: backgroundColor, + // dialogTheme: const DialogTheme( + // titleTextStyle: TextStyle(color: primaryTextColor), + // ), appBarTheme: const AppBarTheme( color: offBlackColor, titleTextStyle: TextStyle( diff --git a/remote/lib/urls.dart b/remote/lib/urls.dart index fb5bd31..82a1648 100644 --- a/remote/lib/urls.dart +++ b/remote/lib/urls.dart @@ -3,9 +3,29 @@ import 'package:url_launcher/url_launcher.dart'; Future openUrl(Uri url) async { if (!url.hasScheme) { - await customtabs.launch(url.replace(scheme: 'http').toString()); + await customtabs.launchUrl( + url.replace(scheme: 'http'), + customTabsOptions: const customtabs.CustomTabsOptions( + shareState: customtabs.CustomTabsShareState.on, + urlBarHidingEnabled: true, + showTitle: true, + ), + safariVCOptions: const customtabs.SafariViewControllerOptions( + barCollapsingEnabled: true, + dismissButtonStyle: + customtabs.SafariViewControllerDismissButtonStyle.close, + ), + ); } else if (url.isScheme("http") || url.isScheme("https")) { - await customtabs.launch(url.toString()); + await customtabs.launchUrl(url, + customTabsOptions: const customtabs.CustomTabsOptions( + shareState: customtabs.CustomTabsShareState.on, + urlBarHidingEnabled: true, + showTitle: true, + ), + safariVCOptions: const customtabs.SafariViewControllerOptions( + barCollapsingEnabled: true, + )); } else { await launchUrl(url); } diff --git a/remote/pubspec.lock b/remote/pubspec.lock index ac9ba5d..5e7c37f 100644 --- a/remote/pubspec.lock +++ b/remote/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: @@ -178,26 +178,42 @@ packages: dependency: "direct main" description: name: flutter_custom_tabs - sha256: e90e5b7cad5648aeb0e1ed04aa3c0cada62d86f3b5d4aaef488ab7de61ec2a9f + sha256: ac3543d7b4e0ac6ecdf3744360039ebb573656c0ce759149d228e1934d4f7535 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.4.0" + flutter_custom_tabs_android: + dependency: transitive + description: + name: flutter_custom_tabs_android + sha256: "925fc5e7d27372ee523962dcfcd4b77c0443549482c284dd7897b77815547621" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + flutter_custom_tabs_ios: + dependency: transitive + description: + name: flutter_custom_tabs_ios + sha256: c61a58d30b29ccb09ea4da0daa335bbf8714bcf8798d0d9f4f58a0b83c6c421b + url: "https://pub.dev" + source: hosted + version: "2.4.0" flutter_custom_tabs_platform_interface: dependency: transitive description: name: flutter_custom_tabs_platform_interface - sha256: "1d6b9eb6c5671b21511fdb47babf18aa65982784373986c003aaf67ca78798ad" + sha256: "54a6ff5cc7571cb266a47ade9f6f89d1980b9ed2dba18162a6d5300afc408449" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.3.0" flutter_custom_tabs_web: dependency: transitive description: name: flutter_custom_tabs_web - sha256: dbb5689a97c2398aa5dbcfc9cd59cffea5518ec815e9d23def448dc143cb02be + sha256: "236e035c73b6d3ef0a2f85cd8b6b815954e7559c9f9d50a15ed2e53a297b58b0" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.3.0" flutter_launcher_icons: dependency: "direct dev" description: @@ -225,7 +241,7 @@ packages: source: sdk version: "0.0.0" http: - dependency: "direct main" + dependency: transitive description: name: http sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" @@ -268,10 +284,10 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -649,10 +665,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" web: dependency: transitive description: diff --git a/remote/pubspec.yaml b/remote/pubspec.yaml index 29f6fb9..3e8382b 100644 --- a/remote/pubspec.yaml +++ b/remote/pubspec.yaml @@ -32,8 +32,7 @@ dependencies: cloud_firestore: ^4.12.0 cupertino_icons: ^1.0.6 firebase_core: ^2.20.0 - flutter_custom_tabs: ^1.2.1 - http: ^1.2.0 + flutter_custom_tabs: ^2.4.0 mobile_scanner: ^3.5.7 package_info_plus: ^4.2.0 path_provider: ^2.1.2 From e2861cbab95ad6094dc72a37cdae7912a87b72d5 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Wed, 21 May 2025 20:02:17 -0700 Subject: [PATCH 4/7] fix: deletion --- remote/pubspec.lock | 2 +- remote/pubspec.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/remote/pubspec.lock b/remote/pubspec.lock index 5e7c37f..6a88a29 100644 --- a/remote/pubspec.lock +++ b/remote/pubspec.lock @@ -241,7 +241,7 @@ packages: source: sdk version: "0.0.0" http: - dependency: transitive + dependency: "direct main" description: name: http sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" diff --git a/remote/pubspec.yaml b/remote/pubspec.yaml index 3e8382b..ea87ff7 100644 --- a/remote/pubspec.yaml +++ b/remote/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: cupertino_icons: ^1.0.6 firebase_core: ^2.20.0 flutter_custom_tabs: ^2.4.0 + http: ^1.2.0 mobile_scanner: ^3.5.7 package_info_plus: ^4.2.0 path_provider: ^2.1.2 From 365d6d6d3e61789a85abb9c8682fa9aa04984673 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Wed, 21 May 2025 20:52:29 -0700 Subject: [PATCH 5/7] fix: fmt --- remote/lib/urls.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/lib/urls.dart b/remote/lib/urls.dart index 82a1648..26a4708 100644 --- a/remote/lib/urls.dart +++ b/remote/lib/urls.dart @@ -13,7 +13,7 @@ Future openUrl(Uri url) async { safariVCOptions: const customtabs.SafariViewControllerOptions( barCollapsingEnabled: true, dismissButtonStyle: - customtabs.SafariViewControllerDismissButtonStyle.close, + customtabs.SafariViewControllerDismissButtonStyle.close, ), ); } else if (url.isScheme("http") || url.isScheme("https")) { From 638e0e35f9cba616453350d9ccf19c6c1e103697 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Fri, 23 May 2025 12:24:28 -0700 Subject: [PATCH 6/7] fix: deprecations --- remote/lib/screens/control_screen.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/remote/lib/screens/control_screen.dart b/remote/lib/screens/control_screen.dart index c227ac4..2115670 100644 --- a/remote/lib/screens/control_screen.dart +++ b/remote/lib/screens/control_screen.dart @@ -144,10 +144,11 @@ class ControlScreen extends StatelessWidget { ), _ControlBox( title: 'Save Replay', - boxColor: yellow.withOpacity( - channelStatus.obsReplayBuffer == 'started' - ? 1 - : 0.4), + boxColor: yellow.withValues( + alpha: + channelStatus.obsReplayBuffer == 'started' + ? 1 + : 0.4), icon: Icons.save_alt, onTap: channelStatus.obsReplayBuffer == 'started' ? () => saveReplayBuffer(channelId) From f0bcd5506a7f374ef535b7129b20a3352e482f28 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Fri, 23 May 2025 12:26:29 -0700 Subject: [PATCH 7/7] fix: themes --- remote/lib/themes.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/remote/lib/themes.dart b/remote/lib/themes.dart index b07ad96..c6716ea 100644 --- a/remote/lib/themes.dart +++ b/remote/lib/themes.dart @@ -14,7 +14,7 @@ const detailColor = Color(0xFF121312); const textFieldBgColor = Color(0xFFF6F3ED); MaterialColor generateMaterialColor(Color color) { - return MaterialColor(color.value, { + return MaterialColor(color.toARGB32(), { 50: tintColor(color, 0.5), 100: tintColor(color, 0.4), 200: tintColor(color, 0.3), @@ -32,9 +32,9 @@ int tintValue(int value, double factor) => max(0, min((value + ((255 - value) * factor)).round(), 255)); Color tintColor(Color color, double factor) => Color.fromRGBO( - tintValue(color.red, factor), - tintValue(color.green, factor), - tintValue(color.blue, factor), + tintValue((color.r * 255).round(), factor), + tintValue((color.g * 255).round(), factor), + tintValue((color.b * 255).round(), factor), 1); class Themes { @@ -69,10 +69,9 @@ class Themes { listTileTheme: const ListTileThemeData(iconColor: Colors.white), canvasColor: backgroundColor, cardColor: backgroundColor, - // dialogBackgroundColor: backgroundColor, - // dialogTheme: const DialogTheme( - // titleTextStyle: TextStyle(color: primaryTextColor), - // ), + dialogTheme: const DialogThemeData( + titleTextStyle: TextStyle(color: primaryTextColor), + ), appBarTheme: const AppBarTheme( color: offBlackColor, titleTextStyle: TextStyle(