genshin.py
genshin.py copied to clipboard
DS algorithm and salt value upgrade
Currently we're using version 2.11.1, way lower behind the live production ds version 2.40.
Some related code:
https://github.com/y1ndan/genshinhelper2/blob/5402ffbe76885432d387e3cf04bb9d1dcefb9075/genshinhelper/utils.py#L163-L202 https://github.com/Le-niao/Yunzai-Bot/blob/07f39c89bd2603b447ba924aea43e55c2b6d6549/plugins/genshin/model/mys/mysApi.js#L230-L307
Looks like we also need to send full headers to daily reward endpoint, but there's some problem:
- x-rpc-device_id value only obtainable in daily reward requests made by official client, kinda hard to get it unless everyone know how to use mitm proxy.
- Also x-rpc-device_model/x-rpc-device_name, I don't expect that many user know their correct device modal/name string.
- It isn't really user-friendly if some value aren't obtainable unless u install a mitm proxy.
- Does the daily reward requires separate ds salt value?
We cannot expect each user to install the mitm proxy and can only generate random x-rpc-device_id
values for the user to use.
https://github.com/Le-niao/Yunzai-Bot/blob/07f39c89bd2603b447ba924aea43e55c2b6d6549/plugins/genshin/model/mys/mysApi.js#L301-L307
https://github.com/y1ndan/genshinhelper2/blob/5402ffbe76885432d387e3cf04bb9d1dcefb9075/genshinhelper/core.py#L14-L29
Daily rewards require a separate DS salt value.
https://github.com/Le-niao/Yunzai-Bot/blob/07f39c89bd2603b447ba924aea43e55c2b6d6549/plugins/genshin/model/mys/mysApi.js#L292-L299
https://github.com/y1ndan/genshinhelper2/blob/5402ffbe76885432d387e3cf04bb9d1dcefb9075/genshinhelper/mihoyo.py#L233
I doubt random device id would avoid geetest
Yeah, I honestly don't understand how the flow would function at all 😭. I'd appreciate it if someone could add all of the functionality to the base library, but I don't see myself doing it any time soon.