From 76c68baa1f782c96932edc17f7f3eda279a139fc Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Sat, 1 Jul 2023 12:50:21 +0700 Subject: [PATCH 01/15] build: update gradle to v7.6.2 --- android/gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 4f64c73f..76777308 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip -distributionSha256Sum=6147605a23b4eff6c334927a86ff3508cb5d6722cd624c97ded4c2e8640f1f87 +distributionSha256Sum=a01b6587e15fe7ed120a0ee299c25982a1eee045abd6a9dd5e216b2f628ef9ac +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 1875c4ee7357c8e5b3b42dd357e856f26791a596 Mon Sep 17 00:00:00 2001 From: Aabed Khan <39409020+TheAabedKhan@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:44:53 +0545 Subject: [PATCH 02/15] fix: update button being clickable when offline (#987) --- lib/ui/views/home/home_viewmodel.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index b05f0e4d..972a13c1 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -112,13 +112,14 @@ class HomeViewModel extends BaseViewModel { Future hasManagerUpdates() async { String currentVersion = await _managerAPI.getCurrentManagerVersion(); - _latestManagerVersion = await _managerAPI.getLatestManagerVersion(); - + // add v to current version if (!currentVersion.startsWith('v')) { currentVersion = 'v$currentVersion'; } - + + _latestManagerVersion = await _managerAPI.getLatestManagerVersion() ?? currentVersion; + if (_latestManagerVersion != currentVersion) { return true; } From 14f49e9d30ebd2f5e79f71efe52037d3e44f77b4 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 5 Jul 2023 15:43:40 +0200 Subject: [PATCH 03/15] docs: fix description for next page --- docs/1_installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/1_installation.md b/docs/1_installation.md index 45898582..b25e0758 100644 --- a/docs/1_installation.md +++ b/docs/1_installation.md @@ -9,6 +9,6 @@ In order to use ReVanced on your Android device, ReVanced Manager must be instal ## ⏭️ What's next -The next page will guide you through patching an app. +The next page will guide you through using ReVanced Manager. Continue: [🪛 Usage](2_usage.md) From c7b227529d0c25fad2544ae102c61283f4c0461d Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Fri, 7 Jul 2023 22:11:13 +0700 Subject: [PATCH 04/15] chore: disable unnecessary tooltip Remove tooltip in Navigation View, there's no impact to accessibility. Tested using: Android TalkBack --- lib/ui/views/navigation/navigation_view.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ui/views/navigation/navigation_view.dart b/lib/ui/views/navigation/navigation_view.dart index 2a78f933..d8fdd5c6 100644 --- a/lib/ui/views/navigation/navigation_view.dart +++ b/lib/ui/views/navigation/navigation_view.dart @@ -42,6 +42,7 @@ class NavigationView extends StatelessWidget { context, 'navigationView.dashboardTab', ), + tooltip: '', ), NavigationDestination( icon: model.isIndexSelected(1) @@ -51,6 +52,7 @@ class NavigationView extends StatelessWidget { context, 'navigationView.patcherTab', ), + tooltip: '', ), NavigationDestination( icon: model.isIndexSelected(2) @@ -60,6 +62,7 @@ class NavigationView extends StatelessWidget { context, 'navigationView.settingsTab', ), + tooltip: '', ), ], ), From 7c2c695d88296611dc4bee9baf6e6b43086586cc Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Fri, 7 Jul 2023 22:15:12 +0700 Subject: [PATCH 05/15] refactor: apply changes from analyser --- lib/ui/views/home/home_viewmodel.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index 972a13c1..bae78720 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -112,14 +112,15 @@ class HomeViewModel extends BaseViewModel { Future hasManagerUpdates() async { String currentVersion = await _managerAPI.getCurrentManagerVersion(); - + // add v to current version if (!currentVersion.startsWith('v')) { currentVersion = 'v$currentVersion'; } - - _latestManagerVersion = await _managerAPI.getLatestManagerVersion() ?? currentVersion; - + + _latestManagerVersion = + await _managerAPI.getLatestManagerVersion() ?? currentVersion; + if (_latestManagerVersion != currentVersion) { return true; } @@ -272,7 +273,8 @@ class HomeViewModel extends BaseViewModel { label: I18nText('updateButton'), onPressed: () async { await AppInstaller.installApk( - downloadedApk!.path,); + downloadedApk!.path, + ); }, ), ), From e83e13b6d4dcba69a08b1e7423b2182c80942afe Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Fri, 7 Jul 2023 22:21:22 +0700 Subject: [PATCH 06/15] refactor: fix more problem with analyser Missing trailing comma in app_selector_view --- lib/ui/views/app_selector/app_selector_view.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 42ff13e7..e3ab0c41 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -113,7 +113,9 @@ class _AppSelectorViewState extends State { ), installedVersion: app.versionName!, onTap: () => model.canSelectInstalled( - context, app.packageName), + context, + app.packageName, + ), ), ) .toList(), From 16318efb012f58b4deb2ecb4eb2860da698b2379 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Sat, 8 Jul 2023 10:45:13 +0700 Subject: [PATCH 07/15] refactor: seperate translation string by context --- assets/i18n/en_US.json | 88 +++++++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 0c61436f..b732f545 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -17,23 +17,33 @@ "homeView": { "refreshSuccess": "Refreshed successfully", "widgetTitle": "Dashboard", + "updatesSubtitle": "Updates", "patchedSubtitle": "Patched applications", + "updatesAvailable": "Updates available", "noUpdates": "No updates available", + "WIP": "Work in progress...", + "noInstallations": "No patched applications installed", "installed": "Installed", "installUpdate": "Continue to install the update?", + "updateDialogTitle": "Update Manager", "updateChangelogTitle": "Changelog", + "notificationTitle": "Update downloaded", "notificationText": "Tap to install the update", + "downloadingMessage": "Downloading update...", "downloadedMessage": "Update downloaded!", + "installingMessage": "Installing update...", + "errorDownloadMessage": "Unable to download update", "errorInstallMessage": "Unable to install update", + "noConnection": "No internet connection", "updatesDisabled": "Updating a patched app is currently disabled. Repatch the app again." }, @@ -52,6 +62,7 @@ "patcherView": { "widgetTitle": "Patcher", "patchButton": "Patch", + "patchDialogText": "You have selected a resource patch and a split APK installation has been detected, so patching errors may occur.\nAre you sure you want to proceed?", "armv7WarningDialogText": "Patching on ARMv7 devices is not yet supported and might fail. Proceed anyways?", "splitApkWarningDialogText": "Patching a split APK is not yet supported and might fail. Proceed anyways?" @@ -60,8 +71,10 @@ "widgetTitle": "Select an application", "widgetTitleSelected": "Selected application", "widgetSubtitle": "No application selected", + "noAppsLabel": "No applications found", "notInstalled":"App not installed", + "currentVersion": "Current", "suggestedVersion": "Suggested", "allVersions": "All versions" @@ -69,6 +82,7 @@ "patchSelectorCard": { "widgetTitle": "Select patches", "widgetTitleSelected": "Selected patches", + "widgetSubtitle": "Select an application first", "widgetEmptySubtitle": "No patches selected" }, @@ -79,24 +93,33 @@ "appSelectorView": { "viewTitle": "Select an application", "searchBarHint": "Search applications", - "selectFromStorageButton": "Select from storage", + "storageButton": "Storage", + "selectFromStorageButton": "Select from storage", + "errorMessage": "Unable to use selected application", + "downloadToast": "Download function is not available yet", + "featureNotAvailable": "Feature not implemented", "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", "searchBarHint": "Search patches", + "doneButton": "Done", + "default": "Default", "defaultTooltip": "Select all default patches", + "none": "None", "noneTooltip": "Deselect all patches", + "loadPatchesSelection": "Load patches selection", "noSavedPatches": "No saved patches for the selected app.\nPress Done to save current selection.", "noPatchesFound": "No patches found for the selected app", + "selectAllPatchesWarningContent": "You are about to select all patches, that includes non-suggested patches and can cause unwanted behavior." }, "patchItem": { @@ -109,11 +132,14 @@ "installRootButton": "Install as Root", "openButton": "Open", "shareButton": "Share file", + "notificationTitle": "ReVanced Manager is patching", "notificationText": "Tap to return to the installer", + "shareApkMenuOption": "Share APK", "exportApkMenuOption": "Export APK", "shareLogMenuOption": "Share log", + "installErrorDialogTitle": "Error", "installErrorDialogText1": "Root install is not possible with the current patches selection.\nRepatch your app or choose non-root install.", "installErrorDialogText2": "Non-root install is not possible with the current patches selection.\nRepatch your app or choose root install if you have your device rooted.", @@ -122,74 +148,94 @@ }, "settingsView": { "widgetTitle": "Settings", + "appearanceSectionTitle": "Appearance", "teamSectionTitle": "Team", "infoSectionTitle": "Info", "advancedSectionTitle": "Advanced", + "exportSectionTitle": "Import & export", "logsSectionTitle": "Logs", + "darkThemeLabel": "Dark mode", "darkThemeHint": "Welcome to the dark side", + "dynamicThemeLabel": "Material You", "dynamicThemeHint": "Enjoy an experience closer to your device", + "languageLabel": "Language", "englishOption": "English", + "sourcesLabel": "Sources", "sourcesLabelHint": "Configure your custom sources", - "hostRepositoryLabel": "Repository API", - "orgPatchesLabel": "Patches organization", - "sourcesPatchesLabel": "Patches source", - "orgIntegrationsLabel": "Integrations organization", "sourcesIntegrationsLabel": "Integrations source", "sourcesResetDialogTitle": "Reset", "sourcesResetDialogText": "Are you sure you want to reset custom sources to their default values?", "apiURLResetDialogText": "Are you sure you want to reset API URL to its default value?", - "contributorsLabel": "Contributors", - "contributorsHint": "A list of contributors of ReVanced", - "logsLabel": "Logs", - "logsHint": "Share Manager's logs", + "apiURLLabel": "API URL", "apiURLHint": "Configure your custom API URL", "selectApiURL": "API URL", + "hostRepositoryLabel": "Repository API", + "orgPatchesLabel": "Patches organization", + "sourcesPatchesLabel": "Patches source", + "orgIntegrationsLabel": "Integrations organization", + + "contributorsLabel": "Contributors", + "contributorsHint": "A list of contributors of ReVanced", + + "logsLabel": "Logs", + "logsHint": "Share Manager's logs", + "experimentalUniversalPatchesLabel": "Experimental universal patches support", "experimentalUniversalPatchesHint": "Display all applications to use with universal patches, loading list of apps may be slower", "experimentalPatchesLabel": "Experimental patches support", "experimentalPatchesHint": "Enable usage of unsupported patches in any app version", "enabledExperimentalPatches": "Experimental patches support enabled", - "exportSectionTitle": "Import & export", + "aboutLabel": "About", "snackbarMessage": "Copied to clipboard", "restartAppForChanges": "Restart the app to apply changes", - "deleteKeystoreLabel": "Delete keystore", - "deleteKeystoreHint": "Delete the keystore used to sign the app", - "deleteKeystoreDialogText": "Are you sure you want to delete the keystore used to sign patched applications?", - "deletedKeystore": "Keystore deleted", + "deleteTempDirLabel": "Delete temporary files", "deleteTempDirHint": "Delete unused temporary files", "deletedTempDir": "Temporary files deleted", + "exportPatchesLabel": "Export patches selection", "exportPatchesHint": "Export patches selection to a JSON file", "exportedPatches": "Patches selection exported", "noExportFileFound": "No patches selection to export", + "importPatchesLabel": "Import patches selection", "importPatchesHint": "Import patches selection from a JSON file", "importedPatches": "Patches selection imported", + "resetStoredPatchesLabel": "Reset patches", "resetStoredPatchesHint": "Reset the stored patches selection", "resetStoredPatches": "Patches selection has been reset", - "jsonSelectorErrorMessage": "Unable to use selected JSON file", + "deleteLogsLabel": "Delete logs", "deleteLogsHint": "Delete collected manager logs", "deletedLogs": "Logs deleted", + + "deleteKeystoreLabel": "Delete keystore", + "deleteKeystoreHint": "Delete the keystore used to sign the app", + "deleteKeystoreDialogText": "Are you sure you want to delete the keystore used to sign patched applications?", + "deletedKeystore": "Keystore deleted", + "exportKeystoreLabel": "Export keystore", "exportKeystoreHint": "Export keystore used to sign apps", "exportedKeystore": "Keystore exported", "noKeystoreExportFileFound": "No keystore to export", + "importKeystoreLabel": "Import keystore", "importKeystoreHint": "Import keystore used to sign apps", "importedKeystore": "Keystore imported", - "keystoreSelectorErrorMessage": "Unable to use selected KEYSTORE file", + "selectKeystorePassword": "Keystore Password", - "selectKeystorePasswordHint": "Select keystore password used to sign the apk" + "selectKeystorePasswordHint": "Select keystore password used to sign the apk", + + "jsonSelectorErrorMessage": "Unable to use selected JSON file", + "keystoreSelectorErrorMessage": "Unable to use selected KEYSTORE file" }, "appInfoView": { "widgetTitle": "App info", @@ -197,18 +243,22 @@ "uninstallButton": "Uninstall", "patchButton": "Patch", "unpatchButton": "Unpatch", - "unpatchDialogText": "Are you sure you want to unpatch this app?", "rootDialogTitle": "Error", + + "unpatchDialogText": "Are you sure you want to unpatch this app?", "rootDialogText": "App was installed with superuser permissions, but currently ReVanced Manager has no permissions.\nPlease grant superuser permissions first.", + "packageNameLabel": "Package name", "originalPackageNameLabel": "Original package name", "installTypeLabel": "Installation type", "rootTypeLabel": "Root", "nonRootTypeLabel": "Non-root", "patchedDateLabel": "Patched date", - "patchedDateHint": "{date} at {time}", "appliedPatchesLabel": "Applied patches", + + "patchedDateHint": "{date} at {time}", "appliedPatchesHint": "{quantity} applied patches", + "updateNotImplemented": "This feature has not been implemented yet" }, "contributorsView": { From 9e93177afd0b7b2e1612da9bf0cf69c949450b50 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Sat, 8 Jul 2023 11:01:10 +0700 Subject: [PATCH 08/15] feat: show warning dialog when resetting stored patches This prevent user from accidentally resetting stored patches by showing them warning dialog. --- assets/i18n/en_US.json | 3 +- .../settingsView/settings_export_section.dart | 30 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index b732f545..13163555 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -17,7 +17,7 @@ "homeView": { "refreshSuccess": "Refreshed successfully", "widgetTitle": "Dashboard", - + "updatesSubtitle": "Updates", "patchedSubtitle": "Patched applications", @@ -211,6 +211,7 @@ "resetStoredPatchesLabel": "Reset patches", "resetStoredPatchesHint": "Reset the stored patches selection", + "resetStoredPatchesDialogText": "Are you sure you want to reset the stored patches selection?", "resetStoredPatches": "Patches selection has been reset", "deleteLogsLabel": "Delete logs", diff --git a/lib/ui/widgets/settingsView/settings_export_section.dart b/lib/ui/widgets/settingsView/settings_export_section.dart index 0702f065..b2d65c95 100644 --- a/lib/ui/widgets/settingsView/settings_export_section.dart +++ b/lib/ui/widgets/settingsView/settings_export_section.dart @@ -3,6 +3,7 @@ import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_keystore_password.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; final _settingsViewModel = SettingsViewModel(); @@ -91,9 +92,36 @@ class SExportSection extends StatelessWidget { ), ), subtitle: I18nText('settingsView.resetStoredPatchesHint'), - onTap: () => _settingsViewModel.resetSelectedPatches(), + onTap: () => _showResetStoredPatchesDialog(context), ), ], ); } + + Future _showResetStoredPatchesDialog(context) { + return showDialog( + context: context, + builder: (context) => AlertDialog( + title: I18nText('warning'), + backgroundColor: Theme.of(context).colorScheme.secondaryContainer, + content: I18nText( + 'settingsView.resetStoredPatchesDialogText', + ), + actions: [ + CustomMaterialButton( + isFilled: false, + label: I18nText('noButton'), + onPressed: () => Navigator.of(context).pop(), + ), + CustomMaterialButton( + label: I18nText('yesButton'), + onPressed: () => { + Navigator.of(context).pop(), + _settingsViewModel.resetSelectedPatches() + }, + ) + ], + ), + ); + } } From da6cf585c09b73937390f3edbf14bb4046915aa6 Mon Sep 17 00:00:00 2001 From: Aabed Khan Date: Sat, 8 Jul 2023 22:26:31 +0545 Subject: [PATCH 09/15] fix: app crash after custom source --- lib/services/github_api.dart | 18 ++++++++++++++++-- lib/ui/views/home/home_viewmodel.dart | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index 973b9d09..f3a8af40 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -1,6 +1,5 @@ import 'dart:convert'; import 'dart:io'; - import 'package:collection/collection.dart'; import 'package:dio/dio.dart'; import 'package:dio_cache_interceptor/dio_cache_interceptor.dart'; @@ -10,7 +9,6 @@ import 'package:injectable/injectable.dart'; import 'package:revanced_manager/models/patch.dart'; import 'package:revanced_manager/services/manager_api.dart'; - @lazySingleton class GithubAPI { late Dio _dio = Dio(); @@ -61,6 +59,22 @@ class GithubAPI { Future?> getLatestRelease( String repoName, ) async { + try { + final response = await _dio.get( + '/repos/$repoName/releases', + ); + return response.data[0]; + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } + return null; + } + } + + Future?> getLatestManagerRelease( + String repoName, + ) async { try { final response = await _dio.get( '/repos/$repoName/releases', diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index b05f0e4d..36460473 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -345,7 +345,7 @@ class HomeViewModel extends BaseViewModel { } Future?> getLatestManagerRelease() { - return _githubAPI.getLatestRelease(_managerAPI.defaultManagerRepo); + return _githubAPI.getLatestManagerRelease(_managerAPI.defaultManagerRepo); } Future getLatestPatcherReleaseTime() { From ecb54d8e44d1cc4e2b030aeec9c0c00e555beade Mon Sep 17 00:00:00 2001 From: KobeW50 <84587632+KobeW50@users.noreply.github.com> Date: Sun, 9 Jul 2023 17:15:20 -0400 Subject: [PATCH 10/15] docs: improve clarity of speech in issue template (#1005) Co-authored-by: oSumAtrIX --- .github/ISSUE_TEMPLATE/bug-issue.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index bf785da0..6c453787 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -29,7 +29,7 @@ body: - type: textarea attributes: label: Steps to reproduce - description: Add the steps to reproduce this bug including your environment. + description: Add the steps to reproduce this bug, including your environment. placeholder: Step 1. Download some files. Step 2. ... validations: required: true @@ -74,20 +74,20 @@ body: - type: textarea attributes: label: Device logs (exported using Manager settings). - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so there is no need for backticks. render: shell validations: required: true - type: textarea attributes: - label: Installer logs (exported using Installer menu option) [unneeded if issue is not during patching]. - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + label: Installer logs (exported using Installer menu option) [unneeded if the issue is not during patching]. + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so there is no need for backticks. render: shell validations: required: false - type: textarea attributes: - label: Screenshots or videos + label: Screenshots or video description: Add screenshots or videos that show the bug here. placeholder: Drag and drop the screenshots/videos into this box. validations: @@ -105,16 +105,16 @@ body: validations: required: false - type: checkboxes - id: acknowledgements + id: acknowledgments attributes: label: Acknowledgements description: Your issue will be closed if you haven't done these steps. options: - - label: I have searched the existing issues and this is a new and no duplicate or related to another open issue. + - label: I have searched the existing issues; this is new and no duplicate or related to another open issue. required: true - label: I have written a short but informative title. required: true - - label: I filled out all of the requested information in this issue properly. + - label: I properly filled out all of the requested information in this issue. required: true - - label: The issue is related solely to the ReVanced Manager and not related to patching errors or patches + - label: The issue is solely related to ReVanced Manager and not caused by patches. required: true From 98288575708d88265b9a2ca6a0c722eabaa0c53c Mon Sep 17 00:00:00 2001 From: Aabed Khan <39409020+TheAabedKhan@users.noreply.github.com> Date: Mon, 10 Jul 2023 12:16:51 +0545 Subject: [PATCH 11/15] fix: fixed typo --- .github/ISSUE_TEMPLATE/bug-issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index 6c453787..87c8e4fb 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -107,7 +107,7 @@ body: - type: checkboxes id: acknowledgments attributes: - label: Acknowledgements + label: Acknowledgments description: Your issue will be closed if you haven't done these steps. options: - label: I have searched the existing issues; this is new and no duplicate or related to another open issue. From b272988929095fca1fdfc57c7cca8103b18f6b09 Mon Sep 17 00:00:00 2001 From: Pun Date: Mon, 10 Jul 2023 18:43:07 +0700 Subject: [PATCH 12/15] build: always compile with the latest SDK supported by Flutter `targetSdkVersion` is still the same, we want to test the application first before bumping up to latest. --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 78ce0298..a752c0e1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion compileOptions { From 6a45db8a38b46227594705782b4bf07d8d62ad0e Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Mon, 10 Jul 2023 19:36:50 +0700 Subject: [PATCH 13/15] refactor: improve code readability according to formatter --- lib/services/github_api.dart | 19 ++++++++++++----- lib/services/revanced_api.dart | 3 ++- lib/ui/views/settings/settings_viewmodel.dart | 17 ++++++--------- .../appSelectorView/app_skeleton_loader.dart | 9 +++++--- .../appSelectorView/installed_app_item.dart | 7 ++++--- .../not_installed_app_item.dart | 8 +++---- .../homeView/update_confirmation_dialog.dart | 21 +++++++------------ .../patchesSelectorView/patch_item.dart | 13 +++++++----- .../settings_experimental_patches.dart | 6 ++++-- 9 files changed, 55 insertions(+), 48 deletions(-) diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index f3a8af40..bdf5a105 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -73,20 +73,29 @@ class GithubAPI { } Future?> getLatestManagerRelease( - String repoName, - ) async { + String repoName, + ) async { try { final response = await _dio.get( '/repos/$repoName/releases', ); final Map releases = response.data[0]; int updates = 0; - final String currentVersion = await ManagerAPI().getCurrentManagerVersion(); + final String currentVersion = + await ManagerAPI().getCurrentManagerVersion(); while (response.data[updates]['tag_name'] != 'v$currentVersion') { updates++; } - for(int i = 1; i < updates; i++){ - releases.update('body', (value) => value + '\n' + '# '+ response.data[i]['tag_name']+'\n' + response.data[i]['body']); + for (int i = 1; i < updates; i++) { + releases.update( + 'body', + (value) => + value + + '\n' + + '# ' + + response.data[i]['tag_name'] + + '\n' + + response.data[i]['body']); } return releases; } on Exception catch (e) { diff --git a/lib/services/revanced_api.dart b/lib/services/revanced_api.dart index a8bec19c..bc3562ba 100644 --- a/lib/services/revanced_api.dart +++ b/lib/services/revanced_api.dart @@ -140,7 +140,8 @@ class RevancedAPI { return null; } - StreamController managerUpdateProgress = StreamController.broadcast(); + StreamController managerUpdateProgress = + StreamController.broadcast(); void updateManagerDownloadProgress(int progress) { managerUpdateProgress.add(progress.toDouble()); diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 82c09ec1..3840dafb 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -17,8 +17,7 @@ import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; class SettingsViewModel extends BaseViewModel { - final NavigationService _navigationService = - locator(); + final NavigationService _navigationService = locator(); final ManagerAPI _managerAPI = locator(); final Toast _toast = locator(); @@ -63,11 +62,8 @@ class SettingsViewModel extends BaseViewModel { try { final File outFile = File(_managerAPI.storedPatchesFile); if (outFile.existsSync()) { - final String dateTime = DateTime.now() - .toString() - .replaceAll(' ', '_') - .split('.') - .first; + final String dateTime = + DateTime.now().toString().replaceAll(' ', '_').split('.').first; await CRFileSaver.saveFileWithDialog( SaveFileDialogParams( sourceFilePath: outFile.path, @@ -87,8 +83,7 @@ class SettingsViewModel extends BaseViewModel { Future importPatches() async { try { - final FilePickerResult? result = - await FilePicker.platform.pickFiles( + final FilePickerResult? result = await FilePicker.platform.pickFiles( type: FileType.custom, allowedExtensions: ['json'], ); @@ -109,7 +104,7 @@ class SettingsViewModel extends BaseViewModel { } } - Future exportKeystore() async { + Future exportKeystore() async { try { final File outFile = File(_managerAPI.keystoreFile); if (outFile.existsSync()) { @@ -138,7 +133,7 @@ class SettingsViewModel extends BaseViewModel { if (result != null && result.files.single.path != null) { final File inFile = File(result.files.single.path!); inFile.copySync(_managerAPI.keystoreFile); - + _toast.showBottom('settingsView.importedKeystore'); } } on Exception catch (e) { diff --git a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart index c1231b59..51c51b72 100644 --- a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart +++ b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart @@ -34,7 +34,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 20, width: screenWidth * 0.4, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), @@ -45,7 +46,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 15, width: screenWidth * 0.6, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), @@ -56,7 +58,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 15, width: screenWidth * 0.5, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index fc1a97e1..5d811427 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -66,7 +66,7 @@ class _InstalledAppItemState extends State { context, 'installed', translationParams: { - 'version':'v${widget.installedVersion}' + 'version': 'v${widget.installedVersion}' }, ), ), @@ -75,8 +75,9 @@ class _InstalledAppItemState extends State { I18nText( 'suggested', translationParams: { - 'version' : widget.suggestedVersion.isEmpty - ? FlutterI18n.translate(context, 'appSelectorCard.allVersions') + 'version': widget.suggestedVersion.isEmpty + ? FlutterI18n.translate( + context, 'appSelectorCard.allVersions') : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart index fa94eb2b..c0013a0d 100644 --- a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart @@ -60,8 +60,7 @@ class _NotInstalledAppItem extends State { child: Text( '', style: TextStyle( - color: - Theme.of(context).textTheme.titleLarge!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -70,8 +69,9 @@ class _NotInstalledAppItem extends State { I18nText( 'suggested', translationParams: { - 'version' : widget.suggestedVersion.isEmpty - ? FlutterI18n.translate(context, 'appSelectorCard.allVersions') + 'version': widget.suggestedVersion.isEmpty + ? FlutterI18n.translate( + context, 'appSelectorCard.allVersions') : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/homeView/update_confirmation_dialog.dart b/lib/ui/widgets/homeView/update_confirmation_dialog.dart index 108c5d78..16a1f1be 100644 --- a/lib/ui/widgets/homeView/update_confirmation_dialog.dart +++ b/lib/ui/widgets/homeView/update_confirmation_dialog.dart @@ -45,8 +45,7 @@ class UpdateConfirmationDialog extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ I18nText( 'homeView.updateDialogTitle', @@ -63,14 +62,12 @@ class UpdateConfirmationDialog extends StatelessWidget { children: [ Icon( Icons.new_releases_outlined, - color: Theme.of(context) - .colorScheme - .secondary, + color: + Theme.of(context).colorScheme.secondary, ), const SizedBox(width: 8.0), Text( - snapshot.data!['tag_name'] ?? - 'Unknown', + snapshot.data!['tag_name'] ?? 'Unknown', style: TextStyle( fontSize: 20, fontWeight: FontWeight.w500, @@ -96,8 +93,7 @@ class UpdateConfirmationDialog extends StatelessWidget { ), ), Padding( - padding: - const EdgeInsets.only(left: 24.0, bottom: 12.0), + padding: const EdgeInsets.only(left: 24.0, bottom: 12.0), child: I18nText( 'homeView.updateChangelogTitle', child: Text( @@ -113,12 +109,9 @@ class UpdateConfirmationDialog extends StatelessWidget { ), ), Container( - margin: - const EdgeInsets.symmetric(horizontal: 24.0), + margin: const EdgeInsets.symmetric(horizontal: 24.0), decoration: BoxDecoration( - color: Theme.of(context) - .colorScheme - .secondaryContainer, + color: Theme.of(context).colorScheme.secondaryContainer, borderRadius: BorderRadius.circular(12.0), ), child: Markdown( diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index 267fb1c3..d9173d55 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -42,7 +42,9 @@ class PatchItem extends StatefulWidget { class _PatchItemState extends State { @override Widget build(BuildContext context) { - widget.isSelected = widget.isSelected && (!widget.isUnsupported || widget._managerAPI.areExperimentalPatchesEnabled()); + widget.isSelected = widget.isSelected && + (!widget.isUnsupported || + widget._managerAPI.areExperimentalPatchesEnabled()); return Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), child: Opacity( @@ -117,7 +119,7 @@ class _PatchItemState extends State { value: widget.isSelected, activeColor: Theme.of(context).colorScheme.primary, checkColor: - Theme.of(context).colorScheme.secondaryContainer, + Theme.of(context).colorScheme.secondaryContainer, side: BorderSide( width: 2.0, color: Theme.of(context).colorScheme.primary, @@ -128,14 +130,15 @@ class _PatchItemState extends State { !widget._managerAPI .areExperimentalPatchesEnabled()) { widget.isSelected = false; - widget.toast - .showBottom('patchItem.unsupportedPatchVersion'); + widget.toast.showBottom( + 'patchItem.unsupportedPatchVersion'); } else { widget.isSelected = newValue!; } if (widget.isUnsupported && widget.isSelected && - !selectedUnsupportedPatches.contains(widget.name)) { + !selectedUnsupportedPatches + .contains(widget.name)) { selectedUnsupportedPatches.add(widget.name); } }); diff --git a/lib/ui/widgets/settingsView/settings_experimental_patches.dart b/lib/ui/widgets/settingsView/settings_experimental_patches.dart index 79f5e7fe..1b2e2542 100644 --- a/lib/ui/widgets/settingsView/settings_experimental_patches.dart +++ b/lib/ui/widgets/settingsView/settings_experimental_patches.dart @@ -34,9 +34,11 @@ class _SExperimentalPatchesState extends State { setState(() { _settingsViewModel.useExperimentalPatches(value); }); - if(!value) { + if (!value) { for (final patch in selectedUnsupportedPatches) { - PatchesSelectorViewModel().selectedPatches.removeWhere((element) => patch == element.name); + PatchesSelectorViewModel() + .selectedPatches + .removeWhere((element) => patch == element.name); } selectedUnsupportedPatches.clear(); } From 567b1a3aceb1a71a8d8fa1340ee4ce7c798929ab Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Mon, 10 Jul 2023 19:45:50 +0700 Subject: [PATCH 14/15] refactor: improve code readability according to linter --- lib/services/github_api.dart | 17 +++++++++-------- .../appSelectorView/installed_app_item.dart | 4 +++- .../appSelectorView/not_installed_app_item.dart | 4 +++- .../widgets/patchesSelectorView/patch_item.dart | 3 ++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index bdf5a105..62020328 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -88,14 +88,15 @@ class GithubAPI { } for (int i = 1; i < updates; i++) { releases.update( - 'body', - (value) => - value + - '\n' + - '# ' + - response.data[i]['tag_name'] + - '\n' + - response.data[i]['body']); + 'body', + (value) => + value + + '\n' + + '# ' + + response.data[i]['tag_name'] + + '\n' + + response.data[i]['body'], + ); } return releases; } on Exception catch (e) { diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index 5d811427..70a49a1a 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -77,7 +77,9 @@ class _InstalledAppItemState extends State { translationParams: { 'version': widget.suggestedVersion.isEmpty ? FlutterI18n.translate( - context, 'appSelectorCard.allVersions') + context, + 'appSelectorCard.allVersions', + ) : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart index c0013a0d..e932908b 100644 --- a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart @@ -71,7 +71,9 @@ class _NotInstalledAppItem extends State { translationParams: { 'version': widget.suggestedVersion.isEmpty ? FlutterI18n.translate( - context, 'appSelectorCard.allVersions') + context, + 'appSelectorCard.allVersions', + ) : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index d9173d55..294ba3ec 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -131,7 +131,8 @@ class _PatchItemState extends State { .areExperimentalPatchesEnabled()) { widget.isSelected = false; widget.toast.showBottom( - 'patchItem.unsupportedPatchVersion'); + 'patchItem.unsupportedPatchVersion', + ); } else { widget.isSelected = newValue!; } From 490a7a58fcd08ea8ae2d3b20b85743e8c7838e83 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Mon, 10 Jul 2023 20:40:40 +0700 Subject: [PATCH 15/15] build: update app version to `v1.3.9` ReVanced Manager, 1.3.9 (10030009) See PR #996 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index deee0456..a831f51b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager publish_to: 'none' -version: 1.3.8+100300008 +version: 1.3.9+100300009 environment: sdk: '>=3.0.0 <4.0.0'