Compare commits

...

4 Commits

Author SHA1 Message Date
ezequielnick
bcf104e085 fix: workflow2 2025-08-13 12:29:48 +08:00
ezequielnick
9f8c70c8a8 fix: workflow 2025-08-13 11:36:43 +08:00
ezequielnick
0ea9528b70 feat: set default tun device name on macos (configurable) 2025-08-13 10:34:35 +08:00
ezequielnick
4997e098ba fix: remove core privilege check on non-windows 2025-08-13 09:44:11 +08:00
7 changed files with 40 additions and 57 deletions

View File

@ -13,10 +13,10 @@ permissions: write-all
jobs:
cleanup-dev-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Delete Dev Release Assets
if: github.event_name == 'workflow_dispatch'
continue-on-error: true
run: |
# Get release ID for dev tag
@ -41,9 +41,12 @@ jobs:
else
echo "No existing dev release found"
fi
- name: Skip for Tag Release
if: startsWith(github.ref, 'refs/tags/v')
run: echo "Skipping cleanup for tag release"
windows:
needs: [cleanup-dev-release]
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -96,7 +99,6 @@ jobs:
dist/*.sha256
dist/*setup.exe
dist/*portable.7z
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Dev Release
if: github.event_name == 'workflow_dispatch'
@ -114,7 +116,7 @@ jobs:
windows7:
needs: [cleanup-dev-release]
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -168,7 +170,6 @@ jobs:
dist/*.sha256
dist/*setup.exe
dist/*portable.7z
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Dev Release
if: github.event_name == 'workflow_dispatch'
@ -186,7 +187,7 @@ jobs:
linux:
needs: [cleanup-dev-release]
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -233,7 +234,6 @@ jobs:
dist/*.sha256
dist/*.deb
dist/*.rpm
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Dev Release
if: github.event_name == 'workflow_dispatch'
@ -251,7 +251,7 @@ jobs:
macos:
needs: [cleanup-dev-release]
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -321,7 +321,6 @@ jobs:
files: |
dist/*.sha256
dist/*.pkg
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Dev Release
if: github.event_name == 'workflow_dispatch'
@ -338,7 +337,7 @@ jobs:
macos10:
needs: [cleanup-dev-release]
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
strategy:
fail-fast: false
matrix:
@ -410,7 +409,6 @@ jobs:
files: |
dist/*.sha256
dist/*.pkg
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Dev Release
if: github.event_name == 'workflow_dispatch'
@ -427,7 +425,7 @@ jobs:
updater:
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
needs: [windows, macos, windows7, macos10]
needs: [windows, windows7, linux, macos, macos10]
runs-on: ubuntu-latest
steps:
- name: Checkout

View File

@ -4,10 +4,12 @@
- 如果当前没有以管理员模式运行TUN 开关保持关闭
- 区分 app 日志与 core 日志输出为不同文件
- 完善内核权限鉴别,上一个内核以管理员模式启动的时候,弹出提示
- 修改 MacOS 默认虚拟网卡名称为 utun1500可自定义
### 修复 (Fix)
- 修复某些系统下的悬浮窗开启崩溃的问题(开启兼容模式=关闭硬件加速)
- 开机自启在非管理员模式下报错的问题
- 解决某些 macos 系统下无法开启虚拟网卡的问题(tun device名称冲突)
## 1.8.3
**本次更新移除了 Windows 下启动必须管理员模式的机制,改为只在启用虚拟网卡模式的时候,申请 UAC 权限重启软件,安全性更好,更灵活,给无法使用管理员模式运行软件的企业用户提供了更大的便利**

View File

@ -24,5 +24,7 @@ changelog += '\n#### Linux\n\n'
changelog += `- DEB[64位](${downloadUrl}/mihomo-party-linux-${version}-amd64.deb) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-arm64.deb)\n\n`
changelog += `- RPM[64位](${downloadUrl}/mihomo-party-linux-${version}-x86_64.rpm) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-aarch64.rpm)`
changelog += '\n\n### 机场推荐:\n- 高性能海外机场,稳定首选:[https://狗狗加速.com](https://party.dginv.click/#/register?code=ARdo0mXx)'
writeFileSync('latest.yml', yaml.stringify(latest))
writeFileSync('changelog.md', changelog)

View File

@ -487,22 +487,8 @@ export async function checkHighPrivilegeCore(): Promise<boolean> {
}
if (process.platform === 'darwin' || process.platform === 'linux') {
const { stat, existsSync } = await import('fs')
const { promisify } = await import('util')
const statAsync = promisify(stat)
if (!existsSync(corePath)) {
await managerLogger.info('Core file does not exist')
return false
}
const stats = await statAsync(corePath)
const hasSetuid = (stats.mode & 0o4000) !== 0
const isOwnedByRoot = stats.uid === 0
await managerLogger.info(`Core file stats - setuid: ${hasSetuid}, owned by root: ${isOwnedByRoot}, mode: ${stats.mode.toString(8)}`)
return hasSetuid && isOwnedByRoot
await managerLogger.info('Non-Windows platform, skipping high privilege core check')
return false
}
} catch (error) {
await managerLogger.error('Failed to check high privilege core', error)

View File

@ -113,25 +113,21 @@ if (process.platform === 'win32' && !exePath().startsWith('C')) {
app.commandLine.appendSwitch('in-process-gpu')
}
// 内核检测
// 运行内核检测
async function checkHighPrivilegeCoreEarly(): Promise<void> {
if (process.platform !== 'win32') {
return
}
try {
await initBasic()
// 应用管理员权限运行,跳过检测
if (process.platform === 'win32') {
const { checkAdminPrivileges } = await import('./core/manager')
const isCurrentAppAdmin = await checkAdminPrivileges()
const { checkAdminPrivileges } = await import('./core/manager')
const isCurrentAppAdmin = await checkAdminPrivileges()
if (isCurrentAppAdmin) {
console.log('Current app is running as administrator, skipping privilege check')
return
}
} else if (process.platform === 'darwin' || process.platform === 'linux') {
if (process.getuid && process.getuid() === 0) {
console.log('Current app is running as root, skipping privilege check')
return
}
if (isCurrentAppAdmin) {
console.log('Current app is running as administrator, skipping privilege check')
return
}
const hasHighPrivilegeCore = await checkHighPrivilegeCore()
@ -155,7 +151,7 @@ async function checkHighPrivilegeCoreEarly(): Promise<void> {
if (choice === 0) {
try {
// 非TUN重启
// Windows 平台重启应用获取管理员权限
await restartAsAdmin(false)
process.exit(0)
} catch (error) {

View File

@ -67,7 +67,7 @@ export const defaultControledMihomoConfig: Partial<IMihomoConfig> = {
'skip-auth-prefixes': ['127.0.0.1/32'],
tun: {
enable: false,
device: 'Mihomo',
device: process.platform === 'darwin' ? 'utun1500' : 'Mihomo',
stack: 'mixed',
'auto-route': true,
'auto-redirect': false,

View File

@ -18,7 +18,7 @@ const Tun: React.FC = () => {
const { tun } = controledMihomoConfig || {}
const [loading, setLoading] = useState(false)
const {
device = 'Mihomo',
device = platform === 'darwin' ? 'utun1500' : 'Mihomo',
stack = 'mixed',
'auto-route': autoRoute = true,
'auto-redirect': autoRedirect = false,
@ -165,18 +165,17 @@ const Tun: React.FC = () => {
<Tab key="system" title="System" />
</Tabs>
</SettingItem>
{platform !== 'darwin' && (
<SettingItem title={t('tun.device.title')} divider>
<Input
size="sm"
className="w-[100px]"
value={values.device}
onValueChange={(v) => {
setValues({ ...values, device: v })
}}
/>
</SettingItem>
)}
<SettingItem title={t('tun.device.title')} divider>
<Input
size="sm"
className="w-[100px]"
value={values.device}
placeholder={platform === 'darwin' ? 'utun1500' : 'Mihomo'}
onValueChange={(v) => {
setValues({ ...values, device: v })
}}
/>
</SettingItem>
<SettingItem title={t('tun.strictRoute')} divider>
<Switch