From 74fa513f834c5c0f9b29ed021e9e830cdd394323 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Wed, 4 Sep 2024 21:17:03 +0800 Subject: [PATCH] custom substore icon --- resources/subStoreIcon.png | Bin 0 -> 2938 bytes src/main/resolve/server.ts | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 resources/subStoreIcon.png diff --git a/resources/subStoreIcon.png b/resources/subStoreIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4b58fd9bcd5e23f039a49aefb531622d8c2ea8d GIT binary patch literal 2938 zcmbVO30MRgb+zlW^UVD7&p+?~e(!h8_srV4 zv9r8A13WPpjJG&iG!MP2U6(r%9oH!n>(HBrK03*W!FY{uU0BT4;!zlk+f`M()FhR} zfUr(OgA_VBLbGc0C>nzan`YHRa5`cl%aK%-R!HfruAz`s3LzztBLO7(NF+@aooztk zvSZ`n>~vV5piB!Vhgm_CK!cbdvQ?wj8bPa&(#H#;bJsGRLhgf@(uI@=mqD^rGM5~w zGazIhjY)+803h=OG=`kZfp`KrJCw`>m`pmrr88JmCKCi0=t&+pD5yb$LJ7_j%^Wa? zJ_#vlCX*hd(=8SY&BCJT45@U6Kp>z4OgfWEMG;hEmevGWsaoT>w+tf02pd#-lS-#0 zyBHz4F4H8Wpkn*I(C7zgwZ?%+p)sRdAw8Wz16*G90Tu8dPM>K|_Ze5fbVQA45Ut6G zVi|*2eVWdsGp6Z2K|T2TJp*WTC6YlKAJwAK44N>SqRglp0|EIc+8CduN9gkqqb}0` zBT;5l<~Wx(dN9&}Kqj3bUZ+#P&DGqulF3XKjYFO!fnb%^<;3K7wjd(Nga|2U-dI$C zPi1oB8EDd2Ad5Ez;DZ3r50&T?DrMFOP<}jv12Xv_gYzB~ts4bog8nC10fS1NK?9*K zt29t5Lf30kDdfRGf{{A4&VU+5)v@|iNF<L4 z4v)&_$N{RH#ZpkYOr?^+fOv9QbdZ838tz%VWuvREP&bR5nk*rt$#@ zph5tIaG3}jX36EQdhR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dlYxLIE^@JE70K2hoydL!hAa;(&j(BgJ c?Eh+5=BlAW%=T}8cKscTqhduBGi1yD4N6B(dH?_b literal 0 HcmV?d00001 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' } }) }