Skip to content

Commit

Permalink
WPS Office: add custom download command for install scripts and URL v…
Browse files Browse the repository at this point in the history
…alidation in updater
  • Loading branch information
theofficialgman committed Jan 15, 2024
1 parent 6487690 commit d49a883
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/updates/WPS Office.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ webVer="$(wget -qO- --timeout=5 https://linux.wps.cn/ | grep -o 'wps\-office_.*_
arm64_url="https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo "$webVer" | sed 's/.*\.//g')/wps-office_${webVer}_arm64.deb"
armhf_url="https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo "$webVer" | sed 's/.*\.//g')/wps-office_${webVer}_arm64.deb"

# custom validate url function
# this will not overwrite the validate_url function created by the main update_apps.yml file for other update scripts
function validate_url(){
if command wget --header="Referer: https://linux.wps.cn/" --timeout=5 -q --spider "$1"; then
return 0
else
return 1
fi
}

source $GITHUB_WORKSPACE/.github/workflows/update_github_script.sh
3 changes: 2 additions & 1 deletion apps/WPS Office/install-32
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ preserve-environment=true" | sudo tee /etc/schroot/chroot.d/wps-office-chroot >/
echo
#package found in: https://linux.wps.cn/
version=11.1.0.11711
wget "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo $version | sed 's/.*\.//g')/wps-office_${version}_arm64.deb" -O /tmp/wps-office.deb || error "In the 64-bit chroot, wget failed to download wps-office.deb!"
# download wps office with custom command
wget --header="Referer: https://linux.wps.cn/" "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo $version | sed 's/.*\.//g')/wps-office_${version}_arm64.deb" -c -O /tmp/wps-office.deb || error "In the 64-bit chroot, wget failed to download wps-office.deb!"
sudo mv /tmp/wps-office.deb /opt/wps-office-chroot/wps-office.deb

status "Installing wps package in the chroot..."
Expand Down
7 changes: 6 additions & 1 deletion apps/WPS Office/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ else
firejail_package="http://ports.ubuntu.com/pool/universe/f/firejail/firejail_0.9.62-3ubuntu0.1_arm64.deb"
fi

install_packages "$firejail_package" "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo $version | sed 's/.*\.//g')/wps-office_${version}_arm64.deb" || exit 1
# download wps office with custom command
rm -f /tmp/wps-office.deb
wget --header="Referer: https://linux.wps.cn/" "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/$(echo $version | sed 's/.*\.//g')/wps-office_${version}_arm64.deb" -c -O /tmp/wps-office.deb || exit 1

install_packages "$firejail_package" /tmp/wps-office.deb || exit 1
rm -f /tmp/wps-office.deb

#Prevent application from connecting to the internet
sudo sed -i 's|^Exec=|Exec=firejail --net=none --noblacklist=~/.local/share/Kingsoft --noblacklist=~/.config/Kingsoft |g' /usr/share/applications/wps*.desktop

0 comments on commit d49a883

Please sign in to comment.