Your device must be successfully rooted with the Magisk app.
Note: This method is highly device-specific and carries a higher risk of bricking your radio firmware. Risks and Considerations
The IMEI (International Mobile Equipment Identity) number is a unique identifier assigned to every mobile device. Changing the IMEI number can be useful for various reasons, such as privacy concerns, device identification issues, or to bypass certain network restrictions. Magisk, a popular rooting tool, provides a convenient way to modify the IMEI number. This paper explores the concept of changing IMEI with Magisk, its benefits, risks, and a step-by-step guide on how to do it.
If you need to change the IMEI at the partition level (to bypass a carrier block or fix a broken device), you often need to use PC-based tools in conjunction with Magisk.
Recovery and security