thesadru / genshin.py

Modern API wrapper for Genshin Impact & Honkai Impact 3rd built on asyncio and pydantic. 原神 崩坏3
https://thesadru.github.io/genshin.py
MIT License
390 stars 71 forks source link

Implement the Traveler's Diary #2

Closed thesadru closed 2 years ago

thesadru commented 2 years ago

The Traveler's Diary has been available in the hoyolab app for a while now. Chinese users had it for some time already, as proved by https://github.com/hyhAsma/Genshin_id_inquiry/commit/904441a399874295a9e0b16125cae3f7012bfe7d Implementations of it already exist (for example Snap.Genshin) but there don't seem to be any for overseas players.

This has been addressed before in https://github.com/thesadru/genshinstats/issues/18 but the endpoint has been falsely identified as the endpoint for transaction logs.

This task would've ordinarily been very simple however this data is only visible from the app. This requires reverse-engineering the app itself which has been done for the Chinese Miyoushe app but not for the Overseas Hoyolab one. I will be attempting to somehow intercept requests but I do not have any experience with reverse-engineering apps so I would gladly appreciate any help.

PS: Chinese users may already use this feature thanks to 1600940.

CustomIcon commented 2 years ago

Screenshot_2021-10-28-14-40-21-325_com guoshi httpcanary you mean this?

edit: i had to use an http proxy to fetch endpoints might be helpful

CustomIcon commented 2 years ago

IMG_20211028_144656 Screenshot_2021-10-28-14-46-27-906_com guoshi httpcanary soo. yeah here you go

thesadru commented 2 years ago

Oh yeah, that's the one. What did you do to be able to see the entire request? I swear everything I tried failed because I couldn't intercept the https request before it's been encrypted so I could only ever see the domain.

The first one is the real-time notes, that one is already implemented.

CustomIcon commented 2 years ago

i used http Canary. i have a modded apk for myself that has removed tracking and ads, and fixed certificate to capture http and tcp request from any app. you can contact me through telegram https://t.me/CustomIcon and ill give you instructions on how to get it work, or help you with those requests since i have a rooted phone