belowaverage-org/SuperGrate

Add Localization (HideBuildInAccounts not working)

Manschk3rl opened this issue · 4 comments

Describe the bug
If you have set your operating system to german, the setting "HideBuildInAccounts" does not work.
it shows entries like "NT-AUTHORITÄT\SYSTEM" (which is german for "NT-AUTHORITY\SYSTEM")

To Reproduce
Steps to reproduce the behavior:

  1. Set your OS language to german.
  2. Start SuperGrate.
  3. Under "Settings" set "HideBuildInAccounts" on "true".
  4. "Source Computer" > local machine
  5. "List Source"
  6. See the error

Expected behavior
"NT-xxx" entries should not appear in the list.

Screenshots
1
2

Logs
[SUCCESS]<11:49:53> Config loaded! [SUCCESS]<11:49:53> Welcome to Super Grate! v1.3.5.0 [INFO]<11:49:53> Enter some information to get started! [INFO]<11:49:59> Getting list of users on: ZE999-WIN11... [VERBOSE]<11:49:59> Found: ZE999-Win11\test [WARNING]<11:49:59> Could not resolve as an SID via WMI! [VERBOSE]<11:49:59> Found: S-1-5-21-85594344-4232975197-2231365188-1002 [VERBOSE]<11:49:59> Found: ZE999-Win11\Admin [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Netzwerkdienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Lokaler Dienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\SYSTEM [SUCCESS]<11:49:59> Users listed successfully. [INFO]<11:55:00> Writing log to: C:\Users\Admin\Desktop\SuperGrate_30.11.2022_11-54-57.log...

Additional context
Im not a programmer but i guess its because the program is searching for "NT AUTHORITY". Found in "SuperGrate/Classes/Misc.cs" line 107 if (bool.TryParse(Config.Settings["HideBuiltInAccounts"], out bool setting) && setting && (**user.Contains("NT AUTHORITY")** || **user.Contains("NT SERVICE")**))

Thanks for the report, it sounds like I am going to need to localize Super Grate with different languages.
That is a big task so might take me a few weeks to build in localization. I will likely need help from you with translating to German as well if you are up for it.

Hi, i found a better solution. The SID from the NT-Accounts are always S-1-5-18 - 20. I replaced your user.Contains("NT AUTHORITY") || user.Contains("NT SERVICE") with an easy Regex match Regex.IsMatch(SID, @"^S-1-5-[0-9]+$") which searches for the String "S-1-5-" followed by numbers and an end after the numbers. User accounts SID are in a different format.
Screenshot 2022-12-01 131343
Super Grate - User Migration   Backup 01 12 2022 13_14_06

That will work for now, mind sending a pull request?

Done.
But sure im up for the "Add Localization" projekt if you need help with german :)