Skip to content

Commit 846f423

Browse files
committed
fix: try pod file
1 parent 48ab342 commit 846f423

File tree

1 file changed

+42
-57
lines changed

1 file changed

+42
-57
lines changed

.circleci/config.yml

Lines changed: 42 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -176,47 +176,30 @@ commands:
176176
- run:
177177
name: Install Python3 and MITM Proxy
178178
command: |
179-
# Detect OS and install requirements accordingly
180-
if [ "$(uname)" == "Darwin" ]; then
181-
echo "Running on macOS..."
182-
brew install python3 openssl
183-
else
184-
echo "Running on Linux..."
185-
sudo apt-get update
186-
sudo apt-get install -y python3 python3-pip openssl
187-
fi
188-
189-
# Verify installations
190-
python3 --version
191-
pip3 --version
192-
193-
# Upgrade pip and install mitmproxy
194-
pip3 install --upgrade pip
195-
pip3 install mitmproxy==10.2.4
196-
197-
# Start mitmdump
198-
mitmdump --set block_global=false &
199-
sleep 10
200-
201-
# Create mitmproxy directory
202-
mkdir -p ~/.mitmproxy
203-
204-
# Wait for certificate generation
205-
while [ ! -f ~/.mitmproxy/mitmproxy-ca-cert.pem ]; do
206-
sleep 2
207-
done
208-
209-
# Create all required certificate formats
210-
cd ~/.mitmproxy
211-
# Create .cer (PEM format)
212-
cp mitmproxy-ca-cert.pem mitmproxy-ca-cert.cer
213-
# Create .crt (PEM format)
214-
cp mitmproxy-ca-cert.pem mitmproxy-ca-cert.crt
215-
# Create .der format for iOS
216-
openssl x509 -in mitmproxy-ca-cert.pem -outform DER -out mitmproxy-ca-cert.der
217-
218-
echo "MITM Proxy setup completed"
219-
179+
# Detect OS and install requirements accordingly
180+
if [ "$(uname)" == "Darwin" ]; then
181+
echo "Running on macOS..."
182+
if ! command -v brew &> /dev/null; then
183+
echo "Homebrew not found. Installing Homebrew..."
184+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
185+
fi
186+
brew install python3 openssl
187+
else
188+
echo "Running on Linux..."
189+
sudo apt-get update
190+
sudo apt-get install -y python3 python3-pip openssl
191+
fi
192+
193+
# Verify installations
194+
python3 --version
195+
pip3 --version
196+
197+
# Upgrade pip to the latest version
198+
pip3 install --upgrade pip
199+
200+
# Install mitmproxy version 10.2.4
201+
pip3 install mitmproxy==10.2.4
202+
220203
setup_appium:
221204
steps:
222205
- run:
@@ -375,11 +358,11 @@ commands:
375358
adb shell setprop net.eth0.dns2 8.8.4.4
376359
# Install MITM certificate
377360
echo "Installing certificate..."
378-
HASH=$(openssl x509 -inform PEM -subject_hash_old -in ~/.mitmproxy/mitmproxy-ca-cert.pem | head -1)
379-
cp ~/.mitmproxy/mitmproxy-ca-cert.pem $HASH.0
380-
adb push $HASH.0 /system/etc/security/cacerts/
381-
adb shell chmod 644 /system/etc/security/cacerts/$HASH.0
382-
adb reboot
361+
HASH=$(openssl x509 -inform PEM -subject_hash_old -in ~/.mitmproxy/mitmproxy-ca-cert.pem | head -1)
362+
cp ~/.mitmproxy/mitmproxy-ca-cert.pem $HASH.0
363+
adb push $HASH.0 /system/etc/security/cacerts/ && \
364+
adb shell "chmod 644 /system/etc/security/cacerts/$HASH.0"
365+
adb reboot
383366
384367
echo "Waiting for network connectivity..."
385368
for i in {1..30}; do
@@ -419,8 +402,12 @@ commands:
419402
name: Start MITM Proxy
420403
background: true
421404
command: |
422-
mitmdump -s ~/project/examples/hybrid/e2e/proxy-server.py -p 8082 &
405+
echo "Starting MITM Proxy on port 8082..."
406+
mitmdump -s ~/project/examples/hybrid/e2e/proxy-server.py -p 8082 --listen-host 127.0.0.1 &
423407
sleep 10
408+
echo "MITM Proxy started."
409+
curl -v --proxy 127.0.0.1:8082 http://mitm.it
410+
lsof -iTCP:8082 -sTCP:LISTEN
424411
- run:
425412
name: Configure and Test Proxy Settings
426413
working_directory: ~/project/examples/hybrid
@@ -905,15 +892,6 @@ jobs:
905892
app-dir: << parameters.working_directory >>
906893
- build_and_pack_sdk:
907894
working_directory: << parameters.working_directory >>
908-
- run:
909-
name: Clean and Install Pods
910-
working_directory: <<parameters.working_directory>>/ios
911-
command: |
912-
rm -rf ~/Library/Caches/CocoaPods
913-
rm -rf Pods
914-
rm -rf ~/Library/Developer/Xcode/DerivedData/*
915-
pod cache clean --all
916-
pod install --repo-update
917895
- run:
918896
name: Install CocoaPods
919897
working_directory: <<parameters.working_directory>>/ios
@@ -930,6 +908,13 @@ jobs:
930908
build
931909
# Setup testing environment
932910
- setup_mitm_proxy
911+
- run:
912+
name: Start MITM Proxy
913+
background: true
914+
command: |
915+
mitmdump -s ~/project/examples/hybrid/e2e/proxy-server.py -p 8082 &
916+
sleep 10
917+
933918
- setup_ios_proxy
934919
- setup_appium
935920

@@ -1086,4 +1071,4 @@ workflows:
10861071
branches:
10871072
only: dream11
10881073
prepare_steps:
1089-
-
1074+
- prepare_dream11

0 commit comments

Comments
 (0)