mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-04-18 16:10:30 +08:00
Compare commits
4 Commits
436ef9a030
...
294dd75b48
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
294dd75b48 | ||
|
|
f56c585818 | ||
|
|
ef96819621 | ||
|
|
5e0c5b6e69 |
14
changelog.md
14
changelog.md
@ -1,4 +1,18 @@
|
|||||||
|
## 1.8.3
|
||||||
|
**本次更新移除了 Windows 下启动必须管理员模式的机制,改为只在启用虚拟网卡模式的时候,申请 UAC 权限重启软件,安全性更好,更灵活,给无法使用管理员模式运行软件的企业用户提供了更大的便利**
|
||||||
|
|
||||||
|
### 新功能 (Feat)
|
||||||
|
- 移除 Windows 下启动必须管理员模式的机制,改为只在启用虚拟网卡模式的时候,申请 UAC 权限重启软件
|
||||||
|
|
||||||
|
### 重构 (Refactor)
|
||||||
|
- Geodata 文件只有在源文件更新的时候才会在启动时覆盖更新
|
||||||
|
|
||||||
|
### 修复 (Fix)
|
||||||
|
- 修复 DNS/嗅探覆写开关逻辑,修改设置不再会直接写入运行时配置,增加了“仅保存”按钮
|
||||||
|
- 悬浮窗改为纯矩形,修复 windows 下兼容性问题带来的白边
|
||||||
|
|
||||||
## 1.8.2
|
## 1.8.2
|
||||||
|
|
||||||
**本次更新主要集中在重大内核更新和依赖升级后所产生的 bug 修复,解决了自1.7版以后首次安装无法启动的问题,推荐更新**
|
**本次更新主要集中在重大内核更新和依赖升级后所产生的 bug 修复,解决了自1.7版以后首次安装无法启动的问题,推荐更新**
|
||||||
|
|
||||||
### 新功能 (Feat)
|
### 新功能 (Feat)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mihomo-party",
|
"name": "mihomo-party",
|
||||||
"version": "1.8.2",
|
"version": "1.8.3",
|
||||||
"description": "Mihomo Party",
|
"description": "Mihomo Party",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "mihomo-party-org",
|
"author": "mihomo-party-org",
|
||||||
|
|||||||
@ -323,6 +323,26 @@ const resolveSysproxy = () =>
|
|||||||
downloadURL: `https://github.com/mihomo-party-org/sysproxy/releases/download/${arch}/sysproxy.exe`
|
downloadURL: `https://github.com/mihomo-party-org/sysproxy/releases/download/${arch}/sysproxy.exe`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const resolveMonitor = async () => {
|
||||||
|
const tempDir = path.join(TEMP_DIR, 'TrafficMonitor')
|
||||||
|
const tempZip = path.join(tempDir, `${arch}.zip`)
|
||||||
|
if (!fs.existsSync(tempDir)) {
|
||||||
|
fs.mkdirSync(tempDir, { recursive: true })
|
||||||
|
}
|
||||||
|
await downloadFile(
|
||||||
|
`https://github.com/mihomo-party-org/mihomo-party-run/releases/download/monitor/${arch}.zip`,
|
||||||
|
tempZip
|
||||||
|
)
|
||||||
|
const zip = new AdmZip(tempZip)
|
||||||
|
const resDir = path.join(cwd, 'extra', 'files')
|
||||||
|
const targetPath = path.join(resDir, 'TrafficMonitor')
|
||||||
|
if (fs.existsSync(targetPath)) {
|
||||||
|
fs.rmSync(targetPath, { recursive: true })
|
||||||
|
}
|
||||||
|
zip.extractAllTo(targetPath, true)
|
||||||
|
|
||||||
|
console.log(`[INFO]: TrafficMonitor finished`)
|
||||||
|
}
|
||||||
|
|
||||||
const resolve7zip = () =>
|
const resolve7zip = () =>
|
||||||
resolveResource({
|
resolveResource({
|
||||||
@ -413,7 +433,12 @@ const tasks = [
|
|||||||
retry: 5,
|
retry: 5,
|
||||||
winOnly: true
|
winOnly: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'monitor',
|
||||||
|
func: resolveMonitor,
|
||||||
|
retry: 5,
|
||||||
|
winOnly: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'substore',
|
name: 'substore',
|
||||||
func: resolveSubstore,
|
func: resolveSubstore,
|
||||||
|
|||||||
@ -82,6 +82,18 @@ async function fixDataDirPermissions(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 比较修改geodata文件修改时间
|
||||||
|
async function isSourceNewer(sourcePath: string, targetPath: string): Promise<boolean> {
|
||||||
|
try {
|
||||||
|
const sourceStats = await stat(sourcePath)
|
||||||
|
const targetStats = await stat(targetPath)
|
||||||
|
|
||||||
|
return sourceStats.mtime > targetStats.mtime
|
||||||
|
} catch {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function initDirs(): Promise<void> {
|
async function initDirs(): Promise<void> {
|
||||||
await fixDataDirPermissions()
|
await fixDataDirPermissions()
|
||||||
|
|
||||||
@ -137,11 +149,18 @@ async function initFiles(): Promise<void> {
|
|||||||
const sourcePath = path.join(resourcesFilesDir(), file)
|
const sourcePath = path.join(resourcesFilesDir(), file)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!existsSync(targetPath) && existsSync(sourcePath)) {
|
// 检查是否需要复制
|
||||||
await cp(sourcePath, targetPath, { recursive: true })
|
if (existsSync(sourcePath)) {
|
||||||
|
const shouldCopyToWork = !existsSync(targetPath) || await isSourceNewer(sourcePath, targetPath)
|
||||||
|
if (shouldCopyToWork) {
|
||||||
|
await cp(sourcePath, targetPath, { recursive: true })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!existsSync(testTargetPath) && existsSync(sourcePath)) {
|
if (existsSync(sourcePath)) {
|
||||||
await cp(sourcePath, testTargetPath, { recursive: true })
|
const shouldCopyToTest = !existsSync(testTargetPath) || await isSourceNewer(sourcePath, testTargetPath)
|
||||||
|
if (shouldCopyToTest) {
|
||||||
|
await cp(sourcePath, testTargetPath, { recursive: true })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Failed to copy ${file}:`, error)
|
console.error(`Failed to copy ${file}:`, error)
|
||||||
|
|||||||
@ -60,7 +60,7 @@ const FloatingApp: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app-drag h-screen w-screen overflow-hidden">
|
<div className="app-drag h-screen w-screen overflow-hidden">
|
||||||
<div className="floating-bg border border-divider flex rounded-full bg-content1 h-[calc(100%-2px)] w-[calc(100%-2px)]">
|
<div className="floating-bg border border-divider flex bg-content1 h-full w-full">
|
||||||
<div className="flex justify-center items-center h-full aspect-square">
|
<div className="flex justify-center items-center h-full aspect-square">
|
||||||
<div
|
<div
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
@ -78,7 +78,7 @@ const FloatingApp: React.FC = () => {
|
|||||||
}
|
}
|
||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
className={`app-nodrag cursor-pointer floating-thumb ${tunEnabled ? 'bg-secondary' : sysProxyEnabled ? 'bg-primary' : 'bg-default'} hover:opacity-hover rounded-full h-[calc(100%-4px)] aspect-square`}
|
className={`app-nodrag cursor-pointer floating-thumb ${tunEnabled ? 'bg-secondary' : sysProxyEnabled ? 'bg-primary' : 'bg-default'} hover:opacity-hover h-[calc(100%-4px)] aspect-square`}
|
||||||
>
|
>
|
||||||
<MihomoIcon className="floating-icon text-primary-foreground h-full leading-full text-[22px] mx-auto" />
|
<MihomoIcon className="floating-icon text-primary-foreground h-full leading-full text-[22px] mx-auto" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user