mirror of
https://git.axenov.dev/mirrors/cursor-free-vip.git
synced 2026-01-03 17:29:04 +03:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12d46d5f18 | ||
|
|
6cb3ad79af | ||
|
|
6470c65f8b | ||
|
|
491b227486 | ||
|
|
96c0cd5274 | ||
|
|
60a438e618 | ||
|
|
6a25871366 | ||
|
|
b46a58bd23 | ||
|
|
fea2b88a8e | ||
|
|
63fe39f2c1 | ||
|
|
386ffa4568 | ||
|
|
9c66725caf | ||
|
|
16b6ba95e2 | ||
|
|
3424f49a57 | ||
|
|
07bed23848 | ||
|
|
c12c52269e | ||
|
|
8d279ce972 | ||
|
|
849ec5ea8d | ||
|
|
c48c35fd09 | ||
|
|
a361d2fe6d |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
version:
|
version:
|
||||||
description: 'Version number (e.g. 1.0.9)'
|
description: 'Version number (e.g. 1.0.9)'
|
||||||
required: true
|
required: true
|
||||||
default: '1.8.04'
|
default: '1.8.09'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -241,4 +241,4 @@ jobs:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,5 +1,29 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v1.8.09
|
||||||
|
1. Add: Bypass Token Limit Check | 繞過 Token 使用限制檢查
|
||||||
|
2. Add:Bypass Claude Limit 30000 set to 900000(9e5) | 繞過 Claude 使用限制 30000 設置為 900000(9e5)
|
||||||
|
3. Add: Force Update Config | 添加強制更新配置
|
||||||
|
4. Add: Multilanguage support for force update | 添加強制更新功能的多語言支持
|
||||||
|
5. Fix: Reset break | 修復重置中斷
|
||||||
|
4. Fix: Some Issues | 修復一些問題
|
||||||
|
|
||||||
|
## v1.8.08
|
||||||
|
1. Add: Force Update Config | 添加強制更新配置
|
||||||
|
2. Add: Multilanguage support for force update | 添加強制更新功能的多語言支持
|
||||||
|
3. Fix: Google Auth & Github Auth JWT Problem | 修復 Google Auth & Github Auth JWT 問題
|
||||||
|
4. Fix: Totally reset import & import * raw options problem | 修復 totally reset import & import * raw 選項問題
|
||||||
|
5. Fix: reset.file_not_found problem | 修復 reset.file_not_found 問題
|
||||||
|
6. Outdated: Bypass Cursor Version Check | 過期:繞過 Cursor 版本檢查
|
||||||
|
7. Document: i.header.set("x-cursor-config-version", "UUID4-xxxxxx-xxxxxx-xxxxxx-xxxxxx"); | 文檔:i.header.set("x-cursor-config-version", "UUID4-xxxxxx-xxxxxx-xxxxxx-xxxxxx");
|
||||||
|
8. Fix: Some Issues | 修復一些問題
|
||||||
|
|
||||||
|
## v1.8.07
|
||||||
|
1. Add: Bypass Cursor Version Check | 添加繞過 Cursor 版本檢查
|
||||||
|
2. Add: Multilanguage support for bypass | 添加繞過的多語言支持
|
||||||
|
3. MSG: Free & free trial accounts can no longer use chat with premium models on Cursor Version 0.45 or less. Please upgrade to Pro or use Cursor Version 0.46 or later. Install Cursor at https://www.cursor.com/downloads or update from within the editor.
|
||||||
|
4. Fix: Some Issues | 修復一些問題
|
||||||
|
|
||||||
## v1.8.06
|
## v1.8.06
|
||||||
1. Add: Google Account Deletion Feature | 添加 Google 账号删除功能
|
1. Add: Google Account Deletion Feature | 添加 Google 账号删除功能
|
||||||
2. Update: Menu with new account deletion option | 更新菜单添加账号删除选项
|
2. Update: Menu with new account deletion option | 更新菜单添加账号删除选项
|
||||||
|
|||||||
@@ -19,4 +19,65 @@ begemail.com
|
|||||||
dugmail.com
|
dugmail.com
|
||||||
solerbe.net
|
solerbe.net
|
||||||
corhash.net
|
corhash.net
|
||||||
mailshou.com
|
mailshou.com
|
||||||
|
0-mail.com
|
||||||
|
1secmail.com
|
||||||
|
20minutemail.com
|
||||||
|
2prong.com
|
||||||
|
33mail.com
|
||||||
|
anonbox.net
|
||||||
|
anonymbox.com
|
||||||
|
boun.cr
|
||||||
|
burnermail.io
|
||||||
|
byom.de
|
||||||
|
chammy.info
|
||||||
|
cloud-mail.top
|
||||||
|
cool.fr.nf
|
||||||
|
crazymailing.com
|
||||||
|
cuvox.de
|
||||||
|
deadaddress.com
|
||||||
|
dispostable.com
|
||||||
|
dudmail.com
|
||||||
|
emailondeck.com
|
||||||
|
fakeinbox.com
|
||||||
|
fakemailgenerator.com
|
||||||
|
filzmail.com
|
||||||
|
fizmail.com
|
||||||
|
guerrillamail.com
|
||||||
|
harakirimail.com
|
||||||
|
hottempmail.com
|
||||||
|
inboxbear.com
|
||||||
|
inboxkitten.com
|
||||||
|
incognitomail.org
|
||||||
|
letthemeatspam.com
|
||||||
|
maildrop.cc
|
||||||
|
mailinator.com
|
||||||
|
mailnesia.com
|
||||||
|
mailsac.com
|
||||||
|
mailtemp.net
|
||||||
|
mailzilla.org
|
||||||
|
mintemail.com
|
||||||
|
moakt.com
|
||||||
|
my10minutemail.com
|
||||||
|
mytrashmail.com
|
||||||
|
nospamfor.us
|
||||||
|
nowmymail.com
|
||||||
|
openmailbox.org
|
||||||
|
privacyroot.com
|
||||||
|
sharklasers.com
|
||||||
|
spam4.me
|
||||||
|
spamavert.com
|
||||||
|
spambog.com
|
||||||
|
spamex.com
|
||||||
|
spamfree24.org
|
||||||
|
spaml.com
|
||||||
|
temp-mail.org
|
||||||
|
tempmail.net
|
||||||
|
tempmailaddress.com
|
||||||
|
temporaryemail.net
|
||||||
|
throwawayemail.com
|
||||||
|
trash-mail.com
|
||||||
|
trashmail.com
|
||||||
|
trbvn.com
|
||||||
|
yopmail.com
|
||||||
|
zippymail.info
|
||||||
|
|||||||
158
bypass_version.py
Normal file
158
bypass_version.py
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
import os
|
||||||
|
import json
|
||||||
|
import shutil
|
||||||
|
import platform
|
||||||
|
import configparser
|
||||||
|
import time
|
||||||
|
from colorama import Fore, Style, init
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
|
from utils import get_user_documents_path
|
||||||
|
|
||||||
|
# Initialize colorama
|
||||||
|
init()
|
||||||
|
|
||||||
|
# Define emoji constants
|
||||||
|
EMOJI = {
|
||||||
|
'INFO': 'ℹ️',
|
||||||
|
'SUCCESS': '✅',
|
||||||
|
'ERROR': '❌',
|
||||||
|
'WARNING': '⚠️',
|
||||||
|
'FILE': '📄',
|
||||||
|
'BACKUP': '💾',
|
||||||
|
'RESET': '🔄',
|
||||||
|
'VERSION': '🏷️'
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_product_json_path(translator=None):
|
||||||
|
"""Get Cursor product.json path"""
|
||||||
|
system = platform.system()
|
||||||
|
|
||||||
|
# Read configuration
|
||||||
|
config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip")
|
||||||
|
config_file = os.path.join(config_dir, "config.ini")
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
|
if os.path.exists(config_file):
|
||||||
|
config.read(config_file)
|
||||||
|
|
||||||
|
if system == "Windows":
|
||||||
|
localappdata = os.environ.get("LOCALAPPDATA")
|
||||||
|
if not localappdata:
|
||||||
|
raise OSError(translator.get('bypass.localappdata_not_found') if translator else "LOCALAPPDATA environment variable not found")
|
||||||
|
|
||||||
|
product_json_path = os.path.join(localappdata, "Programs", "Cursor", "resources", "app", "product.json")
|
||||||
|
|
||||||
|
# Check if path exists in config
|
||||||
|
if 'WindowsPaths' in config and 'cursor_path' in config['WindowsPaths']:
|
||||||
|
cursor_path = config.get('WindowsPaths', 'cursor_path')
|
||||||
|
product_json_path = os.path.join(cursor_path, "product.json")
|
||||||
|
|
||||||
|
elif system == "Darwin": # macOS
|
||||||
|
product_json_path = "/Applications/Cursor.app/Contents/Resources/app/product.json"
|
||||||
|
|
||||||
|
elif system == "Linux":
|
||||||
|
# Try multiple common paths
|
||||||
|
possible_paths = [
|
||||||
|
"/opt/Cursor/resources/app/product.json",
|
||||||
|
"/usr/share/cursor/resources/app/product.json",
|
||||||
|
"/usr/lib/cursor/app/product.json"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Add extracted AppImage paths
|
||||||
|
extracted_usr_paths = os.path.expanduser("~/squashfs-root/usr/share/cursor/resources/app/product.json")
|
||||||
|
if os.path.exists(extracted_usr_paths):
|
||||||
|
possible_paths.append(extracted_usr_paths)
|
||||||
|
|
||||||
|
for path in possible_paths:
|
||||||
|
if os.path.exists(path):
|
||||||
|
product_json_path = path
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise OSError(translator.get('bypass.product_json_not_found') if translator else "product.json not found in common Linux paths")
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise OSError(translator.get('bypass.unsupported_os', system=system) if translator else f"Unsupported operating system: {system}")
|
||||||
|
|
||||||
|
if not os.path.exists(product_json_path):
|
||||||
|
raise OSError(translator.get('bypass.file_not_found', path=product_json_path) if translator else f"File not found: {product_json_path}")
|
||||||
|
|
||||||
|
return product_json_path
|
||||||
|
|
||||||
|
def compare_versions(version1, version2):
|
||||||
|
"""Compare two version strings"""
|
||||||
|
v1_parts = [int(x) for x in version1.split('.')]
|
||||||
|
v2_parts = [int(x) for x in version2.split('.')]
|
||||||
|
|
||||||
|
for i in range(max(len(v1_parts), len(v2_parts))):
|
||||||
|
v1 = v1_parts[i] if i < len(v1_parts) else 0
|
||||||
|
v2 = v2_parts[i] if i < len(v2_parts) else 0
|
||||||
|
if v1 < v2:
|
||||||
|
return -1
|
||||||
|
elif v1 > v2:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def bypass_version(translator=None):
|
||||||
|
"""Bypass Cursor version check by modifying product.json"""
|
||||||
|
try:
|
||||||
|
print(f"\n{Fore.CYAN}{EMOJI['INFO']} {translator.get('bypass.starting') if translator else 'Starting Cursor version bypass...'}{Style.RESET_ALL}")
|
||||||
|
|
||||||
|
# Get product.json path
|
||||||
|
product_json_path = get_product_json_path(translator)
|
||||||
|
print(f"{Fore.CYAN}{EMOJI['FILE']} {translator.get('bypass.found_product_json', path=product_json_path) if translator else f'Found product.json: {product_json_path}'}{Style.RESET_ALL}")
|
||||||
|
|
||||||
|
# Check file permissions
|
||||||
|
if not os.access(product_json_path, os.W_OK):
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('bypass.no_write_permission', path=product_json_path) if translator else f'No write permission for file: {product_json_path}'}{Style.RESET_ALL}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Read product.json
|
||||||
|
try:
|
||||||
|
with open(product_json_path, "r", encoding="utf-8") as f:
|
||||||
|
product_data = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('bypass.read_failed', error=str(e)) if translator else f'Failed to read product.json: {str(e)}'}{Style.RESET_ALL}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Get current version
|
||||||
|
current_version = product_data.get("version", "0.0.0")
|
||||||
|
print(f"{Fore.CYAN}{EMOJI['VERSION']} {translator.get('bypass.current_version', version=current_version) if translator else f'Current version: {current_version}'}{Style.RESET_ALL}")
|
||||||
|
|
||||||
|
# Check if version needs to be modified
|
||||||
|
if compare_versions(current_version, "0.46.0") < 0:
|
||||||
|
# Create backup
|
||||||
|
timestamp = time.strftime("%Y%m%d%H%M%S")
|
||||||
|
backup_path = f"{product_json_path}.{timestamp}"
|
||||||
|
shutil.copy2(product_json_path, backup_path)
|
||||||
|
print(f"{Fore.GREEN}{EMOJI['BACKUP']} {translator.get('bypass.backup_created', path=backup_path) if translator else f'Backup created: {backup_path}'}{Style.RESET_ALL}")
|
||||||
|
|
||||||
|
# Modify version
|
||||||
|
new_version = "0.48.7"
|
||||||
|
product_data["version"] = new_version
|
||||||
|
|
||||||
|
# Save modified product.json
|
||||||
|
try:
|
||||||
|
with open(product_json_path, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(product_data, f, indent=2)
|
||||||
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {translator.get('bypass.version_updated', old=current_version, new=new_version) if translator else f'Version updated from {current_version} to {new_version}'}{Style.RESET_ALL}")
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('bypass.write_failed', error=str(e)) if translator else f'Failed to write product.json: {str(e)}'}{Style.RESET_ALL}")
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print(f"{Fore.YELLOW}{EMOJI['INFO']} {translator.get('bypass.no_update_needed', version=current_version) if translator else f'No update needed. Current version {current_version} is already >= 0.46.0'}{Style.RESET_ALL}")
|
||||||
|
return True
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('bypass.bypass_failed', error=str(e)) if translator else f'Version bypass failed: {str(e)}'}{Style.RESET_ALL}")
|
||||||
|
print(f"{Fore.YELLOW}{EMOJI['INFO']} {translator.get('bypass.stack_trace') if translator else 'Stack trace'}: {traceback.format_exc()}{Style.RESET_ALL}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
def main(translator=None):
|
||||||
|
"""Main function"""
|
||||||
|
return bypass_version(translator)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
53
config.py
53
config.py
@@ -3,6 +3,8 @@ import sys
|
|||||||
import configparser
|
import configparser
|
||||||
from colorama import Fore, Style
|
from colorama import Fore, Style
|
||||||
from utils import get_user_documents_path, get_default_chrome_path, get_linux_cursor_path
|
from utils import get_user_documents_path, get_default_chrome_path, get_linux_cursor_path
|
||||||
|
import shutil
|
||||||
|
import datetime
|
||||||
|
|
||||||
EMOJI = {
|
EMOJI = {
|
||||||
"INFO": "ℹ️",
|
"INFO": "ℹ️",
|
||||||
@@ -52,6 +54,7 @@ def setup_config(translator=None):
|
|||||||
},
|
},
|
||||||
'Utils': {
|
'Utils': {
|
||||||
'enabled_update_check': 'True',
|
'enabled_update_check': 'True',
|
||||||
|
'enabled_force_update': 'True',
|
||||||
'enabled_account_info': 'True'
|
'enabled_account_info': 'True'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,6 +260,56 @@ def print_config(config, translator=None):
|
|||||||
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
def force_update_config(translator=None):
|
||||||
|
"""
|
||||||
|
Force update configuration file with latest defaults if update check is enabled.
|
||||||
|
Args:
|
||||||
|
translator: Translator instance
|
||||||
|
Returns:
|
||||||
|
ConfigParser instance or None if failed
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip")
|
||||||
|
config_file = os.path.join(config_dir, "config.ini")
|
||||||
|
current_time = datetime.datetime.now()
|
||||||
|
|
||||||
|
# If the config file exists, check if forced update is enabled
|
||||||
|
if os.path.exists(config_file):
|
||||||
|
# First, read the existing configuration
|
||||||
|
existing_config = configparser.ConfigParser()
|
||||||
|
existing_config.read(config_file, encoding='utf-8')
|
||||||
|
# Check if "enabled_update_check" is True
|
||||||
|
update_enabled = True # Default to True if not set
|
||||||
|
if existing_config.has_section('Utils') and existing_config.has_option('Utils', 'enabled_force_update'):
|
||||||
|
update_enabled = existing_config.get('Utils', 'enabled_force_update').strip().lower() in ('true', 'yes', '1', 'on')
|
||||||
|
|
||||||
|
if update_enabled:
|
||||||
|
try:
|
||||||
|
# Create a backup
|
||||||
|
backup_file = f"{config_file}.bak.{current_time.strftime('%Y%m%d_%H%M%S')}"
|
||||||
|
shutil.copy2(config_file, backup_file)
|
||||||
|
if translator:
|
||||||
|
print(f"\n{Fore.CYAN}{EMOJI['INFO']} {translator.get('config.backup_created', path=backup_file) if translator else f'Backup created: {backup_file}'}{Style.RESET_ALL}")
|
||||||
|
print(f"\n{Fore.CYAN}{EMOJI['INFO']} {translator.get('config.config_force_update_enabled') if translator else 'Config file force update enabled'}{Style.RESET_ALL}")
|
||||||
|
# Delete the original config file (forced update)
|
||||||
|
os.remove(config_file)
|
||||||
|
if translator:
|
||||||
|
print(f"{Fore.CYAN}{EMOJI['INFO']} {translator.get('config.config_removed') if translator else 'Config file removed for forced update'}{Style.RESET_ALL}")
|
||||||
|
except Exception as e:
|
||||||
|
if translator:
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('config.backup_failed', error=str(e)) if translator else f'Failed to backup config: {str(e)}'}{Style.RESET_ALL}")
|
||||||
|
else:
|
||||||
|
if translator:
|
||||||
|
print(f"\n{Fore.CYAN}{EMOJI['INFO']} {translator.get('config.config_force_update_disabled', fallback='Config file force update disabled by configuration. Keeping existing config file.') if translator else 'Config file force update disabled by configuration. Keeping existing config file.'}{Style.RESET_ALL}")
|
||||||
|
|
||||||
|
# Generate a new (or updated) configuration if needed
|
||||||
|
return setup_config(translator)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
if translator:
|
||||||
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('config.force_update_failed', error=str(e)) if translator else f'Force update config failed: {str(e)}'}{Style.RESET_ALL}")
|
||||||
|
return None
|
||||||
|
|
||||||
def get_config(translator=None):
|
def get_config(translator=None):
|
||||||
"""Get existing config or create new one"""
|
"""Get existing config or create new one"""
|
||||||
return setup_config(translator)
|
return setup_config(translator)
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"delete_google_account": "Delete Cursor Google Account",
|
"delete_google_account": "Delete Cursor Google Account",
|
||||||
"continue_prompt": "Continue? (y/N): ",
|
"continue_prompt": "Continue? (y/N): ",
|
||||||
"operation_cancelled_by_user": "Operation cancelled by user",
|
"operation_cancelled_by_user": "Operation cancelled by user",
|
||||||
"exiting": "Exiting ……"
|
"exiting": "Exiting ……",
|
||||||
|
"bypass_version_check": "Bypass Cursor Version Check"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"en": "English",
|
"en": "English",
|
||||||
@@ -116,7 +117,8 @@
|
|||||||
"modify_file_failed": "Modify File Failed: {error}",
|
"modify_file_failed": "Modify File Failed: {error}",
|
||||||
"windows_machine_id_updated": "Windows Machine ID Updated Successfully",
|
"windows_machine_id_updated": "Windows Machine ID Updated Successfully",
|
||||||
"update_windows_machine_id_failed": "Update Windows Machine ID Failed: {error}",
|
"update_windows_machine_id_failed": "Update Windows Machine ID Failed: {error}",
|
||||||
"update_windows_machine_guid_failed": "Update Windows Machine GUID Failed: {error}"
|
"update_windows_machine_guid_failed": "Update Windows Machine GUID Failed: {error}",
|
||||||
|
"file_not_found": "File Not Found: {path}"
|
||||||
},
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"title": "Cursor Registration Tool",
|
"title": "Cursor Registration Tool",
|
||||||
@@ -523,7 +525,8 @@
|
|||||||
"premium_usage": "Premium Usage",
|
"premium_usage": "Premium Usage",
|
||||||
"basic_usage": "Basic Usage",
|
"basic_usage": "Basic Usage",
|
||||||
"usage_not_found": "Usage not found",
|
"usage_not_found": "Usage not found",
|
||||||
"lifetime_access_enabled": "Lifetime Access Enabled"
|
"lifetime_access_enabled": "Lifetime Access Enabled",
|
||||||
|
"token_not_found": "Token not found"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"config_not_available": "Configuration not available",
|
"config_not_available": "Configuration not available",
|
||||||
@@ -553,7 +556,13 @@
|
|||||||
"config_setup_error": "Error setting up config: {error}",
|
"config_setup_error": "Error setting up config: {error}",
|
||||||
"storage_file_is_valid_and_contains_data": "Storage file is valid and contains data",
|
"storage_file_is_valid_and_contains_data": "Storage file is valid and contains data",
|
||||||
"error_reading_storage_file": "Error reading storage file: {error}",
|
"error_reading_storage_file": "Error reading storage file: {error}",
|
||||||
"also_checked": "Also checked {path}"
|
"also_checked": "Also checked {path}",
|
||||||
|
"backup_created": "Backup created: {path}",
|
||||||
|
"config_removed": "Config file removed for forced update",
|
||||||
|
"backup_failed": "Failed to backup config: {error}",
|
||||||
|
"force_update_failed": "Force update config failed: {error}",
|
||||||
|
"config_force_update_disabled": "Config file force update disabled , skipping forced update",
|
||||||
|
"config_force_update_enabled": "Config file force update enabled , performing forced update"
|
||||||
},
|
},
|
||||||
"oauth": {
|
"oauth": {
|
||||||
"authentication_button_not_found": "Authentication button not found",
|
"authentication_button_not_found": "Authentication button not found",
|
||||||
@@ -669,5 +678,25 @@
|
|||||||
"found_email": "Found email: {email}",
|
"found_email": "Found email: {email}",
|
||||||
"email_not_found": "Email not found: {error}",
|
"email_not_found": "Email not found: {error}",
|
||||||
"confirm_prompt": "Are you sure you want to proceed? (y/N): "
|
"confirm_prompt": "Are you sure you want to proceed? (y/N): "
|
||||||
|
},
|
||||||
|
"bypass": {
|
||||||
|
"starting": "Starting Cursor version bypass...",
|
||||||
|
"found_product_json": "Found product.json: {path}",
|
||||||
|
"no_write_permission": "No write permission for file: {path}",
|
||||||
|
"read_failed": "Failed to read product.json: {error}",
|
||||||
|
"current_version": "Current version: {version}",
|
||||||
|
"backup_created": "Backup created: {path}",
|
||||||
|
"version_updated": "Version updated from {old} to {new}",
|
||||||
|
"write_failed": "Failed to write product.json: {error}",
|
||||||
|
"no_update_needed": "No update needed. Current version {version} is already >= 0.46.0",
|
||||||
|
"bypass_failed": "Version bypass failed: {error}",
|
||||||
|
"stack_trace": "Stack trace",
|
||||||
|
"localappdata_not_found": "LOCALAPPDATA environment variable not found",
|
||||||
|
"product_json_not_found": "product.json not found in common Linux paths",
|
||||||
|
"unsupported_os": "Unsupported operating system: {system}",
|
||||||
|
"file_not_found": "File not found: {path}",
|
||||||
|
"title": "Cursor Version Bypass Tool",
|
||||||
|
"description": "This tool modifies Cursor's product.json to bypass version restrictions",
|
||||||
|
"menu_option": "Bypass Cursor Version Check"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"delete_google_account": "删除 Cursor Google 账号",
|
"delete_google_account": "删除 Cursor Google 账号",
|
||||||
"continue_prompt": "继续?(y/N): ",
|
"continue_prompt": "继续?(y/N): ",
|
||||||
"operation_cancelled_by_user": "操作被用户取消",
|
"operation_cancelled_by_user": "操作被用户取消",
|
||||||
"exiting": "退出中 ……"
|
"exiting": "退出中 ……",
|
||||||
|
"bypass_version_check": "绕过 Cursor 版本检查"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"en": "英语",
|
"en": "英语",
|
||||||
@@ -116,7 +117,8 @@
|
|||||||
"modify_file_failed": "修改文件失败: {error}",
|
"modify_file_failed": "修改文件失败: {error}",
|
||||||
"windows_machine_id_updated": "Windows机器ID更新成功",
|
"windows_machine_id_updated": "Windows机器ID更新成功",
|
||||||
"update_windows_machine_id_failed": "更新Windows机器ID失败: {error}",
|
"update_windows_machine_id_failed": "更新Windows机器ID失败: {error}",
|
||||||
"update_windows_machine_guid_failed": "更新Windows机器GUID失败: {error}"
|
"update_windows_machine_guid_failed": "更新Windows机器GUID失败: {error}",
|
||||||
|
"file_not_found": "文件未找到: {path}"
|
||||||
},
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"title": "Cursor 注册工具",
|
"title": "Cursor 注册工具",
|
||||||
@@ -501,7 +503,8 @@
|
|||||||
"premium_usage": "高级使用量",
|
"premium_usage": "高级使用量",
|
||||||
"basic_usage": "基础使用量",
|
"basic_usage": "基础使用量",
|
||||||
"usage_not_found": "使用量未找到",
|
"usage_not_found": "使用量未找到",
|
||||||
"lifetime_access_enabled": "永久访问已启用"
|
"lifetime_access_enabled": "永久访问已启用",
|
||||||
|
"token_not_found": "Token 未找到"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"config_not_available": "配置未找到。",
|
"config_not_available": "配置未找到。",
|
||||||
@@ -531,7 +534,13 @@
|
|||||||
"config_setup_error": "配置设置错误",
|
"config_setup_error": "配置设置错误",
|
||||||
"storage_file_is_valid_and_contains_data": "存储文件有效且包含数据",
|
"storage_file_is_valid_and_contains_data": "存储文件有效且包含数据",
|
||||||
"error_reading_storage_file": "读取存储文件时出错",
|
"error_reading_storage_file": "读取存储文件时出错",
|
||||||
"also_checked": "也检查了 {path}"
|
"also_checked": "也检查了 {path}",
|
||||||
|
"backup_created": "备份创建: {path}",
|
||||||
|
"config_removed": "配置文件已删除用于强制更新",
|
||||||
|
"backup_failed": "备份失败: {error}",
|
||||||
|
"force_update_failed": "强制更新配置失败: {error}",
|
||||||
|
"config_force_update_disabled": "配置文件强制更新已禁用,跳过强制更新",
|
||||||
|
"config_force_update_enabled": "配置文件强制更新已启用,正在执行强制更新"
|
||||||
},
|
},
|
||||||
"oauth": {
|
"oauth": {
|
||||||
"authentication_button_not_found": "未找到认证按钮",
|
"authentication_button_not_found": "未找到认证按钮",
|
||||||
@@ -647,5 +656,25 @@
|
|||||||
"email_not_found": "未找到邮箱: {error}",
|
"email_not_found": "未找到邮箱: {error}",
|
||||||
"found_danger_zone": "已找到危险区域部分",
|
"found_danger_zone": "已找到危险区域部分",
|
||||||
"confirm_prompt": "您确定要继续吗?(y/N): "
|
"confirm_prompt": "您确定要继续吗?(y/N): "
|
||||||
|
},
|
||||||
|
"bypass": {
|
||||||
|
"starting": "开始绕过 Cursor 版本限制...",
|
||||||
|
"found_product_json": "找到 product.json: {path}",
|
||||||
|
"no_write_permission": "没有写入权限: {path}",
|
||||||
|
"read_failed": "读取 product.json 失败: {error}",
|
||||||
|
"current_version": "当前版本: {version}",
|
||||||
|
"backup_created": "备份创建: {path}",
|
||||||
|
"version_updated": "版本从 {old} 更新到 {new}",
|
||||||
|
"write_failed": "写入 product.json 失败: {error}",
|
||||||
|
"no_update_needed": "不需要更新。当前版本 {version} 已 >= 0.46.0",
|
||||||
|
"bypass_failed": "绕过版本限制失败: {error}",
|
||||||
|
"stack_trace": "堆栈跟踪",
|
||||||
|
"localappdata_not_found": "LOCALAPPDATA 环境变量未找到",
|
||||||
|
"product_json_not_found": "product.json 未在常见 Linux 路径中找到",
|
||||||
|
"unsupported_os": "不支持的操作系统: {system}",
|
||||||
|
"file_not_found": "文件未找到: {path}",
|
||||||
|
"title": "Cursor 版本绕过工具",
|
||||||
|
"description": "此工具修改 Cursor 的 product.json 以绕过版本限制",
|
||||||
|
"menu_option": "绕过 Cursor 版本检查"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"delete_google_account": "刪除 Cursor Google 帳號",
|
"delete_google_account": "刪除 Cursor Google 帳號",
|
||||||
"continue_prompt": "繼續?(y/N): ",
|
"continue_prompt": "繼續?(y/N): ",
|
||||||
"operation_cancelled_by_user": "操作被使用者取消",
|
"operation_cancelled_by_user": "操作被使用者取消",
|
||||||
"exiting": "退出中 ……"
|
"exiting": "退出中 ……",
|
||||||
|
"bypass_version_check": "繞過 Cursor 版本檢查"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
"en": "英文",
|
"en": "英文",
|
||||||
@@ -116,7 +117,8 @@
|
|||||||
"modify_file_failed": "修改文件失敗: {error}",
|
"modify_file_failed": "修改文件失敗: {error}",
|
||||||
"windows_machine_id_updated": "Windows機器ID更新成功",
|
"windows_machine_id_updated": "Windows機器ID更新成功",
|
||||||
"update_windows_machine_id_failed": "更新Windows機器ID失敗: {error}",
|
"update_windows_machine_id_failed": "更新Windows機器ID失敗: {error}",
|
||||||
"update_windows_machine_guid_failed": "更新Windows機器GUID失敗: {error}"
|
"update_windows_machine_guid_failed": "更新Windows機器GUID失敗: {error}",
|
||||||
|
"file_not_found": "文件未找到: {path}"
|
||||||
},
|
},
|
||||||
|
|
||||||
"register": {
|
"register": {
|
||||||
@@ -483,7 +485,8 @@
|
|||||||
"premium_usage": "高級使用量",
|
"premium_usage": "高級使用量",
|
||||||
"basic_usage": "基礎使用量",
|
"basic_usage": "基礎使用量",
|
||||||
"usage_not_found": "使用量未找到",
|
"usage_not_found": "使用量未找到",
|
||||||
"lifetime_access_enabled": "永久訪問已啟用"
|
"lifetime_access_enabled": "永久訪問已啟用",
|
||||||
|
"token_not_found": "Token 未找到"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"config_not_available": "配置未找到。",
|
"config_not_available": "配置未找到。",
|
||||||
@@ -513,7 +516,13 @@
|
|||||||
"config_setup_error": "配置設置錯誤",
|
"config_setup_error": "配置設置錯誤",
|
||||||
"storage_file_is_valid_and_contains_data": "儲存文件有效且包含數據",
|
"storage_file_is_valid_and_contains_data": "儲存文件有效且包含數據",
|
||||||
"error_reading_storage_file": "讀取儲存文件時出錯",
|
"error_reading_storage_file": "讀取儲存文件時出錯",
|
||||||
"also_checked": "也檢查了 {path}"
|
"also_checked": "也檢查了 {path}",
|
||||||
|
"backup_created": "備份已創建: {path}",
|
||||||
|
"config_removed": "配置文件已刪除用於強制更新",
|
||||||
|
"backup_failed": "備份失敗: {error}",
|
||||||
|
"force_update_failed": "強制更新配置失敗: {error}",
|
||||||
|
"config_force_update_disabled": "配置文件強制更新已禁用,跳過強制更新",
|
||||||
|
"config_force_update_enabled": "配置文件強制更新已啟用,正在執行強制更新"
|
||||||
},
|
},
|
||||||
"oauth": {
|
"oauth": {
|
||||||
"authentication_button_not_found": "未找到認證按鈕",
|
"authentication_button_not_found": "未找到認證按鈕",
|
||||||
@@ -629,5 +638,25 @@
|
|||||||
"found_danger_zone": "已找到危險區域部分",
|
"found_danger_zone": "已找到危險區域部分",
|
||||||
"confirm_prompt": "您確定要繼續嗎?(y/N): ",
|
"confirm_prompt": "您確定要繼續嗎?(y/N): ",
|
||||||
"typed_delete_js": "已使用 JavaScript 輸入\"Delete\""
|
"typed_delete_js": "已使用 JavaScript 輸入\"Delete\""
|
||||||
|
},
|
||||||
|
"bypass": {
|
||||||
|
"starting": "開始繞過 Cursor 版本限制...",
|
||||||
|
"found_product_json": "找到 product.json: {path}",
|
||||||
|
"no_write_permission": "沒有寫入權限: {path}",
|
||||||
|
"read_failed": "讀取 product.json 失敗: {error}",
|
||||||
|
"current_version": "當前版本: {version}",
|
||||||
|
"backup_created": "備份已創建: {path}",
|
||||||
|
"version_updated": "版本從 {old} 更新到 {new}",
|
||||||
|
"write_failed": "寫入 product.json 失敗: {error}",
|
||||||
|
"no_update_needed": "不需要更新。當前版本 {version} 已 >= 0.46.0",
|
||||||
|
"bypass_failed": "繞過版本限制失敗: {error}",
|
||||||
|
"stack_trace": "堆疊跟踪",
|
||||||
|
"localappdata_not_found": "LOCALAPPDATA 環境變量未找到",
|
||||||
|
"product_json_not_found": "product.json 未在常見 Linux 路徑中找到",
|
||||||
|
"unsupported_os": "不支持的操作系統: {system}",
|
||||||
|
"file_not_found": "文件未找到: {path}",
|
||||||
|
"title": "Cursor 版本繞過工具",
|
||||||
|
"description": "此工具修改 Cursor 的 product.json 以繞過版本限制",
|
||||||
|
"menu_option": "繞過 Cursor 版本檢查"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14
main.py
14
main.py
@@ -9,7 +9,7 @@ import locale
|
|||||||
import platform
|
import platform
|
||||||
import requests
|
import requests
|
||||||
import subprocess
|
import subprocess
|
||||||
from config import get_config
|
from config import get_config, force_update_config
|
||||||
import shutil
|
import shutil
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -286,7 +286,8 @@ def print_menu():
|
|||||||
11: f"{Fore.GREEN}11{Style.RESET_ALL}. {EMOJI['CONTRIBUTE']} {translator.get('menu.contribute')}",
|
11: f"{Fore.GREEN}11{Style.RESET_ALL}. {EMOJI['CONTRIBUTE']} {translator.get('menu.contribute')}",
|
||||||
12: f"{Fore.GREEN}12{Style.RESET_ALL}. {EMOJI['SETTINGS']} {translator.get('menu.config')}",
|
12: f"{Fore.GREEN}12{Style.RESET_ALL}. {EMOJI['SETTINGS']} {translator.get('menu.config')}",
|
||||||
13: f"{Fore.GREEN}13{Style.RESET_ALL}. {EMOJI['SETTINGS']} {translator.get('menu.select_chrome_profile')}",
|
13: f"{Fore.GREEN}13{Style.RESET_ALL}. {EMOJI['SETTINGS']} {translator.get('menu.select_chrome_profile')}",
|
||||||
14: f"{Fore.GREEN}14{Style.RESET_ALL}. {EMOJI['ERROR']} {translator.get('menu.delete_google_account', fallback='Delete Cursor Google Account')}"
|
14: f"{Fore.GREEN}14{Style.RESET_ALL}. {EMOJI['ERROR']} {translator.get('menu.delete_google_account', fallback='Delete Cursor Google Account')}",
|
||||||
|
15: f"{Fore.GREEN}15{Style.RESET_ALL}. {EMOJI['UPDATE']} {translator.get('menu.bypass_version_check', fallback='Bypass Cursor Version Check')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Automatically calculate the number of menu items in the left and right columns
|
# Automatically calculate the number of menu items in the left and right columns
|
||||||
@@ -551,14 +552,15 @@ def main():
|
|||||||
if not config:
|
if not config:
|
||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.config_init_failed')}{Style.RESET_ALL}")
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.config_init_failed')}{Style.RESET_ALL}")
|
||||||
return
|
return
|
||||||
|
force_update_config(translator)
|
||||||
|
|
||||||
if config.getboolean('Utils', 'enabled_update_check'):
|
if config.getboolean('Utils', 'enabled_update_check'):
|
||||||
check_latest_version() # Add version check before showing menu
|
check_latest_version() # Add version check before showing menu
|
||||||
print_menu()
|
print_menu()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
choice_num = 14
|
choice_num = 15
|
||||||
choice = input(f"\n{EMOJI['ARROW']} {Fore.CYAN}{translator.get('menu.input_choice', choices=f'0-{choice_num}')}: {Style.RESET_ALL}")
|
choice = input(f"\n{EMOJI['ARROW']} {Fore.CYAN}{translator.get('menu.input_choice', choices=f'0-{choice_num}')}: {Style.RESET_ALL}")
|
||||||
|
|
||||||
if choice == "0":
|
if choice == "0":
|
||||||
@@ -624,6 +626,10 @@ def main():
|
|||||||
import delete_cursor_google
|
import delete_cursor_google
|
||||||
delete_cursor_google.main(translator)
|
delete_cursor_google.main(translator)
|
||||||
print_menu()
|
print_menu()
|
||||||
|
elif choice == "15":
|
||||||
|
import bypass_version
|
||||||
|
bypass_version.main(translator)
|
||||||
|
print_menu()
|
||||||
else:
|
else:
|
||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.invalid_choice')}{Style.RESET_ALL}")
|
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.invalid_choice')}{Style.RESET_ALL}")
|
||||||
print_menu()
|
print_menu()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import configparser
|
|||||||
from new_signup import get_user_documents_path
|
from new_signup import get_user_documents_path
|
||||||
import traceback
|
import traceback
|
||||||
from config import get_config
|
from config import get_config
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
# Initialize colorama
|
# Initialize colorama
|
||||||
init()
|
init()
|
||||||
@@ -334,37 +335,40 @@ def modify_workbench_js(file_path: str, translator=None) -> bool:
|
|||||||
with open(file_path, "r", encoding="utf-8", errors="ignore") as main_file:
|
with open(file_path, "r", encoding="utf-8", errors="ignore") as main_file:
|
||||||
content = main_file.read()
|
content = main_file.read()
|
||||||
|
|
||||||
if sys.platform == "win32":
|
patterns = {
|
||||||
# Define replacement patterns
|
# 通用按钮替换模式
|
||||||
CButton_old_pattern = r'M(x,I(as,{title:"Upgrade to Pro",size:"small",get codicon(){return $.rocket},get onClick(){return t.pay}}),null)'
|
r'B(k,D(Ln,{title:"Upgrade to Pro",size:"small",get codicon(){return A.rocket},get onClick(){return t.pay}}),null)': r'B(k,D(Ln,{title:"yeongpin GitHub",size:"small",get codicon(){return A.github},get onClick(){return function(){window.open("https://github.com/yeongpin/cursor-free-vip","_blank")}}}),null)',
|
||||||
CButton_new_pattern = r'M(x,I(as,{title:"yeongpin GitHub",size:"small",get codicon(){return $.rocket},get onClick(){return function(){window.open("https://github.com/yeongpin/cursor-free-vip","_blank")}}}),null)'
|
|
||||||
elif sys.platform == "linux":
|
# Windows/Linux/Mac 通用按钮替换模式
|
||||||
CButton_old_pattern = r'M(x,I(as,{title:"Upgrade to Pro",size:"small",get codicon(){return $.rocket},get onClick(){return t.pay}}),null)'
|
r'M(x,I(as,{title:"Upgrade to Pro",size:"small",get codicon(){return $.rocket},get onClick(){return t.pay}}),null)': r'M(x,I(as,{title:"yeongpin GitHub",size:"small",get codicon(){return $.rocket},get onClick(){return function(){window.open("https://github.com/yeongpin/cursor-free-vip","_blank")}}}),null)',
|
||||||
CButton_new_pattern = r'M(x,I(as,{title:"yeongpin GitHub",size:"small",get codicon(){return $.rocket},get onClick(){return function(){window.open("https://github.com/yeongpin/cursor-free-vip","_blank")}}}),null)'
|
|
||||||
elif sys.platform == "darwin":
|
# Badge 替换
|
||||||
CButton_old_pattern = r'M(x,I(as,{title:"Upgrade to Pro",size:"small",get codicon(){return $.rocket},get onClick(){return t.pay}}),null)'
|
r'<div>Pro Trial': r'<div>Pro',
|
||||||
CButton_new_pattern = r'M(x,I(as,{title:"yeongpin GitHub",size:"small",get codicon(){return $.rocket},get onClick(){return function(){window.open("https://github.com/yeongpin/cursor-free-vip","_blank")}}}),null)'
|
|
||||||
|
|
||||||
CBadge_old_pattern = r'<div>Pro Trial'
|
r'py-1">Auto-select': r'py-1">Bypass-Version-Pin',
|
||||||
CBadge_new_pattern = r'<div>Pro'
|
|
||||||
|
#
|
||||||
|
r'async getEffectiveTokenLimit(e){const n=e.modelName;if(!n)return 2e5;':r'async getEffectiveTokenLimit(e){return 9000000;const n=e.modelName;if(!n)return 9e5;',
|
||||||
|
# Pro
|
||||||
|
r'var DWr=ne("<div class=settings__item_description>You are currently signed in with <strong></strong>.");': r'var DWr=ne("<div class=settings__item_description>You are currently signed in with <strong></strong>. <h1>Pro</h1>");',
|
||||||
|
|
||||||
|
# Toast 替换
|
||||||
|
r'notifications-toasts': r'notifications-toasts hidden'
|
||||||
|
}
|
||||||
|
|
||||||
CToast_old_pattern = r'notifications-toasts'
|
# 使用patterns进行替换
|
||||||
CToast_new_pattern = r'notifications-toasts hidden'
|
for old_pattern, new_pattern in patterns.items():
|
||||||
|
content = content.replace(old_pattern, new_pattern)
|
||||||
# Replace content
|
|
||||||
content = content.replace(CButton_old_pattern, CButton_new_pattern)
|
|
||||||
content = content.replace(CBadge_old_pattern, CBadge_new_pattern)
|
|
||||||
content = content.replace(CToast_old_pattern, CToast_new_pattern)
|
|
||||||
|
|
||||||
# Write to temporary file
|
# Write to temporary file
|
||||||
tmp_file.write(content)
|
tmp_file.write(content)
|
||||||
tmp_path = tmp_file.name
|
tmp_path = tmp_file.name
|
||||||
|
|
||||||
# Backup original file
|
# Backup original file with timestamp
|
||||||
backup_path = file_path + ".backup"
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
if os.path.exists(backup_path):
|
backup_path = f"{file_path}.backup.{timestamp}"
|
||||||
os.remove(backup_path)
|
|
||||||
shutil.copy2(file_path, backup_path)
|
shutil.copy2(file_path, backup_path)
|
||||||
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {translator.get('reset.backup_created', path=backup_path)}{Style.RESET_ALL}")
|
||||||
|
|
||||||
# Move temporary file to original position
|
# Move temporary file to original position
|
||||||
if os.path.exists(file_path):
|
if os.path.exists(file_path):
|
||||||
@@ -411,7 +415,10 @@ def modify_main_js(main_path: str, translator) -> bool:
|
|||||||
tmp_file.write(content)
|
tmp_file.write(content)
|
||||||
tmp_path = tmp_file.name
|
tmp_path = tmp_file.name
|
||||||
|
|
||||||
shutil.copy2(main_path, main_path + ".old")
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
|
backup_path = f"{main_path}.old.{timestamp}"
|
||||||
|
shutil.copy2(main_path, backup_path)
|
||||||
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {translator.get('reset.backup_created', path=backup_path)}{Style.RESET_ALL}")
|
||||||
shutil.move(tmp_path, main_path)
|
shutil.move(tmp_path, main_path)
|
||||||
|
|
||||||
os.chmod(main_path, original_mode)
|
os.chmod(main_path, original_mode)
|
||||||
@@ -461,7 +468,8 @@ def patch_cursor_get_machine_id(translator) -> bool:
|
|||||||
print(f"{Fore.CYAN}{EMOJI['INFO']} {translator.get('reset.version_check_passed')}{Style.RESET_ALL}")
|
print(f"{Fore.CYAN}{EMOJI['INFO']} {translator.get('reset.version_check_passed')}{Style.RESET_ALL}")
|
||||||
|
|
||||||
# Backup file
|
# Backup file
|
||||||
backup_path = main_path + ".bak"
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
|
backup_path = f"{main_path}.bak.{timestamp}"
|
||||||
if not os.path.exists(backup_path):
|
if not os.path.exists(backup_path):
|
||||||
shutil.copy2(main_path, backup_path)
|
shutil.copy2(main_path, backup_path)
|
||||||
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {translator.get('reset.backup_created', path=backup_path)}{Style.RESET_ALL}")
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {translator.get('reset.backup_created', path=backup_path)}{Style.RESET_ALL}")
|
||||||
@@ -638,8 +646,8 @@ class MachineIDResetter:
|
|||||||
winreg.SetValueEx(key, "MachineGuid", 0, winreg.REG_SZ, new_guid)
|
winreg.SetValueEx(key, "MachineGuid", 0, winreg.REG_SZ, new_guid)
|
||||||
winreg.CloseKey(key)
|
winreg.CloseKey(key)
|
||||||
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {self.translator.get('reset.windows_machine_guid_updated')}{Style.RESET_ALL}")
|
print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {self.translator.get('reset.windows_machine_guid_updated')}{Style.RESET_ALL}")
|
||||||
except PermissionError:
|
except PermissionError as e:
|
||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('reset.permission_denied')}{Style.RESET_ALL}")
|
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('reset.permission_denied', error=str(e))}{Style.RESET_ALL}")
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('reset.update_windows_machine_guid_failed', error=str(e))}{Style.RESET_ALL}")
|
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('reset.update_windows_machine_guid_failed', error=str(e))}{Style.RESET_ALL}")
|
||||||
@@ -717,12 +725,10 @@ class MachineIDResetter:
|
|||||||
with open(self.db_path, "r", encoding="utf-8") as f:
|
with open(self.db_path, "r", encoding="utf-8") as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
backup_path = self.db_path + ".bak"
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
if not os.path.exists(backup_path):
|
backup_path = f"{self.db_path}.bak.{timestamp}"
|
||||||
print(f"{Fore.YELLOW}{EMOJI['BACKUP']} {self.translator.get('reset.creating_backup')}: {backup_path}{Style.RESET_ALL}")
|
print(f"{Fore.YELLOW}{EMOJI['BACKUP']} {self.translator.get('reset.creating_backup')}: {backup_path}{Style.RESET_ALL}")
|
||||||
shutil.copy2(self.db_path, backup_path)
|
shutil.copy2(self.db_path, backup_path)
|
||||||
else:
|
|
||||||
print(f"{Fore.YELLOW}{EMOJI['INFO']} {self.translator.get('reset.backup_exists')}{Style.RESET_ALL}")
|
|
||||||
|
|
||||||
print(f"{Fore.CYAN}{EMOJI['RESET']} {self.translator.get('reset.generating')}...{Style.RESET_ALL}")
|
print(f"{Fore.CYAN}{EMOJI['RESET']} {self.translator.get('reset.generating')}...{Style.RESET_ALL}")
|
||||||
new_ids = self.generate_new_ids()
|
new_ids = self.generate_new_ids()
|
||||||
@@ -786,7 +792,8 @@ class MachineIDResetter:
|
|||||||
|
|
||||||
# Create backup if file exists
|
# Create backup if file exists
|
||||||
if os.path.exists(machine_id_path):
|
if os.path.exists(machine_id_path):
|
||||||
backup_path = machine_id_path + ".backup"
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||||
|
backup_path = f"{machine_id_path}.backup.{timestamp}"
|
||||||
try:
|
try:
|
||||||
shutil.copy2(machine_id_path, backup_path)
|
shutil.copy2(machine_id_path, backup_path)
|
||||||
print(f"{Fore.GREEN}{EMOJI['INFO']} {self.translator.get('reset.backup_created', path=backup_path) if self.translator else f'Backup created at: {backup_path}'}{Style.RESET_ALL}")
|
print(f"{Fore.GREEN}{EMOJI['INFO']} {self.translator.get('reset.backup_created', path=backup_path) if self.translator else f'Backup created at: {backup_path}'}{Style.RESET_ALL}")
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ EMOJI = {
|
|||||||
"SUCCESS": "✅",
|
"SUCCESS": "✅",
|
||||||
"ERROR": "❌",
|
"ERROR": "❌",
|
||||||
"INFO": "ℹ️",
|
"INFO": "ℹ️",
|
||||||
"RESET": "<EFBFBD><EFBFBD>",
|
"RESET": "🔄",
|
||||||
"WARNING": "⚠️",
|
"WARNING": "⚠️",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,4 +811,4 @@ def run(translator=None):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from main import translator as main_translator
|
from main import translator as main_translator
|
||||||
run(main_translator)
|
run(main_translator)
|
||||||
Reference in New Issue
Block a user