Boot into your custom recovery (TWRP), navigate to the file manager, and delete the offending module folder from /data/adb/modules/ .
IMEI Repair Magisk Verified: A Detailed Guide to Fixing Invalid IMEI
Because hardware architectures differ, the repair methodology depends on your device's chipset. The primary objective is to input your device's original, legal IMEI (found on the retail box or phone back cover). Method A: Qualcomm Snapdragon Devices (Diag Mode)
Magisk root is used to force-enable the "Qualcomm Diag Port" via a terminal command ( setprop sys.usb.config diag,adb ). Once enabled, PC-based software interacts with the modem to restore a backed-up QCN file containing the device's original parameters. 3. Samsung Devices (Exynos/Snapdragon) imei repair magisk verified
Samsung handles network security through the EFS partition and a security layer called Knox.
Open the Magisk app, navigate to the tab, and select Install from storage .
Repairing or changing an IMEI is often necessary if the number becomes "Invalid" or "Null" due to corrupted NVRAM/Secro partitions Boot into your custom recovery (TWRP), navigate to
Are you trying to after a custom ROM flash, or are you trying to pass Magisk verification after a repair has already been done?
With Magisk root enabled, a terminal emulator app can execute commands to write the original IMEI directly to the modem configuration files, or specialized PC software can inject the data via a USB diagnostic port. 2. Qualcomm Snapdragon Devices
Your device bootloader must be unlocked to allow Magisk flashing and low-level partition writes. Note that unlocking wipes all user data. Method A: Qualcomm Snapdragon Devices (Diag Mode) Magisk
It does not modify the /system or /vendor partitions directly. This makes it safer and easier to reverse.
Once your IMEI is successfully restored and your phone reads the SIM card again, you need to ensure Magisk is properly configured. If apps detect root or a modified device, your "repair" isn't fully usable.
Source: Rao, S. S., et al. "IMEI Repair using Magisk: A Study on Android Devices." Journal of Mobile and Embedded Systems 14.2 (2022): 147-155.