MarvinFS

Vivo X200 Ultra Debloat script (no root)

Jul 14th, 2025
131
0
346 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # VIVO X200 Ultra PowerShell Android Cleaner (make sure to save file in UTF-8 BOM)
  2. # Author: MarvinFS, 2025 v3.4
  3. # Based on "Script from the community of Chinese devices x200p/x200p mini on 4pda.ru"
  4.  
  5. [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
  6.  
  7. function Press-AnyKey {
  8.     Write-Host "`nPress any key to continue..."
  9.     $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
  10. }
  11.  
  12. $adbPath = Join-Path $PSScriptRoot 'adb.exe'
  13. if (-not (Test-Path $adbPath)) {
  14.     $adbPath = "C:\Program Files\platform-tools\adb.exe"
  15.     if (-not (Test-Path $adbPath)) {
  16.         Write-Host "Error: adb.exe not found!" -ForegroundColor Red
  17.         Write-Host "Download ADB from:"
  18.         Write-Host "https://github.com/fawazahmed0/Latest-adb-fastboot-installer-for-windows/releases"
  19.         Press-AnyKey
  20.         exit 1
  21.     }
  22. }
  23.  
  24. $PackagesToRemove = @(
  25.     "com.vivo.widget.gallery", "com.vivo.widget.healthcare", "com.vivo.widget.calendar",
  26.     "com.bbk.photoframewidget", "com.vivo.countdownwidget", "com.vivo.browser", "cn.com.omronhealthcare.omronplus.vivo",
  27.     "com.android.bbk.lockscreen3", "com.android.bbklog", "com.baidu.searchbox", "com.bbk.iqoo.feedback", "com.bbk.theme",
  28.     "com.chaozh.iReader", "com.dragon.read", "com.eg.android.AlipayGphone", "com.iqoo.secure", "com.kaixinkan.ugc.video",
  29.     "com.kaixinkan.ugc.video.atom", "com.mobile.cos.iroaming", "com.mobile.iroaming", "com.sina.weibo", "com.smile.gifmaker",
  30.     "com.ss.android.article.news", "com.ss.android.ugc.aweme", "com.taobao.taobao", "com.tongcheng.android",
  31.     "com.unionpay.tsmservice", "com.vivo.ai.copilot", "com.vivo.alldocuments", "com.vivo.are", "com.vivo.browser.novel.widget",
  32.     "com.vivo.desktopstickers", "com.vivo.email", "com.vivo.ese.widget", "com.vivo.familycare.widget", "com.vivo.game",
  33.     "com.vivo.health", "com.vivo.healthwidget", "com.vivo.minigamecenter", "com.vivo.remoteassistant", "com.vivo.smartremote",
  34.     "com.vivo.sosappwidget", "com.vivo.space", "com.vivo.symmetry", "com.vivo.Tips", "com.vivo.translator", "com.vivo.vhome",
  35.     "com.vivo.video.widget", "com.vivo.walkietalkie", "com.vivo.wallet", "com.vivo.wallet.appwidget", "com.vivo.widget.iot",
  36.     "com.vivo.widget.vhome", "com.xs.fm", "com.xtc.originwidget", "com.xunmeng.pinduoduo", "ctrip.android.view"
  37. )
  38. $PackagesToDisableOnly = @(
  39.     "com.vivo.desktopstickers", "com.baidu.map.location", "com.baidu.input_vivo", "com.vivo.remoteassistant",
  40.     "com.vivo.vivokaraoke", "com.mobiletools.systemhelper", "com.android.healthconnect.controller", "com.vivo.healthservice",
  41.     "com.vivo.base.player", "com.bbk.theme", "com.vivo.ai.base.copilot", "com.vivo.launchercopilot", "com.vivo.voicewakeup",
  42.     "com.vivo.aiengine", "com.vivo.ai.gptagent", "com.vivo.aiservice", "com.vivo.assistant", "com.vivo.gamewatch",
  43.     "com.vivo.gamespace", "com.vivo.gamelib", "com.vivo.gametrain", "com.vivo.puresearch", "com.bbk.iqoo.logsystem",
  44.     "com.vivo.voicerecognition", "com.vivo.vhomeguide", "com.vivo.ai.ime.nex"
  45. )
  46. $PackagesToRestoreUninstall = $PackagesToRemove
  47. $PackagesToRestoreDisable = $PackagesToDisableOnly + $PackagesToRemove
  48.  
  49. function Adb {
  50.     & $adbPath @args
  51. }
  52.  
  53. function Check-Device {
  54.     Write-Host "Checking for connected Android device via ADB..."
  55.     $adbOutput = Adb devices
  56.     $devices = @()
  57.     $unauthorized = $false
  58.     foreach ($line in $adbOutput) {
  59.         $clean = $line.Trim()
  60.         if ($clean -eq "" -or $clean -like "List*") { continue }
  61.         $fields = $clean -split "\s+"
  62.         if ($fields.Count -ge 2) {
  63.             if ($fields[1] -eq "device") {
  64.                 $devices += $fields[0]
  65.             } elseif ($fields[1] -eq "unauthorized") {
  66.                 $unauthorized = $true
  67.             }
  68.         }
  69.     }
  70.     if ($devices.Count -eq 0) {
  71.         Write-Host "`nWARNING: No device found or USB debugging not enabled!" -ForegroundColor Red
  72.         if ($unauthorized) {
  73.             Write-Host "Device unauthorized. Allow USB debugging on the phone."
  74.         }
  75.         Press-AnyKey
  76.         return $false
  77.     }
  78.     Write-Host ("Found devices: " + ($devices -join ', '))
  79.     return $true
  80. }
  81.  
  82. function Get-InstalledPackages {
  83.     return Adb shell pm list packages
  84. }
  85.  
  86. function Backup-Packages {
  87.     param ([Parameter(Mandatory=$true)][string[]]$Packages)
  88.     if (-not (Check-Device)) { return $false }
  89.     $backupDir = Join-Path $PSScriptRoot 'deleted_apk'
  90.     if (-not (Test-Path $backupDir)) { New-Item -Path $backupDir -ItemType Directory | Out-Null }
  91.     $installed = Get-InstalledPackages
  92.     foreach ($pkg in $Packages) {
  93.         if ($installed -contains "package:$pkg") {
  94.             Write-Host "Backing up $pkg ..."
  95.             $pathOutput = Adb shell pm path $pkg
  96.             if ($pathOutput) {
  97.                 $apkCount = 0
  98.                 foreach ($line in $pathOutput) {
  99.                     if ($line -match '^package:(.*)') {
  100.                         $apkRemotePath = $Matches[1]
  101.                         $apkFileName = if ($apkCount -eq 0) { "$pkg.base.apk" } else { "$pkg.split.$apkCount.apk" }
  102.                         $localPath = Join-Path $backupDir $apkFileName
  103.                         $pullRes = Adb pull $apkRemotePath $localPath 2>&1
  104.                         if ($pullRes -match "1 file pulled") {
  105.                             Write-Host "   > Backed up to $localPath."
  106.                             $apkCount++
  107.                         } else {
  108.                             Write-Host "   > Backup error for $($apkFileName): $($pullRes)"
  109.                         }
  110.                     }
  111.                 }
  112.                 if ($apkCount -eq 0) {
  113.                     Write-Host "   > No APK paths found."
  114.                 }
  115.             } else {
  116.                 Write-Host "   > Failed to get path for $pkg."
  117.             }
  118.         } else {
  119.             Write-Host "$pkg > Not installed, skipping."
  120.         }
  121.     }
  122.     return $true
  123. }
  124.  
  125. function Remove-Packages {
  126.     if (-not (Check-Device)) { return }
  127.     $installed = Get-InstalledPackages
  128.     foreach ($pkg in $PackagesToRemove) {
  129.         if ($installed -contains "package:$pkg") {
  130.             Write-Host "Removing $pkg ..."
  131.             $res = Adb shell pm uninstall -k --user 0 $pkg 2>&1
  132.             if ($res -match "Success") {
  133.                 Write-Host "   > Removed."
  134.             } else {
  135.                 Write-Host "   > Error: $($res)"
  136.             }
  137.         } else {
  138.             Write-Host "$pkg > Not installed."
  139.         }
  140.     }
  141. }
  142.  
  143. function Disable-Packages {
  144.     if (-not (Check-Device)) { return }
  145.     $installed = Get-InstalledPackages
  146.     foreach ($pkg in $PackagesToDisableOnly) {
  147.         if ($installed -contains "package:$pkg") {
  148.             Write-Host "Disabling $pkg ..."
  149.             $res = Adb shell pm disable-user --user 0 $pkg 2>&1
  150.             if ($res -match "new state: disabled") {
  151.                 Write-Host "   > Disabled."
  152.             } elseif ($res -match "already disabled") {
  153.                 Write-Host "   > Already disabled."
  154.             } else {
  155.                 Write-Host "   > $($res)"
  156.             }
  157.         } else {
  158.             Write-Host "$pkg > Not installed."
  159.         }
  160.     }
  161. }
  162.  
  163. function Restore-Packages {
  164.     if (-not (Check-Device)) { return }
  165.     $installed = Get-InstalledPackages
  166.     foreach ($pkg in $PackagesToRestoreUninstall) {
  167.         Write-Host "Restoring $pkg ..."
  168.         $res = Adb shell cmd package install-existing $pkg 2>&1
  169.         if ($res -match "installed for user") {
  170.             Write-Host "   > Restored."
  171.         } else {
  172.             Write-Host "   > $($res)"
  173.         }
  174.     }
  175.     $installed = Get-InstalledPackages
  176.     foreach ($pkg in $PackagesToRestoreDisable) {
  177.         if ($installed -contains "package:$pkg") {
  178.             Write-Host "Enabling $pkg ..."
  179.             $res = Adb shell pm enable $pkg 2>&1
  180.             Write-Host "   > $($res)"
  181.         }
  182.     }
  183. }
  184.  
  185. function Restore-FromBackup {
  186.     if (-not (Check-Device)) { return }
  187.     $backupDir = Join-Path $PSScriptRoot 'deleted_apk'
  188.     if (-not (Test-Path $backupDir)) {
  189.         Write-Host "Backup folder not found."
  190.         return
  191.     }
  192.     $apks = Get-ChildItem -Path $backupDir -Filter *.apk
  193.     if ($apks.Count -eq 0) {
  194.         Write-Host "No APKs found in backup."
  195.         return
  196.     }
  197.  
  198.     $packageGroups = $apks | Group-Object -Property { $_.BaseName -replace '\.base|\.split\.\d+', '' }
  199.  
  200.     Write-Host "List of APKs to be restored from deleted_apk folder:"
  201.     foreach ($group in $packageGroups) {
  202.         Write-Host "   - Package: $($group.Name)"
  203.         foreach ($apk in $group.Group) {
  204.             Write-Host "     * $($apk.Name)"
  205.         }
  206.     }
  207.  
  208.     Write-Host "`nNOTE: Make sure the phone screen is ON and UNLOCKED!"
  209.     Write-Host "You will need to confirm each installation manually on the phone screen!"
  210.     Write-Host "Waiting 5 seconds..."
  211.     Start-Sleep -Seconds 5
  212.  
  213.     foreach ($group in $packageGroups) {
  214.         $pkg = $group.Name
  215.         $apkFiles = $group.Group | Sort-Object Name | ForEach-Object { $_.FullName }
  216.         Write-Host "`nInstalling APKs for $pkg ..."
  217.         if ($apkFiles.Count -eq 1) {
  218.             $res = Adb install -r $apkFiles[0] 2>&1
  219.         } else {
  220.             $args = @('-r') + $apkFiles
  221.             $res = Adb install-multiple @args 2>&1
  222.         }
  223.  
  224.         if ($res -match "Success") {
  225.             Write-Host "   > Installed successfully."
  226.         } elseif ($res -match "INSTALL_FAILED_USER_RESTRICTED") {
  227.             Write-Host "   > INSTALL FAILED: You did not confirm on screen or the device blocked install."
  228.             Write-Host "   > Make sure screen is ON, unlocked and confirm install manually."
  229.         } else {
  230.             Write-Host "   > Error installing $($pkg): $($res)"
  231.         }
  232.     }
  233. }
  234.  
  235. Write-Host "----------------------START-------------------"
  236. Write-Host "VIVO X200 Ultra ADB Debloat Tool (NO ROOT) v.3.4"
  237. Write-Host "Ensure USB debugging is enabled on your phone!"
  238. Write-Host "Proceed at your own risk."
  239. Write-Host "----------------------START-------------------"
  240. Press-AnyKey
  241.  
  242. $menu = @(
  243.     "1) Remove and disable",
  244.     "2) Disable only",
  245.     "3) Remove only",
  246.     "4) Restore applications",
  247.     "5) Restore from backup (install APKs from deleted_apk folder)",
  248.     "6) Exit"
  249. )
  250.  
  251. while ($true) {
  252.     Clear-Host
  253.     Write-Host ($menu -join "`n")
  254.     $choice = Read-Host "Select action (1-6)"
  255.     switch ($choice) {
  256.         "1" {
  257.             if ((Read-Host "Confirm (y/n)?") -eq "y") {
  258.                 if (Backup-Packages -Packages ($PackagesToRemove + $PackagesToDisableOnly)) {
  259.                     Remove-Packages
  260.                     Disable-Packages
  261.                 }
  262.             }
  263.         }
  264.         "2" {
  265.             if ((Read-Host "Confirm (y/n)?") -eq "y") {
  266.                 Disable-Packages
  267.             }
  268.         }
  269.         "3" {
  270.             if ((Read-Host "Confirm (y/n)?") -eq "y") {
  271.                 if (Backup-Packages -Packages $PackagesToRemove) {
  272.                     Remove-Packages
  273.                 }
  274.             }
  275.         }
  276.         "4" {
  277.             if ((Read-Host "Confirm (y/n)?") -eq "y") {
  278.                 Restore-Packages
  279.             }
  280.         }
  281.         "5" {
  282.             if ((Read-Host "Confirm (y/n)?") -eq "y") {
  283.                 Restore-FromBackup
  284.             }
  285.         }
  286.         "6" {
  287.             Write-Host "Exiting..."
  288.             exit 0
  289.         }
  290.         default {
  291.             Write-Host "Invalid input."
  292.         }
  293.     }
  294.     Press-AnyKey
  295. }
  296.  
Advertisement
Add Comment
Please, Sign In to add comment