-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathuninstall.sh
More file actions
107 lines (94 loc) · 3 KB
/
uninstall.sh
File metadata and controls
107 lines (94 loc) · 3 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
#!/system/bin/sh
set -x
# Log file & Logger
LOGFILE="/data/local/tmp/uninstall.log"
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') | $*" >> "$LOGFILE" 2>&1
}
# Safely delete files & directories
delete_file() {
local FILE="$1"
if [ -e "$FILE" ]; then
rm -rf "$FILE" >> "$LOGFILE" 2>&1
if [ $? -eq 0 ]; then
log "Deleted $FILE"
else
log "Failed to delete $FILE"
fi
else
log "Skipped $FILE (not found)"
fi
}
# Safely restore backups
restore_backup() {
local BACKUP="$1"
local ORIGINAL="$2"
if [ -e "$BACKUP" ]; then
mv "$BACKUP" "$ORIGINAL" >> "$LOGFILE" 2>&1
if [ $? -eq 0 ]; then
log "Restored $ORIGINAL from backup"
else
log "Failed to restore $ORIGINAL from backup"
fi
else
log "No $BACKUP found"
fi
}
# Revert system properties if modified
revert_prop_if_modified() {
local PROP="$1"
local MODIFIED="$2"
local DEFAULT="$3"
local CURRENT
CURRENT="$(getprop "$PROP" 2>/dev/null)"
if [ "$CURRENT" = "$MODIFIED" ]; then
resetprop -n "$PROP" "$DEFAULT" >> "$LOGFILE" 2>&1
if [ $? -eq 0 ]; then
log "Reverted $PROP to $DEFAULT (was $MODIFIED)"
else
log "Failed to revert $PROP (was $MODIFIED)"
fi
else
log "Skipped $PROP (current=$CURRENT)"
fi
}
# Start logging
log "•••••• Integrity-Box Uninstall Started ••••••"
# Define paths
TRICKY_STORE="/data/adb/tricky_store"
KEYBOX="$TRICKY_STORE/keybox.xml"
KEYBOX_BACKUP="$TRICKY_STORE/keybox.xml.bak"
TARGET="$TRICKY_STORE/target.txt"
TARGET_BACKUP="$TRICKY_STORE/target.txt.bak"
# Delete files and directories
delete_file "$KEYBOX"
delete_file "$TARGET"
delete_file /data/adb/shamiko/whitelist
delete_file /data/adb/nohello/whitelist
delete_file /data/adb/modules/playintegrityfix
delete_file /data/adb/Box-Brain
delete_file /data/adb/service.d/hash.sh
delete_file /data/adb/service.d/lineage.sh
delete_file /data/adb/service.d/prop.sh
delete_file /data/adb/service.d/shamiko.sh
# Restore backups
restore_backup "$TARGET_BACKUP" "$TARGET"
restore_backup "$KEYBOX_BACKUP" "$KEYBOX"
# Revert props
revert_prop_if_modified "persist.sys.pihooks.disable.gms_key_attestation_block" "true" "false"
revert_prop_if_modified "persist.sys.pihooks.disable.gms_props" "true" "false"
revert_prop_if_modified "persist.sys.pihooks.disable" "1" "0"
revert_prop_if_modified "persist.sys.kihooks.disable" "1" "0"
# Unhide hidden files
if [ -f "/data/adb/Vault/.hidefiles/last_action.sh" ]; then
sh "/data/adb/Vault/.hidefiles/last_action.sh"
fi
# Finish
log "•••••• Integrity-Box Uninstall Completed ••••••"
sync
resetprop -p --delete "persist.sys.entryhooks_enabled"
resetprop -p --delete "persist.sys.spoof.gms"
resetprop -p --delete "persist.sys.pixelprops.gms"
resetprop -p --delete "persist.sys.pixelprops.gapps"
resetprop -p --delete "persist.sys.pixelprops.google"
resetprop -p --delete "persist.sys.pixelprops.pi"