From 8e2cfbddc5f1a46279d5f4310837b55d79a41b26 Mon Sep 17 00:00:00 2001 From: BenjaminHalko Date: Sun, 27 Aug 2023 14:05:39 -0700 Subject: [PATCH 1/9] fix: ignore the root .gradle folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2f302002..aa4fd514 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ unlinked.ds unlinked_spec.ds # Android related +.gradle/ **/android/**/gradle-wrapper.jar **/android/.gradle **/android/captures/ From 42e41c399f36b751fb17ed049147b66449526f98 Mon Sep 17 00:00:00 2001 From: Ushie Date: Mon, 28 Aug 2023 19:05:30 +0300 Subject: [PATCH 2/9] fix: hide install button on error --- lib/ui/views/installer/installer_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 508c449d..7e072b1f 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -21,7 +21,7 @@ class InstallerView extends StatelessWidget { bottom: false, child: Scaffold( floatingActionButton: Visibility( - visible: !model.isPatching, + visible: !model.isPatching && !model.hasErrors, child: FloatingActionButton.extended( label: I18nText('installerView.installButton'), icon: const Icon(Icons.file_download_outlined), From e49bcb2a69b70492066122b443907ef8bb72bd44 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 31 Aug 2023 12:36:29 +0200 Subject: [PATCH 3/9] chore: simplify issue templates (#1165) --- .github/ISSUE_TEMPLATE/bug-issue.yml | 97 +++++------------------- .github/ISSUE_TEMPLATE/feature-issue.yml | 40 ++++------ 2 files changed, 34 insertions(+), 103 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index 87c8e4fb..b90072cc 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -1,5 +1,5 @@ name: 🐞 Bug report -description: Report a very clearly broken issue. +description: Create a new bug report. title: 'bug: ' labels: [bug] body: @@ -8,53 +8,20 @@ body: value: | # ReVanced Manager bug report - Important to note that your issue may have already been reported before. Please check for existing issues [here](https://github.com/revanced/revanced-manager/labels/bug). - - - type: dropdown - attributes: - label: Type - options: - - Error while running the manager - - Error at runtime - - Cosmetic - - Other - validations: - required: true + Please check for existing issues [here](https://github.com/revanced/revanced-manager/labels/bug) before creating a new one. - type: textarea attributes: label: Bug description - description: How did you find the bug? Any additional details that might help? + description: + - Describe your bug in detail + - Add steps to reproduce the bug if possible (Step 1. Download some files. Step 2. ...) + - Add images and videos if possible + - List selected patches if applicable validations: required: true - type: textarea attributes: - label: Steps to reproduce - description: Add the steps to reproduce this bug, including your environment. - placeholder: Step 1. Download some files. Step 2. ... - validations: - required: true - - type: textarea - attributes: - label: Android version - description: Android version used. - validations: - required: true - - type: textarea - attributes: - label: Manager version - description: Manager version used. - validations: - required: true - - type: textarea - attributes: - label: Target package name - description: App you tried to patch. - validations: - required: true - - type: textarea - attributes: - label: Target package version. - description: Version of the app you tried to patch. + label: Version of ReVanced Manager and version & name of application you tried to patch validations: required: true - type: dropdown @@ -64,57 +31,31 @@ body: - Non-root - Root validations: - required: true + required: false - type: textarea attributes: - label: Patches selected. - description: Patches you selected for the app. - validations: - required: true - - 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 there is no need for backticks. + label: Device logs + description: Export logs in ReVanced Manager settings. render: shell validations: required: true - type: textarea attributes: - 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. + label: Patcher logs + description: Export logs in "Patcher" screen. render: shell validations: required: false - - type: textarea - attributes: - 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: - required: false - - type: textarea - attributes: - label: Solution - description: If applicable, add a possible solution. - validations: - required: false - - type: textarea - attributes: - label: Additional context - description: Add additional context here. - validations: - required: false - type: checkboxes - id: acknowledgments attributes: - label: Acknowledgments - description: Your issue will be closed if you haven't done these steps. + label: Acknowledgements + description: Your issue will be closed if you don't follow the checklist below! options: - - label: I have searched the existing issues; this is new and no duplicate or related to another open issue. + - label: This request is not a duplicate of an existing issue. required: true - - label: I have written a short but informative title. + - label: I have chosen an appropriate title. required: true - - label: I properly filled out all of the requested information in this issue. + - label: All requested information has been provided properly. required: true - - label: The issue is solely related to ReVanced Manager and not caused by patches. + - label: The issue is solely related to the ReVanced Manager required: true diff --git a/.github/ISSUE_TEMPLATE/feature-issue.yml b/.github/ISSUE_TEMPLATE/feature-issue.yml index 8df4eab2..fda70e87 100644 --- a/.github/ISSUE_TEMPLATE/feature-issue.yml +++ b/.github/ISSUE_TEMPLATE/feature-issue.yml @@ -1,52 +1,42 @@ name: ⭐ Feature request -description: Create a detailed feature request. +description: Create a new feature request. title: 'feat: <title>' labels: [feature-request] body: - - type: dropdown + - type: markdown attributes: - label: Type - options: - - Functionality - - Cosmetic - - Other - validations: - required: true + value: | + # ReVanced Manager feature request + + Please check for existing feature requests [here](https://github.com/revanced/revanced-manager/labels/bug) before creating a new one. - type: textarea attributes: - label: Issue - description: What is the current problem. Why does it require a feature request? - validations: - required: true - - type: textarea - attributes: - label: Feature - description: Describe your feature in detail. How does it solve the issue? + label: Feature description + description: Describe your feature in detail. validations: required: true - type: textarea attributes: label: Motivation - description: Why should your feature should be considered? + description: Explain why the lack of it is a problem. validations: required: true - type: textarea attributes: label: Additional context - description: Add additional context here. + description: In case there is something else you want to add. validations: required: false - type: checkboxes - id: acknowledgements attributes: label: Acknowledgements - description: Your issue will be closed if you haven't done these steps. + description: Your issue will be closed if you don't follow the checklist below! options: - - label: I have searched the existing issues and this is a new and no duplicate or related to another open issue. + - label: This request is not a duplicate of an existing issue. required: true - - label: I have written a short but informative title. + - label: I have chosen an appropriate title. required: true - - label: I filled out all of the requested information in this issue properly. + - label: All requested information has been provided properly. required: true - - label: The issue is related solely to the ReVanced Manager + - label: The issue is solely related to the ReVanced Manager required: true From 5733acb77a50652f0c33a962fb27e34e157eac29 Mon Sep 17 00:00:00 2001 From: Pun Butrach <pun.butrach@gmail.com> Date: Thu, 31 Aug 2023 20:35:24 +0700 Subject: [PATCH 4/9] build(dependency): update patcher to v14.2.2 https://github.com/ReVanced/revanced-patcher/releases/tag/v14.2.2 --- 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 13b99831..9f8312e7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -85,7 +85,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // ReVanced - implementation "app.revanced:revanced-patcher:14.2.1" + implementation "app.revanced:revanced-patcher:14.2.2" // Signing & aligning implementation("org.bouncycastle:bcpkix-jdk15on:1.70") From 8cb96f1e459f00cca03d46b5ef590e6c28a04718 Mon Sep 17 00:00:00 2001 From: aAbed <39409020+TheAabedKhan@users.noreply.github.com> Date: Thu, 31 Aug 2023 19:34:12 +0545 Subject: [PATCH 5/9] fix: permissions handling at first launch --- lib/ui/views/navigation/navigation_viewmodel.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/navigation/navigation_viewmodel.dart b/lib/ui/views/navigation/navigation_viewmodel.dart index 99110cc1..0967501d 100644 --- a/lib/ui/views/navigation/navigation_viewmodel.dart +++ b/lib/ui/views/navigation/navigation_viewmodel.dart @@ -18,13 +18,12 @@ class NavigationViewModel extends IndexTrackingViewModel { Future<void> initialize(BuildContext context) async { locator<Toast>().initialize(context); final SharedPreferences prefs = await SharedPreferences.getInstance(); - requestManageExternalStorage(); + await requestManageExternalStorage(); if (prefs.getBool('permissionsRequested') == null) { await Permission.storage.request(); - await Permission.manageExternalStorage.request(); await prefs.setBool('permissionsRequested', true); - RootAPI().hasRootPermissions().then( + await RootAPI().hasRootPermissions().then( (value) => Permission.requestInstallPackages.request().then( (value) => Permission.ignoreBatteryOptimizations.request(), ), From fc8a4fc5b6b543de511e84adf371a92a98f802f4 Mon Sep 17 00:00:00 2001 From: Jay Gajjar <gajjarjay52@gmail.com> Date: Sun, 3 Sep 2023 04:17:20 +0530 Subject: [PATCH 6/9] fix: `Don't use 'BuildContext's across async gaps.` (#1148) --- lib/ui/views/app_selector/app_selector_viewmodel.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ui/views/app_selector/app_selector_viewmodel.dart b/lib/ui/views/app_selector/app_selector_viewmodel.dart index 9075b2a3..e3691bba 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -90,10 +90,14 @@ class AppSelectorViewModel extends BaseViewModel { await DeviceApps.getApp(packageName, true) as ApplicationWithIcon?; if (app != null) { if (await checkSplitApk(packageName) && !isRooted) { - return showSelectFromStorageDialog(context); + if (context.mounted) { + return showSelectFromStorageDialog(context); + } } else if (!await checkSplitApk(packageName) || isRooted) { selectApp(app); - Navigator.pop(context); + if (context.mounted) { + Navigator.pop(context); + } } } } From c5fc54e7215a25d95af7c214d5118ed5553289f9 Mon Sep 17 00:00:00 2001 From: Pun Butrach <pun.butrach@gmail.com> Date: Sun, 3 Sep 2023 21:48:28 +0700 Subject: [PATCH 7/9] fix(installer): open the patched app after install (#1233) --- lib/ui/views/installer/installer_view.dart | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index 7e072b1f..7988d6fb 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -23,9 +23,21 @@ class InstallerView extends StatelessWidget { floatingActionButton: Visibility( visible: !model.isPatching && !model.hasErrors, child: FloatingActionButton.extended( - label: I18nText('installerView.installButton'), - icon: const Icon(Icons.file_download_outlined), - onPressed: () => model.installTypeDialog(context), + label: I18nText( + model.isInstalled + ? 'installerView.openButton' + : 'installerView.installButton', + ), + icon: model.isInstalled + ? const Icon(Icons.open_in_new) + : const Icon(Icons.file_download_outlined), + onPressed: model.isInstalled + ? () => { + model.openApp(), + model.cleanPatcher(), + Navigator.of(context).pop(), + } + : () => model.installTypeDialog(context), elevation: 0, ), ), From 9f64011b260ef6aba7a0f304317eca12d05fcdd9 Mon Sep 17 00:00:00 2001 From: Ushie <ushiekane@gmail.com> Date: Sun, 3 Sep 2023 20:54:42 +0300 Subject: [PATCH 8/9] fix: npe when patching on android 8 --- .../main/kotlin/app/revanced/manager/flutter/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt index 2c11653d..4bdb6cf0 100644 --- a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt +++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt @@ -24,7 +24,6 @@ import java.io.StringWriter import java.util.logging.LogRecord import java.util.logging.Logger - class MainActivity : FlutterActivity() { private val handler = Handler(Looper.getMainLooper()) private lateinit var installerChannel: MethodChannel @@ -182,7 +181,8 @@ class MainActivity : FlutterActivity() { updateProgress(0.1, "Loading patches...", "Loading patches") val patches = PatchBundleLoader.Dex( - File(patchBundleFilePath) + File(patchBundleFilePath), + optimizedDexDirectory = cacheDir ).filter { patch -> val isCompatible = patch.compatiblePackages?.any { it.name == patcher.context.packageMetadata.packageName From 8f54b226b4b5850e18bd2fa8892fd361415e58b7 Mon Sep 17 00:00:00 2001 From: Ushie <ushiekane@gmail.com> Date: Sun, 3 Sep 2023 21:14:09 +0300 Subject: [PATCH 9/9] refactor(patches-selector): improve universal patches header --- .../patches_selector_view.dart | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index 9039c2ce..2ad050d0 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -199,7 +199,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> { supportedPackageVersions: model.getSupportedVersions(patch), isUnsupported: !isPatchSupported(patch), - isChangeEnabled: _managerAPI.isPatchesChangeEnabled(), + isChangeEnabled: + _managerAPI.isPatchesChangeEnabled(), isNew: model.isPatchNew( patch, model.getAppInfo().packageName, @@ -221,8 +222,23 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> { padding: const EdgeInsets.symmetric( vertical: 10.0, ), - child: I18nText( - 'patchesSelectorView.universalPatches', + child: Container( + padding: const EdgeInsets.only( + top: 10.0, + bottom: 10.0, + left: 5.0, + ), + child: I18nText( + 'patchesSelectorView.universalPatches', + child: Text( + '', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .primary, + ), + ), + ), ), ), ...model.getQueriedPatches(_query).map((patch) { @@ -236,7 +252,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> { supportedPackageVersions: model.getSupportedVersions(patch), isUnsupported: !isPatchSupported(patch), - isChangeEnabled: _managerAPI.isPatchesChangeEnabled(), + isChangeEnabled: + _managerAPI.isPatchesChangeEnabled(), isNew: false, isSelected: model.isSelected(patch), onChanged: (value) => model.selectPatch(