$unveilrPath = ".\unveilr.exe"
$appletBasePath = "C:\Users\Administrator\Documents\WeChat Files\Applet"
Write-Host "Starting batch decompile (Smartly skipping empty directories)..." -ForegroundColor Green
Write-Host "Applet Base Path: $appletBasePath"
Write-Host "Decompiler Tool: $unveilrPath"
Write-Host "---------------------------------------------"
$wxAppFolders = Get-ChildItem -Path $appletBasePath -Directory -Filter "wx*"
if ($wxAppFolders.Count -eq 0) {
Write-Host "Error: No 'wx*' folders found in '$appletBasePath'." -ForegroundColor Red
exit
}
foreach ($appFolder in $wxAppFolders) {
$versionFolder = Get-ChildItem -Path $appFolder.FullName -Directory | Where-Object { $_.Name -match "^\d+$" } | Select-Object -First 1
if ($versionFolder) {
$targetPath = $versionFolder.FullName
$wxapkgFiles = Get-ChildItem -Path $targetPath -File -Filter "*.wxapkg"
if ($wxapkgFiles) {
Write-Host "Processing: $($appFolder.Name) -> $($versionFolder.Name)" -ForegroundColor Yellow
try {
& $unveilrPath $targetPath
Write-Host "Finished processing: $targetPath" -ForegroundColor Cyan
}
catch {
Write-Host "Failed to process: $targetPath" -ForegroundColor Red
Write-Host "Error details: $_" -ForegroundColor Red
}
Write-Host "---------------------------------------------"
}
else {
Write-Host "Skipping empty directory: $targetPath (No .wxapkg files found)" -ForegroundColor Gray
}
}
else {
Write-Host "Warning: No version sub-folder found in $($appFolder.FullName), skipping." -ForegroundColor Magenta
}
}
Write-Host "All applets processed!" -ForegroundColor Green