mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
fix: minor UI and UX fixes
This commit is contained in:
@ -12,7 +12,6 @@ class RootCheckerView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<RootCheckerViewModel>.reactive(
|
||||
disposeViewModel: false,
|
||||
onModelReady: (model) => model.initialize,
|
||||
viewModelBuilder: () => RootCheckerViewModel(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
floatingActionButton: Column(
|
||||
@ -64,11 +63,7 @@ class RootCheckerView extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 170),
|
||||
MagiskButton(
|
||||
onPressed: () {
|
||||
model
|
||||
.getMagiskPermissions()
|
||||
.then((value) => model.checkRoot());
|
||||
},
|
||||
onPressed: () => model.checkRoot(),
|
||||
),
|
||||
I18nText(
|
||||
'rootCheckerView.grantedPermission',
|
||||
|
@ -9,11 +9,6 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
final _navigationService = locator<NavigationService>();
|
||||
bool? isRooted = false;
|
||||
|
||||
Future<void> initialize() async {
|
||||
await checkRoot();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> checkRoot() async {
|
||||
isRooted = await Root.isRooted();
|
||||
if (isRooted == true) {
|
||||
@ -22,15 +17,6 @@ class RootCheckerViewModel extends BaseViewModel {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<bool> getMagiskPermissions() async {
|
||||
try {
|
||||
await Root.exec(cmd: 'cat /proc/version');
|
||||
} on Exception {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> navigateToHome() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
prefs.setBool('isRooted', isRooted!);
|
||||
|
Reference in New Issue
Block a user