Repository navigation
fix: use new CN APIManager keyset for app version 6.4.0+ - #3
Merged
Merged
Conversation
The CN server now selects the API AES keyset by the X-App-Version header. Clients reporting 6.4.0 or later receive responses encrypted with a new key/IV (extracted from the 6.4.0 global-metadata), so decrypting them with the old keyset yielded empty data and msgpack failed with 'Unpack failed: incomplete input'. - Add get_keyset(region, app_version) that falls back to the legacy keyset for CN versions below 6.4.0 - Use it for request encryption / response decryption in AbCache - Add 'cn-legacy' region to apidecrypt for old dumps Fixes #2
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2
问题
国服服务端会根据请求头
X-App-Version选择 API 的 AES keyset。客户端版本为 6.4.0 及以上时,响应用的是一组新的 key/IV。sssekai 仍用旧 keyset 解密,结果是空数据,于是msgpack报Unpack failed: incomplete input。对
GET /api/system的实测结果:新 key/IV 来自国服 6.4.0 APK 的
global-metadata.dat:P**************Or**************O改动
crypto/APIManager.py:cn换成新 keyset,旧 keyset 改名为cn-legacy;新增get_keyset(region, app_version),国服版本低于 6.4.0 时用 legacy keysetabcache:请求加密和响应解密都改用get_keysetapidecrypt:--region新增cn-legacy,用于解密旧版本的抓包数据测试
AbCache._update_system_data()实际请求国服:6.4.0 用新 keyset 解密成功;6.3.0 和 5.4.0 用 legacy keyset 解密成功POSTuser auth)以及 6.4.0 之后的 AssetBundleInfo 还没验证。🤖 Generated with Claude Code