feat: 添加PolicyKit权限配置和安装/卸载脚本

This commit is contained in:
Elysia
2026-01-28 22:10:03 +08:00
parent 185b4984c6
commit 071aa36fb4
4 changed files with 16 additions and 5 deletions

View File

@@ -7,6 +7,9 @@ directories:
files: files:
- "dist" - "dist"
- "dist-electron" - "dist-electron"
extraFiles:
- from: "extras"
to: "extras"
linux: linux:
icon: "public/amber-pm-logo.icns" icon: "public/amber-pm-logo.icns"
@@ -25,6 +28,8 @@ linux:
- "deb" - "deb"
- "rpm" - "rpm"
deb: deb:
afterInstall: "scripts/debian-postinst.sh"
afterRemove: "scripts/debian-postrm.sh"
depends: depends:
- "libgtk-3-0" - "libgtk-3-0"
- "libnotify4" - "libnotify4"

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> "https://specifications.freedesktop.org/PolicyKit/1.0/policyconfig.dtd">
<policyconfig> <policyconfig>
<vendor>AmberPM</vendor> <vendor>AmberPM</vendor>
<icon_name>x-package-repository</icon_name> <icon_name>x-package-repository</icon_name>
<action id="store.spark-app.amber-pm-installer"> <action id="store.spark-app.amber-pm-store">
<description>运行amber-pm-installer需要权限</description> <description>运行apm-app-store管理软件需要权限</description>
<message>要使用amber-pm-installer需要权限</message> <message>要使用apm-app-store管理软件需要权限</message>
<defaults> <defaults>
<allow_any>yes</allow_any> <allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive> <allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/apm-installer</annotate> <annotate key="org.freedesktop.policykit.exec.path">/opt/apm-app-store/extras/apm-installer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action> </action>
</policyconfig> </policyconfig>

3
scripts/debian-postinst.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/bash
cp -fv /opt/apm-app-store/extras/store.spark-app.amber-pm-store.policy /usr/share/polkit-1/actions/store.spark-app.amber-pm-store.policy

3
scripts/debian-postrm.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/bash
rm -fv /usr/share/polkit-1/actions/store.spark-app.amber-pm-store.policy