Skip to content

Commit

Permalink
👷 Fix action download apk
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Mar 12, 2024
1 parent c20d15f commit 199325c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ const repo = "PaiGramTeam/GetToken"
const token = process.env.GHP_TOKEN

const getAppVersion = async () => {
const latestVersionRsp = await axios.get("https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease", {
const latestVersionRsp = await axios.get("https://api-takumi.miyoushe.com/ptolemaios_api/api/getLatestRelease", {
headers: {
"x-rpc-client_type": "2",
"x-rpc-app_version": "2.37.1",
"x-rpc-channel": "miyousheluodi"
"x-rpc-app_version": "2.67.1",
"x-rpc-channel": "miyousheluodi",
"x-rpc-h265_supported": "1",
"referer": "https://app.mihoyo.com",
"x-rpc-verify_key": "bll8iq97cem8",
"user-agent": "okhttp/4.9.3"
}
})
return latestVersionRsp.data.data
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
- name: Install jq
run: sudo apt-get install -y jq
- name: Download package
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"
run: |
chmod +x download.sh
./download.sh
- name: Patch package
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"
- name: Upload build artifacts
Expand Down
6 changes: 6 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# shellcheck disable=SC2154
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")"
url="$(echo "$jsonData" | jq --raw-output '.data.package_url')"
curl -o miyoushe.apk "$url"

0 comments on commit 199325c

Please sign in to comment.