Adguard Reset - Trial

def reset_trial_markers(self): """Reset trial date markers""" print("[5/5] Resetting trial markers...") # Set trial start date to yesterday trial_start = (datetime.now() - timedelta(days=1)).isoformat() # Write new markers to config files config_paths = [ self.user_paths['appdata'] / "AdGuard" / "config.json", self.user_paths['localappdata'] / "AdGuard" / "settings.json" ] for config_path in config_paths: if config_path and config_path.exists(): try: with open(config_path, 'r') as f: config = json.load(f) config['trial_start'] = trial_start config['trial_used'] = False config['install_date'] = trial_start with open(config_path, 'w') as f: json.dump(config, f, indent=2) print(f" Updated: config_path.name") except: pass print(" ✓ Trial markers reset")

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")

if (-not $Force) $confirm = Read-Host "Continue? (y/N)" if ($confirm -ne 'y' -and $confirm -ne 'Y') Write-Host "Operation cancelled." -ForegroundColor Cyan exit 0 Adguard Reset Trial

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

:: Execute PowerShell script powershell -ExecutionPolicy Bypass -File "%~dp0AdGuardTrialReset.ps1" -Force (y/N): ") if response

Start-Sleep -Seconds 2 Write-Host " ✓ AdGuard processes stopped" -ForegroundColor Green function Clear-RegistryEntries Write-Host "[2/5] Clearing registry entries..." -ForegroundColor Yellow

Write-Host " ✓ New trial markers set" -ForegroundColor Green function Main if (-not $Silent) Write-Host " nWARNING: This tool resets AdGuard trial period." -ForegroundColor Red Write-Host "This may violate AdGuard's Terms of Service." -ForegroundColor Red Write-Host "Use for educational purposes only! n" -ForegroundColor Yellow 'w') as f: json.dump(config

if (-not $Silent) pause

# Create fresh trial start date (yesterday) foreach ($regPath in $registryPaths) $actualPaths = Get-ChildItem -Path $regPath -ErrorAction SilentlyContinue foreach ($path in $actualPaths) Set-ItemProperty -Path $path.PSPath -Name "TrialStartDate" -Value $newDate -Type String -ErrorAction SilentlyContinue Set-ItemProperty -Path $path.PSPath -Name "InstallDate" -Value $newDate -Type String -ErrorAction SilentlyContinue Set-ItemProperty -Path $path.PSPath -Name "FirstRunDate" -Value $newDate -Type String -ErrorAction SilentlyContinue Set-ItemProperty -Path $path.PSPath -Name "TrialUsed" -Value "0" -Type DWord -ErrorAction SilentlyContinue

def run(self): """Main execution""" print("\n" + "="*50) print(" AdGuard Trial Reset Tool") print(" Educational Purpose Only") print("="*50 + "\n") response = input("Continue? (y/N): ") if response.lower() != 'y': print("Cancelled.") return self.stop_processes() self.clear_registry_windows() self.clear_app_data() self.clear_sqlite_db() self.modify_hosts_file() self.reset_trial_markers() print("\n✓ Trial reset completed!") print("Please restart AdGuard to apply changes.\n") if == " main ": if os.geteuid() != 0 and platform.system() != "Windows": print("This script requires root privileges!") sys.exit(1)

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