feat: Request root and install permissions as soon as possible

This commit is contained in:
Alberto Ponces 2022-09-14 23:30:02 +01:00
parent 598f7571de
commit 9f3a30d9f2
2 changed files with 7 additions and 0 deletions

View File

@ -1,7 +1,11 @@
// ignore_for_file: use_build_context_synchronously
import 'package:app_installer/app_installer.dart';
import 'package:device_apps/device_apps.dart';
import 'package:dynamic_themes/dynamic_themes.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:revanced_manager/services/root_api.dart';
import 'package:revanced_manager/ui/views/home/home_view.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
import 'package:revanced_manager/ui/views/settings/settings_view.dart';
@ -21,6 +25,8 @@ class NavigationViewModel extends IndexTrackingViewModel {
DynamicTheme.of(context)!.setTheme(1);
}
}
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
}
Widget getViewForIndex(int index) {

View File

@ -49,6 +49,7 @@ dependencies:
ref: feature/nullSafe
package_info_plus: ^1.4.3+1
path_provider: ^2.0.11
permission_handler: ^10.0.0
pull_to_refresh: ^2.0.0
root: ^2.0.2
share_extend: ^2.0.0