mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:33:45 +08:00
feat: Use polkit to elevate permission instaed of sudo (#678)
This commit is contained in:
parent
7ae2f1980b
commit
0c7fe0664e
@ -28,7 +28,7 @@ pub fn grant_permission(core: String) -> anyhow::Result<()> {
|
||||
let output = {
|
||||
let path = path.replace(' ', "\\ "); // 避免路径中有空格
|
||||
let shell = format!("setcap cap_net_bind_service,cap_net_admin=+ep {path}");
|
||||
Command::new("sudo")
|
||||
Command::new("pkexec")
|
||||
.arg("sh")
|
||||
.arg("-c")
|
||||
.arg(shell)
|
||||
|
Loading…
x
Reference in New Issue
Block a user