Skip to content

Commit

Permalink
fix: add some ci configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
AyaMahmoud148 committed Nov 26, 2024
1 parent 21bd8a6 commit 73e1687
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,36 +341,45 @@ commands:
adb root
sleep 5
adb remount
adb shell setprop net.eth0.dns1 8.8.8.8
adb shell setprop net.eth0.dns2 8.8.4.4
# Install MITM certificate
echo "Installing certificate..."
HASH=$(openssl x509 -inform PEM -subject_hash_old -in ~/.mitmproxy/mitmproxy-ca-cert.pem | head -1)
cp ~/.mitmproxy/mitmproxy-ca-cert.pem $HASH.0
adb push $HASH.0 /system/etc/security/cacerts/ && \
adb shell "chmod 644 /system/etc/security/cacerts/$HASH.0"
echo "Waiting for network connectivity..."
for i in {1..30}; do
if adb shell ping -c 1 8.8.8.8 >/dev/null 2>&1; then
echo "Network is accessible"
break
fi
echo "Attempt $i/30: Network not ready yet..."
sleep 2
done
# Configure proxy settings
echo "Configuring proxy settings for emulator..."
adb shell settings put global global_http_proxy_host "localhost"
echo "Configuring proxy settings..."
adb shell settings put global global_http_proxy_host "127.0.0.1"
adb shell settings put global global_http_proxy_port 8084
adb shell settings put global http_proxy "localhost:8084"
adb shell settings put global airplane_mode_on 0
adb shell settings put global private_dns_mode "off"
adb shell settings put global wifi_on 1
# Verify internet connectivity
adb shell ping -c 4 8.8.8.8
adb shell settings put global http_proxy "127.0.0.1:8084"
# Launch browser to test proxy
echo "Launching browser to test proxy..."
adb shell am start -n "com.android.chrome/com.google.android.apps.chrome.Main" -a android.intent.action.VIEW -d "https://example.com"
echo "Testing network connection..."
adb shell ping -c 4 8.8.8.8
# Verify proxy settings
echo "Verifying proxy settings..."
adb shell settings list global | grep proxy
echo "Testing proxy connection..."
adb shell curl -v --proxy 127.0.0.1:8084 http://mitm.it || {
echo "Proxy test failed. Debug info:"
echo "Current proxy settings:"
adb shell settings get global http_proxy
echo "Network interfaces:"
adb shell ifconfig
echo "Running proxy processes:"
ps aux | grep mitm
}
setup_ios_proxy:
steps:
Expand Down

0 comments on commit 73e1687

Please sign in to comment.