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

Search This thread

areallydumbperson

Senior Member
nvcfg.img
nvram.img
proinfo.img
protect1.img
protect2.img

sec1.img
seccfg.img


Which tool does one use to extract those image files from the "read back" image on a GNU/Linux machine?

The first readback file:
ROM_0: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,0), end-CHS (0x0,0,0), startsector 1, 30310399 sectors, extended partition table (last)
open it in 7zip :)
 
  • Like
Reactions: VR25

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
Did anyone have success installing and running an Android 12 or 11 GSI? If so, I'd like to know which ones work and the optimal installation steps. So far, I had no luck (not booting).

Just got this device and realized the stock Android 11 ROM has major rough edges. Are the stock Android 10 and 9 ROMs any better?

Update
On Android 11 firmware base, only Google SGIs boot successfully.
This may be due to a secondary signature verification (something other than vbmeta).
 
Last edited:

Badzsa

Member
Mar 25, 2021
28
2
Did anyone have success installing and running an Android 12 or 11 GSI? If so, I'd like to know which ones work and the optimal installation steps. So far, I had no luck (not booting).

Just got this device and realized the stock Android 11 ROM has major rough edges. Are the stock Android 10 and 9 ROMs any better?

Update
On Android 11 firmware base, only Google SGIs boot successfully.
This may be due to a secondary signature verification (something other than vbmeta).
stock android 9 and 10 are far way better , but if you downgrade to android 9 or 10, after a week nokia will force you to upgrade android 11 "again" , and you cannot hide it or disable it ..
 

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
GSI Installation Steps

1. Install Android 11 firmware base. While 10 might work as well, I haven't tested it. Android 9 firmware did not work for me, but it's been a while since the last time I tested (might work with latest GSI's).

2. Flash an ARM64 A/B VNDKLITE GSI variant, with fastboot, TWRP or terminal (cat, dd, etc.).
fastboot flash system system-squeak-arm64-ab-vndklite-floss-secure.img

3. Factory reset with one of these three methods:
- Stock recovery (recommended);
- fastboot -w;
- TWRP's "format data" option.

Notes
- I assume everyone already knows how to unlock the bootloader, root, and flash vbmeta.
- Only secure VNDKLITE flavors are booting.
 
Last edited:

areallydumbperson

Senior Member
It turns out non-Google GSIs (Android 10-12) fail to boot due to userdata encryption.

Magisk cannot disable encryption on Nokia 2.2.

One must patch /vendor/etc/fstab.* and then format userdata to get rid of encryption.

I did it and wrote a script to automate the patching.
I'm now running the latest PHH GSI (Android 12).

Steps (follow at your own risk!)

0. Backup the active slot vendor (optional).
# mount | awk '/ \/vendor /{print $1}' | xargs cat > /sdcard/vendor.img

1. Extract the attached zip, run su -c sh /path/to/disable_encryption.sh and follow the instructions.
For some reason, I had to repeat the patching several times (rebooting in between) for the change to stick.
Do NOT proceed until the change persists AFTER rebooting.
The script is aware of this and guides through the process.

2. fastboot --disable-verity --disable-verification flash vbmeta /path/to/stock-vbmeta/image
or
fastboot flash vbmeta /patched/vbmeta/image (from Google)

3. fastboot flash system /path/to/GSI

4. fastboot format userdata (more reliable than erase and -w)

5. fastboot reboot

Note: I'm on the latest firmware base (Android 11, November 2021 security patch), but the patching should work even for those who are on Android 10.
oh so thats why they fail to boot? tysm :)
 

areallydumbperson

Senior Member
It turns out non-Google GSIs (Android 10-12) fail to boot due to userdata encryption.

Magisk cannot disable encryption on Nokia 2.2.

One must patch /vendor/etc/fstab.* and then format userdata to get rid of encryption.

I did it and wrote a script to automate the patching.
I'm now running the latest PHH GSI (Android 12).

Steps (follow at your own risk!)

0. Backup the active slot vendor (optional).
# mount | awk '/ \/vendor /{print $1}' | xargs cat > /sdcard/vendor.img

1. Extract the attached zip, run su -c sh /path/to/disable_encryption.sh and follow the instructions.
For some reason, I had to repeat the patching several times (rebooting in between) for the change to stick.
Do NOT proceed until the change persists AFTER rebooting.
The script is aware of this and guides through the process.

2. fastboot --disable-verity --disable-verification flash vbmeta /path/to/stock-vbmeta/image
or
fastboot flash vbmeta /patched/vbmeta/image (from Google)

3. fastboot flash system /path/to/GSI

4. fastboot format userdata (more reliable than erase and -w)

5. fastboot reboot

Note: I'm on the latest firmware base (Android 11, November 2021 security patch), but the patching should work even for those who are on Android 10.
can confirm this patch works :) andy yan's lineage os 18 gsi successfully boots
 

areallydumbperson

Senior Member
note: i had trouble installing gapps in twrp heres a solution

note 2: u can do this in twrp terminal but its gonna be harder

connect your phone in recovery to pc

now run adb shell

and paste this command below

e2fsck -f /dev/block/platform/bootdevice/by-name/system_b && resize2fs /dev/block/platform/bootdevice/by-name/system_b

now you can sideload opengapps without any trouble :D
 

Badzsa

Member
Mar 25, 2021
28
2
It turns out non-Google GSIs (Android 10-12) fail to boot due to userdata encryption.

Magisk cannot disable encryption on Nokia 2.2.

One must patch /vendor/etc/fstab.* and then format userdata to get rid of encryption.

I did it and wrote a script to automate the patching.
I'm now running the latest PHH GSI (Android 12).

Steps (follow at your own risk!)

0. Backup the active slot vendor (optional).
# mount | awk '/ \/vendor /{print $1}' | xargs cat > /sdcard/vendor.img

1. Extract the attached zip, run su -c sh /path/to/disable_encryption.sh and follow the instructions.
For some reason, I had to repeat the patching several times (rebooting in between) for the change to stick.
Do NOT proceed until the change persists AFTER rebooting.
The script is aware of this and guides through the process.

2. fastboot --disable-verity --disable-verification flash vbmeta /path/to/stock-vbmeta/image
or
fastboot flash vbmeta /patched/vbmeta/image (from Google)

3. fastboot flash system /path/to/GSI

4. fastboot format userdata (more reliable than erase and -w)

5. fastboot reboot

Note: I'm on the latest firmware base (Android 11, November 2021 security patch), but the patching should work even for those who are on Android 10.
1. Extract the attached zip, run su -c sh /path/to/disable_encryption.sh and follow the instructions.
- you mean : run super user ?
 

areallydumbperson

Senior Member
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)
 

Attachments

  • TWRP-11-Bug-Fix.img
    27.5 MB · Views: 14
  • Like
Reactions: AAditya846 and VR25

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
hey guys im planning to build another custom recovery for this phone which recovery should i build :)
I like to thinker with as much stuff as possible, but there's no specific recovery name in my mind right now. The more complete it feels (feature-wise) the better.

Speaking of completeness, the process of creating dedicated forums for Nokia 2.2 has begun!
To speed it up, I'd like you guys to share with me all XDA links to Nokia 2.2 topics.
I don't have much free time right now to find them myself.
Once I have most links, I'll forward the information to admins.
 
Last edited:

areallydumbperson

Senior Member
I like to thinker with as much stuff as possible, but there's no specific recovery name in my mind right now. The more complete it feels (feature-wise) the better.

Speaking of completeness, the process of creating dedicated forums for Nokia 2.2 has begun!
To speed it up, I'd like you guys to share with me all XDA links to Nokia 2.2 topics.
I don't have much free time right now to find them myself.
Once I have most links, I'll forward the information to admins.
all the major stuff is all here LOL but yeah sure ill find some links
 

jerryhou85

Forum Moderator
Staff member
@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
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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



    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
    hi.guys

    1. i download driver but i dont know install x86 or x64 which i install??

    2. if i do readback like this video tutorial its ok???

    3. if i keep the dump.img file after readback and my phone be bootlooped after readback...can i return my phone with dump.img file or not??

    4. for the step 5 i must press any button??

    5. in step 7 he open adb himself??? or its come automatically?

    sorry im not dev😁
  • 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)