-
Notifications
You must be signed in to change notification settings - Fork 41
/
.config.sh
executable file
·51 lines (46 loc) · 1.27 KB
/
.config.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
export BINDIR="bin"
export APKTOOL=$BINDIR/apktool_2.8.1.jar
export BAKSMALI=$BINDIR/baksmali-2.5.2.jar
export SMALI=$BINDIR/smali-2.5.2.jar
export APKSIGNER=$BINDIR/uber-apk-signer-1.3.0.jar
export ENJARIFY=$BINDIR/enjarify.sh
export APKEDITOR=$BINDIR/APKEditor-1.2.7.jar
export WORKDIR="project"
export LPDIR="/sdcard/Android/data/___.lp/files/LuckyPatcher/"
# is running under WSL?
if [ $(uname -r | grep -i "microsoft") ]; then
export ADB="adb.exe"
export AAPT="aapt.exe"
export JAVA="java.exe"
export ADB="adb.exe"
export DX="cmd.exe /c dx.bat"
else
export ADB="adb"
export AAPT="aapt"
export JAVA="java"
export ADB="adb"
export DX="dx"
fi
# asks the user to select input file
# $1 - search directory
# $2 - input file glob
select_file() {
SELECT_DIR="\"$1\"/$2"
RESULTS=$(eval ls -d $SELECT_DIR 2>/dev/null)
if [ -z "$RESULTS" ]; then
echo "Error: No matches for '$SELECT_DIR'" >&2
exit 1
fi
# set the prompt used by select, replacing "#?"
PS3="Select input number: "
select filename in $RESULTS; do
if [[ "$filename" == "" ]]; then
echo "'$REPLY' is not a valid choice" >/dev/tty
continue
fi
echo "$filename"
return
done
}