Skip to content
8 changes: 5 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: FlowCrypt Android App
agent:
machine:
type: e2-standard-2
os_image: ubuntu2004
os_image: ubuntu2404
execution_time_limit:
minutes: 60

Expand All @@ -30,9 +30,11 @@ global_job_config:
- sudo apt install -y dnsmasq resolvconf
- echo "#added by flowcrypt" | sudo tee -a /etc/dnsmasq.conf
- echo "listen-address=127.0.0.1" | sudo tee -a /etc/dnsmasq.conf
- echo "address=/flowcrypt.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf
- echo "address=/wrongssl.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf
- echo "address=/test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf
- echo "address=/localhost/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf
- echo "server=8.8.8.8" | sudo tee -a /etc/dnsmasq.conf
# redirect the systemd-resolved to use the localhost as the primary nameserver
- sudo sed -i '1inameserver 127.0.0.1\' /etc/resolv.conf
- sudo systemctl restart dnsmasq
# print some debug info
- ping fel.localhost -c 1
Expand Down
13 changes: 13 additions & 0 deletions script/ci-wait-for-emulator.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
#
# © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
# Contributors: denbond7
#

set -o xtrace
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
adb shell wm dismiss-keyguard
Expand All @@ -18,5 +23,13 @@ adb shell "iptables -t nat -A PREROUTING -s 127.0.0.1 -p tcp --dport 443 -j REDI
adb shell "iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT --to 1212"
###################################################################################################

# https://developer.android.com/tools/adb#forwardports
# forwards requests on a specific host port to a different port on a device.
# It can be helpful for debugging a mock web server
adb forward tcp:1212 tcp:1212

#check the emulator has internet connection
adb shell "ping -c 1 www.google.com"

echo "Emulator is ready"
set +o xtrace