Created
April 15, 2018 10:53
-
-
Save ImSingee/81e578392231541336acb7fc3c73019f to your computer and use it in GitHub Desktop.
「加减大师」游戏攻略
This file contains 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
import re | |
import json | |
from mitmproxy import ctx | |
from urllib.parse import quote | |
from pprint import pformat | |
def response(flow): | |
path = flow.request.path | |
if path == '/index/index_one_nine_two/make_question': | |
ctx.log.info('Start') | |
data = json.loads(flow.response.text) | |
ctx.log.info(pformat(data)) | |
if type(data) is list: | |
for m in data: | |
if type(m) is dict: | |
m['seconds'] = 20 | |
m['symbol'] = ' 对 ' if m['is_true'] == '1' else ' 错 ' | |
if type(data) is dict: | |
for k,v in data.items(): | |
if type(v) == dict: | |
v.update({'seconds': 20, 'symbol':' 对 ' if v['is_true'] == 1 else ' 错 '}) | |
flow.response.text = json.dumps(data) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
「加减大师」游戏攻略
安装 Python 3
安装 mitmproxy
在终端中运行以下命令即可
将程序代码保存在用户家目录下,命名为
jack.py
在终端中运行以下命令
mitmproxy -p 8129 -s ~/jack.py
设置代理
在iOS 下的「设置 - 无线局域网 - 你连接的 Wi-Fi 右侧的小 i - 配置代理 - 手动」中设置服务器和端口。
服务器为 Mac 的内网 IP 地址(可以通过按住 Option 键选择 Wi-Fi 图标查询)
端口为 8129
在手机中打开 mitm.it
下载证书、设置证书可信
根据操作系统选择平台下载证书(iOS 选择 Apple 标识并确认安装描述文件即可),并在「设置 - 通用 - 关于本机 - 证书信任设置」中打开「mitmproxy」
开心的玩吧~