diff --git a/resources/subStoreIcon.png b/resources/subStoreIcon.png new file mode 100644 index 0000000..c4b58fd Binary files /dev/null and b/resources/subStoreIcon.png differ diff --git a/src/main/resolve/server.ts b/src/main/resolve/server.ts index 7a9c984..655bc02 100644 --- a/src/main/resolve/server.ts +++ b/src/main/resolve/server.ts @@ -1,9 +1,11 @@ import { getAppConfig, getControledMihomoConfig } from '../config' import { Worker } from 'worker_threads' import { resourcesFilesDir, subStoreDir } from '../utils/dirs' +import subStoreIcon from '../../../resources/subStoreIcon.png?asset' import http from 'http' import net from 'net' import path from 'path' +import { nativeImage } from 'electron' export let pacPort: number export let subStorePort: number @@ -57,10 +59,14 @@ export async function startSubStoreServer(): Promise { if (!useSubStore || useCustomSubStore) return if (subStorePort) return subStorePort = await findAvailablePort(3000) + const icon = nativeImage.createFromPath(subStoreIcon) + icon.toDataURL() new Worker(path.join(resourcesFilesDir(), 'sub-store.bundle.js'), { env: { SUB_STORE_BACKEND_API_PORT: subStorePort.toString(), - SUB_STORE_DATA_BASE_PATH: subStoreDir() + SUB_STORE_DATA_BASE_PATH: subStoreDir(), + SUB_STORE_BACKEND_CUSTOM_ICON: icon.toDataURL(), + SUB_STORE_BACKEND_CUSTOM_NAME: 'Mihomo Party' } }) }