Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy gives "网络配置解析失败,请重试" in-game #4

Open
Wirowo opened this issue Oct 13, 2022 · 0 comments
Open

Proxy gives "网络配置解析失败,请重试" in-game #4

Wirowo opened this issue Oct 13, 2022 · 0 comments

Comments

@Wirowo
Copy link

Wirowo commented Oct 13, 2022

Using the proxy as it is with some tweaks to network_config on Darknights-proxy.py to make it more similar to the actual server response ends with "网络配置解析失败,请重试" in-game.

The Darknights-proxy.py code looks like this:

from mitmproxy.options import Options
from mitmproxy.proxy.config import ProxyConfig
from mitmproxy.proxy.server import ProxyServer
from mitmproxy.tools.web.master import WebMaster
from mitmproxy.http import HTTPFlow
network_config = """
{"sign":"nC2VN/RNdRvgUbKyTQdQNOqLGxeFPpXSyUQafWgw1Et0ZStN8XhcJF1uC7I6xJEfj0I9hhceKvovXcynOmAHkRXX+bC28+U3SQFw1znujieIbkzL1WKWs5D3erg3VR/0Z2/bsT0TM+X0mxcDqrlfI/cAMjGUoRLZ6NCMSjkz65g=","content":"{\"configVer\":\"5\",\"funcVer\":\"V032\",\"configs\":{\"V032\":{\"override\":true,\"network\":{\"gs\":\"placeholder\",\"as\":\"placeholder\",\"u8\":\"placeholder\",\"hu\":\"https://ak.hycdn.cn/assetbundle/official\",\"hv\":\"https://ak-conf.hypergryph.com/config/prod/official/{0}/version\",\"rc\":\"https://ak-conf.hypergryph.com/config/prod/official/remote_config\",\"an\":\"https://ak-conf.hypergryph.com/config/prod/announce_meta/{0}/announcement.meta.json\",\"prean\":\"https://ak-conf.hypergryph.com/config/prod/announce_meta/{0}/preannouncement.meta.json\",\"sl\":\"https://ak.hypergryph.com/protocol/service\",\"of\":\"placeholder/index.html\",\"pkgAd\":\"https://ak.hypergryph.com/download\",\"pkgIOS\":\"https://apps.apple.com/cn/app/id1454663939\",\"secure\":false}}}}"}

"""

dist = "localhost.direct"

class ArkInterceptor():

    def __init__(self):
        print("Proxy Loaded.")

    def response(self, flow: HTTPFlow):
        if not flow.request.path.find("network_config") == -1:
            flow.response.set_text(str(network_config).replace("placeholder",dist))

# run directly for localhost only
if __name__ == "__main__":
    ops = Options(
        listen_host='0.0.0.0',
        listen_port=8080,
        ssl_insecure=True
    )
    master = WebMaster(ops)
    master.server = ProxyServer(ProxyConfig(ops))
    master.addons.add(ArkInterceptor())
    master.run()

addons = [
    ArkInterceptor()
]

Haven't been able to log in because the game doesn't like the proxy's response to the https://ak-conf.hypergryph.com/config/prod/official/network_config?sign=1665690559%20194323875%20502967 request. I apologize for not posting in Chinese, but I can't speak the language and Google translate is not a good option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant