Exploit databaseDownload repository ZIP
GH-29e755ab02c968b347a7e04c962bbc6b
starriv/cve-2026-98260-xiaomi-17-pro-max
Sources for CVE-2026-98260
61 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files16
starriv/cve-2026-98260-xiaomi-17-pro-maxRevision e9d8d6a6779b
- ↑..Parent directory
- device/
- lib/
- autoretry.sh
- bootloop-capture.sh
- build.sh
- check.sh
- clean-device-temp.sh
- fetch-binaries.sh
- freeze-risk-audit.sh
- load-ksu.sh
- post-reboot.sh
- privacy-clean.sh
- root.sh
- run.sh
- staged-batch.sh
- unbrick-restore.sh
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
scripts/staged-batch.sh
Shell · 2,830 bytes#!/usr/bin/env bash
# staged-batch.sh — 分批复跑「一批」的封装(见 docs/RUNBOOK.md 第 3 节)
#
# 流程:等上次重启完成 → 校验没卡 logo → 临时 root → apply --only <groups> → 重启验证
#
# 用法:
# ./scripts/staged-batch.sh tier0,setting
# ./scripts/staged-batch.sh quickapp,platform,freeze
# ./scripts/staged-batch.sh --no-final-reboot security
# ./scripts/staged-batch.sh --force-build-mismatch <groups> # 构建不在白名单时
#
# 退出码:
# 0 本批已 apply 并重启(下一批脚本会验证这次重启)
# 1 上一批重启后没等到 boot_completed(疑似卡 logo)→ 停,按 docs/RUNBOOK.md 第 4.1 节处置
# 2 提权失败
# 3 apply 失败
set -uo pipefail
ADB="${ADB:-$(command -v adb 2>/dev/null || echo /Users/starriv/SDK/android/platform-tools/adb)}"
SERIAL="${SERIAL:-}"
REBOOT=1
FORCE_BUILD=0
STAGE_GROUPS=""
BOOT_TIMEOUT="${BOOT_TIMEOUT:-240}"
while [ $# -gt 0 ]; do
case "$1" in
--no-final-reboot) REBOOT=0 ;;
--force-build-mismatch) FORCE_BUILD=1 ;;
--boot-timeout) shift; BOOT_TIMEOUT="${1:?}" ;;
--serial) shift; SERIAL="${1:?}" ;;
-h|--help) sed -n '2,16p' "$0"; exit 0 ;;
*) STAGE_GROUPS="$1" ;;
esac
shift
done
[ -n "$STAGE_GROUPS" ] || { echo "用法: $0 <groups> [--no-final-reboot]" >&2; exit 2; }
adbs() { if [ -n "$SERIAL" ]; then "$ADB" -s "$SERIAL" "$@"; else "$ADB" "$@"; fi; }
sh_() { adbs shell "$1" 2>/dev/null | tr -d '\r'; }
say() { printf '\n[%s] %s\n' "$(date +%H:%M:%S)" "$*"; }
boot_done() { [ "$(sh_ 'getprop sys.boot_completed')" = "1" ]; }
say "等待设备(上一批重启,最长 ${BOOT_TIMEOUT}s)"
deadline=$(( $(date +%s) + BOOT_TIMEOUT ))
ok=0
while [ "$(date +%s)" -lt "$deadline" ]; do
if adbs get-state >/dev/null 2>&1 && boot_done; then ok=1; break; fi
sleep 3
done
if [ "$ok" != 1 ]; then
say "✖ 等不到 boot_completed=1:上一批疑似卡 logo"
echo " 下一步:./scripts/unbrick-restore.sh triage(adb 可见时),否则 recovery 清数据,见 docs/RUNBOOK.md 第 4.1 节"
exit 1
fi
say "开机正常:uptime=$(sh_ 'cut -d. -f1 /proc/uptime')s bootanim=$(sh_ 'getprop init.svc.bootanim')"
say "临时 root"
ROOT_ARGS="--boots 12"
[ "$FORCE_BUILD" = 1 ] && ROOT_ARGS="$ROOT_ARGS --force-build-mismatch"
if ! ./scripts/run.sh $ROOT_ARGS >"logs/staged-$(date +%H%M%S)-root.log" 2>&1; then
say "✖ 提权失败,日志在 logs/staged-*-root.log"; exit 2
fi
sh_ 'su -c id' | grep -q 'uid=0' || { say "✖ su 不可用"; exit 2; }
say "apply --only $STAGE_GROUPS"
./scripts/privacy-clean.sh apply --only "$STAGE_GROUPS" || { say "✖ apply 失败"; exit 3; }
if [ "$REBOOT" = 1 ]; then
say "重启验证(下一批会检查 boot_completed)"
adbs reboot >/dev/null 2>&1 || true
fi
say "本批完成:$STAGE_GROUPS"