Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Redmi / Xiaomi ADB Debloat

Non-root ADB debloat helper for Xiaomi/Redmi/POCO phones running HyperOS
(or MIUI). Written for a Redmi Note 15 5G on HyperOS 3, but the package
lists apply just as well to HyperOS 2 devices - community reports confirm
no significant bloatware changes between the two.

## Prep (do this before connecting the phone)

1. Install Android platform-tools (`adb`) on this machine:
- Fedora/RHEL: `sudo dnf install android-tools`
- Debian/Ubuntu: `sudo apt install android-sdk-platform-tools`
- Arch: `sudo pacman -S android-tools`
2. On the phone: **Settings > About phone**, tap "HyperOS version" (or "MIUI
version") 7 times to unlock Developer options.
3. **Settings > Additional settings > Developer options**: enable
**USB debugging**. On MIUI/HyperOS also enable **USB debugging (Security
settings)** if you plan to use `install-existing`/`uninstall` for system
apps - some ROMs gate `pm uninstall` behind it.
4. Connect the phone by USB cable, unlock it, and accept the "Allow USB
debugging?" prompt (tick "always allow from this computer").
5. Verify: `adb devices` should show the device as `device`, not
`unauthorized` or `offline`.

## Usage

```bash
cd android
./redmi_debloat.sh info # print all known packages, no device needed
./redmi_debloat.sh list # show which of them are actually installed
./redmi_debloat.sh remove --dry-run # preview what `remove` would do
./redmi_debloat.sh remove # remove Tier 1 (safe) only
./redmi_debloat.sh remove --include-miui # also remove Tier 2 (Xiaomi bundled apps)
./redmi_debloat.sh restore com.miui.notes # bring one package back
./redmi_debloat.sh restore-all removed-packages-*.txt # bring everything back
```

Every `remove` run writes a `removed-packages-<timestamp>.txt` file with
exactly what it removed, so a bad call is one `restore-all` away from fixed.

## How it works

Uses `adb shell pm uninstall -k --user 0 <package>`. This does **not**
delete the system APK - it just hides the app from the current user profile
and keeps its data (`-k`). Nothing here needs root, and everything is
undone by `restore`/`restore-all`, or trivially by a factory reset.

## Package tiers

- **Tier 1 - safe**: ordinary third-party apps Xiaomi/carriers bundle
(Facebook, Amazon, Netflix, LinkedIn, Opera, Microsoft Office, WPS
Office, bundled games, etc). These are regular user apps, not system
components - removing them is as safe as uninstalling any app from the
launcher.
- **Tier 2 - opt-in (`--include-miui`)**: Xiaomi/HyperOS-branded bundled
apps and services (Mi Browser, Mi Video/Music, GetApps-adjacent extras,
`com.miui.analytics`, `com.miui.msa.global` ad services). Low risk for
most people, but skipped by default since a couple of these touch
account/cloud features some users keep.
- **Tier 3 - documented only, never touched by the script**: packages
where sources actively disagree, or where real breakage has been
reported (`com.miui.daemon` and Cloud SMS verification, `com.android.stk`
and banking apps, `com.xiaomi.xmsf` and OTA updates, etc). Run
`./redmi_debloat.sh info` to see the full list with the reasoning for
each. Leave these alone.

## Sources

Package lists and risk notes were compiled from:

- [Minimal Xiaomi/Redmi Debloat List (Android 15 / HyperOS 2, 06/2025)](https://gist.github.com/gabeweb/a126aa204c2c08882ed192e16173457c)
- [matthieu-pierson/debloat-hyperos-adb](https://github.com/matthieu-pierson/debloat-hyperos-adb)
- [leechuanfeng/hyperos-debloat](https://github.com/leechuanfeng/hyperos-debloat)
- [XDA: HyperOS 2/3 debloat guide & package list](https://xdaforums.com/t/how-to-debloat-hyperos-2-3-updated-list-of-packages-apps-200-tutorial-video-4-ways-methods-2026.4775822/)

Bloatware varies by region, carrier and HyperOS version, so always run
`list` first and read `info`'s notes before using `--include-miui`.
40 changes: 40 additions & 0 deletions android/redmi-note-15-5g-20260913-session-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Redmi Note 15 5G / HyperOS 3 debloat log

2026-09-13, Redmi Note 15 5G (kunzite), HyperOS 3.

Restore list: `removed-packages-custom-20260913-212642.txt` (79 packages,
compatible with `restore-all`).

## Critical: never remove (now in TIER3_DO_NOT_REMOVE_DOC)

- `com.android.htmlviewer`: hosts the live `com.android.settings.cloud.CloudSettings` content provider. Removing it crashes SystemUI's keyguard and forces a reboot into Recovery.
- `miui.systemui.plugin`: crashes SystemUI directly if removed.

## Restored, currently installed again

- `com.android.systemui.accessibility.accessibilitymenu`, `com.miui.core`, and about 40 other MIUI/Xiaomi packages were restored as a precaution before the cause above was pinned down. No need to re-remove them.
- `com.google.android.googlequicksearchbox` was briefly reinstalled to fix the power button long-press action (it had been mapped to the removed Gemini assistant), then removed again. The fix persists as its own setting and doesn't need the app installed.

## Removed on purpose

- `com.xiaomi.account`, `com.miui.cloudservice`: no account signed in, no shared dependencies.
- `com.miui.securitycenter`: bundles Yandex Mobile Ads, MyTarget, Facebook Audience Network, and AppMetrica telemetry. Its CloudSettings provider declaration is not the active one.
- `com.google.android.gm`, `net.thunderbird.android`: no email use planned on this device.

## Unrelated pre-existing bug

Gmail never showed the signed-in Google account. That account's login is an email alias with no Gmail mailbox behind it, confirmed via Google's own "add Gmail" prompt. Not caused by debloating, not fixable by reinstalling Gmail. Resolved by removing Gmail.

## Also fixed in the script

`Remove-Package`/`Restore-Package` ran `adb shell` without redirecting stdin, so it consumed the rest of a piped package list and `remove`/`restore-all` silently stopped after one package. Fixed with `</dev/null`.

## Not us

These carrier OOBE packages were already disabled before this session (region/carrier mismatch): `com.altice.android.myapps`, `com.aura.oobe.vodafone`, `com.dti.bouyguestelecom`, `com.dti.telefonica`, `com.ironsource.appcloud.oobe.hutchison`, `com.orange.aura.oobe`, `com.sfr.android.sfrjeux`, `de.telekom.tsc`.

## Restore

```bash
./redmi_debloat.sh restore-all removed-packages-custom-20260913-212642.txt
```
Loading
Loading