lena萌宝宝

导航

charles配置安卓上抓包怎么设置?

平板上用charles抓https 的包 不行的可以参考这个文档
https://cloud.tencent.com/developer/article/2496038

步骤:

1.电脑安装charles,help查看IP

2.pad上wifi中设置代理IP和端口号进去

此时charles上会收到一个消息,点击确定

3.打开charles,

 

 

4.对下载的证书进行hash计算,打开电脑终端输入以下命令进行计算,再使用这个hash值对证书文件进行重名,并且文件名后缀为.0

把下载到桌面的证书改成算出来的hash值的名称

 5.平板连接电脑usb

adb root

adb push C:\Users\yinli\Desktop\80a3ce24.0  /data/local/tmp

cd /data/local/tmp/

touch 123.sh

vi 123.sh

进入复制粘贴下面这段代码:

将里面的

 换成80a3ce24.0

mkdir -p -m 700 /data/local/tmp/tmp-ca-copy
 
cp /apex/com.android.conscrypt/cacerts/* /data/local/tmp/tmp-ca-copy/
 
mount -t tmpfs tmpfs /system/etc/security/cacerts
 
mv /data/local/tmp/tmp-ca-copy/* /system/etc/security/cacerts/
 
cp /data/local/tmp/74f17b3e.0 /system/etc/security/cacerts/

 
chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*
 
ZYGOTE_PID=$(pidof zygote || true)
ZYGOTE64_PID=$(pidof zygote64 || true)
 
for Z_PID in "$ZYGOTE_PID" "$ZYGOTE64_PID"; do
    if [ -n "$Z_PID" ]; then
        nsenter --mount=/proc/$Z_PID/ns/mnt -- \
            /bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
    fi
done
 
APP_PIDS=$(
    echo "$ZYGOTE_PID $ZYGOTE64_PID" | \
    xargs -n1 ps -o 'PID' -P | \
    grep -v PID
)
 
for PID in $APP_PIDS; do
    nsenter --mount=/proc/$PID/ns/mnt -- \
        /bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts &
done
wait # Launched in parallel - wait for completion here
 
echo "System certificate injected"

chmod 777 123.sh

source 123.sh

 

表示已经OK,到charles上可以查看到包了

 

posted on 2025-04-17 15:25  宝宝萌  阅读(153)  评论(0)    收藏  举报