From f09e38c92c9468385d80f3c05435ba30478395a7 Mon Sep 17 00:00:00 2001 From: yintro4ha <57131177+yintro4ha@users.noreply.github.com> Date: Mon, 24 Aug 2020 15:05:22 +0800 Subject: [PATCH 1/2] Update utils.sh Add Variable: 1. HTTP_PROXY_USER 2. HTTP_PROXY_PASSWORD --- src/utils.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils.sh b/src/utils.sh index 971161a..eed4b56 100755 --- a/src/utils.sh +++ b/src/utils.sh @@ -52,7 +52,16 @@ function enable_proxy_if_needed () { adb shell "content update --uri content://telephony/carriers --bind proxy:s:"0.0.0.0" --bind port:s:"0000" --where "mcc=310" --where "mnc=260"" sleep 5 adb shell "content update --uri content://telephony/carriers --bind proxy:s:"${p[0]}" --bind port:s:"${p[1]}" --where "mcc=310" --where "mnc=260"" - + + if [ ! -z "${HTTP_PROXY_USER}" ]; then + sleep 2 + adb shell "content update --uri content://telephony/carriers --bind user:s:"${HTTP_PROXY_USER}" --where "mcc=310" --where "mnc=260"" + fi + if [ ! -z "${HTTP_PROXY_PASSWORD}" ]; then + sleep 2 + adb shell "content update --uri content://telephony/carriers --bind password:s:"${HTTP_PROXY_PASSWORD}" --where "mcc=310" --where "mnc=260"" + fi + adb unroot # Mobile data need to be restarted for Android 10 or higher From 1ac4a6484e55d179b94a5e26b4a85c4fc9afa3e2 Mon Sep 17 00:00:00 2001 From: yintro4ha <57131177+yintro4ha@users.noreply.github.com> Date: Mon, 24 Aug 2020 15:10:03 +0800 Subject: [PATCH 2/2] Update README_CUSTOM_CONFIG.md Add document for new proxy auth variable --- README_CUSTOM_CONFIG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README_CUSTOM_CONFIG.md b/README_CUSTOM_CONFIG.md index f4fc620..9eace51 100644 --- a/README_CUSTOM_CONFIG.md +++ b/README_CUSTOM_CONFIG.md @@ -13,6 +13,15 @@ You can enable proxy inside container and Android emulator by passing following - NO_PROXY="localhost" - ENABLE_PROXY_ON_EMULATOR=true +Proxy with authentication +---- + +You can set proxy with authentication by passing following environment variable: + +- HTTP_PROXY_USER="\" +- HTTPS_PROXY_PASSWORD="\" + + Language --------