Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shali Deeraj
committed
Apr 8, 2019
1 parent
1f52fda
commit 28b62e7
Showing
34 changed files
with
775 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker run -it --rm -v $(pwd)/sdk:/sdk android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk' | ||
docker run -it -v $(pwd)/sdk:/opt/android-sdk android-sdk /bin/bash | ||
sdkmanager --list | grep patcher | ||
sdkmanager "patcher;v4" |
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,8 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 |
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,17 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends wget unzip | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
|
||
ARG ANDROID_SDK_VERSION=4333796 | ||
ENV ANDROID_HOME /opt/android-sdk | ||
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \ | ||
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ | ||
unzip *tools*linux*.zip && \ | ||
rm *tools*linux*.zip | ||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin |
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,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends wget unzip | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
|
||
ARG ANDROID_SDK_VERSION=4333796 | ||
ENV ANDROID_HOME /opt/android-sdk | ||
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \ | ||
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ | ||
unzip *tools*linux*.zip && \ | ||
rm *tools*linux*.zip | ||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin | ||
|
||
ADD license_accepter.sh /opt/ | ||
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME |
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,52 @@ | ||
#!/bin/bash | ||
|
||
check_android_home() { | ||
if [ "$#" -lt 1 ]; then | ||
if [ -z "${ANDROID_HOME}" ]; then | ||
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter" | ||
exit 1 | ||
else | ||
ANDROID_HOME="${ANDROID_HOME}" | ||
fi | ||
else | ||
ANDROID_HOME=$1 | ||
fi | ||
echo "ANDROID_HOME is at $ANDROID_HOME" | ||
} | ||
|
||
accept_all_android_licenses() { | ||
ANDROID_LICENSES="$ANDROID_HOME/licenses" | ||
if [ ! -d $ANDROID_LICENSES ]; then | ||
echo "Android licenses directory doesn't exist, creating one..." | ||
mkdir -p $ANDROID_LICENSES | ||
fi | ||
|
||
accept_license_of android-googletv-license 601085b94cd77f0b54ff86406957099ebe79c4d6 | ||
accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55 | ||
accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e | ||
accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee | ||
accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd | ||
accept_license_of android-sdk-preview-license 504667f4c0de7af1a06de9f4b1727b84351f2910 | ||
accept_license_of google-gdk-license 33b6a2b64607f11b759f320ef9dff4ae5c47d97a | ||
accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a | ||
} | ||
|
||
accept_license_of() { | ||
local license=$1 | ||
local content=$2 | ||
local file=$ANDROID_LICENSES/$license | ||
if [ -f $file ]; then | ||
if grep -q "^$content$" $file; then | ||
echo "$license: $content has been accepted already" | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content >> $file | ||
fi | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content > $file | ||
fi | ||
} | ||
|
||
check_android_home "$@" | ||
accept_all_android_licenses |
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,20 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends wget unzip git | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
|
||
ARG ANDROID_SDK_VERSION=4333796 | ||
ENV ANDROID_HOME /opt/android-sdk | ||
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \ | ||
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ | ||
unzip *tools*linux*.zip && \ | ||
rm *tools*linux*.zip | ||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin | ||
|
||
ADD license_accepter.sh /opt/ | ||
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME |
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,45 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends wget unzip git | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
|
||
ARG ANDROID_SDK_VERSION=4333796 | ||
ENV ANDROID_HOME /opt/android-sdk | ||
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \ | ||
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ | ||
unzip *tools*linux*.zip && \ | ||
rm *tools*linux*.zip | ||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin | ||
|
||
ADD license_accepter.sh /opt/ | ||
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME | ||
|
||
EXPOSE 22 | ||
ADD sshd-banner /etc/ssh/ | ||
ADD authorized_keys /tmp/ | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends openssh-server supervisor locales && \ | ||
mkdir -p /var/run/sshd /var/log/supervisord && \ | ||
locale-gen en en_US en_US.UTF-8 && \ | ||
apt-get remove -y locales && apt-get autoremove -y && \ | ||
FILE_SSHD_CONFIG="/etc/ssh/sshd_config" && \ | ||
echo "\nBanner /etc/ssh/sshd-banner" >> $FILE_SSHD_CONFIG && \ | ||
echo "\nPermitUserEnvironment=yes" >> $FILE_SSHD_CONFIG && \ | ||
ssh-keygen -q -N "" -f /root/.ssh/id_rsa && \ | ||
FILE_SSH_ENV="/root/.ssh/environment" && \ | ||
touch $FILE_SSH_ENV && chmod 600 $FILE_SSH_ENV && \ | ||
printenv | grep "JAVA_HOME\|ANDROID_HOME\|PATH" >> $FILE_SSH_ENV && \ | ||
FILE_AUTH_KEYS="/root/.ssh/authorized_keys" && \ | ||
touch $FILE_AUTH_KEYS && chmod 600 $FILE_AUTH_KEYS && \ | ||
for file in /tmp/*.pub; \ | ||
do if [ -f "$file" ]; then echo "\n" >> $FILE_AUTH_KEYS && cat $file >> $FILE_AUTH_KEYS && echo "\n" >> $FILE_AUTH_KEYS; fi; \ | ||
done && \ | ||
(rm /tmp/*.pub 2> /dev/null || true) | ||
|
||
ADD supervisord.conf /etc/supervisor/conf.d/ | ||
CMD ["/usr/bin/supervisord"] |
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,2 @@ | ||
* | ||
!.gitignore |
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,52 @@ | ||
#!/bin/bash | ||
|
||
check_android_home() { | ||
if [ "$#" -lt 1 ]; then | ||
if [ -z "${ANDROID_HOME}" ]; then | ||
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter" | ||
exit 1 | ||
else | ||
ANDROID_HOME="${ANDROID_HOME}" | ||
fi | ||
else | ||
ANDROID_HOME=$1 | ||
fi | ||
echo "ANDROID_HOME is at $ANDROID_HOME" | ||
} | ||
|
||
accept_all_android_licenses() { | ||
ANDROID_LICENSES="$ANDROID_HOME/licenses" | ||
if [ ! -d $ANDROID_LICENSES ]; then | ||
echo "Android licenses directory doesn't exist, creating one..." | ||
mkdir -p $ANDROID_LICENSES | ||
fi | ||
|
||
accept_license_of android-googletv-license 601085b94cd77f0b54ff86406957099ebe79c4d6 | ||
accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55 | ||
accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e | ||
accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee | ||
accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd | ||
accept_license_of android-sdk-preview-license 504667f4c0de7af1a06de9f4b1727b84351f2910 | ||
accept_license_of google-gdk-license 33b6a2b64607f11b759f320ef9dff4ae5c47d97a | ||
accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a | ||
} | ||
|
||
accept_license_of() { | ||
local license=$1 | ||
local content=$2 | ||
local file=$ANDROID_LICENSES/$license | ||
if [ -f $file ]; then | ||
if grep -q "^$content$" $file; then | ||
echo "$license: $content has been accepted already" | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content >> $file | ||
fi | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content > $file | ||
fi | ||
} | ||
|
||
check_android_home "$@" | ||
accept_all_android_licenses |
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,6 @@ | ||
|
||
/ \ _ __ __| |_ __ ___ (_) __| | | ||
/ _ \ | '_ \ / _` | '__/ _ \| |/ _` | | ||
/ ___ \| | | | (_| | | | (_) | | (_| | | ||
/_/ \_\_| |_|\__,_|_| \___/|_|\__,_| | ||
|
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,10 @@ | ||
[supervisord] | ||
nodaemon = true | ||
|
||
[include] | ||
files = /etc/supervisor/conf.d/*.conf | ||
|
||
[program:sshd] | ||
command = /usr/sbin/sshd -D | ||
stderr_logfile = /var/log/supervisord/sshd-stderr.log | ||
stdout_logfile = /var/log/supervisord/sshd-stdout.log |
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,7 @@ | ||
docker build -t android-sdk-emu . | ||
docker run -d -p 2222:22 -p 5901:5901 android-sdk-emu | ||
sdkmanager --list | ||
sdkmanager "emulator" "platform-tools" "platforms;android-24" "system-images;android-24;default;armeabi-v7a" | ||
echo "no" | avdmanager create avd -n test -k "system-images;android-24;default;armeabi-v7a" | ||
avdmanager list avd | ||
emulator64-arm -avd test -noaudio -no-boot-anim -accel on -gpu swiftshader_indirect & |
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,66 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN dpkg --add-architecture i386 && \ | ||
apt-get update -y && \ | ||
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ | ||
apt-get install -y --no-install-recommends openjdk-8-jdk && \ | ||
apt-get install -y --no-install-recommends wget unzip git && \ | ||
apt-get install -y --no-install-recommends qt5-default | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
|
||
ARG ANDROID_SDK_VERSION=4333796 | ||
ENV ANDROID_HOME /opt/android-sdk | ||
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \ | ||
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ | ||
unzip *tools*linux*.zip && \ | ||
rm *tools*linux*.zip | ||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/emulator | ||
ENV LD_LIBRARY_PATH ${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib | ||
|
||
ADD license_accepter.sh /opt/ | ||
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME | ||
|
||
EXPOSE 22 | ||
ADD sshd-banner /etc/ssh/ | ||
ADD authorized_keys /tmp/ | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends openssh-server supervisor locales && \ | ||
mkdir -p /var/run/sshd /var/log/supervisord && \ | ||
locale-gen en en_US en_US.UTF-8 && \ | ||
apt-get remove -y locales && apt-get autoremove -y && \ | ||
FILE_SSHD_CONFIG="/etc/ssh/sshd_config" && \ | ||
echo "\nBanner /etc/ssh/sshd-banner" >> $FILE_SSHD_CONFIG && \ | ||
echo "\nPermitUserEnvironment=yes" >> $FILE_SSHD_CONFIG && \ | ||
ssh-keygen -q -N "" -f /root/.ssh/id_rsa && \ | ||
FILE_SSH_ENV="/root/.ssh/environment" && \ | ||
touch $FILE_SSH_ENV && chmod 600 $FILE_SSH_ENV && \ | ||
printenv | grep "JAVA_HOME\|ANDROID_HOME\|PATH\|LD_LIBRARY_PATH" >> $FILE_SSH_ENV && \ | ||
FILE_AUTH_KEYS="/root/.ssh/authorized_keys" && \ | ||
touch $FILE_AUTH_KEYS && chmod 600 $FILE_AUTH_KEYS && \ | ||
for file in /tmp/*.pub; \ | ||
do if [ -f "$file" ]; then echo "\n" >> $FILE_AUTH_KEYS && cat $file >> $FILE_AUTH_KEYS && echo "\n" >> $FILE_AUTH_KEYS; fi; \ | ||
done && \ | ||
(rm /tmp/*.pub 2> /dev/null || true) | ||
|
||
# setup adb server | ||
EXPOSE 5037 | ||
|
||
ADD supervisord.conf /etc/supervisor/conf.d/ | ||
CMD ["/usr/bin/supervisord"] | ||
|
||
# install and configure VNC server | ||
ENV USER root | ||
ENV DISPLAY :1 | ||
EXPOSE 5901 | ||
ADD vncpass.sh /tmp/ | ||
ADD watchdog.sh /usr/local/bin/ | ||
ADD supervisord_vncserver.conf /etc/supervisor/conf.d/ | ||
RUN apt-get update -y && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xfce4 xfce4-goodies xfonts-base dbus-x11 tightvncserver expect && \ | ||
chmod +x /tmp/vncpass.sh; sync && \ | ||
/tmp/vncpass.sh && \ | ||
rm /tmp/vncpass.sh && \ | ||
apt-get remove -y expect && apt-get autoremove -y && \ | ||
FILE_SSH_ENV="/root/.ssh/environment" && \ | ||
echo "DISPLAY=:1" >> $FILE_SSH_ENV |
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,2 @@ | ||
* | ||
!.gitignore |
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,52 @@ | ||
#!/bin/bash | ||
|
||
check_android_home() { | ||
if [ "$#" -lt 1 ]; then | ||
if [ -z "${ANDROID_HOME}" ]; then | ||
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter" | ||
exit 1 | ||
else | ||
ANDROID_HOME="${ANDROID_HOME}" | ||
fi | ||
else | ||
ANDROID_HOME=$1 | ||
fi | ||
echo "ANDROID_HOME is at $ANDROID_HOME" | ||
} | ||
|
||
accept_all_android_licenses() { | ||
ANDROID_LICENSES="$ANDROID_HOME/licenses" | ||
if [ ! -d $ANDROID_LICENSES ]; then | ||
echo "Android licenses directory doesn't exist, creating one..." | ||
mkdir -p $ANDROID_LICENSES | ||
fi | ||
|
||
accept_license_of android-googletv-license 601085b94cd77f0b54ff86406957099ebe79c4d6 | ||
accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55 | ||
accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e | ||
accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee | ||
accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd | ||
accept_license_of android-sdk-preview-license 504667f4c0de7af1a06de9f4b1727b84351f2910 | ||
accept_license_of google-gdk-license 33b6a2b64607f11b759f320ef9dff4ae5c47d97a | ||
accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a | ||
} | ||
|
||
accept_license_of() { | ||
local license=$1 | ||
local content=$2 | ||
local file=$ANDROID_LICENSES/$license | ||
if [ -f $file ]; then | ||
if grep -q "^$content$" $file; then | ||
echo "$license: $content has been accepted already" | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content >> $file | ||
fi | ||
else | ||
echo "Accepting $license: $content ..." | ||
echo -e $content > $file | ||
fi | ||
} | ||
|
||
check_android_home "$@" | ||
accept_all_android_licenses |
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,6 @@ | ||
|
||
/ \ _ __ __| |_ __ ___ (_) __| | | ||
/ _ \ | '_ \ / _` | '__/ _ \| |/ _` | | ||
/ ___ \| | | | (_| | | | (_) | | (_| | | ||
/_/ \_\_| |_|\__,_|_| \___/|_|\__,_| | ||
|
Oops, something went wrong.