1、安装mitmproxy
pip install mitmproxy==8.1.1
2、安装雷神模拟器9
这个自行百度下载咯,注意启动安卓9版本
3、启动mitmproxy
cmd输入mitmweb 默认即可,接下来出现8080端口,记住这个端口,后续是可以自行修改的
接下来就是在模拟器中网络这里,添加上代理 ,填写上对应的IP和8080端口
随即在模拟器游览器中打开: mitm.it 网址
点击下载安卓证书.cer ,如果需要将证书安装至系统目录下,可以关注其它文章。
完了之后打开baidu.com,就可以看到对应的包了
4、常见问题
一、python开了代理后执行pip报错
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/urllib3/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /simple/urllib3/
第一:关掉VPN 第二:安装pip install urllib3==1.25.11
二、报错 ImportError: cannot import name ‘url_quote‘ from ‘werkzeug.urls‘
解决:pip install Werkzeug==2.2.2