[GUIDE][Nougat & Oreo] How to flash TWRP and Magisk with locked bootloader

Search This thread

JonnyTech

Senior Member
Dec 4, 2013
133
46
@bigrammy where does the system store the OTA update files? Without thinking I accepted the prompt to do an update. Now the phone only boots to TWRP. Guessing that I need to flash the new stock boot and recovery to reboot correctly. Then I can patch with Magisk again. But I don't know the location.
 

bigrammy

Senior Member
Apr 8, 2011
2,945
2,570
huddersfield
@bigrammy where does the system store the OTA update files? Without thinking I accepted the prompt to do an update. Now the phone only boots to TWRP. Guessing that I need to flash the new stock boot and recovery to reboot correctly. Then I can patch with Magisk again. But I don't know the location.
Hmm could be tricky to get out of since we have no clue how far it got in the update process. :eek: If the OTA is like the other's I suspect it failed while switching to the recovery it first flashes to the "boot" partition.
But to answer your question the OTA should be in /data/ota_package or /data/ota
PS: Was it the November patch (Google security patch 2018-11) or is there another for December?
If it's the 2018-11 I have just captured it if you need it.
Download it here:
 
Last edited:

JonnyTech

Senior Member
Dec 4, 2013
133
46
Thanks @bigrammy but it encrypted my data partition and I lost everything and started again :( Shall be more careful about what I click when tired!

EDIT: T'was the November patch
 
  • Like
Reactions: bigrammy

bigrammy

Senior Member
Apr 8, 2011
2,945
2,570
huddersfield
Thanks @bigrammy but it encrypted my data partition and I lost everything and started again :( Shall be more careful about what I click when tired!

EDIT: T'was the November patch
We really need a TWRP than can handle encrypted data correctly and is small enough to fit in the partition. :rolleyes:
Maybe I will give it another shot some time when I have little to do. :eek:
 
  • Like
Reactions: JonnyTech

JonnyTech

Senior Member
Dec 4, 2013
133
46
Hello, my phone dont even want to boot to the recovery it just restart after holding the keys, any idea?

Do you get as far as the on-screen 10 second countdown? You must have the USB port connected in order to boot all the way to recovery.

---------- Post added at 20:47 ---------- Previous post was at 20:44 ----------

bigrammy said:
We really need a TWRP than can handle encrypted data correctly and is small enough to fit in the partition. :rolleyes:
Maybe I will give it another shot some time when I have little to do. :eek:
If you provide step-by-step instructions then maybe I could try - but would still prefer a custom ROM...
 
  • Like
Reactions: bigrammy

bigrammy

Senior Member
Apr 8, 2011
2,945
2,570
huddersfield
If you provide step-by-step instructions then maybe I could try - but would still prefer a custom ROM...

I have no step by step instruction because my pc ain't up to compiling oreo "O" or even "N" so I never tried :eek:
I did try port some recovery's but most use LMZ for compression and seem to use f2fs as the preffered method for /data and some even use it on /system. :eek:
LMZ does not seem to be supported by NE1's BL so we need to use gzip compression.
The best I can do is refer you to HERE and check his commits regarding the "twrp: fix encryption" :fingers-crossed:

EDIT: BTW I found some more references to the device model id. In /data/system/users/0/settings_global.xml When viewed line 22 says setting id "44" = TA1020 package="android" default value=TA-1020 default syset=true
I am not sure if this .xml just reads what's there or if it sets the values. :confused:
 
Last edited:
Oct 15, 2016
15
0
Do you get as far as the on-screen 10 second countdown? You must have the USB port connected in order to boot all the way to recovery.

---------- Post added at 20:47 ---------- Previous post was at 20:44 ----------


If you provide step-by-step instructions then maybe I could try - but would still prefer a custom ROM...

it worked now! ,thnx man i really appreciate it

---------- Post added at 10:50 PM ---------- Previous post was at 10:43 PM ----------

great now my phone wont boot anymore ,it stuck at powered by android then immediately restart ..
 
Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,945
2,570
huddersfield
it worked now! ,thnx man i really appreciate it

---------- Post added at 10:50 PM ---------- Previous post was at 10:43 PM ----------

great now my phone wont boot anymore ,it stuck at powered by android then immediately restart ..

Hi,
Can you please provide details of what you are doing, the firmware version you are on what you did while in twrp etc etc otherwise we can only guess and it's so painful trying to extract all the info piece by piece before we can assist :crying:
 
Oct 15, 2016
15
0
Hi,
Can you please provide details of what you are doing, the firmware version you are on what you did while in twrp etc etc otherwise we can only guess and it's so painful trying to extract all the info piece by piece before we can assist :crying:

first of all ,im sorry, well im on 8.0.0 Oreo ,i basically flashed twrp (3.2.1-0)then boot into it then a message appears saying keep system read only or something ,so i swiped ,as soon as i did that i just restarted the phone ,and i couldn't :c
 
Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,945
2,570
huddersfield
first of all ,im sorry, well im on 8.0.0 Oreo ,i basically flashed twrp (3.2.1-0)then boot into it then a message appears saying keep system read only or something ,so i swiped ,as soon as i did that i just restarted the phone ,and i couldn't :c
No need to be sorry just provide the details as you have now done :good:
If you did not place a tick in the box which says keep /system Read Only?? You will have tripped verity by swipeing and not flashing Magisk which would disable it. Basically you will now need to re-flash the /system and recovery using spflashtool.
 
Oct 15, 2016
15
0
No need to be sorry just provide the details as you have now done :good:
If you did not place a tick in the box which says keep /system Read Only?? You will have tripped verity by swipeing and not flashing Magisk which would disable it. Basically you will now need to re-flash the /system and recovery using spflashtool.

thnx for the reply, i have the stock recovery ,but where do i find the /system file?
 

JonnyTech

Senior Member
Dec 4, 2013
133
46
FaroukBenMiled said:
but where do i find the /system file?
Full ROM here: https://mega.nz/#!zVxl0agI!UrcTWf9LfDZV-9xLCdgTu85RKTYnaeNZSSgOJX7FwXM

---------- Post added at 02:35 ---------- Previous post was at 02:25 ----------

bigrammy said:
check his commits regarding the "twrp: fix encryption" :fingers-crossed:
When viewed line 22 says setting id "44" = TA1020 package="android" default value=TA-1020 default syset=true
Thanks, shall look into it when I get more time, gonna read up about building TWRP.
Good find with the xml file but it does not change anything and resets after a reboot.
 

DoubleCat

Member
Dec 23, 2018
9
2
This guide is interesting and the steps are probably easy enough for me to follow, but I don't need nor want twrp/magisk, I don't plan to root my phone, I just want vanilla Android 8.0, how should I proceed if I just want to replace 8.1 with 8.0? I am desperate, 8.1 is bad on so many levels :(

Also, even if I lose all my data and settings, shouldn't app settings be automatically restored since Google claims to back them up on the cloud? What's the best way to manually back up as many things as possible? If there's no way, fine with me. Wasting half a day setting everything back is an acceptable price to pay if I can get rid of 8.1.
 
  • Like
Reactions: SkaboXD

SkaboXD

Senior Member
Jan 18, 2017
1,132
445
Ganja
Xiaomi Poco X3 NFC
This guide is interesting and the steps are probably easy enough for me to follow, but I don't need nor want twrp/magisk, I don't plan to root my phone, I just want vanilla Android 8.0, how should I proceed if I just want to replace 8.1 with 8.0? I am desperate, 8.1 is bad on so many levels :(

Also, even if I lose all my data and settings, shouldn't app settings be automatically restored since Google claims to back them up on the cloud? What's the best way to manually back up as many things as possible? If there's no way, fine with me. Wasting half a day setting everything back is an acceptable price to pay if I can get rid of 8.1.

Thanks for kind words, well I'm currently not sure how because i don't own this device for like 4-5 months so I'm not updated to latest version. Ask some experienced people like @bigrammy, @redweaver or @JonnyTech some of them will help you for sure.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Before following guide check this:

    If you never unlocked bootloader or you flashed Android 7.1.1 nb0 with locked bootloader, then you need to go back to Android 7.0, after that unlock then lock bootloader. If you want to update, use OTA, don't flash nb0 because it have stock LK inside.
    Here is the explanation why:
    In theory and put simply as possible it should not work on a never unlocked before device if the LK does it's job properly. :confused:
    The LK does all the checking down the secure boot chain prior to allowing the recovery or boot.img to boot.
    If a device has been officially Unlocked then the LK should write (normally hidden) 1 bite identifiers to partitions like secro, misc, oem, etc etc (Depends on the OEM where and how) so when you flash a new ROM the new LK should still look for these bite's and if it see's them then it will allow the none stock .img's like twrp to boot normally.
    So to sum up
    1. Nokia made a huge screw up and the Nokia 3 is a totally insecure device like most of cheap MediaTek Chinese phone's out there.
    2. The LK knows the bootloader was officially Unlocked before and therefore ignores the secure boot chain.
    Downloads:
    SP Flash Tool:
    https://spflashtool.com/download/
    VCOM Drivers:
    https://spflashtool.com/download/MediaTek_USB_VCOM_drivers.zip
    Scatter file (extracted from nb0, use this scatter to avoid renaming issue):
    https://mega.nz/#!qJh1TSLL!5afi-7NYqKT3H62tqBISYSAdBDgN6eIM20WRSbtq3qE
    Compatible DA (Download Agent):
    https://mega.nz/#!xd8B3AJQ!PW82IpLzMzyNQk55BdwMnRMPlKQA0Yzj_8k_xN5r9XM
    Stock boot.img and Stock recovery.img:
    https://forum.xda-developers.com/nokia-3/development/link-stock-boot-img-stock-recovery-img-t3785576
    TWRP 3.1.0-0 by mediafire007:
    https://onedrive.live.com/?authkey=...126&parId=768DA1AA966F93C9!3122&action=locate
    TWRP 3.2.1-0 by SkaboXD:
    https://mega.nz/#!qIhFkKia!AkUMvQJ0PGVnSePabTvOgO-oUAMZahlCNaZfy2gE4vE
    Magisk ZIP:
    https://github.com/topjohnwu/Magisk/releases/download/v16.0/Magisk-v16.0.zip
    Magisk Manager APK:
    https://github.com/topjohnwu/MagiskManager/releases/download/v5.7.0/MagiskManager-v5.7.0.apk
    unSU script:
    https://forum.xda-developers.com/attachment.php?attachmentid=4410561&d=1517853382

    First Step: Installing and setting SP Flash Tools
    Install VCOM Drivers (video tutorial): https://youtube.com/watch?v=w3whZ2QMGvo
    Then extract SP Flash Tool to Desktop. Open extracted folder and open flash_tool.exe. Create new folder on Desktop and call it ''magisk twrp sp flash tool'' or something like that and move scatter to that folder. Then go back to SP Flash Tool and load scatter file. Close SP Flash Tool. Now copy/move DA_SWSEC_CRYPTO20.bin (Compatible DA that you downloaded) and replace it to sp flash tool folder. Then open sp flash tool and load DA that you replaced.

    Second Step: Flashing TWRP and Magisk
    Extract twrp to ''magisk twrp sp flash tool'' folder. Rename it to NE1-0-215H-00WW-recovery so SP Flash Tool can recognize it. Turn off your phone. Now open SP Flash Tool, tick recovery, select Download only mode and click Download. Hold power + vol up button at the same time and quickly connect phone to USB. Then it will go to META mode and downloading will begin first with red bar and second with yellow bar. When download completes, green tick/circle mark will appear. Now you have TWRP. Rename NE1-0-215H-00WW-recovery to twrp-recovery.img so you can remember file name.

    If you don't have root, just flash Magisk ZIP with TWRP.
    If you have SuperSU and you want to switch to Magisk, flash unSU script with TWRP which uninstalls SuperSU, then you need to flash stock boot.img. Switch from install zip to install image and click on stock boot.img. Tick boot partition and flash. When it's done with flashing, you can flash Magisk.

    OPTIONAL
    If you are for some reason scared to flash TWRP or don't want to mess with recovery partition, this is step for you.

    Second Step: Flashing Magisk without touching recovery partition
    If you want to switch from SuperSU to Magisk, unroot SuperSU in SuperSU options. Transfer stock boot.img to your device from PC. Go to your phone and install Magisk Manager APK and open it. Click install then click "Patch boot image file" then select stock boot.img then it starts downloading Magisk ZIP and patching boot.img. You will get patched_boot.img in /sdcard/MagiskManager. Now transfer stock boot.img and patched boot.img back to PC and move it to "magisk twrp sp flash tool" folder. Rename stock boot.img to NE1-0-215H-00WW-boot. Turn off your phone. Now open SP Flash Tool, tick boot, select Download only mode and click Download. Hold power + vol up button at the same time and quickly connect phone to USB. Then it will go to META mode and downloading will begin first with red bar and second with yellow bar. When download completes, green tick/circle mark will appear. Close SP Flash Tool. Rename NE1-0-215H-00WW-boot to stock-boot.img and rename patched-boot.img to NE1-0-215H-00WW-boot. Turn off your phone. Now open SP Flash Tool, tick boot, select Download only mode and click Download. Hold power + vol up button at the same time and quickly connect phone to USB. Then it will go to META mode and downloading will begin first with red bar and second with yellow bar. When download completes, green tick/circle mark will appear. TA-DA you have Magisk root. Rename NE1-0-215H-00WW-boot to patched-boot.img so you can remember file name.

    What about OTA?:
    If you want to have OTA updates, remember to flash stock recovery back if you flashed TWRP. With installed update you will not lose:
    - Data (apps, internal storage data)
    - Xposed framework (if flashed directly to system)
    - Xposed modules

    you will lose:
    - Magisk
    - Magisk modules
    - Xposed framework (if you flashed it systemlessly)

    To gain root, just flash Magisk again.

    Comment if links need to be updated.

    Credits:
    @sp flash Tool developers for providing SP Flash Tool
    @blackpanther0582 for nb0 and scatter file
    @Max brackenz for Download Agent
    @mediafire007 for TWRP
    @topjohnwu for Magisk
    @osm0sis for unSU script
    @bigrammy for useful tips
    2
    well it should work for them too, but where to find someone who never unlocked bootloader.
    In theory and put simply as possible it should not work on a never unlocked before device if the LK does it's job properly. :confused:
    The LK does all the checking down the secure boot chain prior to allowing the recovery or boot.img to boot.
    If a device has been officially Unlocked then the LK should write (normally hidden) 1 bite identifiers to partitions like secro, misc, oem, etc etc (Depends on the OEM where and how) so when you flash a new ROM the new LK should still look for these bite's and if it see's them then it will allow the none stock .img's like twrp to boot normally.
    So to sum up
    1. Nokia made a huge screw up and the Nokia 3 is a totally insecure device like most of cheap MediaTek Chinese phone's out there.
    2. The LK knows the bootloader was officially Unlocked before and therefore ignores the secure boot chain.

    I've never unlocked a Nokia (HMD) device bootloader and to be honest, after reading all the issues and problems some have been having trying to unlock their Nokia 3's, I don't think I want to try.

    I am getting very frustrated about the fact my TA 1020 (UK) is still stuck on Android 7.1.1 and the march security update.

    I've tried all the hacks suggested like taking the Sim out and resetting, connecting to Indian vpns and pressing check for updates every hour over a 14 hour period.
    My Nokia 3 is an unlocked (Sim free) version as well.

    Your not the Only one bubba1601 both mine and a friends TA 1020 still have not received the official Oreo update yet. :(
    My Friends phone is 100% pure stock and never been rooted or bootloader unlocked both of us have sim free devices too so not sure why UK users are not getting the update yet. :silly:
    2
    Works in variant TA-1028 on official Oreo. Great guide tnx
    2
    I waited a week for this guide when I saw you talking to each other in the Nokia 3 TWRP thread..
    And when I lost hope that you're going to make the thread I had to break down what you were saying amd make my own way..
    It took me 6 hours to get all the tools and files and figure it out.. :)
    Thank you anyways <3
    2
    did you cleaned Google services data after that?

    Flashing ost will work on TA-1020 right? Now I wonder if that's the reason why the vpn thing has been working for most people. Perhaps since it's the nb0 files are Asian (India and UAE)
    @bubba1601 maybe flashing OST is the only way to go.