Repository navigation
Expand file tree
/
Copy pathcustomize.sh
More file actions
411 lines (359 loc) · 18 KB
/
Copy pathcustomize.sh
File metadata and controls
411 lines (359 loc) · 18 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# Allow a scripts-only mode for older Android (<10) which may not require the Zygisk components
Start Random KeyBox By @Malak_Root
if [ -f /data/adb/modules/playintegrityfix/scripts-only-mode ]; then
ui_print "! Installing global scripts only; Zygisk attestation fallback and device spoofing disabled"
touch $MODPATH/scripts-only-mode
sed -i 's/\(description=\)\(.*\)/\1[Scripts-only mode] \2/' $MODPATH/module.prop
[ -f /data/adb/modules/playintegrityfix/uninstall.sh ] && sh /data/adb/modules/playintegrityfix/uninstall.sh
rm -rf $MODPATH/action.sh $MODPATH/app_replace_list.txt \
$MODPATH/autopif4.sh $MODPATH/classes.dex \
$MODPATH/common_setup.sh $MODPATH/custom.app_replace_list.txt \
$MODPATH/custom.pif.json $MODPATH/custom.pif.prop \
$MODPATH/example.pif.json $MODPATH/example.pif.prop $MODPATH/migrate.sh \
$MODPATH/pif.json $MODPATH/pif.prop $MODPATH/zygisk \
/data/adb/modules/playintegrityfix/custom.app_replace_list.txt \
/data/adb/modules/playintegrityfix/custom.pif.json \
/data/adb/modules/playintegrityfix/custom.pif.prop \
/data/adb/modules/playintegrityfix/skippersistprop \
/data/adb/modules/playintegrityfix/system \
/data/adb/modules/playintegrityfix/uninstall.sh
fi
# Copy any disabled app files to updated module
if [ -d /data/adb/modules/playintegrityfix/system ]; then
ui_print "- Restoring disabled ROM apps configuration"
cp -afL /data/adb/modules/playintegrityfix/system $MODPATH
fi
# Copy any supported custom files to updated module
for FILE in custom.app_replace_list.txt custom.pif.json custom.pif.prop skipdelprop skippersistprop uninstall.sh; do
if [ -f "/data/adb/modules/playintegrityfix/$FILE" ]; then
ui_print "- Restoring $FILE"
cp -af /data/adb/modules/playintegrityfix/$FILE $MODPATH/$FILE
fi
done
# Warn if potentially conflicting modules are installed
if [ -d /data/adb/modules/MagiskHidePropsConf ]; then
ui_print "! MagiskHidePropsConfig (MHPC) module may cause issues with PIF"
fi
# Run common tasks for installation and boot-time
if [ -d "$MODPATH/zygisk" ]; then
. $MODPATH/common_func.sh
. $MODPATH/common_setup.sh
fi
# Migrate custom.pif.json to latest defaults if needed
if [ -f "$MODPATH/custom.pif.json" ]; then
if ! grep -q "api_level" $MODPATH/custom.pif.json || ! grep -q "verboseLogs" $MODPATH/custom.pif.json || ! grep -q "spoofVendingFinger" $MODPATH/custom.pif.json; then
ui_print "- Running migration script on custom.pif.json:"
ui_print " "
chmod 755 $MODPATH/migrate.sh
sh $MODPATH/migrate.sh --install --force --advanced $MODPATH/custom.pif.json
ui_print " "
fi
fi
#!/system/bin/sh
##########################################
# adapted from Play Integrity Fork by @osm0sis
# source: https://github.com/osm0sis/PlayIntegrityFork
# license: GPL-3.0
##########################################
ui_print "##########################################"
ui_print " ✦🔥 Welcome! ✦🔥 "
ui_print " 🧠 Mod By @IBDump @Samy 🧠 "
ui_print "##########################################"
ui_print ""
ui_print "------------------------------------------"
ui_print " ✦🔥 Update ✦🔥 "
ui_print " 🌐 https://github.com/IBDump/IB-KEYBOX/ "
ui_print "------------------------------------------"
ui_print ""
ui_print "******************************************"
ui_print " 📱 Telegram: https://t.me/malak_root"
ui_print " @ibrahim_bd1 "
ui_print "******************************************"
ui_print ""
# Installation done message
ui_print ""
ui_print "✅✅✅ Installation Complete! ✅✅✅"
ui_print " 🎉 Enjoy using IB-KEYBOX! 🎉 "
ui_print ""
ui_print "# End Play integrity Script ⭐"
#!/system/bin/sh
# ---------- Device Info ----------
device_model=$(getprop ro.product.model)
android_version=$(getprop ro.build.version.release)
api_level=$(getprop ro.build.version.sdk)
ui_print "📱 Device: $device_model"
ui_print "📦 Android: $android_version (API $api_level)"
ui_print ""
log_message() {
echo "$(date '+%Y-%m-%d %H:%M:%S') [SECURITY_PATCH] $1"
}
# ---------- Cleanup Tricky Store (run as root) ----------
su -c "rm -rf /data/adb/modules/IB-KEYBOX
rm -f /data/adb/boot_hash
rm -rf /data/adb/tricky_store && mkdir -p /data/adb/tricky_store && chmod 700 /data/adb/tricky_store"
STORE_DIR="/data/adb/tricky_store"
sp="$STORE_DIR/security_patch.txt"
# ---------- Security Patch ----------
# ---------- Security Patch ----------
log_message() {
echo "$(date '+%Y-%m-%d %H:%M:%S') [SECURITY_PATCH] $1"
}
STORE_DIR="/data/adb/tricky_store"
sp="$STORE_DIR/security_patch.txt"
mkdir -p "$STORE_DIR"
chmod 700 "$STORE_DIR"
log_message "Checking Android version (API $api_level)"
if [ "$api_level" -ge 33 ]; then
# Android 13+ → create security patch file
current_year=$(date +%Y)
current_month=$(date +%m)
if [ "$current_month" -eq 1 ]; then
prev_month=12
prev_year=$((current_year - 1))
else
prev_month=$((10#$current_month - 1))
prev_year=$current_year
fi
formatted_month=$(printf "%02d" $prev_month)
echo "all=${prev_year}-${formatted_month}-05" > "$sp"
# set permissions root:root 644
su -c "chown 0:0 '$sp'"
su -c "chmod 0644 '$sp'"
log_message "✅ Security patch file created"
ui_print "✅ Security patch file created"
else
# Android 10–12 → skip
[ -f "$sp" ] && su -c "rm -f '$sp'" >/dev/null 2>&1
log_message "🟢 Security patch skipped"
ui_print ""
fi
# ---------- KeyBox ----------
unzip -o "$ZIPFILE" 'zygisk/*' -d "$MODPATH/zygisk" > /dev/null 2>&1
if [ -f "/data/adb/tricky_store/keybox.xml" ]; then
backup_file "$CONFIG_DIR/keybox.xml"
rm "/data/adb/tricky_store/keybox.xml"
fi
random_keybox=$(find "$MODPATH/zygisk" -type f -name "*@Malak_Root" | shuf -n 1)
if [ -z "$random_keybox" ]; then
abort "Error: No @Malak_Root files found"
exit 1
fi
cp "$random_keybox" "/data/adb/tricky_store/keybox.xml"
su -c "chown 0:0 '/data/adb/tricky_store/keybox.xml' >/dev/null 2>&1 || true"
su -c "chmod 0644 '/data/adb/tricky_store/keybox.xml' >/dev/null 2>&1 || true"
su -c killall com.google.android.gms
su -c killall com.google.android.gms.unstable
# ---------- Bootloader & Spoofer ----------
SAFE_MODE=0
KILL_PKG="com.android.vending"
# ---------- helpers ----------
append_unique() { # append_unique <file> <line>
local f="$1" line="$2"
[ -f "$f" ] || touch "$f"
grep -qxF "$line" "$f" 2>/dev/null || echo "$line" >>"$f"
}
pkg_exists() { # pkg_exists <package.name>
pm list packages "$1" 2>/dev/null | grep -q "^package:$1$"
}
# ---------- paths ----------
STORE_DIR="/data/adb/tricky_store"
TARGET_TXT="$STORE_DIR/target.txt"
TEE_STATUS="$STORE_DIR/tee_status"
BOOT_HASH_FILE="/data/adb/boot_hash"
mkdir -p "$STORE_DIR"
chmod 0755 "$STORE_DIR" 2>/dev/null
# ========================================================
# 1) SET_TARGET
# ========================================================
log_message "SET_TARGET Start"
teeBroken="false"
if [ -f "$TEE_STATUS" ]; then
teeBroken=$(grep -E '^teeBroken=' "$TEE_STATUS" | cut -d= -f2 2>/dev/null || echo "false")
fi
for L in \
"android" \
"com.android.vending" \
"com.google.android.gsf" \
"com.google.android.gms" \
"com.google.android.apps.walletnfcrel" \
"com.openai.chatgpt" \
"com.reveny.nativecheck" \
"io.github.vvb2060.keyattestation" \
"io.github.vvb2060.mahoshojo" \
"icu.nullptr.nativetest" \
"com.android.nativetest" \
"io.liankong.riskdetector" \
"me.garfieldhan.holmes" \
"luna.safe.luna" \
"com.zhenxi.hunter" \
"gr.nikolasspyr.integritycheck" \
"com.youhu.laifu" \
"com.google.android.contactkeys" \
"com.google.android.ims" \
"com.google.android.safetycore" \
"com.whatsapp" \
"com.whatsapp.w4b"
do
append_unique "$TARGET_TXT" "done"
done
add_packages() {
pm list packages "$1" 2>/dev/null | cut -d: -f2 | while read -r pkg; do
[ -n "$pkg" ] || continue
if ! grep -q "^$pkg" "$TARGET_TXT" 2>/dev/null; then
if [ "$teeBroken" = "true" ]; then
append_unique "$TARGET_TXT" "$pkg"
else
append_unique "$TARGET_TXT" "$pkg"
fi
fi
done
}
log_message "SET_TARGET Writing"
add_packages "-3"
add_packages "-s"
chmod 0644 "$TARGET_TXT" 2>/dev/null
log_message "SET_TARGET Finish"
# ========================================================
# 2) SET_BOOT_HASH
# ========================================================
log_message "SET_BOOT_HASH Start"
boot_hash=$(su -c "getprop ro.boot.vbmeta.digest" 2>/dev/null)
mkdir -p "$(dirname "$BOOT_HASH_FILE")"
if [ -n "$boot_hash" ]; then
echo "$boot_hash" > "$BOOT_HASH_FILE"
chmod 0644 "$BOOT_HASH_FILE"
su -c "resetprop -n ro.boot.vbmeta.digest $boot_hash" 2>/dev/null
log_message "SET_BOOT_HASH Finish"
else
log_message "SET_BOOT_HASH vbmeta digest is empty"
fi
# ========================================================
# 3) KILL_GOOGLE
# ========================================================
log_message "KILL_GOOGLE Start"
if [ "$SAFE_MODE" -eq 0 ] && pkg_exists "$KILL_PKG"; then
am force-stop "$KILL_PKG" >/dev/null 2>&1
cmd package stop-user --user 0 "$KILL_PKG" >/dev/null 2>&1
pm clear "$KILL_PKG" >/dev/null 2>&1
fi
log_message "KILL_GOOGLE Finish"
# ========================================================
# 4) DELETE TWRP FOLDER
# ========================================================
log_message "DELETE_TWRP Start"
if [ "$SAFE_MODE" -eq 0 ]; then
TWRP_FOLDER="/sdcard/TWRP"
[ -d "$TWRP_FOLDER" ] && rm -rf "$TWRP_FOLDER" >/dev/null 2>&1
fi
log_message "DELETE_TWRP Finish"
# ========================================================
# 5) Hide My Applist cleanup
# ========================================================
log_message "HMA Start"
if [ "$SAFE_MODE" -eq 0 ]; then
FOLDERS=$(find /data/system -maxdepth 1 -type d \( -iname "*hide*" -o -iname "*hma*" -o -iname "*applist*" \) 2>/dev/null)
if [ -n "$FOLDERS" ]; then
for F in $FOLDERS; do rm -rf "$F" >/dev/null 2>&1; done
fi
fi
log_message "HMA Finish"
# Start Auto Hide App Script
#nohup am start -a android.intent.action.VIEW -d https://t.me/malak_root>/dev/null 2>&1 &
su -c "magisk --denylist add com.google.android.gms com.google.android.gms:snet"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms:identitycredentials"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms:car"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.unstable"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.ui"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.room"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.remapping1"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.persistent"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.learning"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms.feedback"
su -c "magisk --denylist add com.google.android.gms com.google.android.gms"
su -c "magisk --denylist add com.android.vending com.android.vending"
su -c "magisk --denylist add com.android.vending com.google.android.finsky.verifier.impl.ConsentDialog"
su -c "magisk --denylist add com.android.vending com.google.android.finsky.verifier.impl.legacydialogs.PackageWarningDialog"
su -c "magisk --denylist add com.google.android.finsky.verifier.impl.legacydialogs.PackageWarningDialog com.google.android.finsky.verifier.impl.legacydialogs.PackageWarningDialog"
su -c "magisk --denylist add com.google.android.finsky.verifier.impl.ConsentDialog com.google.android.finsky.verifier.impl.ConsentDialog"
su -c "magisk --denylist add com.android.vending com.android.vending:background"
su -c "magisk --denylist add com.android.vending com.android.vending:instant_app_installer"
su -c "magisk --denylist add com.android.vending com.android.vending:com.google.android.finsky.verifier.apkanalysis.service.ApkContentsScanService"
su -c "magisk --denylist add com.android.vending com.android.vending:recovery_mode"
su -c "magisk --denylist add com.android.vending com.android.vending:quick_launch"
su -c "magisk --denylist add com.alrajhiretailapp com.alrajhiretailapp"
su -c "magisk --denylist add com.alrajhiretailapp com.alrajhiretailapp:gib"
su -c "magisk --denylist add com.alrajhiretailapp com.alrajhiretailapp:container"
su -c "magisk --denylist add com.alrajhiretailapp com.alrajhiretailapp:phoenix"
su -c "magisk --denylist add com.alrajhiretailapp com.alrajhiretailapp:playcore_missing_splits_activity"
su -c "magisk --denylist add com.BanqueMisr.MobileBanking com.BanqueMisr.MobileBanking"
su -c "magisk --denylist add com.CIB.Digital.MB com.CIB.Digital.MB"
su -c "magisk --denylist add com.egyptianbanks.instapay com.egyptianbanks.instapay"
su -c "magisk --denylist add sa.gov.nic.myid sa.gov.nic.myid"
su -c "magisk --denylist add com.stc com.stc"
su -c "magisk --denylist add com.etisalat.flous com.etisalat.flous"
su -c "magisk --denylist add com.ucare.we com.ucare.we"
su -c "magisk --denylist add com.ucare.we com.ucare.we:pushservice"
su -c "magisk --denylist add com.ofss.obdx.and.nbe.com.eg com.ofss.obdx.and.nbe.com.eg"
su -c "magisk --denylist add com.ofss.obdx.and.nbe.com.eg com.ofss.obdx.and.nbe.com.eg:playcore_missing_splits_activity"
su -c "magisk --denylist add com.snb.alahlimobile com.snb.alahlimobile"
su -c "magisk --denylist add com.snb.alahlimobile com.snb.alahlimobile:gib"
su -c "magisk --denylist add com.snb.alahlimobile com.snb.alahlimobile:pushservice"
su -c "magisk --denylist add sa.com.stcpay sa.com.stcpay"
su -c "magisk --denylist add sa.gov.nic.twkhayat sa.gov.nic.twkhayat"
su -c "magisk --denylist add sa.gov.nic.twkhayat sa.gov.nic.twkhayat:container"
su -c "magisk --denylist add sa.gov.nic.twkhayat sa.gov.nic.twkhayat:pushservice"
su -c "magisk --denylist add com.orange.mobinilandme com.orange.mobinilandme"
su -c "magisk --denylist add com.orange.mobinilandme com.orange.mobinilandme:container"
su -c "magisk --denylist add com.TE.WEWallet com.TE.WEWallet"
su -c "magisk --denylist add com.emeint.android.myservices com.emeint.android.myservices"
su -c "magisk --denylist add sa.gov.moi sa.gov.moi"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:plugin"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:GP6Service"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:imsdk_inner_webview"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:intl_inner_webview"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:networkDetector"
su -c "magisk --denylist add com.rekoo.pubgm com.rekoo.pubgm:playcore_missing_splits_activity"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:plugin"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:playcore_missing_splits_activity"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:networkDetector"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:intl_inner_webview"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:imsdk_inner_webview"
su -c "magisk --denylist add com.tencent.ig com.tencent.ig:GP6Service"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:GP6Service"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:imsdk_inner_webview"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:networkDetector"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:plugin"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:playcore_missing_splits_activity"
su -c "magisk --denylist add com.pubg.krmobile com.pubg.krmobile:intl_inner_webview"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:GP6Service"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:imsdk_inner_webview"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:networkDetector"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:intl_inner_webview"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:plugin"
su -c "magisk --denylist add com.vng.pubgmobile com.vng.pubgmobile:playcore_missing_splits_activity"
su -c "magisk --denylist add sa.gov.moia.es.amer sa.gov.moia.es.amer"
su -c "magisk --denylist add com.tcs.nim com.tcs.nim"
su -c "magisk --denylist add com.tcs.nim com.tcs.nim:container"
su -c "magisk --denylist add com.kimchangyoun.rootbeerFresh.sample com.kimchangyoun.rootbeerFresh.sample"
su -c "magisk --denylist add com.scottyab.rootbeer.sample com.scottyab.rootbeer.sample"
su -c "magisk --denylist add com.fawry.myfawry com.fawry.myfawry"
su -c "magisk --denylist add com.fawry.myfawry com.fawry.myfawry:remote"
su -c "magisk --denylist add com.orange.eg.money com.orange.eg.money"
su -c "magisk --denylist add com.orange.eg.money com.orange.eg.money:error_activity"
su -c "magisk --denylist add com.orange.eg.money com.orange.eg.money:container"
su -c "magisk --denylist add krypton.tbsafetychecker krypton.tbsafetychecker"
su -c "magisk --denylist add com.competitivetechnology.tvtc com.competitivetechnology.tvtc"
su -c "magisk --denylist add com.competitivetechnology.tvtc com.competitivetechnology.tvtc:remote"
su -c "magisk --denylist add sa.alfursan.it.apps.ontimeplus sa.alfursan.it.apps.ontimeplus"
su -c "magisk --denylist add com.mosques_managment.moia.gov.sa com.mosques_managment.moia.gov.sa"
su -c "magisk --denylist add com.mosques_managment.moia.gov.sa com.mosques_managment.moia.gov.sa:pushservice"
su -c "magisk --denylist add com.google.android.ims com.google.android.ims"
su -c "magisk --denylist add com.google.android.ims com.google.android.ims:crash_report"
su -c "magisk --denylist add com.google.android.ims com.google.android.ims:primes_lifeboat"
# Clean up any leftover files from previous deprecated methods
rm -f /data/data/com.google.android.gms/cache/pif.prop /data/data/com.google.android.gms/pif.prop \
/data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json