Files
workphone-sdk/sdk/scripts/uninstall_old_ocreat_apks.sh

39 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# [兼容入口] 卸载旧奥创 APK — 请优先使用:
# bash sdk/scripts/clean_aochuang_device.sh --apply [-s SERIAL]
# Skill机擎/阿服/奥创真机清机/SKILL.md
# 本脚本仅卸两核心包,不含 xesd/Magisk/007 App。
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [[ "${1:-}" == "--full" ]]; then
shift
exec bash "$SCRIPT_DIR/clean_aochuang_device.sh" --apply "$@"
fi
OCREAT_PACKAGES=(
"org.xeslciw.manager" # XESlciw 框架管理
"top.zzz.vivwxjz" # 微信 Hook 模块
)
KEEP_PACKAGE="com.system.cloudservice" # 新工作程序,不卸载
ADB="${ADB:-adb}"
if [[ -n "$1" ]]; then
ADB="adb -s $1"
fi
echo "=== 卸载旧奥创 APK保留 $KEEP_PACKAGE==="
echo "设备: $($ADB devices -l | grep -v 'List' | grep device | head -1 || echo '未指定,使用默认')"
echo ""
for pkg in "${OCREAT_PACKAGES[@]}"; do
if $ADB shell pm list packages 2>/dev/null | grep -q "^package:$pkg"; then
echo "卸载: $pkg"
$ADB uninstall "$pkg" || echo " (卸载失败或需手动确认)"
else
echo "跳过(未安装): $pkg"
fi
done
echo ""
echo "完成。新工作程序 $KEEP_PACKAGE 未动。"