From b803ce7435983a6f4ee164927a7cf65ebc59ca56 Mon Sep 17 00:00:00 2001 From: Dhruvan Bhalara <53393418+dhruvanbhalara@users.noreply.github.com> Date: Wed, 10 May 2023 15:48:51 +0530 Subject: [PATCH 1/6] fix: system navigation overlapping UI (#853) --- lib/ui/views/app_selector/app_selector_view.dart | 5 ++++- lib/ui/views/contributors/contributors_view.dart | 1 + lib/ui/views/installer/installer_view.dart | 6 ++++++ lib/ui/views/patches_selector/patches_selector_view.dart | 6 ++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 487f08a8..620c7b68 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -92,7 +92,10 @@ class _AppSelectorViewState extends State { ? const AppSkeletonLoader() : Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0) - .copyWith(bottom: 80), + .copyWith( + bottom: + MediaQuery.of(context).viewPadding.bottom + 8.0, + ), child: Column( children: [ ...model diff --git a/lib/ui/views/contributors/contributors_view.dart b/lib/ui/views/contributors/contributors_view.dart index 3ebebd7a..1fdc6d40 100644 --- a/lib/ui/views/contributors/contributors_view.dart +++ b/lib/ui/views/contributors/contributors_view.dart @@ -57,6 +57,7 @@ class ContributorsView extends StatelessWidget { title: 'contributorsView.managerContributors', contributors: model.managerContributors, ), + SizedBox(height: MediaQuery.of(context).viewPadding.bottom) ], ), ), diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 0a2c5487..2ba73779 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -20,6 +20,7 @@ class InstallerView extends StatelessWidget { builder: (context, model, child) => WillPopScope( child: SafeArea( top: false, + bottom: false, child: Scaffold( body: CustomScrollView( controller: model.scrollController, @@ -153,6 +154,11 @@ class InstallerView extends StatelessWidget { ), ), ), + SliverFillRemaining( + hasScrollBody: false, + child: SizedBox( + height: MediaQuery.of(context).viewPadding.bottom), + ), ], ), ), diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index d616f9fe..5182d55f 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -129,8 +129,10 @@ class _PatchesSelectorViewState extends State { ), ) : Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0) - .copyWith(bottom: 80), + padding: + const EdgeInsets.symmetric(horizontal: 12.0).copyWith( + bottom: MediaQuery.of(context).viewPadding.bottom + 8.0, + ), child: Column( children: [ Row( From 4150e2265cb4ec8be1108b950536d022e68275bf Mon Sep 17 00:00:00 2001 From: Hokora Yinphine <54823358+HokoraYinphineMPP@users.noreply.github.com> Date: Wed, 10 May 2023 03:23:02 -0700 Subject: [PATCH 2/6] fix: use correct version in update download dialog (#859) --- lib/ui/views/home/home_viewmodel.dart | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index caf77ffb..e7d9e808 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -39,13 +39,10 @@ class HomeViewModel extends BaseViewModel { bool showUpdatableApps = false; List patchedInstalledApps = []; List patchedUpdatableApps = []; - String _managerVersion = ''; + String? _latestManagerVersion = ''; Future initialize(BuildContext context) async { - _managerVersion = await AboutInfo.getInfo().then( - (value) => value.keys.contains('version') ? value['version']! : '', - ); - _managerVersion = await _managerAPI.getCurrentManagerVersion(); + _latestManagerVersion = await _managerAPI.getLatestManagerVersion(); await flutterLocalNotificationsPlugin.initialize( const InitializationSettings( android: AndroidInitializationSettings('ic_notification'), @@ -115,7 +112,6 @@ class HomeViewModel extends BaseViewModel { } Future hasManagerUpdates() async { - final String? latestVersion = await _managerAPI.getLatestManagerVersion(); String currentVersion = await _managerAPI.getCurrentManagerVersion(); // add v to current version @@ -123,7 +119,7 @@ class HomeViewModel extends BaseViewModel { currentVersion = 'v$currentVersion'; } - if (latestVersion != currentVersion) { + if (_latestManagerVersion != currentVersion) { return true; } return false; @@ -194,7 +190,7 @@ class HomeViewModel extends BaseViewModel { ), const SizedBox(width: 8.0), Text( - 'v$_managerVersion', + 'v$_latestManagerVersion', style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, From 359f0526082857c63bc4caa8a31836a7e8be25b8 Mon Sep 17 00:00:00 2001 From: Sebok Andras Date: Fri, 12 May 2023 18:36:47 +0200 Subject: [PATCH 3/6] fix: export keystore not working in some conditions (#862) --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 16abba54..62e6d0e1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,8 @@ dependencies: cross_connectivity: ^3.0.5 cr_file_saver: git: - url: https://github.com/dhruvanbhalara/cr_file_saver.git - ref: a08326ecb48f581b4b09e2e2665d31ed1704c7af + url: https://github.com/dhruvanbhalara/cr_file_saver + ref: "fix/incorrect_file_name" device_apps: git: url: https://github.com/ponces/flutter_plugin_device_apps From 8fc86dbe021b9497fa336b937b3200a41b3057a3 Mon Sep 17 00:00:00 2001 From: Ushie Date: Sat, 13 May 2023 04:54:35 +0300 Subject: [PATCH 4/6] feat: allow selecting installed if app is full apk --- assets/i18n/en_US.json | 2 +- .../views/app_selector/app_selector_view.dart | 11 +-------- .../app_selector/app_selector_viewmodel.dart | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 8274a347..03b28c54 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -78,7 +78,7 @@ "errorMessage": "Unable to use selected application", "downloadToast": "Download function is not available yet", "featureNotAvailable": "Feature not implemented", - "featureNotAvailableText": "This feature has not been added yet for non-root. You'll need to select APK files from storage for now." + "featureNotAvailableText": "This application is a split APK and cannot be selected. Unfortunately, this feature is only available for rooted users at the moment. However, you can still install the application by selecting its APK files from your device's storage instead" }, "patchesSelectorView": { "viewTitle": "Select patches", diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 620c7b68..840e6619 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -111,16 +111,7 @@ class _AppSelectorViewState extends State { model.getSuggestedVersion( app.packageName, ), - onTap: () { - model.isRooted - ? model.selectApp(app).then( - (_) => Navigator.of(context) - .pop(), - ) - : model.showSelectFromStorageDialog( - context, - ); - }, + onTap: () => model.canSelectInstalled(context, app.packageName), ), ) .toList(), diff --git a/lib/ui/views/app_selector/app_selector_viewmodel.dart b/lib/ui/views/app_selector/app_selector_viewmodel.dart index d747e1b8..9eacb93c 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -65,6 +65,14 @@ class AppSelectorViewModel extends BaseViewModel { return _patcherAPI.getSuggestedVersion(packageName); } + Future checkSplitApk(String packageName) async { + final app = await DeviceApps.getApp(packageName); + if (app != null) { + return app.isSplit; + } + return true; + } + Future selectApp(ApplicationWithIcon application) async { locator().selectedApp = PatchedApplication( name: application.appName, @@ -78,6 +86,22 @@ class AppSelectorViewModel extends BaseViewModel { locator().loadLastSelectedPatches(); } + Future canSelectInstalled( + BuildContext context, + String packageName, + ) async { + final app = + await DeviceApps.getApp(packageName, true) as ApplicationWithIcon?; + if (app != null) { + if (await checkSplitApk(packageName) && !isRooted) { + return showSelectFromStorageDialog(context); + } else if (!await checkSplitApk(packageName) || isRooted) { + selectApp(app); + Navigator.pop(context); + } + } + } + Future showSelectFromStorageDialog(BuildContext context) async { return showDialog( context: context, From 8ccb75fc8d3198ba43abdeac0a067843577db8aa Mon Sep 17 00:00:00 2001 From: kitadai31 <90122968+kitadai31@users.noreply.github.com> Date: Wed, 17 May 2023 15:38:03 +0900 Subject: [PATCH 5/6] chore: remove coreLibraryDesugaring --- android/app/build.gradle | 9 --------- 1 file changed, 9 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 40653d79..f64c7eb7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,7 +30,6 @@ android { ndkVersion flutter.ndkVersion compileOptions { - coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } @@ -49,7 +48,6 @@ android { targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - multiDexEnabled true } buildTypes { @@ -79,11 +77,4 @@ dependencies { implementation("org.bouncycastle:bcpkix-jdk15on:1.70") implementation("com.android.tools.build:apksig:7.2.2") - // Core libraries - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - - // Window - implementation 'androidx.window:window:1.0.0' - implementation 'androidx.window:window-java:1.0.0' - } From a27dc6ad1cb60cd3aef9b0836237db9ac5dff19a Mon Sep 17 00:00:00 2001 From: Sangam Shrestha <2shrestha22@gmail.com> Date: Sun, 14 May 2023 16:30:35 +0545 Subject: [PATCH 6/6] feat: migrate to dart3 --- .gitignore | 5 ++++- analysis_options.yaml | 1 - android/build.gradle | 2 +- lib/services/github_api.dart | 2 +- lib/services/revanced_api.dart | 1 - lib/ui/views/app_selector/app_selector_view.dart | 2 +- lib/ui/views/patches_selector/patches_selector_view.dart | 2 +- lib/ui/widgets/homeView/latest_commit_card.dart | 8 ++++---- lib/ui/widgets/settingsView/social_media_widget.dart | 4 ++-- pubspec.yaml | 7 +++---- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index eee69987..2f302002 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,7 @@ app.*.map.json .firebase # Dependency directories -node_modules/ \ No newline at end of file +node_modules/ + +# FVM +.fvm \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index 54664176..da2ffc37 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -98,7 +98,6 @@ linter: - prefer_const_declarations - prefer_const_literals_to_create_immutables - prefer_contains - - prefer_equal_for_default_values - prefer_final_fields - prefer_final_in_for_each - prefer_final_locals diff --git a/android/build.gradle b/android/build.gradle index 0910f549..5086ec38 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -31,6 +31,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index b453e645..ed0bec52 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -90,7 +90,7 @@ class GithubAPI { final List commits = response.data; return commits .map( - (commit) => (commit['commit']['message']).split('\n')[0] + + (commit) => commit['commit']['message'].split('\n')[0] + ' - ' + commit['commit']['author']['name'] + '\n' as String, diff --git a/lib/services/revanced_api.dart b/lib/services/revanced_api.dart index 1c6d3f9e..11fa084c 100644 --- a/lib/services/revanced_api.dart +++ b/lib/services/revanced_api.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:developer'; import 'dart:io'; import 'package:collection/collection.dart'; diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 487f08a8..320d6712 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' hide SearchBar; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/appSelectorView/app_skeleton_loader.dart'; diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index d616f9fe..a5d54304 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' hide SearchBar; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_item.dart'; diff --git a/lib/ui/widgets/homeView/latest_commit_card.dart b/lib/ui/widgets/homeView/latest_commit_card.dart index b1f506f2..e56b241f 100644 --- a/lib/ui/widgets/homeView/latest_commit_card.dart +++ b/lib/ui/widgets/homeView/latest_commit_card.dart @@ -33,8 +33,8 @@ class _LatestCommitCardState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: const [ + const Row( + children: [ Text('ReVanced Manager'), ], ), @@ -82,8 +82,8 @@ class _LatestCommitCardState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: const [ + const Row( + children: [ Text('ReVanced Patches'), ], ), diff --git a/lib/ui/widgets/settingsView/social_media_widget.dart b/lib/ui/widgets/settingsView/social_media_widget.dart index 9418b523..73a6a2ee 100644 --- a/lib/ui/widgets/settingsView/social_media_widget.dart +++ b/lib/ui/widgets/settingsView/social_media_widget.dart @@ -39,9 +39,9 @@ class SocialMediaWidget extends StatelessWidget { ), expanded: Padding( padding: padding ?? EdgeInsets.zero, - child: CustomCard( + child: const CustomCard( child: Column( - children: const [ + children: [ SocialMediaItem( icon: FaIcon(FontAwesomeIcons.github), title: Text('GitHub'), diff --git a/pubspec.yaml b/pubspec.yaml index 16abba54..b4385c8f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: 'none' version: 1.1.0+100100000 environment: - sdk: ">=2.17.5 <3.0.0" + sdk: '>=3.0.0 <4.0.0' dependencies: animations: ^2.0.7 @@ -36,7 +36,7 @@ dependencies: sdk: flutter flutter_background: ^1.2.0 flutter_cache_manager: ^3.3.0 - flutter_i18n: ^0.32.4 + flutter_i18n: ^0.33.0 flutter_local_notifications: ^13.0.0 flutter_localizations: sdk: flutter @@ -47,7 +47,7 @@ dependencies: google_fonts: ^4.0.3 http: ^0.13.5 injectable: ^2.1.1 - intl: ^0.17.0 + intl: ^0.18.0 json_annotation: ^4.8.0 logcat: git: @@ -74,7 +74,6 @@ dependencies: wakelock: ^0.6.2 flutter_dotenv: ^5.0.2 flutter_markdown: ^0.6.14 - pub_release: ^8.0.3 dio_cache_interceptor: ^3.4.0 dev_dependencies: