forked from raffaeleragni/android-wardrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·34 lines (29 loc) · 1 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
if [ "$1" == "cleanup" ] ; then
echo "Cleaning up ..."
rm -fv local.properties Makefile
exit 0
fi
echo -n "Searching for ANT ... "
which ant > /dev/null 2>&1 && echo "FOUND" || (echo "No ANT found!" ; exit 1)
echo "Searching for Android SDK ..."
for dp in /{opt,usr/share,tmp}/android-sdk{-linux,} ; do
echo -n " TESTING '$dp' ... "
if [ -d "$dp" ] && [ -e "$dp/SDK Readme.txt" ] ; then
echo "FOUND"
ANDROID_SDK="$dp"
break
else
echo "NO"
fi
done
test -e "$ANDROID_SDK/SDK Readme.txt" && echo "Using '$ANDROID_SDK'" || (echo "No Android SDK found!" ; exit 1)
echo "Searching for signing key ..."
ANDROID_KEY=`echo ~/.android/debug.keystore`
test -e "$ANDROID_KEY" && echo "Using '$ANDROID_KEY'" || (echo "No signing key found!" ; exit 1)
echo
echo "Generating files ..."
echo " -> local.properties"
cat local.properties.in | sed -e "s#%SDK_DIR%#$ANDROID_SDK#" > local.properties
echo " -> Makefile"
cat Makefile.in | sed -e "s#%SDK_DIR%#$ANDROID_SDK#" -e "s#%KEYSTORE%#$ANDROID_KEY#" > Makefile