Android

I have been using LineageOS on my Redmi Note 4 phone from the day I bought it. Till yesterday, I was running LineageOS 15.1 on it with encryption enabled. Since I wanted to try out the new Pie release, I tried installing the Resurrection Remix 7.0 ROM based on the Android Pie release. After setting everything up and restoring all the apps and data using Titanium Backup, I tried encrypting the device. However the encryption process failed and caused the phone to do a quick restart.

Since this was totally unexpected, I checked the error messages using the adb logcat command. The error message was

E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/userdata
E Cryptfs : Not a valid ext4 superblock
Orig filesystem overlaps crypto footer region.  Cannot encrypt in place.

This was strange because the userdata partition that is mounted at /data was formatted normally using the ext4 filesystem. Searching the internet lead me to this Reddit post which gave some useful pointers about the issue.

I tried to resize the userdata partition by formatting it from the bootloader and voilà the encryption succeeded on the next boot after a clean install. So I started restoring the apps and data from the backup and when it was about to complete, I got an error notification which said internal storage running out, some system functions may not work.

I was surprised by this since my phone had 64 GB of internal storage and there is no way for all of it to get used up. I also wondered if it was due to the encryption of the new apps and data (like what Bitlocker does on Windows by showing the disk to be 100% full while it is doing the initial encryption). (After resolving this issue later, I found this to be this reported issue). I started to suspect that something is broken with the installed ROM. I wanted to flash the stock MIUI ROM to check the partition size but it was difficult to find a working download link for the official fastboot ROM files because of issues (intentional?) with the Xiaomi site as usual.

After flashing the stock ROM via the fastboot interface and then flashing TWRP and then the ROM, GApps and Magisk, I booted into the OS to find the internal storage size detected correctly. However, when I tried to encrypt the phone it failed again with the initial error.

Suspecting some issue with the ROM, I installed LineageOS 15.1 because the encryption was working fine on it. But unfortunately, even with LineageOS 15.1, the encryption was failing with the same error. Since I had already spent too much time trying to fix this, I gave up for the time being and went to sleep.

This morning, I researched this issue further and found this post, which revealed this to be an issue with TWRP 3.2+ not formatting the /data partition properly and the solution was to use a 3.1 version to format the userdata partition and then use the latest TWRP to flash Oreo ROMs or newer because of the compatibility requirements. Luckily for me, it worked perfectly and now my phone can run the Pie-based ROM with data encrypted.

One important lesson I learned from this experience is to be conservative when flashing/switching ROMs because I often end up spending a lot of time to get everything working as expected and also have to suffer phone downtime. Another thing I reminded myself (again!) to do is to periodically download and keep backups of the stock fastboot ROMs because of how unreliable the official site can be.

Cyngn has struck a deal with TrueCaller to integrate it with the default dialer app on Cyanogen OS 12.1. For a privacy-conscious person like me, it was totally unacceptable given the notorious reputation of TrueCaller. Read this post on XDA-Developers for more details.

Cyngn Logo

TrueCaller Logo

Here is how I got rid of TrueCaller. Before installing the OTA on my OnePlus One, I turned off mobile data and Wi-Fi so that I could prevent any internet access till I removed TrueCaller. The phone rebooted after installing the Cyanogen OS 12.1 OTA update (which has been pulled due to some issues at the time of writing this). Immediately after that, I opened the dialer and was prompted to enable TrueCaller. I refused it by selecting Not Now.

TrueCaller opt-in dialog

I also went into the settings menu of the dialer app to make sure there was nothing related to TrueCaller enabled by default. All this just disables TrueCaller but does not remove it entirely. Read on if you want to completely remove it.

Since the TrueCaller app does not show up in the App Drawer, go to Settings ? Apps ? All and scroll down to the TrueCaller Service app. Tap on it and uninstall it from the App Info page that shows up.

Uninstall TrueCaller App

Now your phone should be free of TrueCaller and its privacy issues. If you go to the settings menu of the dialer app, you can verify that there are no settings related to TrueCaller.

This should work for any device for which Cyanogen OS 12.1 is released.

In case you have a change of mind after doing this and want to reinstall TrueCaller, you can do that by navigating to /system/vendor/bundled-app/TrueCaller folder using the File Explorer app and installing the APK that is there. The /system/vendor/bundled-app/ folder contains the APK files for all the other pre-loaded (but removable) apps like Boxer, Browser as well.

Hope this helps 🙂