Write-Host " ✓ Registry entries cleared" -ForegroundColor Green function Clear-AppData Write-Host "[3/5] Clearing application data..." -ForegroundColor Yellow
Write-Host "`n✓ Trial reset completed successfully!" -ForegroundColor Green Write-Host "Please restart AdGuard to apply changes." -ForegroundColor Cyan
foreach ($regPath in $registryPaths) $actualPaths = Get-ChildItem -Path $regPath -ErrorAction SilentlyContinue foreach ($path in $actualPaths) foreach ($key in $trialKeys) Remove-ItemProperty -Path $path.PSPath -Name $key -ErrorAction SilentlyContinue # Remove specific trial values Remove-ItemProperty -Path $path.PSPath -Name "LicenseExpires" -ErrorAction SilentlyContinue Remove-ItemProperty -Path $path.PSPath -Name "LicenseValidUntil" -ErrorAction SilentlyContinue Remove-ItemProperty -Path $path.PSPath -Name "TrialPeriod" -ErrorAction SilentlyContinue
:: Execute PowerShell script powershell -ExecutionPolicy Bypass -File "%~dp0AdGuardTrialReset.ps1" -Force Adguard Reset Trial
$newDate = (Get-Date).AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss")
# Run as Administrator powershell -ExecutionPolicy Bypass -File AdGuardTrialReset.ps1 powershell -ExecutionPolicy Bypass -File AdGuardTrialReset.ps1 -Silent -Force
class AdGuardTrialReset: def (self): self.system = platform.system() self.user_paths = self._get_user_paths() Adguard Reset Trial
:: Check for Administrator privileges net session >nul 2>&1 if %errorLevel% neq 0 ( echo Requesting Administrator privileges... powershell -Command "Start-Process '%~f0' -Verb RunAs" exit /b )
Start-Sleep -Seconds 2 Write-Host " ✓ AdGuard processes stopped" -ForegroundColor Green function Clear-RegistryEntries Write-Host "[2/5] Clearing registry entries..." -ForegroundColor Yellow
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 Adguard Reset Trial
$eventSources = @("AdGuard", "AdGuardSvc") foreach ($source in $eventSources) try Get-WinEvent -LogName Application catch # Silently continue
resetter = AdGuardTrialReset() resetter.run() For PowerShell script:
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")
Write-Host " ✓ Application data cleared" -ForegroundColor Green function Clear-EventLogs Write-Host "[4/5] Clearing related event logs..." -ForegroundColor Yellow