Compare commits

...

15 Commits

Author SHA1 Message Date
2a6dc09a9b chore(release): 1.21.3-dev.1 [skip ci]
## [1.21.3-dev.1](https://github.com/ReVanced/revanced-manager/compare/v1.21.2...v1.21.3-dev.1) (2024-08-18)

### Bug Fixes

* Handle selecting files and folders for patch options correctly ([#2144](https://github.com/ReVanced/revanced-manager/issues/2144)) ([f1c2f41](f1c2f4146c))
2024-08-18 08:19:05 +00:00
f1c2f4146c fix: Handle selecting files and folders for patch options correctly (#2144) 2024-08-18 12:11:10 +04:00
2f46b3c84e chore(release): 1.21.2 [skip ci]
## [1.21.2](https://github.com/ReVanced/revanced-manager/compare/v1.21.1...v1.21.2) (2024-08-11)

### Bug Fixes

* Add haptics to save last APK switch ([#2133](https://github.com/ReVanced/revanced-manager/issues/2133)) ([e063b3d](e063b3d102))
* Don't crash installation when saving last APK is disabled ([#2128](https://github.com/ReVanced/revanced-manager/issues/2128)) ([427928e](427928e542))
* Don't crash when installing the last patched APK ([#2131](https://github.com/ReVanced/revanced-manager/issues/2131)) ([cb722f2](cb722f2634))
* Unable to scroll in the removed patches dialog ([#2113](https://github.com/ReVanced/revanced-manager/issues/2113)) ([295c5a7](295c5a74ea))
2024-08-11 16:08:42 +00:00
5f388abf95 chore: Merge branch dev to main (#2118) 2024-08-11 09:00:47 -07:00
7acdb8e660 chore(release): 1.21.2-dev.3 [skip ci]
## [1.21.2-dev.3](https://github.com/ReVanced/revanced-manager/compare/v1.21.2-dev.2...v1.21.2-dev.3) (2024-08-11)

### Bug Fixes

* Add haptics to save last APK switch ([#2133](https://github.com/ReVanced/revanced-manager/issues/2133)) ([e063b3d](e063b3d102))
* Don't crash when installing the last patched APK ([#2131](https://github.com/ReVanced/revanced-manager/issues/2131)) ([cb722f2](cb722f2634))
2024-08-11 15:59:16 +00:00
e063b3d102 fix: Add haptics to save last APK switch (#2133) 2024-08-11 08:51:18 -07:00
cb722f2634 fix: Don't crash when installing the last patched APK (#2131) 2024-08-11 08:51:02 -07:00
0499d2b08a chore(release): 1.21.2-dev.2 [skip ci]
## [1.21.2-dev.2](https://github.com/ReVanced/revanced-manager/compare/v1.21.2-dev.1...v1.21.2-dev.2) (2024-08-11)

### Bug Fixes

* Don't crash installation when saving last APK is disabled ([#2128](https://github.com/ReVanced/revanced-manager/issues/2128)) ([427928e](427928e542))
2024-08-11 15:39:29 +00:00
427928e542 fix: Don't crash installation when saving last APK is disabled (#2128) 2024-08-11 19:31:18 +04:00
ceb9d66f17 chore(release): 1.21.2-dev.1 [skip ci]
## [1.21.2-dev.1](https://github.com/ReVanced/revanced-manager/compare/v1.21.1...v1.21.2-dev.1) (2024-08-06)

### Bug Fixes

* Unable to scroll in the removed patches dialog ([#2113](https://github.com/ReVanced/revanced-manager/issues/2113)) ([295c5a7](295c5a74ea))
2024-08-06 00:55:10 +00:00
295c5a74ea fix: Unable to scroll in the removed patches dialog (#2113) 2024-08-06 03:46:01 +03:00
400df69528 chore(release): 1.21.1 [skip ci]
## [1.21.1](https://github.com/ReVanced/revanced-manager/compare/v1.21.0...v1.21.1) (2024-07-29)

### Bug Fixes

* Revert commit b26760b2 to fix file and folder selection ([e707e51](e707e51719))
2024-07-29 20:47:18 +00:00
5bc7b135d5 chore: Merge branch dev to main (#2092) 2024-07-30 02:22:56 +05:45
6dce353d78 chore(release): 1.21.1-dev.1 [skip ci]
## [1.21.1-dev.1](https://github.com/ReVanced/revanced-manager/compare/v1.21.0...v1.21.1-dev.1) (2024-07-29)

### Bug Fixes

* Revert commit b26760b2 to fix file and folder selection ([e707e51](e707e51719))
2024-07-29 20:12:35 +00:00
e707e51719 fix: Revert commit b26760b2 to fix file and folder selection 2024-07-29 22:00:25 +02:00
9 changed files with 106 additions and 116 deletions

View File

@ -8,6 +8,7 @@ import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
import 'package:revanced_manager/ui/views/contributors/contributors_view.dart'; import 'package:revanced_manager/ui/views/contributors/contributors_view.dart';
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
import 'package:revanced_manager/ui/views/installer/installer_view.dart'; import 'package:revanced_manager/ui/views/installer/installer_view.dart';
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart'; import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
import 'package:revanced_manager/ui/views/patch_options/patch_options_view.dart'; import 'package:revanced_manager/ui/views/patch_options/patch_options_view.dart';
@ -37,6 +38,7 @@ import 'package:stacked_services/stacked_services.dart';
LazySingleton(classType: HomeViewModel), LazySingleton(classType: HomeViewModel),
LazySingleton(classType: PatcherViewModel), LazySingleton(classType: PatcherViewModel),
LazySingleton(classType: PatchOptionsViewModel), LazySingleton(classType: PatchOptionsViewModel),
LazySingleton(classType: InstallerViewModel),
LazySingleton(classType: NavigationService), LazySingleton(classType: NavigationService),
LazySingleton(classType: ManagerAPI), LazySingleton(classType: ManagerAPI),
LazySingleton(classType: PatcherAPI), LazySingleton(classType: PatcherAPI),

View File

@ -60,10 +60,8 @@ class ManagerAPI {
if (sdkVersion == 0) { if (sdkVersion == 0) {
sdkVersion = await getSdkVersion(); sdkVersion = await getSdkVersion();
} }
isDynamicThemeAvailable = isDynamicThemeAvailable = sdkVersion >= 31; // ANDROID_12_SDK_VERSION = 31
sdkVersion >= 31; // ANDROID_12_SDK_VERSION = 31 isScopedStorageAvailable = sdkVersion >= 30; // ANDROID_11_SDK_VERSION = 30
isScopedStorageAvailable =
sdkVersion >= 30; // ANDROID_11_SDK_VERSION = 30
storedPatchesFile = storedPatchesFile =
(await getApplicationDocumentsDirectory()).path + storedPatchesFile; (await getApplicationDocumentsDirectory()).path + storedPatchesFile;
if (kReleaseMode) { if (kReleaseMode) {

View File

@ -195,7 +195,8 @@ class InstallerViewModel extends BaseViewModel {
} else { } else {
_app.patchedFilePath = _patcherAPI.outFile!.path; _app.patchedFilePath = _patcherAPI.outFile!.path;
} }
locator<HomeViewModel>().initialize(context); final homeViewModel = locator<HomeViewModel>();
_managerAPI.reAssessPatchedApps().then((_) => homeViewModel.getPatchedApps());
} on Exception catch (e) { } on Exception catch (e) {
update( update(
-100.0, -100.0,

View File

@ -55,9 +55,11 @@ class PatcherViewModel extends BaseViewModel {
context: context, context: context,
builder: (context) => AlertDialog( builder: (context) => AlertDialog(
title: Text(t.notice), title: Text(t.notice),
content: Text( content: SingleChildScrollView(
t.patcherView.removedPatchesWarningDialogText( child: Text(
patches: removedPatches.join('\n'), t.patcherView.removedPatchesWarningDialogText(
patches: removedPatches.join('\n'),
),
), ),
), ),
actions: <Widget>[ actions: <Widget>[

View File

@ -27,6 +27,7 @@ class AppInfoViewModel extends BaseViewModel {
BuildContext context, BuildContext context,
PatchedApplication app, PatchedApplication app,
) async { ) async {
locator<PatcherViewModel>().selectedApp = app;
locator<InstallerViewModel>().installTypeDialog(context); locator<InstallerViewModel>().installTypeDialog(context);
} }

View File

@ -528,19 +528,23 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
]; ];
}, },
onSelected: (String selection) async { onSelected: (String selection) async {
// manageExternalStorage permission is required for file/folder selection Future<bool> gotExternalStoragePermission() async {
// otherwise, the app will not complain, but the patches will error out // manageExternalStorage permission is required for folder selection
// the same way as if the user selected an empty file/folder. // otherwise, the app will not complain, but the patches will error out
// Android 11 and above requires the manageExternalStorage permission // the same way as if the user selected an empty folder.
final Map<String, dynamic> availableActions = { // Android 11 and above requires the manageExternalStorage permission
t.patchOptionsView.selectFilePath: () async { if (_managerAPI.isScopedStorageAvailable) {
if (_managerAPI.isScopedStorageAvailable) { final permission =
final permission = await Permission.manageExternalStorage.request();
await Permission.manageExternalStorage.request(); return permission.isGranted;
if (!permission.isGranted) { }
return; return true;
} }
}
switch (selection) {
case 'file':
// here scope storage is not required because file_picker
// will copy the file to the app's cache
final FilePickerResult? result = final FilePickerResult? result =
await FilePicker.platform.pickFiles(); await FilePicker.platform.pickFiles();
if (result == null) { if (result == null) {
@ -548,14 +552,10 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
} }
controller.text = result.files.single.path!; controller.text = result.files.single.path!;
widget.onChanged(controller.text); widget.onChanged(controller.text);
}, break;
t.patchOptionsView.selectFolder: () async { case 'folder':
if (_managerAPI.isScopedStorageAvailable) { if (!await gotExternalStoragePermission()) {
final permission = return;
await Permission.manageExternalStorage.request();
if (!permission.isGranted) {
return;
}
} }
final String? result = final String? result =
await FilePicker.platform.getDirectoryPath(); await FilePicker.platform.getDirectoryPath();
@ -564,13 +564,14 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
} }
controller.text = result; controller.text = result;
widget.onChanged(controller.text); widget.onChanged(controller.text);
}, break;
t.remove: () { case 'remove':
widget.removeValue!(); widget.removeValue!();
}, break;
}; case 'null':
if (availableActions.containsKey(selection)) { controller.text = '';
await availableActions[selection]!(); widget.onChanged(null);
break;
} }
}, },
), ),

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:revanced_manager/gen/strings.g.dart'; import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
class SLastPatchedApp extends StatefulWidget { class SLastPatchedApp extends StatefulWidget {
const SLastPatchedApp({super.key}); const SLastPatchedApp({super.key});
@ -16,7 +17,7 @@ class _SLastPatchedAppState
extends State<SLastPatchedApp> { extends State<SLastPatchedApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SwitchListTile( return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: Text( title: Text(
t.settingsView.lastPatchedAppLabel, t.settingsView.lastPatchedAppLabel,

View File

@ -5,23 +5,23 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: "5aaf60d96c4cd00fe7f21594b5ad6a1b699c80a27420f8a837f4d68473ef09e3" sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "68.0.0" version: "72.0.0"
_macros: _macros:
dependency: transitive dependency: transitive
description: dart description: dart
source: sdk source: sdk
version: "0.1.5" version: "0.3.2"
analyzer: analyzer:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: analyzer name: analyzer
sha256: "21f1d3720fd1c70316399d5e2bccaebb415c434592d778cce8acb967b8578808" sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.5.0" version: "6.7.0"
animations: animations:
dependency: "direct main" dependency: "direct main"
description: description:
@ -319,14 +319,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.0.0" version: "7.0.0"
file_picker:
dependency: "direct main"
description:
name: file_picker
sha256: "824f5b9f389bfc4dddac3dea76cd70c51092d9dff0b2ece7ef4f53db8547d258"
url: "https://pub.dev"
source: hosted
version: "8.0.6"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -410,14 +402,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.3" version: "0.7.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "9d98bd47ef9d34e803d438f17fd32b116d31009f534a6fa5ce3a1167f189a6de"
url: "https://pub.dev"
source: hosted
version: "2.0.21"
flutter_test: flutter_test:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -657,10 +641,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: macros name: macros
sha256: a8403c89b36483b4cbf9f1fcd24562f483cb34a5c9bf101cf2b0d8a083cf1239 sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.0-main.5" version: "0.1.2-main.4"
markdown: markdown:
dependency: transitive dependency: transitive
description: description:
@ -689,10 +673,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "25dfcaf170a0190f47ca6355bdd4552cb8924b430512ff0cafb8db9bd41fe33b" sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.14.0" version: "1.15.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1185,10 +1169,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794" sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.1" version: "0.7.2"
timeago: timeago:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1313,10 +1297,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: "7475cb4dd713d57b6f7464c0e13f06da0d535d8b2067e188962a59bac2cf280b" sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.2" version: "14.2.4"
wakelock_plus: wakelock_plus:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -4,7 +4,7 @@ homepage: https://github.com/ReVanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 1.21.0+101800026 version: 1.21.3-dev.1+101800033
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'
@ -23,7 +23,7 @@ dependencies:
dynamic_color: ^1.7.0 dynamic_color: ^1.7.0
dynamic_themes: ^1.1.0 dynamic_themes: ^1.1.0
expandable: ^5.0.1 expandable: ^5.0.1
file_picker: ^8.0.3 file_picker: ^8.0.5
flutter: flutter:
sdk: flutter sdk: flutter
flutter_background: flutter_background: