Skip to content

Instantly share code, notes, and snippets.

@vsnthdev
Created October 17, 2020 06:09
Show Gist options
  • Select an option

  • Save vsnthdev/aa98694dab81e09ad97892a5d8bf771c to your computer and use it in GitHub Desktop.

Select an option

Save vsnthdev/aa98694dab81e09ad97892a5d8bf771c to your computer and use it in GitHub Desktop.

Revisions

  1. Vasanth Developer created this gist Oct 17, 2020.
    136 changes: 136 additions & 0 deletions clean.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,136 @@
    #!/usr/bin bash

    # DEFINE THE BLOATWARE APPLICATIONS WHICH
    # ARE SAFE TO BE REMOVED
    declare -a bloatware=(
    # Google Bloatware
    "com.google.android.apps.docs" # Google Docs
    "com.google.android.apps.maps" # Google Maps
    "com.google.android.apps.photos" # Google Photos
    "com.google.android.apps.tachyon" # Google Duo
    "com.google.android.apps.subscriptions.red" # Google One
    "com.google.android.music" # Google Play Music
    "com.google.android.apps.youtube.music" # YouTube Music
    "com.google.android.videos" # Google Play Movies & TV
    "com.google.android.apps.googleassistant" # Google Assistant
    "com.google.android.apps.docs" # Google Drive
    "com.google.android.gm" # Gmail
    "com.google.android.googlequicksearchbox" # Google
    "com.google.ar.lens" # Google Lens
    "com.google.android.apps.nbu.paisa.user" # Google Pay
    "com.google.android.youtube" # YouTube

    # MIUI Bloatware
    "com.mi.globalbrowser" # Mi Browser
    "com.mi.android.globalminusscreen" # App Vault
    "com.mi.android.globalFileexplorer" # Mi File Manager
    "com.android.deskclock" # MIUI Clock (with a confusing name)
    "com.mipay.wallet.in" # Mi Wallet (India)
    "com.google.android.feedback" # Feedback app
    "com.miui.backup" # Backup app
    "com.miui.bugreport" # Bug reporting app
    "com.miui.calculator" # Mi Calculator
    "com.miui.cleanmaster" # System Cleaner
    "com.miui.compass" # MIUI Compass
    "com.miui.fm" # MIUI FM
    "com.miui.freeform" # MIUI Picture in Picture service
    "com.miui.hybrid" # Quick Apps (data mining app)
    "com.miui.hybrid.accessory" # Quick Apps (data mining app)
    "com.miui.miservice" # Services & feedback
    "com.miui.mishare.connectivity" # Mi Share
    "com.miui.miwallpaper" # Wallpaper app (may not change lockscreen wallpaper after)
    "com.miui.msa.global" # MSA or MIUI Ad Services
    "com.miui.notes" # Notes
    "com.miui.phrase" # Frequent phrases
    "com.miui.player" # Music Player
    "com.android.soundrecorder" # Sound Recorder
    "com.miui.screenrecorder" # Screen Recorder
    "com.miui.touchassistant" # Quick Ball feature
    "com.miui.videoplayer" # MIUI Video player
    "com.miui.weather2" # Weather app
    "com.miui.yellowpage" # Yellow Page app
    "com.xiaomi.calendar" # Mi Calendar
    "com.xiaomi.glgm" # Games
    "com.xiaomi.joyose" # Junk and safe to remove
    "com.xiaomi.midrop" # Mi Drop
    "com.xiaomi.mipicks" # GetApps (Xiaomi App Store)
    "com.xiaomi.miplay_client"
    "com.xiaomi.mirecycle" # Mi Recycle (MIUI Security)
    "com.xiaomi.payment" # Mi Pay
    "com.xiaomi.scanner" # Scanner app
    "com.tencent.soter.soterserver" # Chinese Payment service
    "com.android.providers.downloads" # Downloads
    "com.android.providers.downloads.ui" # Downloads
    "com.micredit.in" # Mi Credit
    "com.duokan.phone.remotecontroller" # Mi Remote
    "com.android.thememanager" # MIUI Themes
    "com.android.thememanager.module" # MIUI Themes
    "com.miui.newmidrive" # MIUI Drive
    "com.xiaomi.mircs" # MIUI to MIUI Message
    "com.miui.cloudservice" # Cloud service
    "com.miui.micloudsync" # Cloud Sync
    "com.miui.cloudservice.sysbase" # Cloud service
    "com.miui.cloudbackup" # Cloud Backup service
    "com.miui.analytics" # MIUI Analytics (spyware)
    "com.xiaomi.discover" # Xiaomi System apps updater

    # Packages to keep Mi Account working uncomment
    # them to remove Mi Account functionality.
    # Warning: Signout from device before removing these packages.
    # Your phone won't be able to sync with Xiaomi servers after
    # removal of the below packages.

    # "com.xiaomi.account" # Mi Account
    # "com.miui.daemon" # Miui Daemon
    # "com.xiaomi.misettings" # Mi Settings
    # "com.xiaomi.xmsf" # Xiaomi Service Framework
    # "com.xiaomi.xmsfkeeper" # Xiaomi Service Framework

    # Thirdparty Apps
    "in.amazon.mShop.android.shopping" # Amazon
    "com.facebook.appmanager" # Facebook
    "com.facebook.services" # Facebook
    "com.facebook.system" # Facebook
    "com.facebook.katana" # Facebook
    "com.netflix.partner.activation" # Netflix
    "com.netflix.mediaclient" # Netflix
    "com.booking" # Booking
    "com.linkedin.android" # Linkedin
    "com.igg.android.lordsmobile" # Lords Mobile
    "cn.wps.moffice_eng" # WPS Office
    "cn.wps.xiaomi.abroad.lite" # WPS Office
    "com.funnypuri.client" # Zili
    )

    # WAIT FOR A DEVICE TO CONNECT
    clear
    tput civis
    echo "This $(tput setaf 6)bash$(tput sgr0) script will 🧻 remove bloatware from a Xiaomi device"
    echo "Waiting ⏳ for a device to be connected"
    adb wait-for-device

    # TAKE DEVICE MARKET NAME
    device_name=$(adb shell getprop ro.product.odm.marketname)
    if [ -z $device_name ]; then
    device_name="$(adb shell getprop ro.product.manufacturer) $(adb shell getprop ro.product.model)"
    fi

    # LOOP THROUGH ☝️ THE ABOVE APPS
    # AND REMOVE THEM
    for i in "${bloatware[@]}"
    do
    clear
    echo "πŸ› Removing: $(tput bold)$(tput setaf 6)$i$(tput sgr0)"
    adb shell pm uninstall -k --user 0 "$i" > /dev/null 2>&1
    done

    # FINALLY, REBOOT THE DEVICE
    clear
    echo "Successfully debloated your $device_name πŸ₯³"
    adb reboot &
    echo "πŸ“± $device_name will reboot now"
    echo "You can now safely πŸ”Œ unplug your $device_name"
    echo ""
    echo "Developed & Maintained by Vasanth Developer"
    echo "For queries 🐦 tweet $(tput bold)$(tput setaf 6)@vasanthdevelop$(tput setaf 0)"
    tput cnorm