Skip to content

Commit

Permalink
feat: Request root and install permissions as soon as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Sep 14, 2022
1 parent 598f757 commit 9f3a30d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ui/views/navigation/navigation_viewmodel.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -21,6 +25,8 @@ class NavigationViewModel extends IndexTrackingViewModel {
DynamicTheme.of(context)!.setTheme(1);
}
}
RootAPI().hasRootPermissions();
Permission.requestInstallPackages.request();
}

Widget getViewForIndex(int index) {
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f3a30d

Please sign in to comment.