mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-19 15:37:43 +08:00
Compare commits
9 Commits
v1.21.2-de
...
v1.22.0-de
Author | SHA1 | Date | |
---|---|---|---|
f6bfe0d3f9 | |||
51c0f14055 | |||
2a6dc09a9b | |||
f1c2f4146c | |||
2f46b3c84e | |||
5f388abf95 | |||
7acdb8e660 | |||
e063b3d102 | |||
cb722f2634 |
@ -283,7 +283,7 @@
|
||||
"status_failure_timeout_description": "The installation took too long to finish.\n\nWould you like to try again?",
|
||||
"status_failure_storage_description": "The installation failed due to insufficient storage.\n\nFree up some space and try again.",
|
||||
"status_failure_invalid_description": "The installation failed due to the patched app being invalid.\n\nUninstall the app and try again?",
|
||||
"status_failure_incompatible_description": "The app is incompatible with this device.\n\nContact the developer of the app and ask for support.",
|
||||
"status_failure_incompatible_description": "The app is incompatible with this device.\n\nUse an APK that is supported by this device and try again.",
|
||||
"status_failure_conflict_description": "The installation was prevented by an existing installation of the app.\n\nUninstall the installed app and try again?",
|
||||
"status_failure_blocked_description": "The installation was blocked by ${packageName}.\n\nAdjust your security settings and try again.",
|
||||
"install_failed_verification_failure_description": "The installation failed due to a verification issue.\n\nAdjust your security settings and try again.",
|
||||
|
100
lib/app/app.dart
100
lib/app/app.dart
@ -1,49 +1,51 @@
|
||||
import 'package:revanced_manager/services/download_manager.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:revanced_manager/services/revanced_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
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/home/home_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/installer/installer_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/patch_options/patch_options_view.dart';
|
||||
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_view.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_view.dart';
|
||||
import 'package:revanced_manager/ui/widgets/appInfoView/app_info_view.dart';
|
||||
import 'package:stacked/stacked_annotations.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
@StackedApp(
|
||||
routes: [
|
||||
MaterialRoute(page: NavigationView),
|
||||
MaterialRoute(page: PatcherView),
|
||||
MaterialRoute(page: AppSelectorView),
|
||||
MaterialRoute(page: PatchesSelectorView),
|
||||
MaterialRoute(page: PatchOptionsView),
|
||||
MaterialRoute(page: InstallerView),
|
||||
MaterialRoute(page: SettingsView),
|
||||
MaterialRoute(page: ContributorsView),
|
||||
MaterialRoute(page: AppInfoView),
|
||||
],
|
||||
dependencies: [
|
||||
LazySingleton(classType: NavigationViewModel),
|
||||
LazySingleton(classType: HomeViewModel),
|
||||
LazySingleton(classType: PatcherViewModel),
|
||||
LazySingleton(classType: PatchOptionsViewModel),
|
||||
LazySingleton(classType: NavigationService),
|
||||
LazySingleton(classType: ManagerAPI),
|
||||
LazySingleton(classType: PatcherAPI),
|
||||
LazySingleton(classType: RevancedAPI),
|
||||
LazySingleton(classType: GithubAPI),
|
||||
LazySingleton(classType: DownloadManager),
|
||||
LazySingleton(classType: Toast),
|
||||
],
|
||||
)
|
||||
class AppSetup {}
|
||||
import 'package:revanced_manager/services/download_manager.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:revanced_manager/services/revanced_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
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/home/home_viewmodel.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_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patch_options/patch_options_view.dart';
|
||||
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_view.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_view.dart';
|
||||
import 'package:revanced_manager/ui/widgets/appInfoView/app_info_view.dart';
|
||||
import 'package:stacked/stacked_annotations.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
@StackedApp(
|
||||
routes: [
|
||||
MaterialRoute(page: NavigationView),
|
||||
MaterialRoute(page: PatcherView),
|
||||
MaterialRoute(page: AppSelectorView),
|
||||
MaterialRoute(page: PatchesSelectorView),
|
||||
MaterialRoute(page: PatchOptionsView),
|
||||
MaterialRoute(page: InstallerView),
|
||||
MaterialRoute(page: SettingsView),
|
||||
MaterialRoute(page: ContributorsView),
|
||||
MaterialRoute(page: AppInfoView),
|
||||
],
|
||||
dependencies: [
|
||||
LazySingleton(classType: NavigationViewModel),
|
||||
LazySingleton(classType: HomeViewModel),
|
||||
LazySingleton(classType: PatcherViewModel),
|
||||
LazySingleton(classType: PatchOptionsViewModel),
|
||||
LazySingleton(classType: InstallerViewModel),
|
||||
LazySingleton(classType: NavigationService),
|
||||
LazySingleton(classType: ManagerAPI),
|
||||
LazySingleton(classType: PatcherAPI),
|
||||
LazySingleton(classType: RevancedAPI),
|
||||
LazySingleton(classType: GithubAPI),
|
||||
LazySingleton(classType: DownloadManager),
|
||||
LazySingleton(classType: Toast),
|
||||
],
|
||||
)
|
||||
class AppSetup {}
|
||||
|
@ -38,6 +38,8 @@ class ManagerAPI {
|
||||
bool releaseBuild = false;
|
||||
bool suggestedAppVersionSelected = true;
|
||||
bool isDynamicThemeAvailable = false;
|
||||
bool isScopedStorageAvailable = false;
|
||||
int sdkVersion = 0;
|
||||
String storedPatchesFile = '/selected-patches.json';
|
||||
String keystoreFile =
|
||||
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-manager.keystore';
|
||||
@ -55,8 +57,11 @@ class ManagerAPI {
|
||||
Future<void> initialize() async {
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
isRooted = await _rootAPI.isRooted();
|
||||
isDynamicThemeAvailable =
|
||||
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
|
||||
if (sdkVersion == 0) {
|
||||
sdkVersion = await getSdkVersion();
|
||||
}
|
||||
isDynamicThemeAvailable = sdkVersion >= 31; // ANDROID_12_SDK_VERSION = 31
|
||||
isScopedStorageAvailable = sdkVersion >= 30; // ANDROID_11_SDK_VERSION = 30
|
||||
storedPatchesFile =
|
||||
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
||||
if (kReleaseMode) {
|
||||
|
@ -27,6 +27,7 @@ class AppInfoViewModel extends BaseViewModel {
|
||||
BuildContext context,
|
||||
PatchedApplication app,
|
||||
) async {
|
||||
locator<PatcherViewModel>().selectedApp = app;
|
||||
locator<InstallerViewModel>().installTypeDialog(context);
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
|
||||
@ -398,6 +401,7 @@ class TextFieldForPatchOption extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
final TextEditingController controller = TextEditingController();
|
||||
String? selectedKey;
|
||||
String? defaultValue;
|
||||
@ -524,21 +528,42 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
|
||||
];
|
||||
},
|
||||
onSelected: (String selection) async {
|
||||
Future<bool> gotExternalStoragePermission() async {
|
||||
// manageExternalStorage permission is required for folder selection
|
||||
// otherwise, the app will not complain, but the patches will error out
|
||||
// the same way as if the user selected an empty folder.
|
||||
// Android 11 and above requires the manageExternalStorage permission
|
||||
if (_managerAPI.isScopedStorageAvailable) {
|
||||
final permission =
|
||||
await Permission.manageExternalStorage.request();
|
||||
return permission.isGranted;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (selection) {
|
||||
case 'file':
|
||||
final String? result = await FlutterFileDialog.pickFile();
|
||||
if (result != null) {
|
||||
controller.text = result;
|
||||
widget.onChanged(controller.text);
|
||||
// here scope storage is not required because file_picker
|
||||
// will copy the file to the app's cache
|
||||
final FilePickerResult? result =
|
||||
await FilePicker.platform.pickFiles();
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
controller.text = result.files.single.path!;
|
||||
widget.onChanged(controller.text);
|
||||
break;
|
||||
case 'folder':
|
||||
final DirectoryLocation? result =
|
||||
await FlutterFileDialog.pickDirectory();
|
||||
if (result != null) {
|
||||
controller.text = result.toString();
|
||||
widget.onChanged(controller.text);
|
||||
if (!await gotExternalStoragePermission()) {
|
||||
return;
|
||||
}
|
||||
final String? result =
|
||||
await FilePicker.platform.getDirectoryPath();
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
controller.text = result;
|
||||
widget.onChanged(controller.text);
|
||||
break;
|
||||
case 'remove':
|
||||
widget.removeValue!();
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.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 {
|
||||
const SLastPatchedApp({super.key});
|
||||
@ -16,7 +17,7 @@ class _SLastPatchedAppState
|
||||
extends State<SLastPatchedApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SwitchListTile(
|
||||
return HapticSwitchListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: Text(
|
||||
t.settingsView.lastPatchedAppLabel,
|
||||
|
@ -4,7 +4,7 @@ homepage: https://github.com/ReVanced/revanced-manager
|
||||
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.21.2-dev.2+101800030
|
||||
version: 1.22.0-dev.1+101800034
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
@ -23,6 +23,7 @@ dependencies:
|
||||
dynamic_color: ^1.7.0
|
||||
dynamic_themes: ^1.1.0
|
||||
expandable: ^5.0.1
|
||||
file_picker: ^8.0.5
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flutter_background:
|
||||
|
Reference in New Issue
Block a user