[Nothing Phone (2a)] pranayadmn:
CAUTION:

Your warranty may/may not become void depending on your region.

Do not attempt to re-lock the bootloader without flashing a clean version of Nothing OS factory images or full OTA first.

PREREQUISITES:

Latest version of Magisk Manager on your phone. [APK: topjohnwu/Magisk (GitHub)]

An init_boot image corresponding to your Nothing OS version and build date. [OTA archive: spike0en/Pacman_Archive (GitHub)]

A PC/Laptop with:

Latest version of Android SDK Platform-Tools. [Windows: platform-tools-latest-windows.zip] [Linux/Mac: Latest available version from native package manager]

Google USB Driver (for Windows only). [Windows: latest_usb_driver_windows.zip]

PROCEDURE:

I. Patching the init_boot image with Magisk

With the Magisk Manager app installed and the corresponding init_boot image being on the internal storage of your device, patch the image through Magisk by opening the app and choosing Install -> Select and Patch a File.

Once patched, copy the Magisk patched init_boot image from the Download folder of your phone's internal storage to your PC/Laptop.

II. Unlocking the bootloader

Unlock the Developer Options page and enable OEM unlocking and USB debugging options inside it.

Connect your phone to your PC/Laptop and open a command prompt in the same directory as that of the extracted platform-tools folder.

Execute the command below and allow ADB access through the prompt which pops up on your phone.

adb devices

Reboot the device to the bootloader by executing the command below:

adb reboot bootloader

Verify that your PC/Laptop detects your phone in bootloader mode using the command below:

fastboot devices

If it doesn't, install the Google USB Driver using Device Manager.

Finally, to unlock the bootloader, execute this command:

fastboot flashing unlock

Once prompted, press any of the volume buttons of your phone to unlock the bootloader.

III. Flashing the Magisk patched init_boot image

With the device in bootloader mode, check the current active slot of your phone by using:

fastboot getvar current-slot

For convenience, place the Magisk patched init_boot image inside the platform-tools folder. After that, use this command to flash it to the current active slot of your phone while replacing [slot] with the appropriate value in your case.

fastboot flash init_boot_[slot] magisk_patched-XXXXX_YYYYYY.img

Finally, reboot the device by using this command:

fastboot reboot

IV. Updating the device through OTA while retaining Magisk (risky, doesn't always work)

Open Magisk Manager and select Uninstall Magisk and then Restore Images.

Spoiler content hidden.

Do not reboot yet after this step.

Install the available OTA update through Settings but do not tap on Restart now.

Open Magisk Manager again and select Install -> Install to Inactive Slot (After OTA).

Go back to the System update page and select Restart now.

V. Re-locking the bootloader/restoring the device to factory state

Refer to spike0en/Pacman_Archive (GitHub) to install the Nothing OS factory images or full OTA packages.

After successfully installing and booting into Nothing OS once, reboot the device to bootloader mode and lock its bootloader by using the command below:

fastboot flashing lock

Once prompted, press any of the volume buttons of your phone to lock the bootloader.