move ThemeManager to @native

This commit is contained in:
amsyarasyiq 2024-02-08 17:06:50 +08:00
parent fa9b2a890e
commit dbdfb11f85
2 changed files with 4 additions and 2 deletions

View file

@ -8,4 +8,5 @@ export const FileManager = (nmp.DCDFileManager ?? nmp.RTNFileManager) as _FileMa
export const ClientInfoManager = nmp.InfoDictionaryManager ?? nmp.RTNClientInfoManager;
//! 173.14 renamed this to RTNDeviceManager.
export const DeviceManager = nmp.DCDDeviceManager ?? nmp.RTNDeviceManager;
export const BundleUpdaterManager = nmp.BundleUpdaterManager;
export const BundleUpdaterManager = nmp.BundleUpdaterManager;
export const ThemeManager = nmp.RTNThemeManager ?? nmp.DCDTheme;

View file

@ -5,6 +5,7 @@ import { find, findByName, findByProps, findByStoreName } from "@metro/filters";
import { after, before, instead } from "@lib/patcher";
import { createFileBackend, createMMKVBackend, createStorage, wrapSync, awaitSyncWrapper } from "@lib/storage";
import logger from "@lib/logger";
import { ThemeManager } from "./native";
//! As of 173.10, early-finding this does not work.
// Somehow, this is late enough, though?
@ -199,7 +200,7 @@ function patchColor() {
before("isThemeDark", isThemeModule, callback);
before("isThemeLight", isThemeModule, callback);
before("updateTheme", window.nativeModuleProxy.RTNThemeManager, callback);
before("updateTheme", ThemeManager, callback);
before("updateTheme", appearanceManager, ([theme]) => {
enabled = theme === vdKey;