# 激活函数 activate() { echo -e "${GREEN}激活中...${NC}" local android_version=$(get_android_version)
if [[ "$android_version" == "12L" ]] || [[ "$android_version" == "13" ]]; then settings put global settings_enable_monitor_phantom_procs false elif [[ "$android_version" == "12" ]]; then if has_gms; then device_config set_sync_disabled_for_tests persistent device_config put activity_manager max_phantom_processes 2147483647 else device_config put activity_manager max_phantom_processes 2147483647 fi else echo -e "${RED}不支持的 Android 版本: $android_version${NC}" return fi
sleep 1 # 等待设置生效 echo -e "${GREEN}激活成功。${NC}" }
# 取消激活函数 deactivate() { echo -e "${RED}取消激活中...${NC}" local android_version=$(get_android_version)
if [[ "$android_version" == "12L" ]] || [[ "$android_version" == "13" ]]; then settings delete global settings_enable_monitor_phantom_procs elif [[ "$android_version" == "12" ]]; then device_config delete activity_manager max_phantom_processes device_config delete activity_manager set_sync_disabled_for_tests else echo -e "${RED}不支持的 Android 版本: $android_version${NC}" return fi
sleep 1 # 等待设置生效 echo -e "${RED}取消激活成功。${NC}" }
# 查看当前值函数 view_values() { local android_version=$(get_android_version)