Skip to content

Instantly share code, notes, and snippets.

@danisztls
Created May 6, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danisztls/73fa9619754bc0d0474c2b5413529a19 to your computer and use it in GitHub Desktop.
Save danisztls/73fa9619754bc0d0474c2b5413529a19 to your computer and use it in GitHub Desktop.
Remove bloat from Android using ADB
#!/bin/bash
# Remove bloat from Android using ADB
# Based on: https://gist.github.com/Biswa96/81fe477079fa5279f7cfd7b98d5519c7
# Copyright 2021 @danisztls
#
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# WARNING
# -------
# THIS CAN BRICK YOUR PHONE
# BE CAREFUL!
# DATA
# ----
# Apps to Remove
apps=("com.amazon.appmanager"
"com.android.browser"
"com.android.chrome"
"com.android.email"
"com.android.thememanager"
"com.android.wallpaper.livepicker"
"com.facebook.services"
"com.facebook.system"
"com.facebook.appmanager"
"com.google.android.apps.docs"
"com.google.android.apps.maps"
"com.google.android.apps.photos"
"com.google.android.apps.tachyon"
"com.google.android.feedback"
"com.google.android.gm"
"com.google.android.googlequicksearchbox"
"com.google.android.marvin.talkback"
"com.google.android.music"
"com.google.android.syncadapters.calendar"
"com.google.android.syncadapters.contacts"
"com.google.android.talk"
"com.google.android.tts"
"com.google.android.videos"
"com.google.android.youtube"
"com.mfashiongallery.emag"
"com.mi.android.globalpersonalassistant"
"com.mi.dlabs.vr"
"com.mi.globalTrendNews"
"com.mi.global.bbs"
"com.mi.global.shop"
"com.mi.webkit.core"
"com.micredit.in"
"com.milink.service"
"com.mipay.wallet.id"
"com.mipay.wallet.in"
"com.miui.analytics"
"com.miui.android.fashiongallery"
"com.miui.bugreport"
"com.miui.cloudbackup"
"com.miui.cloudservice"
"com.miui.cloudservice.sysbase"
"com.miui.micloudsync"
"com.miui.hybrid"
"com.miui.hybrid.accessory"
"com.miui.klo.bugreport"
"com.miui.miservice"
"com.miui.miwallpaper"
"com.miui.msa.global"
"com.miui.player"
"com.miui.providers.weather"
"com.miui.screenrecorder"
"com.miui.translationservice"
"com.miui.translation.kingsoft"
"com.miui.translation.xmcloud"
"com.miui.translation.youdao"
"com.miui.touchassistant"
"com.miui.userguide"
"com.miui.videoplayer"
"com.miui.virtualsim"
"com.miui.weather2"
"com.miui.yellowpage"
"com.netflix.partner.activation"
"com.swiftkey.languageprovider"
"com.swiftkey.swiftkeyconfigurator"
"com.xiaomi.account"
"com.xiaomi.discover"
"com.xiaomi.glgm"
"com.xiaomi.joyose"
"com.xiaomi.location.fused"
"com.xiaomi.micloud.sdk"
"com.xiaomi.midrop"
"com.xiaomi.mipicks"
"com.xiaomi.miplay_client"
"com.xiaomi.mirecycle"
"com.xiaomi.oversea.ecom"
"com.xiaomi.payment"
"com.xiaomi.providers.appindex"
"com.xiaomi.xmsf")
# Optional and Dangerous
#"com.android.vending" # Play Store
#"com.google.android.gms" # Play Store Service
#"com.google.android.inputmethod.latin" # Gboard
#"com.google.android.gsf.login" # Google Login Service
#"com.google.android.webview" # Android System WebView
#"com.mi.android.globalFileexplorer" # Explorer
#
# WARNING: These will Soft Brick your Phone
#"com.xiaomi.finddevice"
#"com.miui.securitycenter"
#"com.miui.securityadd#"
# LIB
# ---
function cleanup() {
for app in ${apps[@]}; do
adb shell pm uninstall "$app"
adb shell pm uninstall --user 0 "$app"
done
}
function dryrun() {
for app in ${apps[@]}; do
echo "$app"
done
}
# MAIN
# ----
case $1 in
c|cleanup) cleanup;;
d|dryrun) dryrun;;
*) echo "pass cleanup or dryrun as argument";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment