-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BSR) docs(android): improve setup for Android (#7490)
- Loading branch information
1 parent
351c556
commit 0a984cf
Showing
9 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
{ | ||
"packages": [ | ||
"[email protected]", | ||
"jq@latest", | ||
"watchman@latest", | ||
"[email protected]", | ||
"python3@latest", | ||
"git@latest", | ||
"maestro@latest", | ||
// needed to debug pipeline locally | ||
"act@latest", | ||
"gh@latest", | ||
"podman@latest" | ||
] | ||
"podman@latest", | ||
// others stuffs | ||
"git@latest", | ||
"[email protected]", | ||
"watchman@latest", | ||
"jq@latest", // needed by some scripts run in the pipeline | ||
"[email protected]", // needed to install iOS dependencies and to run fastlane | ||
"python3@latest", // needed by scripts/add_tracker.py | ||
"maestro@latest", // needed to run end to end test locally | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit -o nounset -o pipefail | ||
|
||
SSL_CERT_FILE="$(realpath '/Library/Application Support'/*/*/data/*cacert.pem 2>/dev/null || true)" | ||
SSL_CERT_FILE="$(realpath '/Library/Application Support'/*/*/data/*cacert.pem 2>/dev/null || echo '')" | ||
|
||
SCRIPT_FOLDER="$(dirname "$(realpath "$0")")" | ||
|
||
if "$SCRIPT_FOLDER/is_proxy_enabled.sh"; then | ||
if sh "$SCRIPT_FOLDER/is_proxy_enabled.sh"; then | ||
xcrun simctl keychain booted add-root-cert "$SSL_CERT_FILE" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit -o nounset -o pipefail | ||
|
||
SSL_CERT_FILE="$(realpath '/Library/Application Support'/*/*/data/*cacert.pem 2>/dev/null || echo '')" | ||
|
||
SCRIPT_FOLDER="$(dirname "$(realpath "$0")")" | ||
|
||
remove_certificate_bundle_safe() { | ||
if [ -f "$SSL_CERT_BUNDLE_FILE" ]; then | ||
sudo rm "$SSL_CERT_BUNDLE_FILE" | ||
fi | ||
} | ||
|
||
has_certificate() { | ||
echo "${KEYTOOL_PASSWORD}" | | ||
sudo keytool -cacerts -list -alias "mykey" | ||
} | ||
|
||
remove_certificate() { | ||
echo "${KEYTOOL_PASSWORD}" | | ||
sudo keytool -delete -cacerts -alias "mykey" >/dev/null | ||
} | ||
|
||
remove_certificate_safe() { | ||
remove_certificate_bundle_safe | ||
|
||
if has_certificate; then | ||
remove_certificate | ||
fi | ||
} | ||
|
||
set_password_and_accept_trusting_the_certificate() { | ||
echo "${KEYTOOL_PASSWORD}" | ||
echo "oui" | ||
} | ||
|
||
add_certificate() { | ||
set_password_and_accept_trusting_the_certificate | | ||
sudo keytool -import -cacerts -file "$SSL_CERT_BUNDLE_FILE" >/dev/null | ||
} | ||
|
||
add_certificate_safe() { | ||
if ! has_certificate; then | ||
add_certificate | ||
fi | ||
} | ||
|
||
if [ -n "${SSL_CERT_FILE+x}" ]; then | ||
SSL_CERT_DIR="$(dirname "$SSL_CERT_FILE")" | ||
SSL_CERT_TENANT="$(realpath "$SSL_CERT_DIR"/*tenantcert.pem)" | ||
SSL_CERT_BUNDLE_FILE="$SSL_CERT_DIR/cert-bundle.pem" | ||
|
||
# remove_certificate_safe # to be able to debug, remove everything done, comment this when not debugging | ||
|
||
if sh "$SCRIPT_FOLDER/is_proxy_enabled.sh"; then | ||
if [ -f "$SSL_CERT_TENANT" ]; then | ||
echo "Adding certificate for proxy in Java's keytool system requires root password" | ||
|
||
if [ ! -f "$SSL_CERT_BUNDLE_FILE" ]; then | ||
cat "$SSL_CERT_TENANT" "$SSL_CERT_FILE" | sudo tee "$SSL_CERT_BUNDLE_FILE" >/dev/null | ||
fi | ||
|
||
add_certificate_safe | ||
fi | ||
else | ||
remove_certificate_safe | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters