-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomize.sh
More file actions
139 lines (125 loc) · 4.94 KB
/
customize.sh
File metadata and controls
139 lines (125 loc) · 4.94 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/system/bin/sh
# Paths
MODDIR=${0%/*}
LOG="/sdcard/installation.log"
UPDATE="/data/adb/modules_update/Kryptonite"
SRC="$UPDATE/module.prop"
DEST="/data/adb/modules/Kryptonite/module.prop"
mkdir -p "$MODPATH/logs"
# Load module details
MODNAME=$(grep_prop name $TMPDIR/module.prop)
MODVER=$(grep_prop version $TMPDIR/module.prop)
AUTHOR=$(grep_prop author $TMPDIR/module.prop)
TIME=$(date "+%d, %b - %H:%M %Z")
# Gather system info
BRAND=$(getprop ro.product.brand)
MODEL=$(getprop ro.product.model)
DEVICE=$(getprop ro.product.device)
ANDROID=$(getprop ro.system.build.version.release)
SDK=$(getprop ro.system.build.version.sdk)
ARCH=$(getprop ro.product.cpu.abi)
BUILD_DATE=$(getprop ro.system.build.date)
ROM_TYPE=$(getprop ro.system.build.type)
SE=$(getenforce)
KERNEL=$(uname -r)
# Logger
debug() {
echo "$1" | tee -a "$LOG"
}
prepare_directories() {
debug " ✦ Preparing Required Directories "
[ ! -d "/data/adb/modules/Kryptonite" ] && mkdir -p "/data/adb/modules/Kryptonite"
[ ! -f "$SRC" ] && return 1
}
# Handle module prop file
handle_module_props() {
debug " ✦ Handling Module Properties "
touch "/data/adb/modules/Kryptonite/update"
cp "$SRC" "$DEST"
}
# Meow Redirect
release_source() {
[ -f "/data/adb/Box-Brain/v28" ] && return 0
debug " ✦ Redirecting to release source..."
nohup am start -a android.intent.action.VIEW -d https://t.me/MeowPanel >/dev/null 2>&1 &
}
# Header
debug " "
debug "┌──── Module Info ────────────────────┐"
debug "│ $MODNAME "
debug "│ By $AUTHOR"
debug "│ Version: $MODVER"
debug "│ Started at: $TIME"
debug "└────────────────────────────────────┘"
debug " "
# Root check
debug "┌── Root Info ────────────────────────┐"
if [ "$BOOTMODE" ] && [ "$KSU" ]; then
debug "│ Provider : KernelSU"
debug "│ Kernel Version : $KSU_KERNEL_VER_CODE"
debug "│ KSU Version : $KSU_VER_CODE"
[ "$(which magisk)" ] && {
debug "│ ⚠ Multiple root systems detected!"
debug "└───────────────────────────────────┘"
abort "Please use only KernelSU or Magisk."
}
elif [ "$BOOTMODE" ] && [ "$MAGISK_VER_CODE" ]; then
debug "│ Provider : Magisk"
debug "│ Magisk Version : $MAGISK_VER_CODE"
else
debug "│ Root : Unknown / Unsupported"
debug "└───────────────────────────────────┘"
abort "Please install via Magisk or KernelSU (no recovery support)"
fi
debug "└───────────────────────────────────┘"
debug " "
# Device block
debug "┌── Device Info ─────────────────────┐"
debug "│ Brand : $BRAND"
debug "│ Model : $MODEL"
debug "│ Device : $DEVICE"
debug "│ Arch : $ARCH"
debug "│ Android : $ANDROID (SDK $SDK)"
debug "│ Kernel : $KERNEL"
debug "└───────────────────────────────────┘"
debug " "
# ROM block
debug "┌── ROM Info ────────────────────────┐"
debug "│ ROM Type : $ROM_TYPE"
debug "│ Build Date : $BUILD_DATE"
debug "│ SELinux : $SE"
debug "└───────────────────────────────────┘"
debug " "
# Create config files
debug " ✦ Building configuration file..."
CONFIG="/data/adb/display"
mkdir -p "$CONFIG"
touch "CONFIG/customize.txt"
cat > "$CONFIG/customize.txt" << EOF
saturation=1.5
contrast=0.7
reset=false
EOF
# Permissions
debug " ✦ Setting permissions..."
set_perm_recursive "$MODPATH" 0 0 0755 0644
[ -f "$MODPATH/system/bin/daemon" ] && set_perm "$MODPATH/system/bin/daemon" 0 0 0755
prepare_directories
handle_module_props
debug " ✦ After reboot, Open webui to adjust colours"
echo " "
echo " "
echo " ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣄⣠⣄⠀"
echo " ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⠏⠀"
echo " ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀"
echo " ⠀⠀⠀⠀⣀⡤⣤⠶⠛⠉⠉⠀⠀⠉⠉⠛⠲⣤⣤⣄⠀⠀⠀⠀⠀"
echo " ⠀⠀⠀⡼⠃⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠈⢧⠀⠀⠀⠀"
echo " ⠀⠀⡼⢁⡆⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡄⠀⢰⡈⢧⠀⠀⠀"
echo " ⢀⡞⠁⣸⠁⠀⢠⠬⠓⠀⣀⠀⠀⢀⠀⠛⠥⣄⠀⠀⡇⠈⢳⡀⠀"
echo " ⡞⠀⠀⠹⣆⢰⣒⠆⠀⠀⠓⠊⠙⠚⠁⠀⠸⠭⠇⣰⠇⠀⠀⢻⠀"
echo " ⣇⠀⠀⠀⠈⣹⠶⠦⠤⠤⣤⣤⣤⡤⠤⠤⠴⠶⣏⠁⠀⠀⠀⣸⠁"
echo " ⠈⠓⠲⠖⠚⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⠲⠶⠚⠁⠀"
echo " "
echo " "
release_source
exit 0