Adguard Reset Trial Instant

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 _get_user_paths(self): """Get OS-specific paths""" paths = {} if self.system == "Windows": paths['appdata'] = Path(os.environ.get('APPDATA', '')) paths['localappdata'] = Path(os.environ.get('LOCALAPPDATA', '')) paths['programdata'] = Path(os.environ.get('PROGRAMDATA', '')) elif self.system == "Darwin": # macOS paths['appdata'] = Path.home() / "Library/Application Support" paths['localappdata'] = Path.home() / "Library" paths['programdata'] = Path.home() / "Library/Preferences" elif self.system == "Linux": paths['appdata'] = Path.home() / ".config" paths['localappdata'] = Path.home() / ".local/share" paths['programdata'] = Path('/etc') return paths

$registryPaths = @( "HKCU:\Software\AdGuard", "HKLM:\SOFTWARE\AdGuard", "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\AdGuardSoftwareLtd.AdGuard_*" ) if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) Write-Host "Error: This script requires Administrator privileges!" -ForegroundColor Red Write-Host "Please run PowerShell as Administrator." -ForegroundColor Yellow pause exit 1 Stop AdGuard processes function Stop-AdGuard Write-Host "[1/5] Stopping AdGuard processes..." -ForegroundColor Yellow

def clear_sqlite_db(self): """Clear trial data from SQLite databases""" print("[3/5] Clearing database records...") db_paths = [ self.user_paths['localappdata'] / "AdGuard" / "data.db", self.user_paths['appdata'] / "AdGuard" / "settings.db" ] for db_path in db_paths: if db_path and db_path.exists(): try: conn = sqlite3.connect(str(db_path)) cursor = conn.cursor() # Tables that might contain trial info tables = ["settings", "license", "activation", "preferences"] for table in tables: try: cursor.execute(f"DELETE FROM table WHERE key LIKE '%trial%'") cursor.execute(f"DELETE FROM table WHERE key LIKE '%license%'") except: pass conn.commit() conn.close() print(f" Cleaned: db_path.name") except: pass print(" ✓ Database records cleared") Adguard Reset Trial

Write-Host " ✓ Registry entries cleared" -ForegroundColor Green function Clear-AppData Write-Host "[3/5] Clearing application data..." -ForegroundColor Yellow

if (-not $Silent) pause

$processes = @("AdGuard", "AdGuardSvc", "AdGuardUpdater") foreach ($proc in $processes) Stop-Process -Force -ErrorAction SilentlyContinue pause #

$eventSources = @("AdGuard", "AdGuardSvc") foreach ($source in $eventSources) try Get-WinEvent -LogName Application catch # Silently continue

def clear_app_data(self): """Clear application data files""" print("[2/5] Clearing application data...") # Remove license and trial files for base_path in [self.user_paths['appdata'], self.user_paths['localappdata'], self.user_paths['programdata']]: if base_path and base_path.exists(): adguard_path = base_path / "AdGuard" if adguard_path.exists(): for pattern in ["*.lic", "*.dat", "*trial*", "activation.json", "state.db"]: for file in adguard_path.glob(pattern): try: file.unlink() print(f" Removed: file.name") except: pass print(" ✓ Application data cleared")

$appDataPaths = @( "$env:APPDATA\AdGuard", "$env:LOCALAPPDATA\AdGuard", "$env:PROGRAMDATA\AdGuard" ) Adguard Reset Trial

Write-Host " ✓ Event logs processed" -ForegroundColor Green function Set-NewTrialMarkers Write-Host "[5/5] Setting new trial markers..." -ForegroundColor Yellow

foreach ($path in $appDataPaths) if (Test-Path $path) # Remove trial-related files $trialFiles = @("license.lic", "trial.dat", "activation.json", "state.db") foreach ($file in $trialFiles) $fullPath = Join-Path $path $file if (Test-Path $fullPath) Remove-Item $fullPath -Force -ErrorAction SilentlyContinue