Windows-Auto-Night-Mode icon indicating copy to clipboard operation
Windows-Auto-Night-Mode copied to clipboard

Unsigned themes do not fully apply

Open StraggleCraft opened this issue 2 years ago • 3 comments

Description

Unsigned themes do not fully apply when using ADM. I see that ADM uses SecureUXTheme, so I would have thought it would be possible to use themes that I've patched using ADM... I'm not sure if this is a bug or a feature request. The logs don't show anything interesting here, so I figured I'd see if this was a feature that could be added, or if it is a bug.

Expected Behavior

No response

Log Data

2023-09-25 01:07:24 | Info | MessageParser.Parse: signal received: invoke theme switch request 2023-09-25 01:07:41 | Info | PostponeItem.StartExpiry: PauseAutoSwitch had its expiry at 25.09.2023 06:00:01 cancelled 2023-09-25 01:07:49 | Info | ComponentManager.GetComponentsToUpdate: components queued for update: [OfficeSwitch] 2023-09-25 01:07:49 | Info | OfficeSwitch.HandleSwitch: update info - previous: Light, now: Dark, mode: Switch 2023-09-25 01:07:49 | Info | ThemeManager.UpdateTheme: dwm management: full refresh requested by user 2023-09-25 01:08:05 | Info | Tm2Handler.SetTheme: applied theme ADMUnmanagedDark, from origin: C:\Users\User\AppData\Local\Microsoft\Windows\Themes\Penumbra10s.theme directly via IThemeManager2 2023-09-25 01:08:05 | Warn | ThemeHandler.ApplyIThemeManager2: theme switching took longer than expected (15.7562201 seconds) 2023-09-25 01:08:05 | Info | ThemeManager.UpdateTheme: dark theme switch performed, source: Manual 2023-09-25 01:08:05 | Info | Service.ToggleTheme: ui signal received: theme toggle: switching to dark theme

Commit Hash, Version and Windows Build

  • Commit: 57ef363
  • Service/App: 10.4.0.35
  • Updater: 3.1.4
  • Shell: 1.3.3.0
  • .Net: 7.0.5
  • Windows: 19045.3086

Screenshots / Videos

image image

StraggleCraft avatar Sep 25 '23 05:09 StraggleCraft

We know that, and it's currently not supported because it would require full integration of https://github.com/namazso/SecureUxTheme

We do not use SecureUXTheme per se, just the raw windows API that namaszo provided to us.

It is possible to compile the SecureUX library and hook it as DLL in Auto Dark Mode, but doing that is out of scope at the moment. We have had a bridge application that could be updated with some effort, but atm we have our hands full with just getting regular themes to work properly.

Spiritreader avatar Sep 26 '23 19:09 Spiritreader

I saw that "automation" was possible with more recent builds of SecureUxTheme via a C FFI Interface... allegedly being possible to do with powershell etc... This is way over my head though, Does this at all make the task easier than building a new SecureUX library? or still out of scope, too much work.
Thanks for the attention!

https://github.com/namazso/SecureUxTheme/issues/86 https://github.com/namazso/SecureUxTheme/issues/120

Also, would it be possible to add a note to https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/wiki/Known-limitations that unsigned themes are not possible?

StraggleCraft avatar Sep 26 '23 23:09 StraggleCraft

I saw that "automation" was possible with more recent builds of SecureUxTheme via a C FFI Interface.

Yes I compiled a version of the c ffi with and without signature verification to be used with the ADM bridge, but that was retired in favor of the in-built solution that didn't require external dlls https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/blob/master/IThemeManager2Bridge/ThemeDllWrapper.cs

Also, would it be possible to add a note to https://github.com/AutoDarkMode/Windows-Auto-Night-Mode/wiki/Known-limitations that unsigned themes are not possible?

I can do that, although themes with fake signatures were never meant to be supported in the first place.

Spiritreader avatar Sep 27 '23 11:09 Spiritreader