Skip to content

Commit c8d4100

Browse files
committed
Update
- fix contextmenu detection - fix enabling/disabling Superfetch and WD not working if the path included spaces - lowercase_with_underscores
1 parent bbd198b commit c8d4100

File tree

11 files changed

+15
-19
lines changed

11 files changed

+15
-19
lines changed

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:bitsdojo_window/bitsdojo_window.dart';
22
import 'package:fluent_ui/fluent_ui.dart';
3-
import 'package:revitool/screens/homePage.dart';
3+
import 'package:revitool/screens/home_page.dart';
44
import 'package:provider/provider.dart';
55
import 'package:revitool/theme.dart';
66
import 'package:revitool/utils.dart';
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import 'dart:io';
33
import 'package:fluent_ui/fluent_ui.dart';
44
import 'package:process_run/shell_run.dart';
55
import 'package:revitool/screens/pages/PerformancePage.dart';
6-
import 'package:revitool/screens/pages/securityPage.dart';
7-
import 'package:revitool/screens/pages/updates.dart';
8-
import 'package:revitool/screens/pages/usabilityPage.dart';
9-
import 'package:revitool/screens/pages/usabilityPageTwo.dart';
6+
import 'package:revitool/screens/pages/security_page.dart';
7+
import 'package:revitool/screens/pages/updates_page.dart';
8+
import 'package:revitool/screens/pages/usability_page.dart';
9+
import 'package:revitool/screens/pages/usability_page_two.dart';
1010
import 'package:revitool/screens/settings.dart';
1111
import 'package:revitool/utils.dart';
12-
import 'package:revitool/widgets/windowsButtons.dart';
12+
import 'package:revitool/widgets/windows_buttons.dart';
1313
import 'package:win32_registry/win32_registry.dart';
1414
import 'package:bitsdojo_window/bitsdojo_window.dart';
1515

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _PerformancePageState extends State<PerformancePage> {
7373
sfBool = value;
7474
});
7575
if (sfBool) {
76-
await run('${directoryExe.path}\\NSudoLG.exe -U:T -P:E cmd /min /c "${directoryExe.path}\\EnableSF.bat"');
76+
await run('"$directoryExe\\NSudoLG.exe" -U:T -P:E cmd /min /c "$directoryExe\\EnableSF.bat"');
7777
showDialog(
7878
context: context,
7979
builder: (context) => ContentDialog(
@@ -91,7 +91,7 @@ class _PerformancePageState extends State<PerformancePage> {
9191
} else {
9292
// await run('PowerShell -NonInteractive -NoLogo -NoProfile -Command "Disable-MMAgent -mc"');
9393
writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Control\Session Manager\Memory Management\PrefetchParameters', 'isMemoryCompressionEnabled', 0);
94-
await run('${directoryExe.path}\\NSudoLG.exe -U:T -P:E cmd /min /c "${directoryExe.path}\\DisableSF.bat"');
94+
await run('"$directoryExe\\NSudoLG.exe" -U:T -P:E cmd /min /c "$directoryExe\\DisableSF.bat"');
9595
showDialog(
9696
context: context,
9797
builder: (context) => ContentDialog(
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class _SecurityPageState extends State<SecurityPage> {
6262
wdBool = value;
6363
});
6464
if (wdBool) {
65-
await run('${directoryExe.path}\\NSudoLG.exe -U:T -P:E ${directoryExe.path}\\EnableWD.bat');
65+
await run('"$directoryExe\\NSudoLG.exe" -U:T -P:E cmd /min /c "$directoryExe\\EnableWD.bat"');
6666
// // Services and Drivers
6767
// writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Services\MsSecFlt', 'Start', 0);
6868
// writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Services\SecurityHealthService', 'Start', 3);
@@ -93,7 +93,7 @@ class _SecurityPageState extends State<SecurityPage> {
9393
// deleteRegistryKey(Registry.localMachine, r'Software\Policies\Microsoft\Windows Defender\SmartScreen');
9494
// deleteRegistryKey(Registry.localMachine, r'Software\Policies\Microsoft\Windows Defender\Signature Updates');
9595
} else {
96-
await run('${directoryExe.path}\\NSudoLG.exe -U:T -P:E ${directoryExe.path}\\DisableWD.bat');
96+
await run('"$directoryExe\\NSudoLG.exe" -U:T -P:E cmd /min /c "$directoryExe\\DisableWD.bat"');
9797
// writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Services\MsSecFlt', 'Start', 4);
9898
// writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Services\SecurityHealthService', 'Start', 4);
9999
// writeRegistryDword(Registry.localMachine, r'SYSTEM\ControlSet001\Services\Sense', 'Start', 4);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class UsabilityPageTwo extends StatefulWidget {
1212
}
1313

1414
class _UsabilityPageTwoState extends State<UsabilityPageTwo> {
15-
bool mrcBool = readRegistryInt(RegistryHive.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled') != 1;
15+
bool mrcBool = readRegistryInt(RegistryHive.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled') != 0;
1616
bool fetBool = readRegistryInt(RegistryHive.localMachine, r'SYSTEM\ControlSet001\Control\FeatureManagement\Overrides\8\1931258509', 'EnabledState') != 1;
1717

1818
@override
@@ -56,12 +56,12 @@ class _UsabilityPageTwoState extends State<UsabilityPageTwo> {
5656
});
5757
if (mrcBool) {
5858
createRegistryKey(Registry.currentUser, r'Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32');
59-
writeRegistryDword(Registry.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled', 0);
59+
writeRegistryDword(Registry.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled', 1);
6060
await Process.run('taskkill.exe', ['/im', 'explorer.exe', '/f']);
6161
await Process.run('explorer.exe', [], runInShell: true);
6262
} else {
6363
deleteRegistryKey(Registry.currentUser, r'Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32');
64-
writeRegistryDword(Registry.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled', 1);
64+
writeRegistryDword(Registry.localMachine, r'Software\Classes\CLSID', 'IsModernRCEnabled', 0);
6565
await Process.run('taskkill.exe', ['/im', 'explorer.exe', '/f']);
6666
await Process.run('explorer.exe', [], runInShell: true);
6767
}

lib/utils.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import 'dart:io';
22

33
import 'package:win32_registry/win32_registry.dart';
44

5-
// returns the abolute path of the executable file of your app:
65
String mainPath = Platform.resolvedExecutable;
7-
8-
// nsudo path
9-
Directory directoryExe = Directory("${mainPath.substring(0, mainPath.lastIndexOf("\\"))}\\data\\flutter_assets\\additionals");
6+
String directoryExe = Directory("${mainPath.substring(0, mainPath.lastIndexOf("\\"))}\\data\\flutter_assets\\additionals").path;
107

118
// Experimental features
129
bool expBool = false;

lib/widgets/card_highlight.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class _CardHighlightState extends State<CardHighlight> with AutomaticKeepAliveCl
2222

2323
@override
2424
Widget build(BuildContext context) {
25-
final theme = FluentTheme.of(context);
25+
// final theme = FluentTheme.of(context);
2626
super.build(context);
2727
return Column(children: [
2828
Card(

lib/widgets/subtitle.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:fluent_ui/fluent_ui.dart';
2-
import 'package:flutter/widgets.dart';
32

43
Widget subtitle({required Widget content}) {
54
return Builder(builder: (context) {

0 commit comments

Comments
 (0)