From ca29afa425c27f545ab728f4f051849ccfacc1cb Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 12 Dec 2022 15:11:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=9A=84=E5=85=8D=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/spark-store.postinst | 5 ++++- tool/ssinstall | 19 +++---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/debian/spark-store.postinst b/debian/spark-store.postinst index edba50c..75e621e 100755 --- a/debian/spark-store.postinst +++ b/debian/spark-store.postinst @@ -29,7 +29,10 @@ case "$1" in ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss - + + # Create symbol links for SSINSTALL + ln -s -f /opt/durapps/spark-store/bin/auto-install-policy/store.spark-app.ssinstall.policy /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy + # Compile the Sender module gcc /opt/durapps/spark-store/bin/ss-feedback/sender-d.sh.c -o /opt/durapps/spark-store/bin/ss-feedback/sender-d diff --git a/tool/ssinstall b/tool/ssinstall index 023ce5d..921adc3 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -15,19 +15,6 @@ function pkexec_as_current_user() { sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@" } -function zenity() { - #Detect the name of the display in use - local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)" - - #Detect the user using such display - local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1) - - #Detect the id of the user - local uid=$(id -u $user) - - sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@" -} - #################检测文件是否存在 if [ $# -eq 0 ];then echo "没有接收到参数,退出" @@ -68,9 +55,9 @@ dpkg -i "$1" || aptss install -yf else - -zenity --info --icon-name=spark-store --height 270 --width 500 --text "软件包校验失败!这不应该发生!\n可能是因为软件包已损坏,星火仓库未同步,或者最坏的情况:恶意软件尝试利用自动安装来入侵系统!\n如果你不清楚发生了什么,请在接下来的认证窗口中选择取消认证\n执行 sudo aptss ssupdate 后再尝试安装。\n如果问题仍然存在,请在应用信息界面点击 应用反馈 来提交反馈给我们!\n\n如果你是审核人员,这是正常现象,在审核通过前星火仓库不会保存相关信息。请在接下来的弹窗中进行认证即可" - +echo "校验失败,该deb不是星火已经上架的软件包,这可能是因为你正在尝试安装一个尚未上架的软件包" +echo "如果你是审核人员,这是正常的" +echo "为确保安全,将会询问密码" pkexec_as_current_user bash -c "dpkg -i "$1" || aptss install -yf "