mirror of
https://github.com/PaiGramTeam/mihoyo-api-collect.git
synced 2024-11-21 22:58:03 +00:00
Merge branch 'main' of https://github.com/Kamisato-Ayaka-233/mihoyo-api-collect
This commit is contained in:
commit
a78e038829
@ -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)
|
||||
|
@ -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`。
|
||||
|
@ -34,4 +34,11 @@
|
||||
| -111 | 登录失效,请重新登录 | Cookie失效或不正确 |
|
||||
| -101 | 参数错误 | 传递的参数缺失或错误 |
|
||||
| -100 | 登录失效,请重新登录<br>-100 | Cookie失效或不正确 |
|
||||
| 1000 | 参数错误 | 传递的参数缺失或错误 |
|
||||
| 1000 | 参数错误 | 传递的参数缺失或错误 |
|
||||
|
||||
# `api-launcher.mihoyo.com`
|
||||
|
||||
| 错误码 | 消息 | 原因 |
|
||||
| ----- | ---- | ---- |
|
||||
| -205 | invalid key | 启动器Key不正确 |
|
||||
| -204 | no record | 启动器ID不正确 |
|
@ -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_
|
||||
}
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
## 获取用户协议
|
||||
|
||||
_请求方式: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 | 用户协议版本 | 一般为当前游戏版本 |
|
||||
|
||||
<details>
|
||||
<summary>查看示例</summary>
|
||||
```json
|
||||
{
|
||||
"retcode": 0,
|
||||
"message": "OK",
|
||||
"data": {
|
||||
"protocol": "<p style=\"white-space: pre-wrap;\"><span style=\"color:rgba(0,0,0,1)\">Effective Date: July 5, 2023</span></p>\n\n<p style=\"white-space: pre-wrap; min-height: 1.5em; text-align: justify;\"><span style=\"color:rgba(0,0,0,1)\"> </span></p>\n\n<p style=\"white-space: pre-wrap; text-align: justify;\"><span style=\"color:rgba(0,0,0,1)\">PLEASE READ THESE TERMS OF SERVICE CAREFULLY, INCLUDING OUR PRIVACY POLICY.</span></p>\n\n<p style=\"white-space: pre-wrap; text-align: justify;\"><span style=\"color:rgba(0,0,0,1)\">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"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
Loading…
Reference in New Issue
Block a user