-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-fs-data.sh
More file actions
executable file
·40 lines (32 loc) · 1.17 KB
/
post-fs-data.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1.17 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
#!/system/bin/sh
# post-fs-data.sh - Runs early in boot to prepare environment
# Detect root solution and set paths
if [ -d "/data/adb/ksu" ]; then
ROOT_TYPE="kernelsu"
MODULES_DIR="/data/adb/ksu/modules"
elif [ -d "/data/adb/apatch" ] || [ -d "/data/adb/ap" ]; then
ROOT_TYPE="apatch"
MODULES_DIR="/data/adb/modules"
else
ROOT_TYPE="magisk"
MODULES_DIR="/data/adb/modules"
fi
MODDIR="$MODULES_DIR/IntegrityHelper"
UI_DIR="$MODDIR/webroot"
SCRIPTS_DIR="$MODDIR/scripts"
# Ensure directories exist
mkdir -p /data/adb/IntegrityHelper
mkdir -p /data/local/tmp/modules
mkdir -p "$UI_DIR/cgi-bin"
# Copy CGI scripts to ui/cgi-bin/
cp "$SCRIPTS_DIR"/*.sh "$UI_DIR/cgi-bin/"
chmod +x "$UI_DIR/cgi-bin/"*.sh
# Copy handle_request.sh to scripts directory (same as simple_http_server.sh)
cp "$SCRIPTS_DIR/handle_request.sh" "$SCRIPTS_DIR/"
chmod +x "$SCRIPTS_DIR/handle_request.sh"
# Copy httpd.conf to webroot
cp "$SCRIPTS_DIR/httpd.conf" "$UI_DIR/"
# Note: Servers will be started by service.sh
# This script just prepares the environment
# Log that preparation completed
echo "$(date): IntegrityHelper environment prepared on $ROOT_TYPE" >> /data/adb/IntegrityHelper/service.log