adb shell settings get global http_proxy
如果返回值为null或0,则需要设置代理:
adb shell settings put global http_proxy 127.0.0.1:8080
其中8080为Burpsuite监听的端口号。
adb push burpca.crt /mnt/sdcard/
adb shell 'su -c "mount -o remount,rw /system"'
adb shell 'su -c "cp /mnt/sdcard/burpca.crt /system/etc/security/cacerts/"'
adb shell 'su -c "chmod 644 /system/etc/security/cacerts/burpca.crt"'
adb shell 'su -c "mount -o remount,ro /system"'
adb shell settings put global http_proxy 127.0.0.1:8080
adb shell am broadcast -a android.intent.action.PROXY_CHANGE
完成上述步骤后,重新启动你的应用程序,Burpsuite便可以成功拦截和修改Android上的请求。