• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Module] NFC Screen Off

Search This thread

mbecroft

Member
Jul 11, 2011
29
7
Auckland
I did some reading. system_ext is a new thing introduced in Android 11, to help separate device-specific files from common components. system and system_ext are separate partitions.

On my phone (an Fxtec Pro1 with LineageOS 18), the NFC apk, NFC vendor C++ libs etc. are located in system_ext. The current NfcScreenOff installer is hard-coded to search only within /system/app to locate the NFC apk and associated files. For Android 11 support, this needs to be extended to also search /system_ext/app.

OP: are you willing to do this? If not, I will have a crack at it and, if I get it working, submit a PR. But it would be hugely appreciated if OP could make the change, as I'm not too familiar with the magisk install process.

Cheers -Mario
 

rodken

Senior Member
Jan 11, 2010
498
111
Google Pixel XL
OnePlus 8
I did some reading. system_ext is a new thing introduced in Android 11, to help separate device-specific files from common components. system and system_ext are separate partitions.

On my phone (an Fxtec Pro1 with LineageOS 18), the NFC apk, NFC vendor C++ libs etc. are located in system_ext. The current NfcScreenOff installer is hard-coded to search only within /system/app to locate the NFC apk and associated files. For Android 11 support, this needs to be extended to also search /system_ext/app.

OP: are you willing to do this? If not, I will have a crack at it and, if I get it working, submit a PR. But it would be hugely appreciated if OP could make the change, as I'm not too familiar with the magisk install process.

Cheers -Mario
I was wondering why the module kept failing to install on Android 11.
 
  • Like
Reactions: mbecroft

lapwat

Senior Member
Mar 4, 2015
91
28
Quelquepart
OnePlus 2
Redmi K20 Pro
Hi - module fails to install for me on LineageOS 18 at:

-- Searching for NFC app in /system/app/ folder...
! Installation failed

I had a look around and my NFC app seems to be located here:

/system/system_ext/app/NQNfcNci
/system/system_ext/app/NQNfcNci/NQNfcNci.apk
/system/system_ext/app/NQNfcNci/oat/arm64/NQNfcNci.vdex
/system/system_ext/app/NQNfcNci/oat/arm64/NQNfcNci.odex
/system/system_ext/app/NQNfcNci/lib/arm64/libsn100nfc_nci_jni.so

I am not sure what system_ext is or why my NFC app is located there instead of in /system/app where the module installer is searching.

Any help much appreciated!
Thank you for investigating, I've created a release especially for you :)
Give it a try

EDIT

First zip does not work (error 404). Second one neither. The third one has been tested and released as v0.3.2.
 

Attachments

  • NFCScreenOff-mbecroft-systemext-error404.zip
    326.1 KB · Views: 2
  • NFCScreenOff-system_ext-serviceerror.zip
    326.1 KB · Views: 6
  • NFCScreenOff-system_ext.zip
    326.1 KB · Views: 11
Last edited:

lapwat

Senior Member
Mar 4, 2015
91
28
Quelquepart
OnePlus 2
Redmi K20 Pro

dz.smilga

Member
Sep 12, 2012
12
2
Hello dear Dev, thanks for this amazing module.
Unfortunately, it is not working for me at all!
I install it from Magisk Modules section - NFC Screen Off v0.3.1
Google Pay works fine only when screen is on, and it works with sound!

* In attachment You wil find log file

* Device - Xiaomi POCO X3 NFC
* Rom - MIUI Global 12.0.7 stable (miui_SURYAIDGlobal_V12.0.7.0.QJGIDXM_58e1a55be4_10.0)
* Rooted - Magisk 23 / Check SafetyNet - SUCCESS!

Help me, how to make poco great again? :)
 

Attachments

  • magisk_log_2021-06-03T14.29.42Z.log
    31.9 KB · Views: 5

lapwat

Senior Member
Mar 4, 2015
91
28
Quelquepart
OnePlus 2
Redmi K20 Pro
Hello dear Dev, thanks for this amazing module.
Unfortunately, it is not working for me at all!
I install it from Magisk Modules section - NFC Screen Off v0.3.1
Google Pay works fine only when screen is on, and it works with sound!

* In attachment You wil find log file

* Device - Xiaomi POCO X3 NFC
* Rom - MIUI Global 12.0.7 stable (miui_SURYAIDGlobal_V12.0.7.0.QJGIDXM_58e1a55be4_10.0)
* Rooted - Magisk 23 / Check SafetyNet - SUCCESS!

Help me, how to make poco great again? :)
I am not sure I get what you want, Google Pay screen off feature was dropped a while ago. This module does work with NFC tags only (office badges, Bluetooth pairing devices, ...).
 

Tahsin Can

Senior Member
Jan 3, 2017
90
4
Xiaomi Poco X3 Pro
Poco X3 pro not installed. 12.5.2 Global Rom. Data mounted.
Screenshot_2021-07-03-01-05-56-995_com.topjohnwu.magisk.jpg
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    NFC Screen Off

    Read NFC tags when screen is off.
    Disable NFC tagging sound.
    Tap to pay when screen is off.

    ALWAYS include Magisk installation logs when posting an issue.

    Useful integrations: NFC Card Emulator Pro - Tasker
    Installation metrics: Grafana dashboard

    How does it work?

    The NFC app is patched during installation into a `modded` version. This `modded` version is injected at boot time by service.sh so that the phone thinks the screen is always on and unlocked.

    This patch only applies to NFC Service so it does not impact any other functionality of the phone that involves screen state detection.

    The `modded` app was generated using this method.

    Help section

    MY NFC IS NOT DETECTED ANYMORE

    If you did not unlock your device since last boot, unlock it and wait 30 seconds for the module to be loaded.

    After that time, if NFC does not start automatically or manually, it means that the patch does not work for your device. You can uninstall the module and create an issue.

    I AM STUCK IN A BOOTLOOP

    Remove the module manually.

    1. Boot into TWRP
    1. Advanced -> File Manager
    1. Delete /adb/modules/NFCScreenOff
    1. Reboot

    THE MODULE IS NOT WORKING SINCE LAST UPDATE

    Perform a clean reinstallation.

    1. Uninstall the module
    1. Reboot
    1. Install the module
    1. Reboot

    If it does not solve your problem, you can create an issue.

    I LIKE THE MODULE

    2
    @lapwat Hi, awesome module. It is not working for me since the path (and app name) for nfc app is system/app/NxpNfcNci/NxpNfcNci.apk

    Android 10.3.0
    Oneplus 6
    Stock ROM

    Edit:attach log

    Thanks for the logs. Can you send those files to me:
    • /system/app/NxpNfcNci/NxpNfcNci.apk
    • /system/framework/framework-res.apk

    I will do a version for people with NxpNfcNci app (I guess it is OnePlus customized NfcService).
    My stock Xiaomi ROM had a NQNfcNci app.
    2
    The thing is, since this is not the default, nobody would try to do it randomly until finding somebody with this module. It's a very low chance, but still dangerous. Taiping to the fingerprint sensor or unlocking in other preferred way should be more secure, plus it's not that hard to do it. This module only has use if you excessively use NFC tags, otherwise it's just nothing but creating security gaps for nothing.

    Thanks to the dev anyways.

    ---------- Post added at 05:06 AM ---------- Previous post was at 04:56 AM ----------



    Here you go, get the build props with this code in your install.sh:

    Code:
    my_grep_prop() {
      local REGEX="s/^$1=//p"
      shift
      local [email protected]
      [ -z "$FILES" ] && FILES='/system/build.prop /vendor/build.prop /product/build.prop'
      sed -n "$REGEX" $FILES 2>/dev/null | head -n 1
    }
    
    local MANUFACTURER="$(my_grep_prop 'ro\.product\.manufacturer')"
      local        MODEL="$(my_grep_prop 'ro\.product\.model'       )"
      local       DEVICE="$(my_grep_prop 'ro\.product\.device'      )"
      [ -z "$MANUFACTURER" ] && MANUFACTURER="$(my_grep_prop 'ro\.product\.vendor\.manufacturer')"
      [ -z "$MODEL"        ] &&        MODEL="$(my_grep_prop 'ro\.product\.vendor\.model'       )"
      [ -z "$DEVICE"       ] &&       DEVICE="$(my_grep_prop 'ro\.product\.vendor\.device'      )"

    That's exactly what I need it for. I set up all sorts of NFC triggered automations and tasks back in lollipop and have missed using them dearly. I have never used gpay so security is basically irrelevant, I've never heard of anyone trying to attack phones in the wild over NFC


    Until now, the module worked great. But the lastest update (0.0.3) causes bootloops for me.

    -> Googel Pixel 3xl on android 10 (build QQ1A.200105.003)

    Could you also please provide the zip file to version 0.0.2?

    I couldn't find v2 on his github but I had a backup I've attached
    1
    @lapwat Hi, awesome module. It is not working for me since the path (and app name) for nfc app is system/app/NxpNfcNci/NxpNfcNci.apk

    Android 10.3.0
    Oneplus 6
    Stock ROM

    Edit:attach log
    1
    Yep, that worked! Thanks!