mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
!85 修改: debian/spark-store.postinst 重命名: tool/ss-apt-fast -> tool/aptss
* 删除文件 spark-wine7-devel_7.14~spark-1_amd64.deb * final * 修改: debian/spark-store.postinst * 修改: tool/update-upgrade/ss-update-controler.sh * 修改: debian/spark-store.postinst * 只额外生成一份给aptss * 修改: debian/spark-store.postinst * 要提交的变更: * 修改: tool/aptss * 修改: debian/changelog * 修改: pkg/usr/share/bash-completion/completions/aptss * 修改: pkg/usr/share/bash-completion/completions/aptss * 修改: debian/spark-store.postinst * aa * Merge branch 'master' of https://gitee.com/deepin-community-store/spark-store * 修改: src/main.cpp * Merge branch 'master' of https://gitee.com/deepin-community-store/spark-store * 修改: debian/spark-store.postinst
This commit is contained in:
73
tool/aptss
Executable file
73
tool/aptss
Executable file
@@ -0,0 +1,73 @@
|
||||
#/bin/bash
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then
|
||||
|
||||
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||
###刷新apt-fast配置
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
fi
|
||||
|
||||
DEPEND=`which apt-fast`
|
||||
if [ "$DEPEND" = "" ] ; then
|
||||
echo "未安装依赖:apt-fast 开始安装"
|
||||
sudo aptss ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
fi
|
||||
|
||||
###执行
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt-fast "$@" --allow-downgrades
|
||||
|
||||
|
||||
elif [ "$1" = "ssupdate" ];then
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
### 额外一份拿来给aptss自动补全用
|
||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o Dir::Cache="/etc/aptss/" -o APT::Get::List-Cleanup="0"
|
||||
#只更新星火源
|
||||
|
||||
elif [ "$1" = "update" ];then
|
||||
sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
### 额外一份拿来给aptss自动补全用
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt "$@" -o APT::Get::List-Cleanup="0"
|
||||
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt "$@" -o APT::Get::List-Cleanup="0" -o Dir::Cache="/etc/aptss/"
|
||||
|
||||
else
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt "$@"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
#/bin/bash
|
||||
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then
|
||||
|
||||
###刷新apt-fast配置
|
||||
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
||||
# 创建文件夹
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo
|
||||
curl --progress-bar -o /tmp/ss-apt-fast-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
chmod -R 755 /tmp/ss-apt-fast-conf
|
||||
|
||||
|
||||
DEPEND=`which apt-fast`
|
||||
if [ "$DEPEND" = "" ] ; then
|
||||
echo "未安装依赖:apt-fast 开始安装"
|
||||
sudo ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
fi
|
||||
###执行安装
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/tmp/ss-apt-fast-conf/apt-fast.conf' /etc/apt-fast.conf \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt-fast "$@" --allow-downgrades
|
||||
|
||||
rm -rf /tmp/ss-apt-fast-conf
|
||||
|
||||
elif [ "$1" = "ssupdate" ];then
|
||||
sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
#只更新星火源
|
||||
|
||||
else
|
||||
bwrap --dev-bind / / \
|
||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||
apt "$@"
|
||||
fi
|
||||
|
||||
|
||||
@@ -50,22 +50,22 @@ if [ "$(id -u)" != "0" ];then
|
||||
IS_INSTALLED=`which apt-fast`
|
||||
if [ "$IS_INSTALLED" = "" ] ; then
|
||||
echo "未安装依赖:apt-fast 开始安装"
|
||||
echo "$upass" | sudo -S /usr/local/bin/ss-apt-fast ssupdate && echo "$upass" | sudo -S bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
echo "$upass" | sudo -S aptss ssupdate && echo "$upass" | sudo -S bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
|
||||
fi
|
||||
|
||||
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
||||
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
||||
echo ----------------------------------------------------------------------------------
|
||||
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||
echo "$upass" | sudo -S dpkg -i $1 || sudo aptss ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
||||
echo "检测到apt-fast,使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
|
||||
echo "检测到apt-fast,使用aptss进行多线程下载加速"
|
||||
echo ----------------------------------------------------------------------------------
|
||||
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo /usr/local/bin/ss-apt-fast install -yf
|
||||
echo "$upass" | sudo -S dpkg -i $1 || sudo aptss ssupdate && sudo aptss install -yf
|
||||
fi
|
||||
|
||||
|
||||
@@ -78,19 +78,19 @@ else
|
||||
IS_INSTALLED=`which apt-fast`
|
||||
if [ "$IS_INSTALLED" = "" ] ; then
|
||||
echo "未安装依赖:apt-fast 开始安装"
|
||||
/usr/local/bin/ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
aptss ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||
fi
|
||||
|
||||
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
||||
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
||||
echo ----------------------------------------------------------------------------------
|
||||
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||
dpkg -i $1 || aptss ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||
fi
|
||||
|
||||
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
||||
echo "检测到apt-fast,使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
|
||||
echo "检测到apt-fast,使用aptss进行多线程下载加速"
|
||||
echo ----------------------------------------------------------------------------------
|
||||
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && /usr/local/bin/ss-apt-fast install -yf
|
||||
dpkg -i $1 || aptss ssupdate && aptss install -yf
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Exec=/opt/durapps/spark-store/bin/update-upgrade/ss-update-notify.sh
|
||||
Name=spark-update-notifier
|
||||
@@ -16,14 +16,14 @@ echo "UOS中系统依赖无法使用第三方下载工具,使用apt-fast下载
|
||||
for PKG_NAME in $PKG_LIST;
|
||||
do
|
||||
echo "$PKG_NAME 正在下载..."
|
||||
sudo /usr/local/bin/ss-apt-fast download "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
sudo aptss download "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
done
|
||||
|
||||
echo "----开始安装"
|
||||
for PKG_NAME in $PKG_LIST;
|
||||
do
|
||||
echo "$PKG_NAME 正在准备更新..."
|
||||
if sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
if sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
then
|
||||
echo "$PKG_NAME 已更新"
|
||||
else
|
||||
@@ -38,7 +38,7 @@ else ###这是确定是否为UOS
|
||||
for PKG_NAME in $PKG_LIST;
|
||||
do
|
||||
echo "$PKG_NAME 正在准备更新..."
|
||||
if sudo /usr/local/bin/ss-apt-fast install "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
if sudo aptss install "$PKG_NAME" -y >/dev/null 2>&1;
|
||||
then
|
||||
echo "$PKG_NAME 已更新"
|
||||
else
|
||||
|
||||
@@ -51,20 +51,15 @@ case $option in
|
||||
;;
|
||||
1)
|
||||
echo "执行以下操作需要授权..."
|
||||
if [ -f /etc/xdg/autostart/spark-update-notifier.desktop ];then
|
||||
if [ -e /etc/systemd/system/multi-user.target.wants/spark-update-notifier.service ];then
|
||||
echo "---检测到已经启动了自动更新检测,执行关闭"
|
||||
sudo systemctl disable spark-update-notifier
|
||||
sudo rm /etc/xdg/autostart/spark-update-notifier.desktop
|
||||
sleep 3
|
||||
reset
|
||||
else
|
||||
echo "---未检测到自动更新检测,执行启动"
|
||||
sudo systemctl enable spark-update-notifier
|
||||
sudo service spark-update-notifier start
|
||||
# ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop $XDG_CONFIG_HOME/autostart
|
||||
#
|
||||
sudo ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop /etc/xdg/autostart
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-update-notify.sh now
|
||||
sleep 3
|
||||
reset
|
||||
fi
|
||||
@@ -72,8 +67,8 @@ case $option in
|
||||
|
||||
2)
|
||||
echo "执行以下操作需要授权..."
|
||||
sudo ss-apt-fast ssupdate
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
|
||||
sudo aptss ssupdate
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
||||
echo "---请按回车返回"
|
||||
read
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
rm -rf /tmp/spark-store-updatenum/number
|
||||
LANG=en.US
|
||||
|
||||
#!/bin/bash
|
||||
function notify-send() {
|
||||
#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 notify-send "$@"
|
||||
}
|
||||
|
||||
#检测网络链接畅通
|
||||
function network()
|
||||
@@ -39,7 +49,7 @@ fi
|
||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
# 每日更新星火源文件
|
||||
|
||||
updatetext=`ss-apt-fast ssupdate`
|
||||
updatetext=`aptss ssupdate`
|
||||
|
||||
|
||||
mkdir -p /tmp/spark-store-updatenum/
|
||||
@@ -47,14 +57,14 @@ mkdir -p /tmp/spark-store-updatenum/
|
||||
|
||||
isupdate=`echo ${updatetext: -5}`
|
||||
if [ "$isupdate" = "date." ];then
|
||||
sudo echo "0" > /tmp/spark-store-updatenum/number
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串`
|
||||
update_app_number=`echo ${update_app_number##*information...}`
|
||||
sudo echo "$update_app_number" > /tmp/spark-store-updatenum/number
|
||||
|
||||
|
||||
|
||||
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
isexistnumber=0
|
||||
if [ "$1" = "now" ];then
|
||||
if [ -f /tmp/spark-store-updatenum/number ];then
|
||||
update_app_number=`cat /tmp/spark-store-updatenum/number`
|
||||
echo "$update_app_number"
|
||||
if [ "$update_app_number" = "0" ];then
|
||||
exit 0
|
||||
fi
|
||||
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
until [ $isexistnumber -eq 1 ];do
|
||||
if [ -f /tmp/spark-store-updatenum/number ];then
|
||||
sleep 10
|
||||
update_app_number=`cat /tmp/spark-store-updatenum/number`
|
||||
echo "$update_app_number"
|
||||
if [ "$update_app_number" = "0" ];then
|
||||
exit 0
|
||||
fi
|
||||
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||
isexistnumber=1
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
@@ -3,4 +3,4 @@ set -e
|
||||
|
||||
|
||||
echo "---可更新的应用有:"
|
||||
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
reset
|
||||
|
||||
echo "Copyright (c) 2019-2021 The Spark Project"
|
||||
|
||||
if [ -x "/usr/bin/deepin-deb-installer" ] ; then
|
||||
echo "深度软件包安装器已安装,开始检测证书"
|
||||
else
|
||||
echo "未安装深度软件包安装器,拒绝执行"
|
||||
echo "UOS需要深度软件包安装器来认证签名"
|
||||
echo "如果你用的是UOS,你能卸载这玩意说明你已经开了开发者模式......悄悄告诉你,放屁是不用脱裤子的!"
|
||||
echo "如果你用的不是统信系发行版......所以你为什么要打开这个脚本?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/ca-certificates/deepin/private/priv.crt" ] ; then
|
||||
echo "检测到已经生成过证书,直接跳过询问"
|
||||
else
|
||||
until [ -f "/usr/bin/cert-tool" ] ; do
|
||||
#强制未安装证书工具的不通过
|
||||
echo "该工具的原理是利用UOS的自签名安装包免开发者的特性,需要您的UOS ID账号和密码,请在使用工具前确保在应用商店中已安装过“证书工具”这个应用"
|
||||
echo "如果没有安装,则无法使用。请确认安装后再进行下一步操作"
|
||||
sleep 3
|
||||
echo "如果你确认已经安装了该应用,请按回车"
|
||||
read renyijian
|
||||
|
||||
#检测是否在说谎签名文件
|
||||
if [ -f "/usr/bin/cert-tool" ] ; then
|
||||
echo "成功检测到cert-tool存在,开始检测证书\n"
|
||||
else
|
||||
echo "没有检测到该应用,请您再次确认“证书工具”已经安装!"
|
||||
sleep 3
|
||||
clear
|
||||
fi
|
||||
done
|
||||
|
||||
until [ -f "/usr/share/ca-certificates/deepin/private/priv.crt" ] ; do
|
||||
echo "没有检测到证书,准备调用证书工具生成证书,请输入您的UOS账号/密码。本脚本不会上传任何信息"
|
||||
echo "请在此行输入您的UOS账号用户名/电话号/邮箱"
|
||||
read -e account
|
||||
echo "请在此行输入您的UOS账号密码"
|
||||
read -e passwd
|
||||
echo "即将安装证书,请在弹出的窗口安装"
|
||||
cert-tool -username="$account" -password="$passwd"
|
||||
done
|
||||
echo "检测到已经生成过证书,准备签名"
|
||||
fi
|
||||
#这个if是判断是否已经有证书
|
||||
|
||||
unset account
|
||||
unset passwd
|
||||
unset renyijian
|
||||
|
||||
debpath=""
|
||||
cd /tmp
|
||||
|
||||
until [ -f "$debpath" ] ; do
|
||||
if [ ! $1 ] ; then
|
||||
echo "没有检测到参数,以交互式安装运行"
|
||||
echo "请输入deb文件的绝对路径或直接拖入deb文件(仅限支持的文件管理器,比如深度文管),结束后回车"
|
||||
echo "生成的签名过的deb将保存在/tmp/signed_deb"
|
||||
read debpath
|
||||
else
|
||||
echo "参数存在,直接开始签名\n生成的签名过的deb保存在/tmp/signed_deb"
|
||||
debpath="$1"
|
||||
echo "读取到的deb路径为:$debpath"
|
||||
fi
|
||||
debpath=`echo "$debpath" | sed $'s/\'//g'`
|
||||
echo "去除可能的单引号后得到:$debpath"
|
||||
|
||||
if [ -f $debpath ] ; then
|
||||
echo "文件有效,开始签名"
|
||||
echo "------------以下为签名工具输出------------"
|
||||
deepin-elf-sign-deb "$debpath"
|
||||
echo "------------签名工具输出已结束------------"
|
||||
echo "签名结束,启动深度软件包管理器"
|
||||
else
|
||||
echo "路径出错,请确认你输入了正确的路径!"
|
||||
sleep 3
|
||||
clear
|
||||
fi
|
||||
done
|
||||
|
||||
file_name=$(basename "$debpath")
|
||||
|
||||
echo "--------以下为深度软件包安装器输出--------"
|
||||
deepin-deb-installer "/tmp/signed_deb/$file_name"
|
||||
echo "--------深度软件包安装器输出已结束--------"
|
||||
echo "删除临时文件"
|
||||
rm /tmp/signed_deb/$file_name
|
||||
142
tool/ussremove
142
tool/ussremove
@@ -1,142 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
reset
|
||||
|
||||
echo "Copyright (c) 2019-2021 The Spark Project"
|
||||
|
||||
if [ -x "/usr/bin/deepin-deb-installer" ] ; then
|
||||
echo "深度软件包安装器已安装,开始检测证书"
|
||||
else
|
||||
echo "未安装深度软件包安装器,拒绝执行"
|
||||
echo "UOS需要深度软件包安装器来认证签名"
|
||||
echo "如果你用的是UOS,你能卸载这玩意说明你已经开了开发者模式......悄悄告诉你,放屁是不用脱裤子的!"
|
||||
echo "如果你用的不是统信系发行版......所以你为什么要打开这个脚本?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/ca-certificates/deepin/private/priv.crt" ] ; then
|
||||
echo "检测到已经生成过证书,直接跳过询问"
|
||||
else
|
||||
until [ -f "/usr/bin/cert-tool" ] ; do
|
||||
#强制未安装证书工具的不通过
|
||||
echo "该工具的原理是利用UOS的自签名安装包免开发者的特性,需要您的UOS ID账号和密码,请在使用工具前确保在应用商店中已安装过“证书工具”这个应用"
|
||||
echo "如果没有安装,则无法使用。请确认安装后再进行下一步操作"
|
||||
echo "如果你确认已经安装了该应用,请按回车"
|
||||
read renyijian
|
||||
|
||||
#检测是否在说谎签名文件
|
||||
if [ -f "/usr/bin/cert-tool" ] ; then
|
||||
echo "成功检测到cert-tool存在,开始检测证书\n"
|
||||
else
|
||||
echo "没有检测到该应用,请您再次确认“证书工具”已经安装!"
|
||||
sleep 3
|
||||
clear
|
||||
fi
|
||||
done
|
||||
|
||||
until [ -f "/usr/share/ca-certificates/deepin/private/priv.crt" ] ; do
|
||||
echo "没有检测到证书,准备调用证书工具生成证书,请输入您的UOS账号/密码。本脚本不会上传任何信息"
|
||||
echo "请在此行输入您的UOS账号用户名/电话号/邮箱"
|
||||
read account
|
||||
echo "请在此行输入您的UOS账号密码"
|
||||
read passwd
|
||||
echo "即将安装证书,请在弹出的窗口安装"
|
||||
cert-tool -username="$account" -password="$passwd"
|
||||
done
|
||||
echo "检测到已经生成过证书,准备签名"
|
||||
fi
|
||||
#这个if是判断是否已经有证书
|
||||
|
||||
unset account
|
||||
unset passwd
|
||||
unset renyijian
|
||||
|
||||
mkdir -p /tmp/spark-store-appremover
|
||||
cd /tmp/spark-store-appremover
|
||||
#工作目录应当为 /tmp/spark-store-appremover
|
||||
|
||||
while [ ! $pkgname ] ; do
|
||||
if [ ! $1 ] ; then
|
||||
echo "没有检测到包名,以交互式模式运行"
|
||||
echo "请输入你要卸载的软件包名,输入结束后回车"
|
||||
read pkgname
|
||||
else
|
||||
echo "检测到包名,跳过获取"
|
||||
pkgname="$1"
|
||||
echo "读取到的包名为:$pkgname"
|
||||
fi
|
||||
|
||||
if [ ! $pkgname ] ; then
|
||||
echo "没有检测到包名,请重新输入!"
|
||||
sleep 3
|
||||
clear
|
||||
else
|
||||
echo "包名读取成功,进入下一步"
|
||||
fi
|
||||
done
|
||||
|
||||
#while [ ! $version ] ; do
|
||||
# if [ ! $2 ] ; then
|
||||
# echo "没有检测到版本号,以交互式模式运行"
|
||||
# echo "请输入你要卸载的软件包版本号,输入结束后回车"
|
||||
# read version
|
||||
# else
|
||||
# echo "检测到包名,跳过获取"
|
||||
# version="$2"
|
||||
# echo "读取到的版本号为:$version"
|
||||
# fi
|
||||
#
|
||||
# if [ ! $version ] ; then
|
||||
# echo "没有检测到版本号,请重新输入!"
|
||||
# sleep 3
|
||||
# clear
|
||||
# else
|
||||
# echo "版本号读取成功,进入下一步"
|
||||
# fi
|
||||
#done
|
||||
|
||||
#发现版本号不一定一致也可以卸载
|
||||
version="1.0"
|
||||
echo "开始生成deb包"
|
||||
echo "输出的control文件为"
|
||||
echo ""
|
||||
echo "Package: $pkgname"
|
||||
echo "Version: $version"
|
||||
echo "Depends: "
|
||||
echo "Maintainer: spark-store"
|
||||
echo "Description: 这是一个假软件包,请点击卸载"
|
||||
echo "Architecture: $(arch)"
|
||||
echo "-----------------------开始生成-----------------------"
|
||||
workdir=$(pwd)
|
||||
echo "工作目录为$workdir"
|
||||
mkdir DEBIAN
|
||||
cd DEBIAN
|
||||
touch control
|
||||
echo "Package: $pkgname" >> ./control
|
||||
echo "Version: $version" >> ./control
|
||||
echo "Depends: " >> ./control
|
||||
echo "Maintainer: spark-store" >> ./control
|
||||
echo "Description: 这是一个假软件包,请点击卸载" >> ./control
|
||||
echo "Architecture: $(arch)" >> ./control
|
||||
|
||||
echo "-----------------------开始打包-----------------------"
|
||||
cd ..
|
||||
workdir=$(pwd)
|
||||
echo "回退到工作目录,当前目录位于$workdir"
|
||||
fakeroot dpkg -b . ./uninstall.deb
|
||||
echo "-----------------------打包结束-----------------------"
|
||||
|
||||
cd /tmp
|
||||
|
||||
echo "-----------------------开始签名-----------------------"
|
||||
deepin-elf-sign-deb "/tmp/spark-store-appremover/uninstall.deb"
|
||||
echo "-----------------------签名结束-----------------------"
|
||||
echo "-----------------启动深度软件包管理器-------------------"
|
||||
|
||||
deepin-deb-installer "/tmp/signed_deb/uninstall.deb"
|
||||
|
||||
file_name=$(basename "/tmp/signed_deb/uninstall.deb")
|
||||
echo "---------------以上为深度软件包管理器输出----------------"
|
||||
echo "删除临时包"
|
||||
rm "/tmp/signed_deb/$file_name"
|
||||
rm -r /tmp/spark-store-appremover
|
||||
Reference in New Issue
Block a user