A story about Android

September 15, 2021

Introduction

I can’t imagine today’s live without electronic devices. They helps us to find a way, they helps us remind stuff, they should help us… Well, at least on paper.

While electronic devices really helps us, they also used as a tool to big tech companies to earn money from our data. Google earns billions dollars selling our data to third-party and we can’t really do anything about it. However, what we can do obstruct they to earn more money.

Long story short: I interviewed to a new job and they ask me if I have Android phone. I said I don’t have one, but willing to buy it. To clarify: this job was not courier and doesn’t really needed Android phone. But since I absolutely need and want to work there, I was had no choice but to buy new shiny phone instead my 12 years old Pantech. So I’m read all our web resources to choose phone from. Plan was simple: I wanted phone with many ROMs, this usually means, even if manufacturer drop support, users will continue to support this particular phone. Another thing I wanted is official way to unlock bootloader or, at least, simple enough procedure that can be done from GNU/Linux.

That’s how I buy Xiaomi Redmi 7a. And you know what? I’m pretty happy with it. Again, to clarify, in our county any 7 (without a), 8 or 9 models cost two or even three Redmi 7a. You can even buy Note 4x from hands, but it will cost new Redmi 7a. Another option was Galaxy Nexus, but it had problems with CPU and there is no repairer, whom can reball it in our country.

On other hand, Redmi 7a doesn’t had official LineageOS support, but Redmi 7 has. This is… not that problematic, since there is good ROMs, but I just wanted this OS bad, because of privacy issues with stock Android OS. Turns out MIUI is even more evil than Google.

Fighting with evil and devil itself

Since I don’t have time tinkering with new ROMs, I was trying to delete as many trackers as possible. First thing I done when phone fell into my hands was deleting all Facebook and Google stuff which is MANY and BLOAT. You can’t uninstall that shit that easy. Some stuff require manual invention, some require ADB, some require root. However, China engineers prepare a surprise for me. Not only there was Facebook services sewn on tight into the ROM (what the fuck, China?), but all system apps spying with Google and Facebook trackers. I mean, China must hate all that west big tech companies (Huawei scandal), doesn’t they? But as I found out later, county-based updates are different.

For example, if you will install Indian update, there will be different app stack pre-installed. On Russia update, there is Yandex apps installed with update. In addition, every update will lands on different time, so I stuck with Indian update, but no update ever landed anymore for Indians. I don’t even know if this is good or bad thing. On the one hand - there is no need to remove crappy pre-installed apps, on the other hand - no “security” updates, no new kernels, probably no bugfixes that drain your battery (well, I don’t have a problems with it, actually).

And there is problem with my method: every update you need to delete all this crap out your phone. Hence, even after some apps update you need to delete them again and again and again… So I give up and back to Russian update, just stuck with the MIUI 11-something, but who cares.

Google Play Market will put a probe into your …

First thing you should not do is to login into your Google account (if you have one) and don’t even think to launch Google Play market! There is package that remind all things you installed. Also, Google play install more trackers into APKs you download. Don’t believe me? Try installed some APK, which available from website and then check md5 hashes.

Basics

Don't install SIM Card before disabling com.xiaomi.simactivate.service! (see below)

Go to F-Droid website and download F-Droid application. Install application on your phone. That’s now your only app market. We will discuss actual App Market later.

First thing you should do is install ADB. On Linux there is packages in all big distribution. On Windows… I think you can figure it out, because I don’t use Windows at home. Why do you need that? ADB allows you to remove some packages from phone, save space and remove tracker app.

In adb shell you can now disable and remove apps. However, I must warn you: all you do to your phone is your responsibility. This article is not a call to action, this is information I occurs from various sources and my own experience. If you brick your phone - it’s your fault. Nevertheless, to be honest, you can’t really break MIUI by deleting or freeze apps, it’s just restore itself to factory defaults. So my advice: DO A BACKUPS!

pm uninstall --user 0 app.package.name # will uninstall application, use with caution
pm disable-user app.package.name # will freeze app, most simple and safe way

Less evil

If you still wanted to use proprietary apps there is three alternatives:

  1. Aurora (F-Droid)
  2. Apps&Games 4PDA

All of these alternatives promotes non-free services, but we are trying to install some proprietary APKs, why this should trigger us, right?

Aurora is Play Market client. You should not login into your account! Believe me, there is no real reason doing that. Anonymous account working just fine, except for buying stuff, which I also doesn’t recommend to do. Downsides: after lastes Google update on APK policy, Android apps bundle (AAB) can’t be installed through Aurora without root access.

Apps&Games 4PDA mostly warez, but you can find modifications with cutted trackers and ADS. For example, I installed 2Gis from there. Downsides is: you need 4PDA account to use this app; app required some suspicious permission (but works without them); only Russian language supported. There is F-Droid 4PDA app, but it doesn’t work with login.

It’s your choice, but don’t even think update any of F-Droid app through this apps. Just ignore all updates and you’re save.

Uninstalling bloat and Facebook

All of this was done on MIUI 11.0.1.0 (Android 10Q)! I'm not responsible for any consequences!

Do not remove this apps!

According to my sources this apps are unsafe to remove. Phone will enters into bootloop!

You can remove this apps, but this leads to some features stop working:

You should disable this apps:

# This must be disabled, according to my sources deleting this app
# leads to bootloop
pm disable-user com.miui.yellowpage

# MUST be disabled, it called home when sim installed and send PAID SMS!
pm disable-user com.xiaomi.simactivate.service

# Don't know what this is, but I disable it "just in case"
pm disable-user com.huaqin.diaglogger

# Google Play Market, it can be deleted safetly, but I keep it "just in case"
pm disable-user com.android.vending
pm disable-user com.google.android.feedback

This apps save to uninstall completely:

# Facebook services
pm uninstall --user 0 com.facebook.katana # I don't have this on my phone, but just in case
pm uninstall --user 0 com.facebook.services
pm uninstall --user 0 com.facebook.system
pm uninstall --user 0 com.facebook.appmanager

# Google shit
pm uninstall --user 0 com.google.android.gms.location.history
pm uninstall --user 0 com.google.android.videos
pm uninstall --user 0 com.google.android.music
pm uninstall --user 0 com.google.android.apps.photos
pm uninstall --user 0 com.google.android.youtube
pm uninstall --user 0 com.google.android.apps.tachyon
pm uninstall --user 0 com.google.ar.lens
pm uninstall --user 0 com.google.android.googlequicksearchbox
pm uninstall --user 0 com.google.android.apps.wellbeing
pm uninstall --user 0 com.google.android.apps.googleassistant
pm uninstall --user 0 com.google.android.partnersetup

# Android auto service, you will never use, since Google kill it
pm uninstall --user 0 com.google.android.projection.gearhead

# TTS, if you don't use it you will save about 45mb
pm uninstall --user 0 com.google.android.tts

# Live wallpaper picker, if you don't need this - remove safely
pm uninstall --user 0 com.android.wallpaper.livepicker
# Live wallpapers
pm uninstall --user 0 com.android.dreams.basic
pm uninstall --user 0 com.android.dreams.phototable
pm uninstall --user 0 com.miui.android.fashiongallery

# Sim toolkit is useful sometimes, tho in my county there is only shitty services, so I just delete this
pm uninstall --user 0 com.android.stk
pm uninstall --user 0 com.android.stk2

# Netfix, TikTok, Yandex Search, Yandex Zen, Ebay Store, Ozone Store, Aliexpress Store, Auto.ru
pm uninstall --user 0 com.netflix.partner.activation
pm uninstall --user 0 com.zhiliaoapp.musically
pm uninstall --user 0 ru.yandex.searchplugin
pm uninstall --user 0 com.yandex.zen
pm uninstall --user 0 com.ebay.mobile
pm uninstall --user 0 com.ebay.carrier
pm uninstall --user 0 ru.ozon.app.android
pm uninstall --user 0 com.alibaba.aliexpresshd
pm uninstall --user 0 sg.bigo.live
pm uninstall --user 0 ru.auto.ara

# Xiaomi apps

# Laucher screen (if sroll left on last desktop)
# Useless peice of software, that knock in Xiaomi backdoor.
# Also, bloat AF (85MB!).
pm uninstall --user 0 com.mi.android.globalminusscreen

# AnalLitics
pm uninstall --user 0 com.miui.analytics
pm uninstall --user 0 com.miui.msa.global
pm uninstall --user 0 com.miui.bugreport
pm uninstall --user 0 com.miui.miservice
pm uninstall --user 0 com.miui.hybrid
pm uninstall --user 0 com.miui.hybrid.accessory
pm uninstall --user 0 com.xiaomi.joyose

# Xiaomi app store, useless
pm uninstall --user 0 com.xiaomi.mipicks

# Clouds backup by Xiaomi, useless shit anywhere but China
pm uninstall --user 0 com.miui.cloudservice
pm uninstall --user 0 com.miui.cloudservice.sysbase
pm uninstall --user 0 com.miui.newmidrive
pm uninstall --user 0 com.miui.cloudbackup
pm uninstall --user 0 com.miui.backup
pm uninstall --user 0 com.xiaomi.midrop

# ???
pm uninstall --user 0 com.xiaomi.glgm
pm uninstall --user 0 com.tencent.soter.soterserver

# Pay system by Xiaomi, again, usless, uless you're live in China or India
pm uninstall --user 0 com.xiaomi.payment
pm uninstall --user 0 com.xiaomi.wallet.in

# WPS office, just... Arh... Install LibreOffice if you REALLY want office on
# smartphone in the first place.
pm uninstall --user 0 cn.wps.xiaomi.abroad.lite

# Weather app, just use any other alternative, my pick is Forecastie
pm uninstall --user 0 com.miui.weather2

# FM radio, if you're not planning using it, can be removed safely
pm uninstall --user 0 com.miui.fm

# Video and audio player
pm uninstall --user 0 com.miui.videoplayer
pm uninstall --user 0 com.miui.player

# Notes app, I found Notally more useful
pm uninstall --user 0 com.miui.notes

# Calculator, less function even compare to stock Android
# also it awkward
pm uninstall --user 0 com.miui.calculator

Security settings

In all MIUI apps that you left on device, you should go to settings and disable “Recommendations”.

In your WiFi network settings, go to Advanced Settings and change second DNS provider (if first is 8.8.8.8, change it to your router address) to whatever your first DNS (router) is. MIUI using Google DNS servers, that is bad for your privacy.

Update 18.09.2021:

In Downloads app tap to tree dots menu -> settings. Remove flag from Recive recommendations and add flag to revocation something-something (third flag). Very obscure settings, but it will (hopefully) disable all recomendations in Downloads app completly and removing this annoying Accept this MIUI privacy window.

In Themes go into last tab -> settings. Disable recommendations and automatic updates.

Don't login into your MIUI account unless you need to unlock bootloader! Even without MIUI Cloud app, account will store some files and settings into cloud.

Ok, I removed most stock apps, what now?

I have a list of open source apps that are better doing their job, IMO. In addition, all of them can be installing from F-Droid.

Additional tools:

*A bit warning about DuckDuckGo, throught: Delete all data button doesn’t actually delete your data. Forms still will be autocompleting, some history items will not deleted and, I have strong feeling that cookies also not fully deleted. You should delete data completely (if you will) from android app settings, not from browser itself. Alternative to DuckDuckGo can be Mull - fork of Fennec browser, without Mozilla tracking.

**You can use https://volkmilit.gitlab.io/watch as a Invidious link. It will redirect to random Invidious instance, but only works in browser. Are we winning?

No, we are not. I still can’t find good alternatives to:

There is no simple way to block ADS or even change VPN settings. Also, I may forgot some apps and can’t find information about others. MIUI itself can still track me down, etc, etc.

Knee deep in Android

So, once you setup everything there is still things to do!

You can test your setup with App Manager (F-Droid). It doesn’t show everything and not always good, but it’s better than nothing.

For some shady app you can install Virtual Xposed without root access! Useful app for XPosed modules.

Install Lucky Patcher, this app can be useful for patching system to disable media server, for example. You can disable some ads with it.

Conclusion

As I love my phone there is still things to improve in privacy retrospective. ROM still using some strange DNS server and I can’t use firewall to protect myself. But none or less I done all possible to do to protect at least some of my privacy.

Hopefully, there is PinePhone and Librem5 - GNU/Linux smartphones and the future belongs to them. Sources

  1. https://selivan.github.io/2020/02/25/removing-bloatware-from-xiaomi-miui-android.html
  2. https://anonymousmailroot.medium.com/services-bloatware-safe-to-remove-on-xiaomi-devices-via-android-debug-bridge-2e5bcd94dfa0
  3. My own experience with Android devices