在临时修改系统 MAC 地址的功能中新增检查,以确保文件中是否已存在 randomDeviceId_ 时间戳模式。此更改通过日志记录跳过通用注入,提升了功能的可靠性和用户体验。

This commit is contained in:
煎饼果子卷鲨鱼辣椒 2025-04-23 23:11:35 +08:00
parent a2d55a00a2
commit 207689ff56

View File

@ -599,6 +599,14 @@ modify_cursor_app_files() {
continue
fi
# 新增检查:检查是否已存在 randomDeviceId_ 时间戳模式
if grep -q "const randomDeviceId_[0-9]\\{10,\\}" "$file"; then
log_info "文件已经包含 randomDeviceId_ 模式,跳过通用注入"
echo "[FOUND] 文件已包含 randomDeviceId_ 模式,跳过通用注入: $file" >> "$LOG_FILE"
((modified_count++)) # 计为已修改,防止后续尝试其他方法
continue
fi
# 使用更通用的注入方法
log_warn "未找到具体函数,尝试使用通用修改方法"
inject_code="