Print
Category: Datorer
Hits: 1141

There is, actually a "Biggest pitfall". I did it and I got back on track, luckily. But it was not easy to find the solution.

The topic in this article is, "what you should NOT do after unlocking and flashing a new OS into your device".

Im not going to go into the technicals of unlocking and and allowing USB-debugging on your device. There's enough tutorials on that on the net. Just so it's clear: My device was a HTC Nexus 9. And the reason for me wanting to install another OS on it was that it was screwed up. It barely wanted to start. There was about 3-4 years of apps on it after my daughter, and Google had stopped to support the device. The first and best course of action to solve this, is to reset to factory defaults. This will usually solve most problems, but I was/am kind of tired of having Google's Apps and other apps from Google Play running in the background and hogging every bit of resource there is on the device. And of course it's nice to know that there are other options

My choice was LineageOS(formerly known as CyanogenMod) and using TWRP(TeamWin Recovery Project) to install it. It works. I think I installed Lineage OS 15.1(Android 8.1(Oreo)). I tried 16, but it hanged/could not make it work.

Well...back to what you do not want to do after an installation:

Do NOT lock your device after the installation

 

I did that , because I thought it was a good course of action after unlocking it, and I was finished installing my new working OS on the device. But know this: When you type 

:> fastboot oem lock

You might never get back. This is, after what I understand, is something you can do if you're running the pre-installed OS from the supplier. I mean default factory settings. Unlocking is to be kept unlocked otherwise. I did it anyways and it got this "funny" message on my screen:

 

This is not a good message. Scary. What happens here is that you can not unlock it through "traditional" methods. LineageOS does not support unlocking as a default becuase it's supposed to be unlocked 

I found an article on reddit where the solution was: https://www.reddit.com/r/LineageOS/comments/7u0je5/oem_unlocking_option_hidden/.

Embrace it and don't do it again. In case the article goes missing, the solution is to enable unlocking through "root" by giving these commands in bootloader:

1. adb root
2. adb shell setprop ro.oem_unlock_supported 1

Before (1) you manually have to give adb access to function as root. Se picture below(sorry about the language, but you get the idea):

The result of (1) and (2) is this:

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

Must admit that I do not remember the details of it all, but you have to

1. Get into your LineageOS(LineageOS "hung". I think the solution was to clear all cache, and the data-partition through TWRP)
2. Enable USB-debugging
6. Go to settings and activate "Developer settings", and give "Root access to adb".
3. Restart into bootloader
4. Give the commands (1) and (2)
5. Get into your LineageOS
6. Go to settings in OS again and toggle "enable unlocking".
7. Reboot into bootloader
8. enter command "fastboot oem unlock".

I'm not really clear about "this". It was late, and I was tired and mad at myself, but it worked. I managed to unlock it. The message in the booting-sequence(pic) went away.

MOTD: Leave it UNLOCKED!