Skip to content

Commit 57e7811

Browse files
committed
👷 Fix action download apk
1 parent c20d15f commit 57e7811

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/utils.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ const repo = "PaiGramTeam/GetToken"
88
const token = process.env.GHP_TOKEN
99

1010
const getAppVersion = async () => {
11-
const latestVersionRsp = await axios.get("https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease", {
11+
const latestVersionRsp = await axios.get("https://api-takumi.miyoushe.com/ptolemaios_api/api/getLatestRelease", {
1212
headers: {
1313
"x-rpc-client_type": "2",
14-
"x-rpc-app_version": "2.37.1",
15-
"x-rpc-channel": "miyousheluodi"
14+
"x-rpc-app_version": "2.67.1",
15+
"x-rpc-channel": "miyousheluodi",
16+
"x-rpc-h265_supported": "1",
17+
"referer": "https://app.mihoyo.com",
18+
"x-rpc-verify_key": "bll8iq97cem8",
19+
"user-agent": "okhttp/4.9.3"
1620
}
1721
})
1822
return latestVersionRsp.data.data

.github/workflows/android.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
2929
- name: Install jq
3030
run: sudo apt-get install -y jq
3131
- name: Download package
32-
run: "curl -H 'x-rpc-client_type: 2' -H 'x-rpc-app_version: 2.52.1' -H 'x-rpc-channel: miyousheluodi' https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease | jq --raw-output '.data.package_url' | xargs curl -o miyoushe.apk"
32+
run: |
33+
chmod +x download.sh
34+
./download.sh
3335
- name: Patch package
3436
run: "mkdir out && mv app/build/outputs/apk/release/app-release.apk . && java -jar gradle/lspatch/jar-v0.5.1-361-release.jar -f -l 2 -m app-release.apk -o out miyoushe.apk && mv app-release.apk out"
3537
- name: Upload build artifacts

download.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# shellcheck disable=SC2154
4+
jsonData="$(curl -X GET "https://api-takumi.miyoushe.com/ptolemaios_api/api/getLatestRelease" -H "x-rpc-client_type: 2" -H "x-rpc-app_version: 2.67.1" -H "x-rpc-channel: miyousheluodi" -H "x-rpc-h265_supported: 1" -H "referer: https://app.mihoyo.com" -H "x-rpc-verify_key: bll8iq97cem8" -H "x-rpc-csm_source: " -H "user-agent: okhttp/4.9.3")"
5+
url="$(echo "$jsonData" | jq --raw-output '.data.package_url')"
6+
curl -o mihoyobbs.apk "$url"

0 commit comments

Comments
 (0)