核心思想是Android手机使用ubuntu pc中的网络代理Charles,然后手机的网络数据都会先到Charles, 然后使用Charles的网络数据分析工具分析网络。
安装Charles
下面代码来源https://gist.github.com/heyalexej/,并做了精简
#!/usr/bin/env sh
set -e
# install charles proxy from deb sources.
# http://www.charlesproxy.com
sudo sh -c 'echo "deb http://www.charlesproxy.com/packages/apt/ charles-proxy main" > /etc/apt/sources.list.d/charles-proxy.list'
wget -q http://www.charlesproxy.com/packages/apt/PublicKey -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y charles-proxy
# or for the brave
#sudo apt-get install -y charles-proxy-beta
运行charles
执行./charles即可。
配置手机代理
1)连接一个wifi网络 (比如 ‘itleaks’)
2)进入setting,选择wifi选项
3)长按已经连接的wifi网络 ‘itleaks’
4) Modify network config-> Show advanced options.
Set proxy settings.
ip: 设置为pc的ip
port:8888