@@ -176,47 +176,30 @@ commands:
176
176
- run :
177
177
name : Install Python3 and MITM Proxy
178
178
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
+
220
203
setup_appium :
221
204
steps :
222
205
- run :
@@ -375,11 +358,11 @@ commands:
375
358
adb shell setprop net.eth0.dns2 8.8.4.4
376
359
# Install MITM certificate
377
360
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
383
366
384
367
echo "Waiting for network connectivity..."
385
368
for i in {1..30}; do
@@ -419,8 +402,12 @@ commands:
419
402
name : Start MITM Proxy
420
403
background : true
421
404
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 &
423
407
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
424
411
- run :
425
412
name : Configure and Test Proxy Settings
426
413
working_directory : ~/project/examples/hybrid
@@ -905,15 +892,6 @@ jobs:
905
892
app-dir : << parameters.working_directory >>
906
893
- build_and_pack_sdk :
907
894
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
917
895
- run :
918
896
name : Install CocoaPods
919
897
working_directory : <<parameters.working_directory>>/ios
@@ -930,6 +908,13 @@ jobs:
930
908
build
931
909
# Setup testing environment
932
910
- 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
+
933
918
- setup_ios_proxy
934
919
- setup_appium
935
920
@@ -1086,4 +1071,4 @@ workflows:
1086
1071
branches :
1087
1072
only : dream11
1088
1073
prepare_steps :
1089
- -
1074
+ - prepare_dream11
0 commit comments