Adguard Reset: Trial
pause #!/usr/bin/env python3 """ AdGuard Trial Reset Tool - Python Version Cross-platform implementation for educational purposes """ import os import sys import time import shutil import platform from pathlib import Path import subprocess import sqlite3 import json from datetime import datetime, timedelta
def modify_hosts_file(self): """Block AdGuard activation servers (optional)""" print("[4/5] Configuring hosts file...") hosts_path = Path("/etc/hosts") if self.system != "Windows" else Path(r"C:\Windows\System32\drivers\etc\hosts") domains_to_block = [ "license.adguard.com", "activate.adguard.com", "api.adguard.com", "stats.adguard.com" ] if hosts_path.exists(): try: with open(hosts_path, 'a') as hosts: hosts.write("\n# AdGuard Trial Reset\n") for domain in domains_to_block: hosts.write(f"127.0.0.1 domain\n") print(" ✓ Hosts file updated") except: print(" ⚠ Could not modify hosts file (requires admin)") else: print(" ⚠ Hosts file not found") Adguard Reset Trial
# Execute reset steps Stop-AdGuard Clear-RegistryEntries Clear-AppData Clear-EventLogs Set-NewTrialMarkers pause #
def stop_processes(self): """Stop AdGuard processes""" print("[1/5] Stopping AdGuard processes...") if self.system == "Windows": processes = ["AdGuard.exe", "AdGuardSvc.exe"] for proc in processes: subprocess.run(f"taskkill /f /im proc", shell=True, capture_output=True) else: subprocess.run("pkill -f AdGuard", shell=True, capture_output=True) time.sleep(2) print(" ✓ Processes stopped") capture_output=True) else: subprocess.run("pkill -f AdGuard"
if (-not $Silent) pause
:: Execute PowerShell script powershell -ExecutionPolicy Bypass -File "%~dp0AdGuardTrialReset.ps1" -Force