echo"Error: Could not determine logged in user. We've had this problem before with the who command behaving differently on different distributions. You can try modifying the script so that EXECUTING_USER is correct. Hard coding your username here could do the trick (but please don't push the change)"
exit1
fi
if["$USERS_HOME"=""];then
USERS_HOME=`evalecho"~$EXECUTING_USER"`
if["$USERS_HOME"=""];then
echo"Unable to determine the users home directory."
exit1;
fi
fi
if["$TOOLCHAIN_INSTALL_DIRECTORY"=""];then
TOOLCHAIN_INSTALL_DIRECTORY="/opt/android"
fi
echo"TOOLCHAIN_INSTALL_DIRECTORY is $TOOLCHAIN_INSTALL_DIRECTORY"
if[ ! "$1"=""];then
BASE_DIRECTORY=$1
echo"Checking for $BASE_DIRECTORY..."
if[ ! -d "$BASE_DIRECTORY"];then
mkdir "$BASE_DIRECTORY"
fi
fi
cd$BASE_DIRECTORY
#Make sure the base directory is the full path now.
echo"# $USERS_HOME/.profile: executed by the command interpreter for login shells." > $USERS_HOME/.profile
fi
echo"Checking for adb..."
ifhash adb 2>/dev/null;then
echo"It seems that you already have adb installed. Skipping including Android SDK to PATH".
else
echo"adb was not detected. adb is the Android Debug Bridge and is required to install and launch applications from the commandline. A version of adb comes with the Android SDK and I can add the appropriate path to your PATH variable."
read -p "Would you like me to add Android SDK platform tools folder to your PATH variable? (y/n)" answer
case${answer:0:1} in
y|Y )
echo"Adding $ANDROID_ABSOLUTE_DIRECTORY/android-sdk-linux/platform-tools to PATH using $USERS_HOME/.profile"...
echo"WARNING: ECHO_ANDROID_NDK_TOOLCHAINS was defined ($ECHO_ANDROID_NDK_TOOLCHAINS) but was not equal to $THIS_ECHO_ANDROID_NDK_TOOLCHAIN_BASE.. I have modified the entry to the new value."
fi
fi
echo"Adding ECHO_ANDROID_NDK_TOOLCHAINS to your environment using $USERS_HOME/.profile"...
echo"WARNING: ECHO_ANDROID_NDK wass already defined ($ECHO_ANDROID_NDK) but not equal to the new value $ANDROID_ABSOLUTE_DIRECTORY/$ANDROID_NDK_VERSION."
fi
fi
echo"Adding ECHO_ANDROID_NDK to your environment using $USERS_HOME/.profile"...
echo"WARNING: ECHO_ANDROID_SDK was previously defined as ($ECHO_ANDROID_SDK) which is not the same as the new value $ANDROID_ABSOLUTE_DIRECTORY/android-sdk-linux. Previous installations may not work as expected."
fi
fi
echo"Adding ECHO_ANDROID_SDK to your environment using $USERS_HOME/.profile"