-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated by ./update.sh - do not update manually! | ||
# Last updated: 2024-11-06 | ||
{ | ||
version = "12.8.2.18605"; | ||
pro_arm64_url = "https://wps-linux-365.wpscdn.cn/wps/download/ep/Linux365/18605/wps-office_12.8.2.18605.AK.preload.sw_arm64.deb"; | ||
pro_amd64_url = "https://wps-linux-365.wpscdn.cn/wps/download/ep/Linux365/18605/wps-office_12.8.2.18605.AK.preload.sw_amd64.deb"; | ||
pro_arm64_hash = "sha256-BzWpCMzCzn4RFXve7oVd405ErrQLif5wwGdC938oUXw="; | ||
pro_amd64_hash = "sha256-fy238yjdaV6pZOPulAMRJlcj/IHeRDjgMgrTVC0JPLQ="; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash --pure --keep GITHUB_TOKEN -p nix curl cacert nix-prefetch-git jq | ||
|
||
download_json=$(curl 'https://plus.wps.cn/ops/opsd/api/v2/policy' --compressed -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://365.wps.cn' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://365.wps.cn/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'TE: trailers' --data-raw '{"entity_param":[{"window_key":"wps365_download_pc_muti"}]}') | ||
arm64_url=$(echo $download_json | jq '.windows[0].data[3].value | fromjson | .[5].links[0].packageList[0].link' | sed 's/"//g') | ||
amd64_url=$(echo $download_json | jq '.windows[0].data[3].value | fromjson | .[5].links[1].packageList[0].link' | sed 's/"//g') | ||
version=$(echo $amd64_url | awk -F'[_]' '{print $2}' | awk -F'[AK]' '{print $1}' | sed -E 's/(.*)./\1/') | ||
arm64_hash=$(nix hash to-sri --type sha256 "$(nix-prefetch-url $arm64_url)") | ||
amd64_hash=$(nix hash to-sri --type sha256 "$(nix-prefetch-url $amd64_url)") | ||
|
||
cat > sources.nix <<EOF | ||
# Generated by ./update.sh - do not update manually! | ||
# Last updated: $(date +%F) | ||
{ | ||
version = "$version"; | ||
pro_arm64_url = "$arm64_url"; | ||
pro_amd64_url = "$amd64_url"; | ||
pro_arm64_hash = "$arm64_hash"; | ||
pro_amd64_hash = "$amd64_hash"; | ||
} | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters