As /e/OS is based on LineageOS, I’ve decided to test if NFC works on the latter. Installed latest nightly build of LOS (20.0-20230214 to be precise), and it works! Gathered the logs exactly the same way in same circumstances (boot and run NFC Tool):
OnePlus9Pro:/ $ logcat -d *:W | grep -i nfc
01-08 18:53:27.950 239 239 E qcom,sn-nci 5-0028: error reading NFC VDDIO min and max value
01-08 18:53:27.950 239 239 E qcom,sn-nci 5-0028: error reading NFC current value
01-08 18:53:27.950 239 239 E nfc_ldo_config: regulator entry not present
03-02 11:01:39.634 1640 1640 E PackageManager: Package com.android.nfc was user id 0 but is now user SharedUserSetting{9950172 android.uid.nfc/1027} with id 1027; I am not changing its files so it will probably fail!
03-02 11:01:56.215 3531 3812 W libnfc_nci: [WARNING:gki_ulinux.cc(98)] gki_task task_id=0 terminating
03-02 11:01:56.256 3841 3841 E nfc_i2c_dev_write: failed to write -107
03-02 11:01:57.530 3841 3841 E nfc_i2c_dev_write: failed to write -107
03-02 11:01:57.558 1054 1054 E NxpFwDnld: phDnldNfc_SetDlRspTimeout timeout value =9c4
03-02 11:01:57.580 3531 3813 W libnfc_nci: [WARNING:nfc_ncif.cc(1665)] reset notification!!:0x2
03-02 11:01:57.615 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.615 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.631 1054 1054 E android.hardware.nfc_snxxx@1.2-service: failed to get requested memory address
03-02 11:01:57.631 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.643 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.643 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.844 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.844 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: resetModified Unable to open file for writing
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: isModified Unable to open file assume modified
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: resetModified Unable to open file for writing
03-02 11:01:57.888 1054 1054 E android.hardware.nfc_snxxx@1.2-service: resetModified Unable to open file for writing
03-02 11:01:57.931 3531 3813 W libnfc_nci: [WARNING:nfa_ee_act.cc(2173)] nfa_ee_nci_mode_set_rsp p_rsp->status:0x03
03-02 11:01:57.940 3531 3813 W libnfc_nci: [WARNING:nfa_ee_act.cc(2173)] nfa_ee_nci_mode_set_rsp p_rsp->status:0x03
03-02 11:01:57.953 3531 3813 W libnfc_nci: [WARNING:nfa_ee_act.cc(2173)] nfa_ee_nci_mode_set_rsp p_rsp->status:0x00
03-02 11:01:57.966 3531 3813 W libnfc_nci: [WARNING:HciEventManager.cpp(152)] Incorrect Pipe Id
03-02 11:02:35.014 1640 2520 W InputManager-JNI: Input channel object '90105ab Splash Screen com.wakdev.wdnfc (client)' was disposed without first being removed with the input manager!
At the time of this log collection there are no error messages about missing config files, but they were there during first boot after LineageOS install. I’ve installed Magisk and checked for the files and there were none of them on filesystems. I’ve checked for any NFC-related .conf file just in case:
OnePlus9Pro:/ # find / -name *nfc*.conf 2>/dev/null
/dev/kuB6/.magisk/mirror/vendor/etc/libnfc-nxp.conf
/dev/kuB6/.magisk/mirror/vendor/etc/libnfc-nci.conf
/system/etc/libnfc-nci.conf
/vendor/etc/libnfc-nxp.conf
/vendor/etc/libnfc-nci.conf
Then I reinstalled /e/OS and did the same:
OnePlus9Pro:/ # find / -name *nfc*.conf 2>/dev/null
/vendor/etc/libnfc-mtp-SN100.conf
/vendor/etc/libnfc-nci.conf
/dev/9QXzkx/.magisk/mirror/vendor/etc/libnfc-mtp-SN100.conf
/dev/9QXzkx/.magisk/mirror/vendor/etc/libnfc-nci.conf
/system/etc/libnfc-nci.conf
Then I copied and pasted contents of all these files from both /e/OS and LineageOS (reinstalled it again) to my laptop to compare, and it appeared that they are identical, except this snippet in /system/etc/libnfc-nci.conf
on LOS:
###############################################################################
# NCI_RESET_TYPE options
# Default 0x00, reset configurations everytime.
# 0x01, reset configurations only once every boot.
# 0x02, keep configurations.
NCI_RESET_TYPE=0x00
So I reinstalled /e/OS again, installed Magisk and did this in adb shell
:
su
mount -o remount,rw /vendor
cp /vendor/etc/libnfc-mtp-SN100.conf /vendor/etc/libnfc-nxp.conf
mount -o remount,ro /vendor
Rebooted the device, activated NFC Tools app, put my NFC token to NFC module, and it seemed to work!
But:
- the app didn’t recognize all technologies supported by token, just as in mentioned issue, so actual app which I need doesn’t work. Tested with another token and another app — same thing, well, as explected;
- NFC module re-reads the token permanently while it’s near the module: in LOS token reading was accompanied by single “blam” and now in /e/OS it’s like “blam-blam-blam…”
I thought I could fix it with missing snippet in /system/etc/libnfc-nci.conf
, but it couldn’t be done straightforward (got to QUALCOMM CrashDump Mode) and didn’t actually help.
Guess that’s all I can do so far. Need assistance of more qualified person.