Giter VIP home page Giter VIP logo

nfclockscreenoffenabler's Introduction

Enable NFC on lockscreen or screen off

An Xposed modification that lets you select whether NFC is active on the lockscreen or when the screen is off, as opposed to Android's default of only allowing it to be on when your phone is unlocked and the screen on.

Licensed under the GPL v3, but if included in a project, proper credit to qwerty12 is expected.

Contributors:

  • qwerty12 (Main developer of module)
  • madfish73 (Tag lost support)
  • MohammadAG (NFC Unlocking, overall improvement of module)

Building

This module makes use of the open source library ListViewAnimations. To build an APK, you need to include the library in the build path.

ListViewAnimations: https://github.com/nhaarman/ListViewAnimations

nfclockscreenoffenabler's People

Contributors

alienyd avatar etatto avatar liveasx avatar mohammadag avatar ns130291 avatar qwerty12 avatar shantanugoel avatar sleavitt avatar vrthe1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nfclockscreenoffenabler's Issues

Doesn't work (Errors in ADB Logcat)

When turning screen on/off or when scanning an NFC tag I get these errors in adb logcat:

I/PowerManagerService(  786): Waking up from sleep (uid 1000)...
V/KeyguardServiceDelegate(  786): onScreenTurnedOn(showListener = com.android.internal.policy.impl.PhoneWindowManager$2@2930f77d)
I/DisplayPowerController(  786): Blocking screen on until initial contents have been drawn.
V/KeyguardServiceDelegate(  786): **** SHOWN CALLED ****
D/audio_hw_primary(  188): adev_set_parameters: enter: screen_state=on
E/WifiStateMachine(  786): cancelDelayedScan -> 82
E/Xposed  ( 1239): java.lang.NoSuchMethodError: com.android.nfc.NfcService#checkScreenState()#bestmatch
E/Xposed  ( 1239):  at de.robv.android.xposed.XposedHelpers.findMethodBestMatch(XposedHelpers.java:235)
E/Xposed  ( 1239):  at de.robv.android.xposed.XposedHelpers.findMethodBestMatch(XposedHelpers.java:286)
E/Xposed  ( 1239):  at de.robv.android.xposed.XposedHelpers.callMethod(XposedHelpers.java:949)
E/Xposed  ( 1239):  at pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnabler$6.beforeHookedMethod(NFCLockScreenOffEnabler.java:397)
E/Xposed  ( 1239):  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:664)
E/Xposed  ( 1239):  at com.android.nfc.NfcService.applyRouting(Unknown Source)
E/Xposed  ( 1239):  at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1955)
E/Xposed  ( 1239):  at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1942)
E/Xposed  ( 1239):  at android.os.AsyncTask$2.call(AsyncTask.java:292)
E/Xposed  ( 1239):  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/Xposed  ( 1239):  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E/Xposed  ( 1239):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/Xposed  ( 1239):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/Xposed  ( 1239):  at java.lang.Thread.run(Thread.java:818)
D/BrcmNfcJni( 1239): RoutingManager::nfaEeCallback: NFA_EE_SET_TECH_CFG_EVT; status=0x0
E/native  (  786): do suspend false
D/BrcmNfcJni( 1239): RoutingManager::nfaEeCallback: NFA_EE_SET_PROTO_CFG_EVT; status=0x0
D/BrcmNfcJni( 1239): RoutingManager::commitRouting
D/ScreenOnOffReceiver( 1956): Received intent: Intent { act=android.intent.action.SCREEN_ON flg=0x50000010 }.
D/BrcmNfcJni( 1239): RoutingManager::nfaEeCallback: NFA_EE_UPDATED_EVT
I/DisplayPowerController(  786): Unblocked screen on after 110 ms
E/ANDR-PERF-LOCK( 2545): Failed to reset optimization for resource: 4 level: 0
W/System.err( 1239): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
W/System.err( 1239):    at pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnabler$6.afterHookedMethod(NFCLockScreenOffEnabler.java:429)
W/System.err( 1239):    at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:698)
W/System.err( 1239):    at com.android.nfc.NfcService.applyRouting(Unknown Source)
W/System.err( 1239):    at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1955)
W/System.err( 1239):    at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1942)
W/System.err( 1239):    at android.os.AsyncTask$2.call(AsyncTask.java:292)
W/System.err( 1239):    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err( 1239):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
W/System.err( 1239):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err( 1239):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err( 1239):    at java.lang.Thread.run(Thread.java:818)
I/DisplayManagerService(  786): Display device changed: DisplayDeviceInfo{"Built-in Screen": uniqueId="local:0", 1080 x 1920, 60.0 fps, supportedRefreshRates [60.0], density 480, 442.451 x 443.345 dpi, appVsyncOff 7500000, presDeadline 12666667, touch INTERNAL, rotation 0, type BUILT_IN, state ON, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
V/ActivityManager(  786): Display changed displayId=0
D/SurfaceFlinger(  174): Set power mode=2, type=0 flinger=0xb6482000
D/qdhwcomposer(  174): hwc_blank: Unblanking display: 0
D/qdhwcomposer(  174): hwc_blank: Done unblanking display: 0
D/SurfaceControl(  786): Excessive delay in setPowerMode(): 240ms
E/WifiStateMachine(  786): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.00 rxSuccessRate=0.00 targetRoamBSSID=78:24:af:90:e9:b0 RSSI=-44
D/WifiService(  786): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@2d670091}
E/WifiStateMachine(  786): WifiStateMachine CMD_START_SCAN source 10009 txSuccessRate=0.00 rxSuccessRate=0.00 targetRoamBSSID=78:24:af:90:e9:b0 RSSI=-44
D/WifiService(  786): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@2d670091}
I/GCoreUlr( 1956): Successfully inserted location
I/GCoreUlr( 1956): Not calling LocationReporter, hasMoved: true, elapsed millis: 435324, request: Moving(600000)

This is what I assume is causing NFC tags to not work when the screen is off/locked.

Nothing is printed in adb logcat when attempting to scan a tag while the screen is off/locked

NFC tag behavior in comparison to a RFID tag (MIFARE 1K)

Hello,

I have two wristbands, a MIFARE 1K wristband and a NTAG203 wristband. When using the MIFARE wristband it will unlock my phone and return to the current open application. When using my NTAG203 the device will unlock but will return to my launcher regardless of the open application. Is there any way to bypass this, or change this in the software. Sorry if this totally out of place.

Module doesn't work with LG G2

error:
java.lang.NoSuchMethodError: com.android.nfc.LNfcService#onRemoteEndpointDiscovered(com.android.nfc.DeviceHost.TagEndpoint)#exact
at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:179)
at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:129)
at pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnabler.handleLoadPackage(NFCLockScreenOffEnabler.java:448)
at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:20)
at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:34)
at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:70)
at de.robv.android.xposed.XposedBridge$1.beforeHookedMethod(XposedBridge.java:208)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:611)
at android.app.ActivityThread.handleBindApplication(Native Method)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1260)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5105)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)

Module doesn't work with LG G3

Hi there,

I've installed the module on my G3 and it doesn't appear to work.

I've tried enabling, disabling, restarting the phone etc. nothing seems to get it to work.

It did initially work once just after installing / enabling the module (both times I installed it) but after that it stops working.

Currently using it to enable BT, which does work when the screen is on and unlocked, but not locked or off completely (I have it set to work with the screen off).

Any help would be appreciated.

Doesn't work on Nexus 4 with CM13

I have a Google Nexus 4 with CM13 installed.
Android version 6.0.1

I want to unlock my phone when the screen is turned off. I specified a tag under authorized tags. This is the log output when I lock the screen:
log.txt

I think the important stuff is:

04-01 20:35:59.639   938  3204 E Xposed  : java.lang.NoSuchMethodError: com.android.nfc.NfcService#checkScreenState()#bestmatch
04-01 20:35:59.639   938  3204 E Xposed  :      at de.robv.android.xposed.XposedHelpers.findMethodBestMatch(XposedHelpers.java:223)
04-01 20:35:59.639   938  3204 E Xposed  :      at de.robv.android.xposed.XposedHelpers.findMethodBestMatch(XposedHelpers.java:274)
04-01 20:35:59.639   938  3204 E Xposed  :      at de.robv.android.xposed.XposedHelpers.callMethod(XposedHelpers.java:932)
04-01 20:35:59.639   938  3204 E Xposed  :      at pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnabler$6.beforeHookedMethod(NFCLockScreenOffEnabler.java:397)
04-01 20:35:59.639   938  3204 E Xposed  :      at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:661)
04-01 20:35:59.639   938  3204 E Xposed  :      at com.android.nfc.NfcService.applyRouting(<Xposed>)
04-01 20:35:59.639   938  3204 E Xposed  :      at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1971)
04-01 20:35:59.639   938  3204 E Xposed  :      at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1960)
04-01 20:35:59.639   938  3204 E Xposed  :      at android.os.AsyncTask$2.call(AsyncTask.java:295)
04-01 20:35:59.639   938  3204 E Xposed  :      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-01 20:35:59.639   938  3204 E Xposed  :      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
04-01 20:35:59.639   938  3204 E Xposed  :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
04-01 20:35:59.639   938  3204 E Xposed  :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
04-01 20:35:59.639   938  3204 E Xposed  :      at java.lang.Thread.run(Thread.java:818)
04-01 20:35:59.663   938  3204 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
04-01 20:35:59.663   938  3204 W System.err:    at pk.qwerty12.nfclockscreenoffenabler.NFCLockScreenOffEnabler$6.afterHookedMethod(NFCLockScreenOffEnabler.java:429)
04-01 20:35:59.663   938  3204 W System.err:    at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:695)
04-01 20:35:59.664   938  3204 W System.err:    at com.android.nfc.NfcService.applyRouting(<Xposed>)
04-01 20:35:59.664   938  3204 W System.err:    at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1971)
04-01 20:35:59.664   938  3204 W System.err:    at com.android.nfc.NfcService$ApplyRoutingTask.doInBackground(NfcService.java:1960)
04-01 20:35:59.664   938  3204 W System.err:    at android.os.AsyncTask$2.call(AsyncTask.java:295)
04-01 20:35:59.664   938  3204 W System.err:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-01 20:35:59.664   938  3204 W System.err:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
04-01 20:35:59.664   938  3204 W System.err:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
04-01 20:35:59.664   938  3204 W System.err:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
04-01 20:35:59.664   938  3204 W System.err:    at java.lang.Thread.run(Thread.java:818)

Hope you can fix it ;)

NFC Tag blocking features

It would be nice to have this block NFC reading for all tags but ones authorized when the lock screen is locked. This is for security as if you have NFC on, then it's a possibility for someone to scan a NFC card which goes and sends a tweet you don't want or something.

It would also be nice if it blocked ones that are in the list from popping up the choose what to do screen after unlocking because I always have to dismiss it.

I'll see if I can compile code this weekend and see if I can figure out how to implement these things, but if other developers wish to help, that would be great.

Doesn't work on Galaxy Note 4 / CyanogenMod

My device:
UK Samsung Galaxy Note 4
Android 5.1.1, CyanogenMod 12.1

Xposed Framework:
framework 79 installed and active
NFC LockScreenOffEnabler 1.9.7.7

Symptoms
After installing framework by flashing in recovery, booting the phone, installing the framework app, installing NFCLockScreenOffEnabler, setting up for "Enable NFC when screen is off" and rebooting to enable changes, the device does not respond to any NFC when the screen is off. Tried the "screen on but locked" setting, but this also does not work.

I have not yet verified that the framework is operating properly, other than to confirm that the status is "Xposed framework version 79 is active". I need to find a small module I can download and confirm working so that I can rule the framework out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.