NFC Xiaomi with unlocked bootloader: how to use without errors

Unlocking the bootloader on Xiaomi smartphones opens up access to advanced customization capabilities, but often leads to problems with work NFC-Users experience payment errors, unstable tag reading or a complete chip failure, and the reason is to change the system partitions that are responsible for the security of payment transactions and device identification.

In this article, we will explain why. NFC It stops working after unlocking the bootloader on 90% of Xiaomi models with a chip NXP, How to diagnose a problem and return functionality without losing data. MIUI, custom firmware (LineageOS, Pixel Experience) and modified versions like MIUI EU or xiaomi.eu.

You will know which system files are responsible for NFC, How to get around the limitations of Google Pay and Mi Pay, and what alternative ways to use the chip remain available even with an unlocked bootloader.The instructions are relevant for models from the Redmi Note 10 Pro to Xiaomi 13 Ultra, but the principles apply to the entire line of smartphones of the brand.

Why? NFC breaks down after unlocking the loader

The main cause of non-working NFC on Xiaomi after unlocking - violation of the chain of trust between hardware keys (sewn into the chip) and the software environment:

  • πŸ”‘ DRM-keys (widevine) L1 β†’ L3, what NFC-authentication)
  • πŸ“± Unique device identifiers in the section /persist
  • πŸ”„ System Application Signatures (including com.android.nfc)
  • πŸ›‘οΈ Secure Element (Virtual Element) SIM payment)

As a result, Google Pay and banking applications no longer recognize the device as secure, and the device itself is not safe. NFC-module:

  • ❌ Do not turn on at all (grey switch in settings)
  • ⚠️ Work only for reading tags, not for payments
  • πŸ”„ Disconnect spontaneously after restarting

⚠️ Note: On models with a chip NXP PN80T (for example, Xiaomi 12T, Redmi K50 Pro) after release NFC This may require reflashing modem and nvram partitions, without which the chip will be defined as an "unknown device" in #4636##.

πŸ“Š Your Xiaomi model supports your NFC?
Yeah, and it worked before unlocking.
Yeah, but it stopped working after unlocking.
No, not in my model. NFC
I don't know how to check.

How to check if it works NFC on unlocked Xiaomi

Before you try to fix it. NFC, Make sure the problem really exists. Use these diagnostic techniques:

  1. Visual Check: Go to Settings β†’ Connected devices β†’ NFC. If the switch is gray and inactive, the module is disabled at the system level. If the switch is present, but when it is turned on, it gives an error, the driver problem is the driver.
  2. Testing through the Engineering Menu: Enter ##4636##, Choose Phone Information β†’ scroll to the block NFC. If there is no status or written N/A β€” chip is not initialized.
  3. Tag Reading: Install the App NFC Tools from Google Play. Try reading any label (like a transport card or sticker) If the app doesn't see the chip, it's hardware or kernel-level.
Symptoms.Probable causeDecision
NFC switch grayThere is no libnfc-nci driver in the /vendorReflash the vendor partition or install the Magisk module
NFC It's on, but it doesn't see the mark.Config damaged. /vendor/nfc/libnfc-brcm.confRestore the file from the stock firmware
Google Pay says "Device not certified"SafetyNet certification keys droppedPatch through Magisk + Universal SafetyNet Fix

πŸ’‘

If NFC It only works after restarting, but it is shut down through 5-10 minutes – check the energy saving settings for the com.android.nfc application in Settings β†’ Battery β†’ Optimize. Add it to the exceptions.

Recovery NFC stock-stock MIUI post-unlock

If you are using the official MIUI (even global or Chinese, but with unlocked bootloader, return NFC You can do it without changing the firmware. The key is not to erase the persist partition when you unlock it.

Step-by-step:

Install the latest version MIUI via Fastboot|Download the archive with drivers NFC for your model|Switch vendor and odm through fastboot flash|Install Magisk and Module NFC Fix for MIUI|Reboot the phone and check the chip-->

Detailing the steps:

  1. Update MIUI: Download the latest fastboot firmware for your model from the Xiaomi Firmware Updater website. Unpack it and run it through the command: fastboot flash system system.img fastboot flash vendor vendor.img Don't use fastboot. -w, so as not to erase!
  2. Driver Recovery: For models with a chip NXP (Most of the flagships download the archive nfc_fix_[model].zip from the forum 4PDA. Squeeze it through. TWRP or unpack and manually copy the files to /vendor/lib/hw and /vendor/etc.
  3. SafetyNet Patch: Install Magisk, then Universal SafetyNet Fix (to pass certification) MIUI NFC Enabler (if the chip is not switched on)

After installation, run the command in Terminal:

su


setenforce 0

⚠️ Attention: On Xiaomi 11T Pro and 12 Pro after firmware vendor may disappear IMEI. Before the procedure, make a backup of the nvram partition through TWRP or the dd if command=/dev/block/bootdevice/by-name/nvram of=/sdcard/nvram.img.

NFC on custom firmware (LineageOS, Pixel Experience, AOSP)

With custom firmware, the situation is more complicated: NFC It often doesn't work out of the box because of the lack of proprietary Xiaomi drivers:

Method 1: Installation of proprietary libraries

Download the archive. vendor_xiaomi_[model].img from the LineageOS repository or 4PDA. Fly it through fastboot:

fastboot flash vendor vendor_xiaomi.img

Then install the Magisk module. NFC Fix for AOSP, which contains patched libnfc-nci.so and android.hardware.nfc@1.2-service.

Method 2: Manual copying of configs

If NFC turns on, but does not see the tag, copy these files from the stock firmware to /vendor/etc:

  • libnfc-brcm.conf (for Broadcom chips)
  • libnfc-nxp.conf (for chips) NXP)
  • nfc_config.xml (antennae)

The file rights must be 644 (owner: root:root).

FirmwareSupported chip NFCAction required
LineageOS 20NXP PN80T, Broadcom BCM2079xSwitch to a vendor + module NFC Fix
Pixel Experience 13Only NXP (Broadcom is not supported)Replace libnfc-nci.so from MIUI 13
crDroid 8.xAny chips.Install NFC Enabler from Magisk
Why not? AOSP-firmware NFC It's worse than the MIUI?
On the stock. MIUI driver NFC optimized for a specific chip and antenna of the device. AOSP Universal drivers are used from CAF (CodeAurora Forum, which does not take into account the hardware implementation of Xiaomi, for example, in the Redmi Note 11 Pro+ antenna NFC is located closer to the upper part of the body, and the universal driver expects a signal from the center - this reduces the reading range of the device. 30-40%.

Google Pay and Mi Pay restrictions

Even if NFC It's a real-time business, and banking apps can block payments because of an unlocked bootloader:

For Google Pay:

  1. Install Magisk and modules: Universal SafetyNet Fix (version 2.3.1 or later) MagiskHide Props Config

MagiskHide Props Config

Edit device fingerprint


β†’ Select a certified device (e.g., Pixel 6)




β†’ Apply the changes and reboot

SafetyNet

YASNAC

ctsProfile: true

For Mi Pay (China/Russia):

Mi Pay checks partition integrity /product. To cheat the test:

  1. Download Mi Pay Fix for Unlocked Bootloader from GitHub.
  2. Install it through Magisk and execute the command: su chmod 644 /product/etc/build.prop echo "ro.boot.verifiedbootstate=orange" >> /product/etc/build.prop
  3. Clear the Mi Pay data and reboot.

Example of automation settings:

Install Tasker. + NFC Tasks, create a task:

  1. Add the trigger. NFC Tag Scanned.
  2. Select the Wi-Fi action β†’ Set On.
  3. Attach the task to a tag (for example, a sticker on the desktop).

Now, when you touch your phone, Wi-Fi will automatically turn on.

πŸ“Š What an alternative scenario NFC You're using it?
Automation of tasks (tags)
Transport maps
Emulation of keys/pauses
File transfer
I don't use it.

Frequent mistakes and their solutions

Let’s look at the typical problems and ways to solve them:

Mistake.Reason.Decision
"NFC antenna not connected"Antenna contact or driver is damaged pn54x_i2cTake the phone apart and check the plume, run the vendor out of stock firmware.
Google Pay: β€œI couldn’t add a map”Reset HardwareBacked KeystoreInstall Keystore Fix and reset Google Play Services data.
NFC only works after restartingcom.android.nfc is being killed by the systemAdd batteries to exceptions and install module NFC Always On.
"Device not certified" in Mi PayThere's no file. /product/etc/security/otacerts.zipCopy a file from stock firmware or use Mi Pay Fix.

If nothing helps:

  • Check the log. NFC via adb logcat | grep -i nfc. Look for errors of the kind E/NfcService: Failed to initialize NFC hardware.
  • In some models (for example, POCO F3) You need to run modem and nvram from MIUI 12.5, even if it's worth it MIUI 14.
  • For Broadcom chips (meet at Redmi) 9T, POCO M3) may require a patch BCM4375B2 via Hex editor.

FAQ: Frequent questions on NFC on unlocked Xiaomi

Can the original be returned? DRM-keys after unlocking?
No, the original Widevine keys. L1 and NFC Secure Elements are reset irrevocably when unlocked, but they can be emulated through Magisk modules (such as DrmFix), but this does not guarantee 100% payment efficiency.
Why? NFC It works in the subway but doesn’t work on Google Pay?
Transport cards (e.g. Troika) use protocol ISO 14443 Type A, which does not require a device certification, and Google Pay works through Host Card Emulation (HCE), Checks SafetyNet and Integrity /system.
How to check which NFC chip is installed in my Xiaomi?
Install the app AIDA64 and go to the Network section β†’ NFC. Chipset Field. NFC The manufacturer will be specified (for example, NXP PN80T or Broadcom BCM20797). Alternatively, enter in Terminal: su cat /proc/nfc_version
Will it work? NFC post-flashing MIUI China?
Yes, but with reservations: MIUI China has Google Play Services shut down by default, so Google Pay won't work without manual installation. Mi Pay will work, but it will require a Chinese bank card to be tied (it's useless for Russia.
Can I use it? NFC Payments via SberPay on unlocked Xiaomi?
SberPay is less strict than Google Pay. It works by: Pass the basic SafetyNet certification (basicIntegrity: true). Install the latest version of the SberBank Online app. Add a card through the Payments menu. β†’ SberPay.Important: Some firmware (like LineageOS) may require manual installation of SberPay APK supportive HCE.