-
Notifications
You must be signed in to change notification settings - Fork 116
/
libmkshrc.so
110 lines (83 loc) · 2.72 KB
/
libmkshrc.so
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Copyright (c) 2010, 2012, 2013, 2014
# Thorsten Glaser <[email protected]>
# This file is provided under the same terms as mksh.
#-
# Minimal /system/etc/mkshrc for Android
#
# Support: https://launchpad.net/mksh
AGVARR="$@"
SCRIPT="$0"
AGV1="$1"
AGV2="$2"
AGV3="$3"
export MYSCRIPT="$(realpath "$0")" 2>/dev/null
if [ "$MYSCRIPT" ]; then
export MYPATH="${MYSCRIPT%/*}"
cmds="$SCRIPT $AGVARR"
fi
priv_dir=/data/data/magisk.term
p(){
COLOR=$1;TEXT="$2";escape="$1"
[ "$COLOR" == "black" ] && escape="0;30"
[ "$COLOR" == "red" ] && escape="0;31"
[ "$COLOR" == "green" ] && escape="0;32"
[ "$COLOR" == "orange" ] && escape="0;33"
[ "$COLOR" == "blue" ] && escape="0;34"
[ "$COLOR" == "purple" ] && escape="0;35"
[ "$COLOR" == "cyan" ] && escape="0;36"
[ "$COLOR" == "light_gray" ] && escape="0;37"
[ "$COLOR" == "gray" ] && escape="1;30"
[ "$COLOR" == "light_red" ] && escape="1;31"
[ "$COLOR" == "light_green" ] && escape="1;32"
[ "$COLOR" == "yellow" ] && escape="1;33"
[ "$COLOR" == "light_blue" ] && escape="1;34"
[ "$COLOR" == "light_purple" ] && escape="1;35"
[ "$COLOR" == "light_cyan" ] && escape="1;36"
[ "$COLOR" == "white" ] && escape="1;37"
[ "$COLOR" == "none" ] && escape="0"
code="\033[${escape}m"
end_code="\033[0m"
echo -en "$code$TEXT$end_code"
}
RC='\033[0m' RED='\033[0;31m' BRED='\033[1;31m' GRAY='\033[1;30m' BLUE='\033[0;34m' BBLUE='\033[1;34m' CYAN='\033[0;34m' CYAN='\033[1;34m' WHITE='\033[1;37m' GREEN='\033[0;32m' BGREEN='\033[1;32m' YELLOW='\033[1;33m' PURPLE='\033[0;35m' BPURPLE='\033[1;35m' ORANGE='\033[0;33m'
pd(){
p "$1" "$2"; echo
}
DLPATH="$priv_dir/magisk"
export OLDPATH="$PATH"
( cd "$priv_dir"
if [ ! -d "$DLPATH" ]; then
rm -rf "$DLPATH" 2>/dev/null
mkdir -p "$DLPATH" 2>/dev/null
fi
link(){ (
agv1="$1"; agv2="$2"
[ ! -f "$DLPATH/$agv2" ] && rm -rf "$DLPATH/$agv2" 2>/dev/null
ln -s "$(which "$agv1")" "$DLPATH/$agv2" 2>/dev/null
) }
link "libapp.so" "magisk.apk"
link "libbusybox.so" "busybox"
link "liblegacy.so" "legacy.zip"
link "libbash.so" "menu"
link "libgxp.so" "gearlock_extension.zip"
)
export PATH="$DLPATH/bin:$DLPATH:$PATH"
alias inmagisk='"$DLPATH/busybox" sh -o standalone "$DLPATH/menu" option "$@"'
alias m='inmagisk "$@"'
magiskhide(){ (
VAR_ARRAY="$@"
MAGISK_VERSION="$(magisk -V)" || exit 1
MAGISKHIDE="--denylist"
[ "$MAGISK_VERSION" -lt "23010" ] && MAGISKHIDE="magiskhide"
magisk $MAGISKHIDE "$@"
) }
denylist(){ ( magiskhide "$@"; ) }
help(){
echo "$(inmagisk help)
MagiskHide / DenyList ConFig
usage: magiskhide [option]...
or: denylist [option]...
shortcut for \"magisk --denylist\" if Magisk version is 23010+"
}
p none "Type "; p light_purple "m"; p none " to open "; pd light_green "Magisk Installer Script";
p none "Website: "; pd light_green "http://github.com/HuskyDG/MagiskOnNox"