genshin.py icon indicating copy to clipboard operation
genshin.py copied to clipboard

DS algorithm and salt value upgrade

Open BachelorForever opened this issue 2 years ago • 3 comments

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:

  1. 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.
  2. Also x-rpc-device_model/x-rpc-device_name, I don't expect that many user know their correct device modal/name string.
  3. It isn't really user-friendly if some value aren't obtainable unless u install a mitm proxy.
  4. Does the daily reward requires separate ds salt value?

BachelorForever avatar Nov 29 '22 01:11 BachelorForever

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

luoshuijs avatar Nov 29 '22 09:11 luoshuijs

I doubt random device id would avoid geetest

BachelorForever avatar Nov 30 '22 07:11 BachelorForever

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.

thesadru avatar Dec 03 '22 14:12 thesadru