From f4de1b3de63833e9cead9a850806d6566441b6cc Mon Sep 17 00:00:00 2001 From: CPTProgrammer <46586216+CPTProgrammer@users.noreply.github.com> Date: Thu, 24 Aug 2023 04:40:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0x-rpc-device=5Fid?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E5=AE=89=E5=8D=93=E8=AE=BE=E5=A4=87=E7=9A=84?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- other/authentication.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/other/authentication.md b/other/authentication.md index 4cb3884..4ba0ea1 100644 --- a/other/authentication.md +++ b/other/authentication.md @@ -81,6 +81,20 @@ _注:以下列表只是说明该请求头的值通常在哪些平台出现, 设备ID,由使用的设备决定。 +安卓上一般为一串由`ANDROID_ID`生成的`UUID`,Kotlin 中可以这样获取(Java 同理) +```Kotlin +import android.content.Context +import android.provider.Settings +import java.util.UUID + +@SuppressLint("HardwareIds") +fun getDeviceId(context: Context): String { + val androidId = Settings.Secure.getString(context.contentResolver, Settings.System.ANDROID_ID) + val uuid = UUID.nameUUIDFromBytes(androidId.toByteArray()) + return uuid.toString() +} +``` + #### `X-Requested-With` 国内版APP为`com.mihoyo.hyperion`。 From 6711387a592c59716db1fb1cf65f5c187585eaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=AB=E9=A2=9CJDC?= <1561515308@qq.com> Date: Thu, 24 Aug 2023 09:13:53 +0800 Subject: [PATCH 2/4] - --- other/error_code.md | 9 ++++++- other/launcher.md | 62 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 65 insertions(+), 6 deletions(-) diff --git a/other/error_code.md b/other/error_code.md index 329d5c8..75c9f52 100644 --- a/other/error_code.md +++ b/other/error_code.md @@ -34,4 +34,11 @@ | -111 | 登录失效,请重新登录 | Cookie失效或不正确 | | -101 | 参数错误 | 传递的参数缺失或错误 | | -100 | 登录失效,请重新登录
-100 | Cookie失效或不正确 | -| 1000 | 参数错误 | 传递的参数缺失或错误 | \ No newline at end of file +| 1000 | 参数错误 | 传递的参数缺失或错误 | + +# `/api-launcher.mihoyo.com` + +| 错误码 | 消息 | 原因 | +| ----- | ---- | ---- | +| -205 | invalid key | 启动器Key不正确 | +| -204 | no record | 启动器ID不正确 | \ No newline at end of file diff --git a/other/launcher.md b/other/launcher.md index 229e70f..a1421d7 100644 --- a/other/launcher.md +++ b/other/launcher.md @@ -1,8 +1,9 @@ # 游戏启动器信息 -- [获取推荐内容](#获取推荐内容) -- [获取游戏资源文件信息](#获取游戏资源文件信息) - +- [游戏启动器信息](#游戏启动器信息) + - [获取推荐内容](#获取推荐内容) + - [获取游戏资源文件信息](#获取游戏资源文件信息) + - [获取用户协议](#获取用户协议) --- ## 获取推荐内容 @@ -21,8 +22,8 @@ _请求方式:GET_ | ---- | ---- | ---- | ---- | | key | str | 启动器Key | | | launcher_id | num | 启动器ID | | -| language | str | 返回文本语言的国家代码 | | -| filter_adv | bool | 是否不获取背景图信息 | 留空则返回所有信息,即`false` | +| language | str | 返回文本语言的国家代码 | 国服仅支持中文(zh-cn) | +| filter_adv | bool | 是否不获取资讯信息 | 留空则返回所有信息,即`false` | **JSON返回:** @@ -429,4 +430,55 @@ _请求方式:GET_ } } ``` + + +## 获取用户协议 + +_请求方式:GET_ + +《原神》国服:`https://sdk-static.mihoyo.com/hk4e_cn/mdk/launcher/api/protocol` + +《原神》国际服:`https://hk4e-launcher-static.hoyoverse.com/hk4e_global/mdk/launcher/api/protocol` + +《崩坏:星穹铁道》国服:`https://api-launcher.mihoyo.com/hkrpg_cn/mdk/launcher/api/protocol` + +**参数:** + +| 字段 | 类型 | 内容 | 备注 | +| ---- | ---- | ---- | ---- | +| key | str | 启动器Key | | +| launcher_id | num | 启动器ID | | +| language | str | 返回文本语言的国家代码 | 国服仅支持中文(zh-cn) | + +**JSON返回:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ---- | ---- | ---- | ---- | +| retcode | num | 返回码 | | +| message | str | 返回消息 | | +| data | obj | 用户协议以及用户协议版本 | 若请求参数中的`language`为不支持的语言,则所有数据均为空与空数组 | + +`data`对象: +| 字段 | 类型 | 内容 | 备注 | +| ---- | ---- | ---- | ---- | +| protocol | str | 用户协议 | 为HTML | +| title | str | 用户协议标题 | | +| agreement_version | str | 用户协议版本 | 一般为当前游戏版本 | + +
+查看示例 +```json +{ + "retcode": 0, + "message": "OK", + "data": { + "protocol": "

Effective Date: July 5, 2023

\n\n

 

\n\n

PLEASE READ THESE TERMS OF SERVICE CAREFULLY, INCLUDING OUR PRIVACY POLICY.

\n\n

This Terms of Service ("Agreement") is a legally binding agreement between COGNOSPHERE PTE. LTD. ("COGNOSPHERE," "we," "our," or "us") and you ("you" or "User"). This Agreement governs your use of or access to COGNOSPHERE Game(s), our online website, any game-specific site, software systems, customer support, social media, community channels and/or any other online services provided by COGNOSPHERE and by any of our authorized third party (collectively the "COGNOSPHERE ...", + "title": "Terms of Service", + "agreement_version": "4.0" + } +} +``` +

\ No newline at end of file From e06c22607d9a1728e0c51d5edd79b538915935f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=AB=E9=A2=9CJDC?= <1561515308@qq.com> Date: Thu, 24 Aug 2023 09:17:28 +0800 Subject: [PATCH 3/4] - --- other/error_code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/error_code.md b/other/error_code.md index 75c9f52..ac90687 100644 --- a/other/error_code.md +++ b/other/error_code.md @@ -36,7 +36,7 @@ | -100 | 登录失效,请重新登录
-100 | Cookie失效或不正确 | | 1000 | 参数错误 | 传递的参数缺失或错误 | -# `/api-launcher.mihoyo.com` +# `api-launcher.mihoyo.com` | 错误码 | 消息 | 原因 | | ----- | ---- | ---- | From a939ffde654532a05a65399ba8544dfd62993fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=AB=E9=A2=9CJDC?= <1561515308@qq.com> Date: Thu, 24 Aug 2023 09:33:21 +0800 Subject: [PATCH 4/4] - --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9383ebe..419acb0 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ - [x] [绕过检测与鉴权](other/authentication.md) - [ ] [错误码](other/error_code.md) - [ ] [各种ID对照表](other/id.md) -- [x] [游戏启动器信息](other/launcher.md) +- [ ] [游戏启动器信息](other/launcher.md) --- ### 米游社(HoYoLab,MiYouShe)