[Xiaomi Poco F1 Guides, News, & Discussion] Cristobal2018:
There are already many guides explaining how to unlock, root and install a custom ROM on your Pocophone F1.

But even following the guides, I met multiple issues (access denied to data partitions, boot loops, ADB recovery stopped working ...).

Here is the full procedure that worked for me.

You will need a computer running under Windows for unlocking your phone because Xiaomi only provides a Windows version of its unlocking tool.

I performed the Fastboot and ADB steps under Linux (Ubuntu) because the installation of the tools under Linux is straightforward whereas I had hard times installing ADB under Windows. Moreover, my ADB client sometimes fails to connect under Windows whereas I have no issues under Linux.

Windows steps

-------------------

1/ backup all your personal information (pictures, videos, docs ...) because unlocking will erase all your data.

2/ you have to create a MIUI account from the stock ROM:

- fill in your email address

- set your phone number otherwise Xiaomi won't let you unlock your phone
​

3/ Xiaomi constrains you to wait for 72 hours after your MIUI account is created before you're able to unlock.

You have no choice but waiting (users reported that the classical fastboot oem unlock does not work).

The delay may differ from one user to another. Some users even reported a ridiculously long unlocking delay of 720 hours (~ 30 days).

It may depend on your country, phone operator etc ...

4/ download the official Xiaomi unlock tool:

miflash_unlock-en-3.3.827.31.zip

MD5: 8812104e1f6859087f1a9d66481ce9e5

SHA256: 4644878fcaa794d8c0bee67900df80efb28b0d8bd63669d943c043412b06790d​

5/ run miflash_unlock.exe while connected to Internet.

The Internet connection is required because the tool performs a user permission checking before allowing you to unlock your phone.

- fill in again your email address & password

- accept all the annoying Xiaomi disclaimers​

6/ finally you will get a screen with 3 green checkboxes telling you that your phone was successfully unlocked:

[IMG="=Successful unlocking"]https://i.imgur.com/raKzDDE.jpg[/IMG]

Linux steps

--------------

7/ install ADB and Fastboot on your Ubuntu system as superuser:

$ sudo apt-get install android-tools-adb android-tools-fastboot​

This simple command is enough for installing all the ADB stuff. Unlike with Windows, you don't need to spend time installing multiple drivers and waste time trying to understand why it doesn't work.

I recommend that all the 'adb' commands are launched as superuser using 'sudo'.

Indeed, some ADB commands will only work as superuser.

Most likely, the ADB path is not set in the superuser environment.

Consequently, you will have to locate the 'adb' path with the 'which' command then launch 'adb' with its absolute file path:

Example with ADB installed under /usr/share/android-sdk/platform-tools

Find 'adb' location:

$ which adb

/usr/share/android-sdk/platform-tools/adb​

Launch 'adb' using the found path:

$ sudo /usr/share/android-sdk/platform-tools/adb devices

​

8/ download the following packages and store them all in a new directory called 'adb':

twrp-3.2.3-2-beryllium.img

This is the latest TWRP recovery for the Pocophone F1.

MD5: 3fbf82042f5ea4e332c24cffc6ac1a4b

SHA256: 71a2fb92813fc7c77e7caf2e4b6716dda6cd688d175c56ec6dcdf34a458223b5

beryllium-9.1.24-9.0-vendor-firmware.zip

Under recent versions of Android, the vendor now provides a unified hardware abstraction layer.

Android now relies on this HAL so it can now be released independently from the hardware layer. This new architecture is also called 'Trebble'. The PixelExperience 9.0 released by jhenrique09 on 05/02/2019 relies on the Pocophone Pie 9.1 vendor firmware which must be installed first.

MD5: e931fb719c86f54b12ab4b91857335af

SHA256: 35cd48bab31755287a742ce7dfba4b75343daece2dcf31a27e1a650851e46ae9

PixelExperience_beryllium-9.0-20190205-2051-OFFICIAL.zip

This version requires that the Pie 9.1 vendor firmware is installed on the phone.

If you don't, you won't be able to go further and will get the Updater process ended with ERROR: 7 error when trying to flash.

MD5: 804305f334dcb6c1a41b9b2ab91a0ce6

SHA256: 0b8ae9f849971ea14d12065d82fa86fe0051d9570ad08e1008c095757b1fab55

DisableForceEncryption_Treble.zip

This tool will disable automatic encryption which occurs at first OS initialization.

This package includes Magisk 16.7 which will be installed by the script.

This is not the latest Magisk version so we will upgrade it later with the latest Magisk 18.1.

MD5: bb2b91c92aa9d441f41a325438d4a081

SHA256: ba0d9de4474594f01837eebf06edac1daa38775cfa78840cd885c28c5032fae2

Magisk-v18.1.zip

Magisk will allow applications to gain root access to your phone. It does quite the same as SuperSU but it does it better. Magisk pass the SafetyNet test whereas SuperSU generally doesn't. It can also hide itself from apps so they will run as on a stock phone.

MD5: 3ab4d455e6f27f0098c1a723705c6ea1

SHA256: eb06176ea1a2a564a82167902e8159fab13af330f3224c725f04b653232bb527

Magisk-uninstaller-20190204.zip

We will use the uninstaller later to uninstall Magisk 16.7 properly before installing Magisk 18.1.

MD5: 34745c7f3c0d13dbeb5f4223ad887b7b

SHA256: ac80eb0131983c8810fab23d092342e07d1b69b2d91035c027cb7a34ed18f9eb​

Personally, I chose the PixelExperience ROM because it is surprisingly stable and fast for one of the first custom Pocophone F1 ROM.

Moreover and specially if you disable auto-encryption, the phone runs much faster than the stock ROM.

The basic Google Apps are included in the ROM so you don't have to install them separately like you have to do with LineageOS.

Finally, the Pixel interface is very ergonomic and much pleasant to use than MIUI.

Before this, I tried LineageOS 15 then 16 but none of them worked for me. I got some boot loops and it even corrupted my bootloader (look at the troubleshooting section here if you meet the same issue).

9/ if present, remove the SD Card because the system can mess up between the apps installed on the internal storage vs external sdcard.

10/ open a terminal shell

11/ change directory to your 'adb' directory created for storing your packages

12/ with phone unplugged, power off then hold Volume Down & Power to enter FASTBOOT mode

13/ connect your phone to computer using your USB cable

14/ run fastboot devices as superuser to check if your phone is correctly connected:

$ sudo fastboot devices

ad5e3f6 fastboot​

If you see your device listed like here then everything worked fine.

15/ flash the TWRP 3.2.3-2 bootloader:

$ sudo fastboot flash recovery twrp-3.2.3-2-beryllium.img

target reported max download size of 536870912 bytes

sending 'recovery' (31004 KB)...

OKAY [ *1.251s]

writing 'recovery'...

OKAY [ *0.312s]

finished. total time: 1.563s​

The flash command will reply 'OKAY' twice if flashing is successful.

16/ you now have to reboot to recovery directly from FASTBOOT mode

otherwise your recovery will be overwritten by stock ROM if you reboot to system

. This is performed by invoking fastboot with the boot argument.

$ sudo fastboot boot twrp-3.2.3-2-beryllium.img

downloading 'boot.img'...

OKAY [ *1.216s]

booting...

OKAY [ *0.064s]

finished. total time: 1.280s ​

The TWRP splash screen should now show up.

17/ TWRP 3.2.3-2 handles decryption but I chose to work without encryption for several reasons:

- you might be unable to use your external SD card outside your phone because of encryption,

- your phone will run faster,

- certificates could probably be revoked remotely by manufacturers or Google so you can lose access to your phone and data.

If your partitions are encrypted (which is the case if you're coming from MIUI), you should format your data partition to restart from an unencrypted partition. Formatting will erase all your data so check you're backed up before doing it.

18/ you now have to reset your phone to perform a clean install.

As far as I am concerned, I advise wiping everything to start from a fresh brand new system.

To do so, tap Wipe, tap Advanced Wipe then check:

* Dalvik / ART Cache

* Cache

* System

* Data

* Internal Storage​

Finally, swipe to wipe.

19/ tap Back arrow then Reboot and finally Recovery

20/ plug your phone with USB cable to your computer.

21/ first of all, kill any running ADB daemon. We do it to be sure ADB daemon is started as superuser.

Indeed, some ADB commands won't work if not superuser.

$ sudo adb kill-server

​

Then check that ADB is working from recovery by typing the command:

$ sudo adb devices

List of devices attached

* daemon not running; starting now at tcp:5037

* daemon started successfully

ad5e3f6 recovery ​

The 'daemon started successfully' output notifies you that ADB daemon just started.

If your device is listed then everything is fine.

22/ go to your 'adb' directory then type the following command to copy all the packages to the /sdcard phone directory:

$ sudo adb push beryllium-9.1.24-9.0-vendor-firmware.zip /sdcard

beryllium-9.1.24-9.0-vendor-firmware.zip: 1 file pushed. 21.5 MB/s (442907715 bytes in 19.651s)

$ sudo adb push PixelExperience_beryllium-9.0-20190205-2051-OFFICIAL.zip /sdcard

PixelExperience_beryllium-9.0-20190205-2051-OFFICIAL.zip: 1 file pushed. 21.4 MB/s (1065939977 bytes in 47.478s)

$ sudo adb push DisableForceEncryption_Treble.zip /sdcard

DisableForceEncryption_Treble.zip: 1 file pushed. 21.3 MB/s (4447302 bytes in 0.199s)

$ sudo adb push Magisk-v18.1.zip /sdcard

Magisk-v18.1.zip: 1 file pushed. 21.4 MB/s (4362466 bytes in 0.194s)

$ sudo adb push Magisk-uninstaller-20190204.zip /sdcard

Magisk-uninstaller-20190204.zip: 1 file pushed. 21.2 MB/s (2290127 bytes in 0.103s)​

23/ go to main TWRP main menu then tap Install then tap beryllium-9.1.24-9.0-vendor-firmware.zip to install.

The vendor firmware must be installed prior to the ROM which relies on it.

If you forget this step, you will get a Updater process ended with ERROR: 7 error when trying to flash the ROM.

24/ go to main TWRP main menu then tap Install then tap PixelExperience_beryllium-9.0-20190205-2051-OFFICIAL.zip to install.

25/ go to main TWRP menu then tap Install then tap DisableForceEncryption_Treble.zip to install.

DisableForceEncryption_Treble will prevent the ROM from auto encrypting your phone upon first initialization. It also install Magisk which will give you root access.

Note that you can skip this step if you want to keep your phone encrypted.

26/ go to main TWRP menu then tap Install then tap Magisk-uninstaller-20190204.zip to uninstall any existing version of Magisk. The DisableForceEncryption_Treble also installs Magisk 16.7 so this step is required for a proper removal.

27/ go to main TWRP menu then tap Install then tap Magisk-v18.1.zip to install.

28/ now, boot to System.

29/ If you installed DisableForceEncryption_Treble then your phone will initialize without encryption.

30/ you now have to link your Pixel OS phone to your Google account and install your apps.

YOU ARE ALL DONE

Congratulations !!! you now have a Pixel OS and rooted system installed on your Pocophone F1.

TROUBLESHOOTING

-------------------------

Before installing Pixel OS, I had hard times trying to flash LineageOS on my Pocophone F1.

For a reason, it corrupted the bootloader and ADB server stopped communicating with my computer.

I thought I bricked my phone but I successfully restored everything by following those steps:

1/ boot to TWRP by holding Volume Up & Power

2/ tap Wipe

3/ tap Advanced wipe

4/ check everything except USB-OTG then swipe to wipe all.

5/ hold Power button for a long time, the phone will then try to boot to System but fall back to FASTBOOT because we just erased the system partition at the previous step.

I advise that you follow exactly this procedure. I can't explain why but I first reboot to FASTBOOT from the TWRP menu but doing like this did not fix the ADB recovery server which still kept unresponsive after reflash.

6/ reflash TWRP by running again sudo fastboot flash recovery twrp-3.2.3-2-beryllium.img

7/ hold Volume Up & Power buttons to boot again to TWRP recovery.

8/ connect your phone to computer with USB cable.

9/ type adb devices and you will see your device again.