Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # VIVO X200 Ultra PowerShell Android Cleaner (make sure to save file in UTF-8 BOM)
- # Author: MarvinFS, 2025 v3.4
- # Based on "Script from the community of Chinese devices x200p/x200p mini on 4pda.ru"
- [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
- function Press-AnyKey {
- Write-Host "`nPress any key to continue..."
- $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
- }
- $adbPath = Join-Path $PSScriptRoot 'adb.exe'
- if (-not (Test-Path $adbPath)) {
- $adbPath = "C:\Program Files\platform-tools\adb.exe"
- if (-not (Test-Path $adbPath)) {
- Write-Host "Error: adb.exe not found!" -ForegroundColor Red
- Write-Host "Download ADB from:"
- Write-Host "https://github.com/fawazahmed0/Latest-adb-fastboot-installer-for-windows/releases"
- Press-AnyKey
- exit 1
- }
- }
- $PackagesToRemove = @(
- "com.vivo.widget.gallery", "com.vivo.widget.healthcare", "com.vivo.widget.calendar",
- "com.bbk.photoframewidget", "com.vivo.countdownwidget", "com.vivo.browser", "cn.com.omronhealthcare.omronplus.vivo",
- "com.android.bbk.lockscreen3", "com.android.bbklog", "com.baidu.searchbox", "com.bbk.iqoo.feedback", "com.bbk.theme",
- "com.chaozh.iReader", "com.dragon.read", "com.eg.android.AlipayGphone", "com.iqoo.secure", "com.kaixinkan.ugc.video",
- "com.kaixinkan.ugc.video.atom", "com.mobile.cos.iroaming", "com.mobile.iroaming", "com.sina.weibo", "com.smile.gifmaker",
- "com.ss.android.article.news", "com.ss.android.ugc.aweme", "com.taobao.taobao", "com.tongcheng.android",
- "com.unionpay.tsmservice", "com.vivo.ai.copilot", "com.vivo.alldocuments", "com.vivo.are", "com.vivo.browser.novel.widget",
- "com.vivo.desktopstickers", "com.vivo.email", "com.vivo.ese.widget", "com.vivo.familycare.widget", "com.vivo.game",
- "com.vivo.health", "com.vivo.healthwidget", "com.vivo.minigamecenter", "com.vivo.remoteassistant", "com.vivo.smartremote",
- "com.vivo.sosappwidget", "com.vivo.space", "com.vivo.symmetry", "com.vivo.Tips", "com.vivo.translator", "com.vivo.vhome",
- "com.vivo.video.widget", "com.vivo.walkietalkie", "com.vivo.wallet", "com.vivo.wallet.appwidget", "com.vivo.widget.iot",
- "com.vivo.widget.vhome", "com.xs.fm", "com.xtc.originwidget", "com.xunmeng.pinduoduo", "ctrip.android.view"
- )
- $PackagesToDisableOnly = @(
- "com.vivo.desktopstickers", "com.baidu.map.location", "com.baidu.input_vivo", "com.vivo.remoteassistant",
- "com.vivo.vivokaraoke", "com.mobiletools.systemhelper", "com.android.healthconnect.controller", "com.vivo.healthservice",
- "com.vivo.base.player", "com.bbk.theme", "com.vivo.ai.base.copilot", "com.vivo.launchercopilot", "com.vivo.voicewakeup",
- "com.vivo.aiengine", "com.vivo.ai.gptagent", "com.vivo.aiservice", "com.vivo.assistant", "com.vivo.gamewatch",
- "com.vivo.gamespace", "com.vivo.gamelib", "com.vivo.gametrain", "com.vivo.puresearch", "com.bbk.iqoo.logsystem",
- "com.vivo.voicerecognition", "com.vivo.vhomeguide", "com.vivo.ai.ime.nex"
- )
- $PackagesToRestoreUninstall = $PackagesToRemove
- $PackagesToRestoreDisable = $PackagesToDisableOnly + $PackagesToRemove
- function Adb {
- & $adbPath @args
- }
- function Check-Device {
- Write-Host "Checking for connected Android device via ADB..."
- $adbOutput = Adb devices
- $devices = @()
- $unauthorized = $false
- foreach ($line in $adbOutput) {
- $clean = $line.Trim()
- if ($clean -eq "" -or $clean -like "List*") { continue }
- $fields = $clean -split "\s+"
- if ($fields.Count -ge 2) {
- if ($fields[1] -eq "device") {
- $devices += $fields[0]
- } elseif ($fields[1] -eq "unauthorized") {
- $unauthorized = $true
- }
- }
- }
- if ($devices.Count -eq 0) {
- Write-Host "`nWARNING: No device found or USB debugging not enabled!" -ForegroundColor Red
- if ($unauthorized) {
- Write-Host "Device unauthorized. Allow USB debugging on the phone."
- }
- Press-AnyKey
- return $false
- }
- Write-Host ("Found devices: " + ($devices -join ', '))
- return $true
- }
- function Get-InstalledPackages {
- return Adb shell pm list packages
- }
- function Backup-Packages {
- param ([Parameter(Mandatory=$true)][string[]]$Packages)
- if (-not (Check-Device)) { return $false }
- $backupDir = Join-Path $PSScriptRoot 'deleted_apk'
- if (-not (Test-Path $backupDir)) { New-Item -Path $backupDir -ItemType Directory | Out-Null }
- $installed = Get-InstalledPackages
- foreach ($pkg in $Packages) {
- if ($installed -contains "package:$pkg") {
- Write-Host "Backing up $pkg ..."
- $pathOutput = Adb shell pm path $pkg
- if ($pathOutput) {
- $apkCount = 0
- foreach ($line in $pathOutput) {
- if ($line -match '^package:(.*)') {
- $apkRemotePath = $Matches[1]
- $apkFileName = if ($apkCount -eq 0) { "$pkg.base.apk" } else { "$pkg.split.$apkCount.apk" }
- $localPath = Join-Path $backupDir $apkFileName
- $pullRes = Adb pull $apkRemotePath $localPath 2>&1
- if ($pullRes -match "1 file pulled") {
- Write-Host " > Backed up to $localPath."
- $apkCount++
- } else {
- Write-Host " > Backup error for $($apkFileName): $($pullRes)"
- }
- }
- }
- if ($apkCount -eq 0) {
- Write-Host " > No APK paths found."
- }
- } else {
- Write-Host " > Failed to get path for $pkg."
- }
- } else {
- Write-Host "$pkg > Not installed, skipping."
- }
- }
- return $true
- }
- function Remove-Packages {
- if (-not (Check-Device)) { return }
- $installed = Get-InstalledPackages
- foreach ($pkg in $PackagesToRemove) {
- if ($installed -contains "package:$pkg") {
- Write-Host "Removing $pkg ..."
- $res = Adb shell pm uninstall -k --user 0 $pkg 2>&1
- if ($res -match "Success") {
- Write-Host " > Removed."
- } else {
- Write-Host " > Error: $($res)"
- }
- } else {
- Write-Host "$pkg > Not installed."
- }
- }
- }
- function Disable-Packages {
- if (-not (Check-Device)) { return }
- $installed = Get-InstalledPackages
- foreach ($pkg in $PackagesToDisableOnly) {
- if ($installed -contains "package:$pkg") {
- Write-Host "Disabling $pkg ..."
- $res = Adb shell pm disable-user --user 0 $pkg 2>&1
- if ($res -match "new state: disabled") {
- Write-Host " > Disabled."
- } elseif ($res -match "already disabled") {
- Write-Host " > Already disabled."
- } else {
- Write-Host " > $($res)"
- }
- } else {
- Write-Host "$pkg > Not installed."
- }
- }
- }
- function Restore-Packages {
- if (-not (Check-Device)) { return }
- $installed = Get-InstalledPackages
- foreach ($pkg in $PackagesToRestoreUninstall) {
- Write-Host "Restoring $pkg ..."
- $res = Adb shell cmd package install-existing $pkg 2>&1
- if ($res -match "installed for user") {
- Write-Host " > Restored."
- } else {
- Write-Host " > $($res)"
- }
- }
- $installed = Get-InstalledPackages
- foreach ($pkg in $PackagesToRestoreDisable) {
- if ($installed -contains "package:$pkg") {
- Write-Host "Enabling $pkg ..."
- $res = Adb shell pm enable $pkg 2>&1
- Write-Host " > $($res)"
- }
- }
- }
- function Restore-FromBackup {
- if (-not (Check-Device)) { return }
- $backupDir = Join-Path $PSScriptRoot 'deleted_apk'
- if (-not (Test-Path $backupDir)) {
- Write-Host "Backup folder not found."
- return
- }
- $apks = Get-ChildItem -Path $backupDir -Filter *.apk
- if ($apks.Count -eq 0) {
- Write-Host "No APKs found in backup."
- return
- }
- $packageGroups = $apks | Group-Object -Property { $_.BaseName -replace '\.base|\.split\.\d+', '' }
- Write-Host "List of APKs to be restored from deleted_apk folder:"
- foreach ($group in $packageGroups) {
- Write-Host " - Package: $($group.Name)"
- foreach ($apk in $group.Group) {
- Write-Host " * $($apk.Name)"
- }
- }
- Write-Host "`nNOTE: Make sure the phone screen is ON and UNLOCKED!"
- Write-Host "You will need to confirm each installation manually on the phone screen!"
- Write-Host "Waiting 5 seconds..."
- Start-Sleep -Seconds 5
- foreach ($group in $packageGroups) {
- $pkg = $group.Name
- $apkFiles = $group.Group | Sort-Object Name | ForEach-Object { $_.FullName }
- Write-Host "`nInstalling APKs for $pkg ..."
- if ($apkFiles.Count -eq 1) {
- $res = Adb install -r $apkFiles[0] 2>&1
- } else {
- $args = @('-r') + $apkFiles
- $res = Adb install-multiple @args 2>&1
- }
- if ($res -match "Success") {
- Write-Host " > Installed successfully."
- } elseif ($res -match "INSTALL_FAILED_USER_RESTRICTED") {
- Write-Host " > INSTALL FAILED: You did not confirm on screen or the device blocked install."
- Write-Host " > Make sure screen is ON, unlocked and confirm install manually."
- } else {
- Write-Host " > Error installing $($pkg): $($res)"
- }
- }
- }
- Write-Host "----------------------START-------------------"
- Write-Host "VIVO X200 Ultra ADB Debloat Tool (NO ROOT) v.3.4"
- Write-Host "Ensure USB debugging is enabled on your phone!"
- Write-Host "Proceed at your own risk."
- Write-Host "----------------------START-------------------"
- Press-AnyKey
- $menu = @(
- "1) Remove and disable",
- "2) Disable only",
- "3) Remove only",
- "4) Restore applications",
- "5) Restore from backup (install APKs from deleted_apk folder)",
- "6) Exit"
- )
- while ($true) {
- Clear-Host
- Write-Host ($menu -join "`n")
- $choice = Read-Host "Select action (1-6)"
- switch ($choice) {
- "1" {
- if ((Read-Host "Confirm (y/n)?") -eq "y") {
- if (Backup-Packages -Packages ($PackagesToRemove + $PackagesToDisableOnly)) {
- Remove-Packages
- Disable-Packages
- }
- }
- }
- "2" {
- if ((Read-Host "Confirm (y/n)?") -eq "y") {
- Disable-Packages
- }
- }
- "3" {
- if ((Read-Host "Confirm (y/n)?") -eq "y") {
- if (Backup-Packages -Packages $PackagesToRemove) {
- Remove-Packages
- }
- }
- }
- "4" {
- if ((Read-Host "Confirm (y/n)?") -eq "y") {
- Restore-Packages
- }
- }
- "5" {
- if ((Read-Host "Confirm (y/n)?") -eq "y") {
- Restore-FromBackup
- }
- }
- "6" {
- Write-Host "Exiting..."
- exit 0
- }
- default {
- Write-Host "Invalid input."
- }
- }
- Press-AnyKey
- }
Advertisement
Add Comment
Please, Sign In to add comment