How To Guide [GUIDE] How to unlock the bootloader for Nokia 2.2

Search This thread

TheBeast941

Senior Member
Apr 6, 2021
59
5
Ok, i uninstalled the original Mediatek driver and installed the one from the SPFlash, although they both were version 1.1352. And tried with all these readback lengths and still get the same error...

Is it possible the readback length value i am using is incorrect? I have no idea what it means and have only tried the ones mentioned in the Youtube video, the readback link (In the first post) and 0xd4000000 (as suggested by areallydumbperson).

Does it matter where the ROM file is saved?

Am i missing something important from this point:
For this case, you need to keep Download Agent file as the same came with SP Flash Tool, and altunlock-MT6761_Android_scatter.txt
??
Wait, you loaded the altunlock scatter file into sp flash tool right? If the scatter file hasn't been loaded into the program it wouldn't know what files should be in the readback. If you have forgotten, switch to the Download tab, load it into the "Scatter-loading file" field then switch back to the Readback tab and attempt to read back again.
 

BobStrop

Member
Jul 31, 2021
10
0
Wait, you loaded the altunlock scatter file into sp flash tool right? If the scatter file hasn't been loaded into the program it wouldn't know what files should be in the readback. If you have forgotten, switch to the Download tab, load it into the "Scatter-loading file" field then switch back to the Readback tab and attempt to read back again.

Yes, as shown at about 0:46 on the Youtube video in the first post.
 

BobStrop

Member
Jul 31, 2021
10
0
So I guess the frequency of response has decreased should I assume its too difficult? Im just curious though because I have followed all the steps properly (as far as i can see) and been pretty clear in my questions.Would really like to learn more.

All i really want through rooting is to be able to remove all the apps which take up 60% of my phones internal memory. Is there another way?
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
So I guess the frequency of response has decreased should I assume its too difficult? Im just curious though because I have followed all the steps properly (as far as i can see) and been pretty clear in my questions.Would really like to learn more.

All i really want through rooting is to be able to remove all the apps which take up 60% of my phones internal memory. Is there another way?
Search for the error that pops up on this website, it may be that the drivers you have downloaded and installed are out of date.
(you may have to sign up/log in to access links on that website)
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
Now to use this Wwr MTK tool i need the PGPT file? What is that? Ha, this is very complicated.
You only have to follow the link in the original post for performing the readback, we don't need to use that tool for what we're doing. Once readback is finished return back to and carry on with this guide.
 

BobStrop

Member
Jul 31, 2021
10
0
You only have to follow the link in the original post for performing the readback, we don't need to use that tool for what we're doing. Once readback is finished return back to and carry on with this guide.
That is what i thought also but for some reason i can not get the readback to work.

I keep getting that same error...I believe the issue must be in the address lengths?
Are the lengths unique to each phone or just the model? I would imagine on the model and therefore there should be a standard value for all Nokia 2.2?

I will have another go tomorrow.

Thanks again everyone!
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
That is what i thought also but for some reason i can not get the readback to work.

I keep getting that same error...I believe the issue must be in the address lengths?
Are the lengths unique to each phone or just the model? I would imagine on the model and therefore there should be a standard value for all Nokia 2.2?

I will have another go tomorrow.

Thanks again everyone!

Don't remember if we talked about this before, but leave adequate space for where you want to store the readback, not enough space means the readback fails. I'd say leave at least 16 GB free to be on the safe side.

If that didn't fix the problem (or you already have enough space) It's possible your USB cable/port could be malfunctioning: try a different cable or use a different USB port. Also shorter USB cables are more recommended since the readback process requires fast read speeds and read speed deteriorates the longer the cable is.
 

SB3P

Member
Aug 11, 2021
15
3
Android 11 Magisk Patched Boot Image (Yes after unlock you can in fact update to android 11 without the device getting bricked)

Flashing Method:

fastboot flash magisk_patched-23000_QNm3D
fastboot reboot

android 10 image coming soon if you managed to update to android 10
For me Magisk (tested 23.0, 22.1 and 23001 Canary) doesn't seems to work on Android 11 (it does bootloop), either by using this ROM or patching my own Android 11 stock boot image (that boots fine when flashing boot partition with `fastboot`). Moreover, by comparing MD5 checksums in both patched files (yours vs mine), they seems to be identical files. What could cause that and do I need to tweak something else?

Also, when trying to patch Android 9 boot image with Magisk everything seems to work alright...
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
For me Magisk (tested 23.0, 22.1 and 23001 Canary) doesn't seems to work on Android 11 (it does bootloop), either by using this ROM or patching my own Android 11 stock boot image (that boots fine when flashing boot partition with `fastboot`). Moreover, by comparing MD5 checksums in both patched files (yours vs mine), they seems to be identical files. What could cause that and do I need to tweak something else?

Also, when trying to patch Android 9 boot image with Magisk everything seems to work alright...
That's because the device only boots when files are patched on Android 9 (such as Magisk or any Android 9 GSI), if you attempt to patch your device with modified files on Android 10 or 11 it won't boot.

That's why the procedure in the guide downgrades your device to Android 9.
 

SB3P

Member
Aug 11, 2021
15
3

Thank you for your answer!



That's why the procedure in the guide downgrades your device to Android 9.

As of steps done to unlock bootloader, I did them all on Android 9 and I did an upgrade to Android 11 only after I finished the whole procedure of unlocking the bootloader. However, I did patched boot image with Magisk on Android 11, as I believe boot images are different between Android 9 and 11. So, in conclusion, bootloader was patched on Android 9 and boot image was patched on Android 11 (where I took this boot image after doing a readback on Android 11 of the boot_b partition only as I discovered OTA updates always install themselves on the other than active slot).

That's because the device only boots when files are patched on Android 9 (such as Magisk or any Android 9 GSI), if you attempt to patch your device with modified files on Android 10 or 11 it won't boot.

So, according to your answer, how should I use the boot image sent by ? I'm sure can't flash it on Android 9 as it is intended for Android 11 and it would cause the bootloop as well on Android 9. What have I done wrong here? If I need to downgrade to Android 9 again, I know how to do that with SP Flash Tool, but right now IDK why I should do that if I want to use this Android 11 patched boot image.

Also, I previously tested LineageOS 16 Unofficial GSI image on Android 9 and it didn't work for me as well (with both flashed vbmeta and wiped user data with fastboot -w).
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
So, according to your answer, how should I use the boot image sent by ? I'm sure can't flash it on Android 9 as it is intended for Android 11 and it would cause the bootloop as well on Android 9. What have I done wrong here? If I need to downgrade to Android 9 again, I know how to do that with SP Flash Tool, but right now IDK why I should do that if I want to use this Android 11 patched boot image.
You would have to downgrade to Android 9 if you want to root your device, you can do that by following the guide again, and then extracting the boot.img file from the firmware file, patching it with the Magisk Manager app and loading the firmware file with the mt6761 scatter file but replacing the boot img with your Magisk image.

Also, I previously tested LineageOS 16 Unofficial GSI image on Android 9 and it didn't work for me as well (with both flashed vbmeta and wiped user data with fastboot -w).

Again, you would have to downgrade to Android 9 to be able to successfully flash and boot into GSIs. Upgrading to Android 10 or 11 then flashing an Android 9 GSI would not work (and it is recommended to flash the GSI with an unmodified boot image for the first boot and then reflash your Magisk image after).
 

SB3P

Member
Aug 11, 2021
15
3
You would have to downgrade to Android 9 if you want to root your device, you can do that by following the guide again, and then extracting the boot.img file from the firmware file, patching it with the Magisk Manager app and loading the firmware file with the mt6761 scatter file but replacing the boot img with your Magisk image.

I know root + Android 9 works, but are there any chances to use that (Android 11) image? Has anyone tested it and confirmed, or
@areallydumbperson just sent it there untested and not working? As I pointed, I was able to reproduce this image with Magisk on Android 11 as well, but unfortunelly I was unable to flash it.

Again, you would have to downgrade to Android 9 to be able to successfully flash and boot into GSIs. Upgrading to Android 10 or 11 then flashing an Android 9 GSI would not work (and it is recommended to flash the GSI with an unmodified boot image for the first boot and then reflash your Magisk image after).

As I said earlier:

(...) I previously tested LineageOS 16 Unofficial GSI image on Android 9 (...)

However, I don't remember if I flashed Magisk then, so I would need to test that again to prove you more details about what could gone wrong.
 

TheBeast941

Senior Member
Apr 6, 2021
59
5
I know root + Android 9 works, but are there any chances to use that (Android 11) image? Has anyone tested it and confirmed, or
@areallydumbperson just sent it there untested and not working? As I pointed, I was able to reproduce this image with Magisk on Android 11 as well, but unfortunelly I was unable to flash it.



As I said earlier:



However, I don't remember if I flashed Magisk then, so I would need to test that again to prove you more details about what could gone wrong.
As a matter of fact I have tried to use Android 10 GSI and Magisk on Android 10 - neither worked so I just refollowed the guide with my IMEI files to downgrade back to Android 9

And yes, he did patch and upload an Android 11 image but he didn't test it to see if it worked (which it didn't). The most probable cause of the mods failing is because the Android 10 and 11 update could have used an entirely different format as opposed to the one from Android 9, and so the same scatter files won't work.
 

SB3P

Member
Aug 11, 2021
15
3
As a matter of fact I have tried to use Android 10 GSI and Magisk on Android 10 - neither worked so I just refollowed the guide with my IMEI files to downgrade back to Android 9

And yes, he did patch and upload an Android 11 image but he didn't test it to see if it worked (which it didn't). The most probable cause of the mods failing is because the Android 10 and 11 update could have used an entirely different format as opposed to the one from Android 9, and so the same scatter files won't work.

Too bad, I just had a little of hope I did something wrong on my side.

> The most probable cause of the mods failing is because the Android 10 and 11 update could have used an entirely different format as opposed to the one from Android 9, and so the same scatter files won't work.

Does fastboot have anything in common with scatter files and SP Flash Tool? I don't think so, but I may be wrong as its my first phone I did flashing / modding on. As stock boot flashes fine via fastboot, I would rather say either Magisk produces the incompatible format of the boot partition (I don't know how to properly unpack / mount boot partition and check the changes, so I have no way to debug it further), as the boot image I got when doing readback on Android 11 fine when flashed back with fastboot (and I'm pretty sure it wouldn't work). Anyway, I personally believe something's blocking us from booting from other partitions after Android 11 update, probably by checking its checksum – but I may be wrong there.

The other thing is that I can't boot back to Android 9 after an update when changing the active slot to A – where A partition scheme shouldn't be touched at all when updating to make it possible to recover when update failed to flash correctly (at least from my understanding of A/B partition scheme). This could be the same case as of custom ROMs, where something else needs to be tweaked so boot verification isn't checked. Anyway, that's my opinion and I might be wrong, I'm complete novice in flashing, yet I have a basic understanding how most common OSes works.

As of Android 11, there's a little hope about being able to boot into any GSI image via DSU Loader (it will work without the need of flashing anything and maybe without the need of having the bootloader unlocked) – I still haven't checked if it is possible. If you're curious about my progress, just call me back and I'll be glad to share with you if that works. I'll use the method described in Android Developer website:

Anyway, I really appreciate you answered me, I'm glad at some point I didn't messed up anything and that's the current limitation everyone needs to deal with.
 

SB3P

Member
Aug 11, 2021
15
3
Too bad, I just had a little of hope I did something wrong on my side.

> The most probable cause of the mods failing is because the Android 10 and 11 update could have used an entirely different format as opposed to the one from Android 9, and so the same scatter files won't work.

Does fastboot have anything in common with scatter files and SP Flash Tool? I don't think so, but I may be wrong as its my first phone I did flashing / modding on. As stock boot flashes fine via fastboot, I would rather say either Magisk produces the incompatible format of the boot partition (I don't know how to properly unpack / mount boot partition and check the changes, so I have no way to debug it further), as the boot image I got when doing readback on Android 11 fine when flashed back with fastboot (and I'm pretty sure it wouldn't work). Anyway, I personally believe something's blocking us from booting from other partitions after Android 11 update, probably by checking its checksum – but I may be wrong there.

The other thing is that I can't boot back to Android 9 after an update when changing the active slot to A – where A partition scheme shouldn't be touched at all when updating to make it possible to recover when update failed to flash correctly (at least from my understanding of A/B partition scheme). This could be the same case as of custom ROMs, where something else needs to be tweaked so boot verification isn't checked. Anyway, that's my opinion and I might be wrong, I'm complete novice in flashing, yet I have a basic understanding how most common OSes works.

As of Android 11, there's a little hope about being able to boot into any GSI image via DSU Loader (it will work without the need of flashing anything and maybe without the need of having the bootloader unlocked) – I still haven't checked if it is possible. If you're curious about my progress, just call me back and I'll be glad to share with you if that works. I'll use the method described in Android Developer website:

Anyway, I really appreciate you answered me, I'm glad at some point I didn't messed up anything and that's the current limitation everyone needs to deal with.

Oh, DSU is killed at some point by the OS (or crashes, there's nothing that would indicate that by the default) – I guess it is broken, at least on my current OS version.
 

SB3P

Member
Aug 11, 2021
15
3
You would have to downgrade to Android 9 if you want to root your device, you can do that by following the guide again, and then extracting the boot.img file from the firmware file, patching it with the Magisk Manager app and loading the firmware file with the mt6761 scatter file but replacing the boot img with your Magisk image.
Actually, you were not right about that – flashing Magisk on Android 11 is in fact possible (and I managed to have it working!), but you need to disable vbmeta first (where Magisk worked fine on Android 9 without disabling vbmeta anyway). So I believe I was right – this wasn't due to incompatible scatter file, but because of boot verification failing on checksum check (or at least AFAIK that's how boot verification). I've also succeed getting the same stock boot image (and vbmeta image) by extracting images from OTA update – so the Android 9 scatter file works fine on Android 11.

So basically to get Magisk working on Nokia 2.2 after Android 11 update, you just need to flash a patched image and disable boot verification in vbmeta (I did that by passing both --disable-verification and --disable-verity flags while flashing Android 11 stock vbmeta).

Here I shared a screenshot as a proof it really can work (at least on Magisk 23.0).

EDIT: Some minior changes in the text sense, it didn't showed correctly what I was meant about when writing the post, which could lead to misinterpretation.
 

Attachments

  • Screenshot_20210813-185954.png
    Screenshot_20210813-185954.png
    106 KB · Views: 22
Last edited:
  • Like
Reactions: AAditya846

AAditya846

Member
May 16, 2016
26
0
You were not right – flashing Magisk on Android 11 is in fact possible (and I managed to have it working!), but you need to disable vbmeta first (where Magisk worked fine on Android 9 without disabling vbmeta anyway). So I was right – this wasn't due to incompatible scatter file, but because of boot verification failing on checksum check (or at least AFAIK that's how boot verification). I've also succeed getting the same stock boot image (and vbmeta image) by extracting images from OTA update – so the Android 9 scatter file works fine on Android 11.

So basically to get Magisk working on Nokia 2.2 after Android 11 update, you just need to flash a patched image and disable boot verification in vbmeta (I did that by passing both --disable-verification and --disable-verity flags while flashing Android 11 stock vbmeta).

Here's screenshot as a proof it really can work (at least on Magisk 23.0):
Do I need a newer patched boot image for Android 11 or the old one from Android 9 will work fine? And, what about TWRP? I've had a working TWRP on android 9 (thanks to a guy from this thread). Does that work?
 

SB3P

Member
Aug 11, 2021
15
3
Do I need a newer patched boot image for Android 11 or the old one from Android 9 will work fine?
Android 11 update contains new boot image. Also just to note, most security updates will contain a patches to the kernel, so boot image may differ after doing an OTA update (I believe that's how I broke the updates on my currently installed image).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Fastboot > flash system > flash vbmeta from stock OS (Android 9) > fastboot -w > reboot
    Right?
    yepp , thats right
  • 10
    To moderators: There's no Nokia 2.2 forum in XDA-Developers, please move this topic when available.
    To content farms: DO NOT COPY AND PASTE THE ENTIRE GUIDE!

    Now the last piece of puzzle of Nokia x.2 series bootloader unlock line has been completed, thanks to the help of a member called Woke_World.
    After I read his procedure, I decided to optimize the entire procedure and use my own firmware file to achieve it.

    Step 1: Do full backup
    (For this case please use SP Flash Tool 5.1924 or newer that can be found on spflashtool.com )

    The firmware for this procedure can be downloaded here: https://www.androidfilehost.com/?fid=2188818919693749336
    SHA256: D056631A8A795A06795B3A4E5F334DBF9B55C3C71269831F8E7926FA3ABA5637

    Please follow the procedure in this topic to do readback: https://forum.xda-developers.com/t/...-global-nokia-5-1-plus-unbrick-guide.3858253/
    For this case, you need to keep Download Agent file as the same came with SP Flash Tool, and altunlock-MT6761_Android_scatter.txt

    Once readback done, please extract these images inside your backup for later use:
    Code:
    nvcfg.img
    nvram.img
    proinfo.img
    protect1.img
    protect2.img

    DO NOT SKIP STEP 1, OR YOUR PHONE WILL NOT HAVE IMEI AND SN!

    Step 2: Format all + Download to flash the firmware with altunlock scatter file
    Switch to Download tab, and choose format all + download to flash the entire phone with this scatter file: "altunlock-MT6761_Android_scatter.txt"
    Once flash complete, disconnect the phone.

    Step 3: Bootloader unlock
    Press and hold volume down key and connect to PC - keep that condition for around 12 seconds then the phone will boot to Fastboot mode.
    Execute these 2 commands to perform bootloader unlock:
    Code:
    fastboot flashing lock_critical
    fastboot oem unlock

    Look at your phone and press volume up to confirm unlock. Once done, disconnect the phone and remove the battery, wait 5 seconds and place the battery back.

    Step 4: Do readback again
    Once readback done, please extract these images inside your backup for later use:
    Code:
    sec1.img
    seccfg.img

    Step 5: Format all + Download to flash the firmware with original scatter file
    Switch to Download tab, and choose format all + download to flash the entire phone with the original scatter file named as "MT6761_Android_scatter.txt" - note there's no altunlock at the beginning of filename.
    Once flash complete, disconnect the phone.

    Step 6: Power on the phone and enable USB debugging, root the phone with MTK Easy SU
    [NOTE: DO NOT INSERT ANY SIM CARDS AND YOU MUST SKIP INTERNET CONNECTION]

    You can download the MTK Easy SU apk from here : https://github.com/JunioJsv/mtk-easy-su/releases/latest
    And Magisk APK from here : https://github.com/topjohnwu/magisk/releases/latest

    When you have both MTK Easy Su and Magisk APK installed, please enable the "Run as 64 Bits" option, and tap the hash (#) button to enable root.
    Once root complete, we can now re-enable bootloader unlock and restore IMEI.

    Step 7: Re-enable bootloader unlock and restore IMEI
    Please copy the 7 img files to your phone's internal storage:
    Code:
    nvcfg.img
    nvram.img
    proinfo.img
    protect1.img
    protect2.img
    sec1.img
    seccfg.img
    We assume you copied them to root directory of internal storage (a.k.a. /storage/emulated/0/ )

    Then execute these commands on your PC:
    Code:
    adb shell
    su
    dd if=/storage/emulated/0/nvcfg.img of=/dev/block/bootdevice/by-name/nvcfg
    dd if=/storage/emulated/0/nvram.img of=/dev/block/bootdevice/by-name/nvram
    dd if=/storage/emulated/0/proinfo.img of=/dev/block/bootdevice/by-name/proinfo
    dd if=/storage/emulated/0/protect1.img of=/dev/block/bootdevice/by-name/protect1
    dd if=/storage/emulated/0/protect2.img of=/dev/block/bootdevice/by-name/protect2
    dd if=/storage/emulated/0/sec1.img of=/dev/block/bootdevice/by-name/sec1
    dd if=/storage/emulated/0/seccfg.img of=/dev/block/bootdevice/by-name/seccfg

    When it's done, please perform factory reset to apply the NVRAM restoration.

    Please watch this video for entire procedure demonstration:

    That wraps up the entire procedure of bootloader unlock, and have fun for modding this device!

    Credits:
    Woke_World from triple-color company product community
    diplomatic for his MTK-SU Exploit and simplified utility called JunioJsv
    topjohnwu for MagiskSU
    3
    @areallydumbperson @VR25

    You may notice that this thread now is located at its own Nokia 2.2 forum.

    Along with this change, several other threads have been moved to this forum as well.

    Please report any thread outside this forum needs to be moved. Thank you very much and hope you enjoy the new place for Nokia 2.2. :D
    2
    TWRP 11 Bugfix:

    Fixed system refusing to mount (finally) thanks lopestorm :) ur fstab flie really helped me out
    bootloops from twrp.me is soon gonna be fixed hopefully i have made a pull request in their git
    more partitions should be able to be backed up (again thanks to lopestorm)