diff --git a/.github/workflows/updates/WPS Office.sh b/.github/workflows/updates/WPS Office.sh index ea05c64902..58ca99b814 100755 --- a/.github/workflows/updates/WPS Office.sh +++ b/.github/workflows/updates/WPS Office.sh @@ -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 diff --git a/apps/WPS Office/install-32 b/apps/WPS Office/install-32 index 68b55471b4..adb2e7b998 100755 --- a/apps/WPS Office/install-32 +++ b/apps/WPS Office/install-32 @@ -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..." diff --git a/apps/WPS Office/install-64 b/apps/WPS Office/install-64 index e9db2000ca..f5a63df5b5 100755 --- a/apps/WPS Office/install-64 +++ b/apps/WPS Office/install-64 @@ -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