[DEV] Xposed module: KitKat Card-Emulation catch-all AID Routing - NFC Hacking

[DEV] Xposed module: NFC Card-Emulation catch-all AID Routing
Hi!
This may be mainly interesting for developers.
Overview:
I created a Xposed module which allows a "catch-all" routing for KitKat's new Host-Card-Emulation feature. Which means you can create an Host-Card-Emulation app which will receive ALL incoming APDUs (not only the ones for the AID your app has registered for).
This may not be useful at all but maybe it makes sense for debugging or checking which AID a specific card terminal is asking for.
Here's the code:
https://github.com/johnzweng/XposedModifyAidRouting
Details:
With Android 4.4 (KitKat) Google introduced NFC Host-Card-Emulation, which allows your phone to act as a NFC-SmartCard. App developers now can create special apps which handle all the incoming NFC data packets and response like a ISO 7816-4 SmartCard would do it.
However, the app developer has to declare explicitly which SmartCard application it wants to simulate in the app's Manifest file.
In more detail: each SmartCard application on a SmartCard is identified by a unique AID (application identifier). Usually a card terminal first sends a SELECT xxxxxxxxx message to the SmartCard where the xxxxxxx stands for the AID, and the SmartCard responds accordingly if it can handle this AID or not.
On a KitKat phone Android takes care of checking the AID value. So if the card terminal sends a SELECT xxxxxxxxx message, Android checks if there is any Card-Emulation app installed which has registered for this AID and if so it forwards this and all folowing APDU (ISO 7816-4 application protocol data unit) packets to this app.
Otherwise (if no app has registered this AID) it simply responds to the card terminal with a Application not found message and no app will ever be informed about the incoming APDU message.
What this Xposed module does:
If this module is enabled, it completly OVERRIDES the AID routing mechanism of Android. So ALL incoming APDUs for ALL application identifier will be routed to the app which has registered the "special magic" AID "F04E66E75C02D8" (I just randomly chose this one.) Even if there are other Card-Emulation apps installed which explicitly register for a specific AID they never will get any APDU message.
So as an app developer, you simply can create a Host Card Emulation app as described here (https://developer.android.com/guide/topics/connectivity/nfc/hce.html) and register it for the special AID F04E66E75C02D8 and your app will receive all APDUs packets for ANY AID value the card terminal ever may ask for.
All your APDUs are belong to us!
Edit:
I just added the module to the Xposed repository. Should now also be available in the Xposed installer app.

androcheck said:
Hi!
This may be mainly interesting for developers.
Overview:
I created a Xposed module which allows a "catch-all" routing for KitKat's new Host-Card-Emulation feature. Which means you can create an Host-Card-Emulation app which will receive ALL incoming APDUs (not only the ones for the AID your app has registered for).
This may not be useful at all but maybe it makes sense for debugging or checking which AID a specific card terminal is asking for.
Here's the code:
https://github.com/johnzweng/XposedModifyAidRouting
Details:
With Android 4.4 (KitKat) Google introduced NFC Host-Card-Emulation, which allows your phone to act as a NFC-SmartCard. App developers now can create special apps which handle all the incoming NFC data packets and response like a ISO 7816-4 SmartCard would do it.
However, the app developer has to declare explicitly which SmartCard application it wants to simulate in the app's Manifest file.
In more detail: each SmartCard application on a SmartCard is identified by a unique AID (application identifier). Usually a card terminal first sends a SELECT xxxxxxxxx message to the SmartCard where the xxxxxxx stands for the AID, and the SmartCard responds accordingly if it can handle this AID or not.
On a KitKat phone Android takes care of checking the AID value. So if the card terminal sends a SELECT xxxxxxxxx message, Android checks if there is any Card-Emulation app installed which has registered for this AID and if so it forwards this and all folowing APDU (ISO 7816-4 application protocol data unit) packets to this app.
Otherwise (if no app has registered this AID) it simply responds to the card terminal with a Application not found message and no app will ever be informed about the incoming APDU message.
What this Xposed module does:
If this module is enabled, it completly OVERRIDES the AID routing mechanism of Android. So ALL incoming APDUs for ALL application identifier will be routed to the app which has registered the "special magic" AID "F04E66E75C02D8" (I just randomly chose this one.) Even if there are other Card-Emulation apps installed which explicitly register for a specific AID they never will get any APDU message.
So as an app developer, you simply can create a Host Card Emulation app as described here (https://developer.android.com/guide/topics/connectivity/nfc/hce.html) and register it for the special AID F04E66E75C02D8 and your app will receive all APDUs packets for ANY AID value the card terminal ever may ask for.
All your APDUs are belong to us!
Edit:
I just added the module to the Xposed repository. Should now also be available in the Xposed installer app.
Click to expand...
Click to collapse
Would this work to get Google Wallet working on NXP controllers?

abuttino said:
Would this work to get Google Wallet working on NXP controllers?
Click to expand...
Click to collapse
No.

Would it be possible to record the aid / adup requests?

I don't know what "adup" stands for but you definitly can record all AID requests.
If you implement your own HostApduService as described here the very first APDU command your service will receive via this method:
Code:
@Override
public byte[] processCommandApdu(byte[] apdu, Bundle extras) {
...
}
will always be the SELECT command containing the AID. So you simply can record all the requests there.

androcheck said:
I don't know what "adup" stands for but you definitly can record all AID requests.
If you implement your own HostApduService as described here the very first APDU command your service will receive via this method:
Code:
@Override
public byte[] processCommandApdu(byte[] apdu, Bundle extras) {
...
}
will always be the SELECT command containing the AID. So you simply can record all the requests there.
Click to expand...
Click to collapse
Thanks! I actually meant APDU.
Also, as part of anti-collision process, the card will provide an UID. It seems the UID provided is randomly generated. Is there a way to specify a UID the phone should provide?

matthew5025 said:
Thanks! I actually meant APDU.
Also, as part of anti-collision process, the card will provide an UID. It seems the UID provided is randomly generated. Is there a way to specify a UID the phone should provide?
Click to expand...
Click to collapse
As far as I can tell the UID seems not to be set anywhere in the Java part, but after skimming through the libnfc-nci I also found no clue where the random UID is set (or if it could be changed). But maybe I just missed it.
So for the moment I cannot tell you for sure if it's possible to change the UID but tend to believe it's not (but anybody should feel free to correct me in this point).

Can this enable Google wallet on Verizon note 3 with kit Kat?

No sorry, unfortunately not.

IllegalAccessException
I have been trying out your module, but keep getting the error:IllegalAccessException on what appears to be this line
Code:
Object resultInstanceAidResolveInfo = ctor.newInstance(registeredAidCacheInstance);
Is there any way around this?
Full logcat output:
Code:
07-11 13:50:27.456: D/Xposed(185): Starting Xposed binary version 58, compiled for SDK 16
07-11 13:50:27.456: D/Xposed(185): Phone: Nexus 7 (asus), Android version 4.4.3 (SDK 19)
07-11 13:50:27.456: D/Xposed(185): ROM: KTU84L
07-11 13:50:27.456: D/Xposed(185): Build fingerprint: google/razorg/deb:4.4.3/KTU84L/1148727:user/release-keys
07-11 13:50:27.456: I/Xposed(185): -----------------
07-11 13:50:27.456: I/Xposed(185): Added Xposed (/data/data/de.robv.android.xposed.installer/bin/XposedBridge.jar) to CLASSPATH.
07-11 13:50:27.736: D/Xposed(185): Using structure member offsets for mode WITH_JIT
07-11 13:50:27.796: I/Xposed(185): Found Xposed class 'de/robv/android/xposed/XposedBridge', now initializing
07-11 13:50:28.237: I/Xposed(185): -----------------
07-11 13:50:28.237: I/Xposed(185): Jul 11, 2014 1:50:28 AM UTC
07-11 13:50:28.237: I/Xposed(185): Loading Xposed v54 (for Zygote)...
07-11 13:50:28.237: I/Xposed(185): Running ROM 'KTU84L' with fingerprint 'google/razorg/deb:4.4.3/KTU84L/1148727:user/release-keys'
07-11 13:50:28.337: I/Xposed(185): Loading modules from /data/app/at.zweng.xposed.modifyaidrouting-1.apk
07-11 13:50:28.557: I/Xposed(185): Loading class at.zweng.xposed.ModNfcAidRouting
07-11 13:50:28.567: I/Xposed(185): Loading modules from /data/app/com.example.nfc_xposed_module_nfcmanager-1.apk
07-11 13:50:28.667: I/Xposed(185): Loading class com.example.nfc_xposed_module_nfcmanager.ModEmulationManager
07-11 13:50:41.009: I/Xposed(921): ModNfcAidRouting: we are in com.android.nfc application. :) Will place method hooks.
07-11 13:50:41.019: I/Xposed(921): ModNfcAidRouting: resolveAidPrefix() method hook in place! Let the fun begin! :)
07-11 13:50:41.019: I/Xposed(921): In the com.android.nfc application
07-11 13:50:41.019: I/Xposed(921): findSelectAid(byte[] ...) hook in place!
07-11 13:54:21.344: I/Xposed(921): Data:00A4040005F999999999
07-11 13:54:21.344: I/Xposed(921): ModNfcAidRouting: resolveAidPrefix(..) was called. aid = F999999999
07-11 13:54:21.344: I/Xposed(921): ModNfcAidRouting: resolveAidPrefix() error in beforeHookedMethod:
07-11 13:54:21.344: I/Xposed(921): java.lang.IllegalAccessException: access to method denied
07-11 13:54:21.344: I/Xposed(921): access to method denied
07-11 13:54:21.344: I/Xposed(921): java.lang.IllegalAccessException: access to method denied
07-11 13:54:21.344: I/Xposed(921): at java.lang.reflect.Constructor.constructNative(Native Method)
07-11 13:54:21.344: I/Xposed(921): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
07-11 13:54:21.344: I/Xposed(921): at at.zweng.xposed.ModNfcAidRouting$1.beforeHookedMethod(ModNfcAidRouting.java:163)
07-11 13:54:21.344: I/Xposed(921): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:611)
07-11 13:54:21.344: I/Xposed(921): at com.android.nfc.cardemulation.RegisteredAidCache.resolveAidPrefix(Native Method)
07-11 13:54:21.344: I/Xposed(921): at com.android.nfc.cardemulation.HostEmulationManager.notifyHostEmulationData(HostEmulationManager.java:171)
07-11 13:54:21.344: I/Xposed(921): at com.android.nfc.NfcService.onHostCardEmulationData(NfcService.java:349)
07-11 13:54:21.344: I/Xposed(921): at com.android.nfc.dhimpl.NativeNfcManager.notifyHostEmuData(NativeNfcManager.java:421)
07-11 13:54:21.344: I/Xposed(921): at dalvik.system.NativeStart.run(Native Method)

sorry for the very late reply. I fixed the "IllegalAccessException" problem. Updated code is already in Github and in Xposed repository available as version 0.2

APDU and AID Routing.
Hey, is there a way to catch all APDU sent?
Because with HCE, the first apdu sent must only be the "Select AID" command. I get that you'd need a custom rom for that. but is there one already available ?

Maybe you should try something like an NFC Spy or NFCGate applications.
---
Sony Xperia A2 SO-04F (Japan version of Z1 Compact)

bobberkarl said:
Hey, is there a way to catch all APDU sent?
Because with HCE, the first apdu sent must only be the "Select AID" command. I get that you'd need a custom rom for that. but is there one already available ?
Click to expand...
Click to collapse
Hi!
As far as I know, this is not possible. At least I didn't find anyting in the Java code.. But this is some time now, I don't know if this maybe has changed in recent android versions.

NoSuchMethod error, google changed the class?
Hey, I am trying to install this beauty of a module to start probing into the local urban transport system but I keep getting an error when the hook is placed that it can't find the resolveAidPrefix method and never logs the success message.
I'm running android 7.1.1 (op3, oos 4.5.1) and after checking the source the method really ain't there.
I was hoping you could provide some assistance since im really no exepert.
The closest i could find was this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And the error:
Code:
01-08 18:17:33.306 I/Xposed ( 795): Loading class at.zweng.xposed.ModNfcAidRouting
01-08 18:17:53.899 I/Xposed ( 2718): ModNfcAidRouting: we are in com.android.nfc application. :) Will place method hooks.
01-08 18:17:53.914 E/Xposed ( 2718): java.lang.NoSuchMethodError: com.android.nfc.cardemulation.RegisteredAidCache#resolveAidPrefix(java.lang.String)#exact
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:342)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:183)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:258)
01-08 18:17:53.914 E/Xposed ( 2718): at at.zweng.xposed.ModNfcAidRouting.handleLoadPackage(ModNfcAidRouting.java:245)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:34)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:61)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:106)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedInit$2.beforeHookedMethod(XposedInit.java:123)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:317)
01-08 18:17:53.914 E/Xposed ( 2718): at android.app.ActivityThread.handleBindApplication(<Xposed>)
01-08 18:17:53.914 E/Xposed ( 2718): at android.app.ActivityThread.-wrap2(ActivityThread.java)
01-08 18:17:53.914 E/Xposed ( 2718): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1600)
01-08 18:17:53.914 E/Xposed ( 2718): at android.os.Handler.dispatchMessage(Handler.java:102)
01-08 18:17:53.914 E/Xposed ( 2718): at android.os.Looper.loop(Looper.java:154)
01-08 18:17:53.914 E/Xposed ( 2718): at android.app.ActivityThread.main(ActivityThread.java:6321)
01-08 18:17:53.914 E/Xposed ( 2718): at java.lang.reflect.Method.invoke(Native Method)
01-08 18:17:53.914 E/Xposed ( 2718): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
01-08 18:17:53.914 E/Xposed ( 2718): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
01-08 18:17:53.914 E/Xposed ( 2718): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103)

RedSmiths said:
Hey, I am trying to install this beauty of a module to start probing into the local urban transport system but I keep getting an error when the hook is placed that it can't find the resolveAidPrefix method and never logs the success message.
I'm running android 7.1.1 (op3, oos 4.5.1) and after checking the source the method really ain't there.
I was hoping you could provide some assistance since im really no exepert.
Click to expand...
Click to collapse
Hi!
The code was changes slightly in recent Android versions.
I've updated the module to version "0.4". Now it should work also with newer Android versions (as far as I see in the code it should also work with Android 9 now).
You can find the updated sourcecode here:
https://github.com/johnzweng/XposedModifyAidRouting
And the APK of the module:
either on Github: https://github.com/johnzweng/XposedModifyAidRouting/releases
or in the Xposed repo:
http://repo.xposed.info/module/at.zweng.xposed.modifyaidrouting

what can be done with this app?
Eli5 please.

xtam said:
what can be done with this app?
Eli5 please.
Click to expand...
Click to collapse
Well, not much and alot, it serves more as maybe an entrance into investigating any existing smartcard system to maybe find some flaws like I did.
Smartcards can hold many applications and when you bring one up to a reader (at least the ISO/IEC 14443 ones) the reader must first issue a SELECT command with the AID (application id) of the application it wants to channel further communications to.
So to emulate smartcards in android, you must build an app with all required permissions but, most importantly, define in the manifest file the AIDs you want to listen too, so that when you bring your phone up to the reader and it sends the SELECT command, android matches it to your app and you get a raw bytes pipe. And here lies the problem.
In my case (and most likely anybody else's) I didn't know the AID of the system I was looking at and almost had to bring and oscilloscope to the train station and attach a coil to it to listen in on the signal and literally see the AID in the waves but luckily I found this module first which goes in and modifies android system code to redirect all AIDs to one that you know and allows you to quickly and simply write down the AID and then disable the module and listen to the correct AID. (and not get walked in on by the police)

Related

[Q] 4.0.3 AOSP build stuck at google logo. Kernel problem?

Hey guys,
i have a problem when building 4.0.3 from source. When i flash the fresh compiled
OTA package to my device, the device ends in a bootloop stuck at the google logo.
Logcat says:
Code:
I/SystemServer( 238): Power Manager
I/SystemServer( 238): Activity Manager
I/ActivityManager( 238): Memory class: 64
I/SurfaceFlinger( 251): SurfaceFlinger is starting
I/SurfaceFlinger( 251): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
E/IMGSRV ( 251): :0: PVRSRVBridgeCall: Failed to access device. Function ID:3223086860 (Bad address).
E/IMGSRV ( 251): :0: OpenServices: PVRSRVBridgeCall failed.
E/IMGSRV ( 251): :0: PVRSRVConnect: Unable to open connection.
E/IMGSRV ( 251): :0: OpenPVRServices: Failed to open services connection
E/IMGSRV ( 251): :0: hal_init: Failed to open services (err=-14)
E/IMGSRV ( 251): :0: hal_open: Graphics HAL not initialized
E/FramebufferNativeWindow( 251): couldn't open framebuffer HAL (Not a typewriter)
E/IMGSRV ( 251): :0: hal_open: Graphics HAL not initialized
E/FramebufferNativeWindow( 251): couldn't open gralloc HAL (Not a typewriter)
E/SurfaceFlinger( 251): Display subsystem failed to initialize. check logs. exiting...
I/ServiceManager( 109): service 'sensorservice' died
I/ServiceManager( 109): service 'power' died
I/ServiceManager( 109): service 'entropy' died
D/AndroidRuntime( 259):
D/AndroidRuntime( 259): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 259): CheckJNI is OFF
I don't know whats going wrong. Can it be a kernel problem? I have tried different 4.0.3 kernels from the dev section, but the result is the same.
The device is a GSM device with PRIMEKK15 unlocked bootloader and I9250XXKK6 baseband.
After pulling the latest 4.0.3 sources with repo and setting up the proprietary files i'have compiled the system without errors:
Code:
~/android/4.0.3$ . build/envsetup.sh
~/android/4.0.3$ lunch full_maguro-userdebug
~/android/4.0.3$ make -j4 otapackage
I really don't understand what i am doing wrong ...
Thanks for any suggestions or answers.

[Guide] How To Logcat

I think this one is definitely needed for this forum as i am seeing more and more users ask how to logcat. So posting this here.
Here's how to use logcat:
There are two main ways to do a logcat, within android, and through adb.
Logcat within android can be done one of two ways, through a Logcat app:
Here are two good examples are either: aLogcat or Catlog
I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))
From Moscow Desire:
On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)
The code for logcat to output to a file is
Code:
adb logcat > name of problem.txt
you can also do
Code:
adb logcat -f name of problem.txt
how I prefer to do it is this way:
Code:
adb logcat -v long > name of problem.txt
with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Here's where using logcat (via adb makes life really easy)
Lets say you find a problem you're having after looking at a logcat.
For example:
When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)
So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)
Code:
D/dalvikvm( 871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
V/AmazonAppstore.DiskInspectorServiceImpl( 871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
D/AmazonAppstore.UpdateService( 871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
W/AmazonAppstore.UpdateService( 871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
D/dalvikvm( 890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
V/AmazonAppstore.ReferenceCounter( 871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
E/WifiStateMachine( 203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon
V/AmazonAppstore.UpdateService( 871): runUpdateCommand doInBackground started.
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateCommand( 871): Not updating key: digitalLocker from: 1334228488057
V/AmazonAppstore.UpdateService( 871): Finished UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: serviceConfig
V/AmazonAppstore.MASLoggerDB( 871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
V/AmazonAppstore.MASLoggerDB( 871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
W/CommandListener( 118): Failed to retrieve HW addr for eth0 (No such device)
D/CommandListener( 118): Setting iface cfg
D/NetworkManagementService( 203): rsp
D/NetworkManagementService( 203): flags
E/WifiStateMachine( 203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
W/PackageParser( 203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
D/wpa_supplicant( 930): wpa_supplicant v0.8.x
D/wpa_supplicant( 930): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): ctrl_interface='eth0'
D/wpa_supplicant( 930): update_config=1
D/wpa_supplicant( 930): Line: 4 - start of a new network block
D/wpa_supplicant( 930): key_mgmt: 0x4
(mind you, that's 29 lines out of 1300ish, just for example)
I then could do the following with logcat:
Code:
adb logcat WifiStateMachine:E *:S -v long > name of problem.txt
and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!
In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)
You can replace the :E with any other letter from above to get more info.
In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)
Sources: http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/help/adb.html
Update for windows users:
Thank go to FuzzyMeep Two, Here's what he's posted for windows
(If you used his tool, here's his post, thank him for his work!)
Note : I am just sharing. Original post here.
Great job brother!!You are in the right path for RC :beer::thumbup:
Sent from my Galaxy Nexus using xda app-developers app
keep going on my friend...:good:
Khizar said:
I think this one is definitely needed for this forum as i am seeing more and more users ask how to logcat. So posting this here.
Here's how to use logcat:
There are two main ways to do a logcat, within android, and through adb.
Logcat within android can be done one of two ways, through a Logcat app:
Here are two good examples are either: aLogcat or Catlog
I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))
From Moscow Desire:
On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)
The code for logcat to output to a file is
Code:
adb logcat > name of problem.txt
you can also do
Code:
adb logcat -f name of problem.txt
how I prefer to do it is this way:
Code:
adb logcat -v long > name of problem.txt
with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Here's where using logcat (via adb makes life really easy)
Lets say you find a problem you're having after looking at a logcat.
For example:
When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)
So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)
Code:
D/dalvikvm( 871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
V/AmazonAppstore.DiskInspectorServiceImpl( 871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
D/AmazonAppstore.UpdateService( 871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
W/AmazonAppstore.UpdateService( 871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
D/dalvikvm( 890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
V/AmazonAppstore.ReferenceCounter( 871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
E/WifiStateMachine( 203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon
V/AmazonAppstore.UpdateService( 871): runUpdateCommand doInBackground started.
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateCommand( 871): Not updating key: digitalLocker from: 1334228488057
V/AmazonAppstore.UpdateService( 871): Finished UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: serviceConfig
V/AmazonAppstore.MASLoggerDB( 871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
V/AmazonAppstore.MASLoggerDB( 871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
W/CommandListener( 118): Failed to retrieve HW addr for eth0 (No such device)
D/CommandListener( 118): Setting iface cfg
D/NetworkManagementService( 203): rsp
D/NetworkManagementService( 203): flags
E/WifiStateMachine( 203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
W/PackageParser( 203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
D/wpa_supplicant( 930): wpa_supplicant v0.8.x
D/wpa_supplicant( 930): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): ctrl_interface='eth0'
D/wpa_supplicant( 930): update_config=1
D/wpa_supplicant( 930): Line: 4 - start of a new network block
D/wpa_supplicant( 930): key_mgmt: 0x4
(mind you, that's 29 lines out of 1300ish, just for example)
I then could do the following with logcat:
Code:
adb logcat WifiStateMachine:E *:S -v long > name of problem.txt
and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!
In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)
You can replace the :E with any other letter from above to get more info.
In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)
Sources: http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/help/adb.html
Update for windows users:
Thank go to FuzzyMeep Two, Here's what he's posted for windows
(If you used his tool, here's his post, thank him for his work!)
Note : I am just sharing. Original post here.
Click to expand...
Click to collapse
I'm happy very happy ... I have little exp with log cat this is my guide ....
Very good another user of Ak team near RC
Sent from my Galaxy Nexus using xda app-developers app
One doubt, I've downloaded catlog and make it run but I don't know where the txt files are stored or what can I do to recover them.
Also the problem I'm experiencing is a random reboot so even if I have catlog running when the reboot occurs, will I be able to recover the log or it will be lost?
Sorry for the noob question but I'm pretty lost here...
binlalo said:
One doubt, I've downloaded catlog and make it run but I don't know where the txt files are stored or what can I do to recover them.
Also the problem I'm experiencing is a random reboot so even if I have catlog running when the reboot occurs, will I be able to recover the log or it will be lost?
Sorry for the noob question but I'm pretty lost here...
Click to expand...
Click to collapse
catlog should have its own folder in data/media where it saves the txt files...

[Q] Open GL Issues Android 4.3

Hi,
How are you?
I have a Galaxy Nexus running Android 4.3 stock and unrooted, and I am experiencing weird behaviour when I try to launch any open GL 2.0 app.
I can not run any Open GL 2.0 app because it always force closes.
Please, Does someone know what can be this issue root cause?
I have been trying to find a fix or workaround for it at google with no success.
I included to this post my system logs, and it loooks like that this is causing the problem:
Code:
D/libEGL ( 5918): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
D/libEGL ( 5918): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
E/libEGL ( 5918): load_driver(/vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so): dlopen failed: cannot locate symbol "KEGLGetBlob" referenced by "libGLESv2_POWERVR_SGX540_120.so"...
E/IMGSRV ( 5918): :0: PVRSRVGetDeviceMemHeapInfo: Error 149 returned
E/IMGSRV ( 5918): :0: SGXCreateRenderContext: Failed to retrieve device memory context information
E/IMGSRV ( 5918):
E/IMGSRV ( 5918): :0: SGXDestroyTransferContext: Called with NULL context. Ignoring
E/IMGSRV ( 5918): :0: SGXDestroyRenderContext: NULL handle
E/IMGSRV ( 5918): :0: PVRSRVDestroyDeviceMemContext: allocations still exist in the memory context to be destroyed
E/IMGSRV ( 5918): :0: Likely Cause: client drivers not freeing alocations before destroying devmemcontext
W/libEGL ( 5918): eglInitialize(0x1) failed (EGL_BAD_ALLOC)
D/AndroidRuntime( 5918): Shutting down VM
I appreciate any help you can give me,
Roger
RogerSilva said:
Hi,
How are you?
I have a Galaxy Nexus running Android 4.3 stock and unrooted, and I am experiencing weird behaviour when I try to launch any open GL 2.0 app.
I can not run any Open GL 2.0 app because it always force closes.
Please, Does someone know what can be this issue root cause?
I have been trying to find a fix or workaround for it at google with no success.
I included to this post my system logs, and it loooks like that this is causing the problem:
Code:
D/libEGL ( 5918): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
D/libEGL ( 5918): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
E/libEGL ( 5918): load_driver(/vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so): dlopen failed: cannot locate symbol "KEGLGetBlob" referenced by "libGLESv2_POWERVR_SGX540_120.so"...
E/IMGSRV ( 5918): :0: PVRSRVGetDeviceMemHeapInfo: Error 149 returned
E/IMGSRV ( 5918): :0: SGXCreateRenderContext: Failed to retrieve device memory context information
E/IMGSRV ( 5918):
E/IMGSRV ( 5918): :0: SGXDestroyTransferContext: Called with NULL context. Ignoring
E/IMGSRV ( 5918): :0: SGXDestroyRenderContext: NULL handle
E/IMGSRV ( 5918): :0: PVRSRVDestroyDeviceMemContext: allocations still exist in the memory context to be destroyed
E/IMGSRV ( 5918): :0: Likely Cause: client drivers not freeing alocations before destroying devmemcontext
W/libEGL ( 5918): eglInitialize(0x1) failed (EGL_BAD_ALLOC)
D/AndroidRuntime( 5918): Shutting down VM
I appreciate any help you can give me,
Roger
Click to expand...
Click to collapse
Any help?Please?
I still can't figure out what is going on =/
I appreciate any help you can give me
RogerSilva said:
Any help?Please?
I still can't figure out what is going on =/
I appreciate any help you can give me
Click to expand...
Click to collapse
Have you gone back to stock via fastboot?
Sent from my Galaxy Nexus using XDA Premium HD app
Hi mrgnex,
thanks for helping.
mrgnex said:
Have you gone back to stock via fastboot?
Sent from my Galaxy Nexus using XDA Premium HD app
Click to expand...
Click to collapse
I am running stock unrooted Android 4.3 ( JWR66Y ), and I did a factory reset after upgrading to 4.3 through OTA.
I have been using stock unrooted Android, I never installed any custom roms on my phone.
Do I need to flash stock image via fastboot even If I have never installed any custom mod or rom in my phone?
Please, Do you have any idea of what could be this issue root cause?
Does attached logs show any clue about it?
( I am not a Android developer, so I don`t know what the error describe in the log means)
I appreciate any help you can give me,
Roger
Please, May someone help me?
This issue is driving me crazy as I can`t run any Open GL 2.0 app, It simply crashes with the error reported on attached log...
Thanks

LineageOS 15 on S5 mini and SE Linux enforcement. Doesn't work well together

Hi,
I'm running LineageOS 15 (Android 8) on S5 mini. Everything is fine except one banking app that I really need. They validate on startup, whether the phone is rooted.
They in fact check if SE Linux is in enforcement mode. Here is the log snippet:
Code:
11-23 18:44:54.894 2259 2521 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity bnds=[350,815][506,994] (has extras)} from uid 10036
11-23 18:44:54.935 2084 2084 I display : [DYNAMIC_RECOMP] HWC_2_GLES by low FPS(0)
11-23 18:44:54.969 2259 4027 I ActivityManager: Start proc 20526:com.fidor.fsw/u0a119 for activity com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity
11-23 18:44:55.190 2084 2084 I display : [DYNAMIC_RECOMP] GLES_2_HWC by high FPS(39)
11-23 18:44:55.229 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libEGL_mali.so from the current namespace instead.
11-23 18:44:55.326 20526 20540 D libEGL : loaded /system/lib/egl/libEGL_mali.so
11-23 18:44:55.339 2084 2133 W GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x400
11-23 18:44:55.356 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libGLESv1_CM_mali.so from the current namespace instead.
11-23 18:44:55.362 20526 20540 D libEGL : loaded /system/lib/egl/libGLESv1_CM_mali.so
11-23 18:44:55.586 20526 20540 I vndksupport: sphal namespace is not configured for this process. Loading /system/lib/egl/libGLESv2_mali.so from the current namespace instead.
11-23 18:44:55.588 20526 20540 D libEGL : loaded /system/lib/egl/libGLESv2_mali.so
11-23 18:44:56.455 20526 20526 I putmethod.latin: type=1400 audit(0.0:774): avc: denied { read } for name="/" dev="tmpfs" ino=3689 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=1
11-23 18:44:56.455 20526 20526 W putmethod.latin: type=1300 audit(0.0:774): arch=40000028 syscall=334 per=800008 success=yes exit=0 a0=ffffff9c a1=898ca354 a2=4 a3=0 items=1 ppid=2066 auid=4294967295 uid=10119 gid=10119 euid=10119 suid=10119 fsuid=10119 egid=10119 sgid=10119 fsgid=10119 tty=(none) ses=4294967295 exe="/system/bin/app_process32" subj=u:r:untrusted_app_25:s0:c512,c768 key=(null)
11-23 18:44:56.455 1978 1978 W auditd : type=1307 audit(0.0:774): cwd="/"
11-23 18:44:56.455 1978 1978 W auditd : type=1302 audit(0.0:774): item=0 name="/sbin" inode=3689 dev=00:12 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=u:object_r:rootfs:s0
11-23 18:44:56.455 1978 1978 W auditd : type=1327 audit(0.0:774): proctitle="com.google.android.inputmethod.latin"
11-23 18:44:56.455 1978 1978 W auditd : type=1320 audit(0.0:774):
11-23 18:44:56.527 2259 3192 W ActivityManager: Force finishing activity com.fidor.fsw/com.gft.fidor.views.splash.SplashScreenActivity
Since LineageOS sets SELinux by default into permissive, this check fails and the app crashes. I'm able to set it to enforced with "SE Linux mode changer" or any other app of that kind, but immediately after the change the phone starts eating 100% cpu and modem (neither internet, nor SMS/phone calls) aren't working, which makes me think LineageOS doesn't work really well in enforcement mode of SE Linux. But the app itself launches just fine with SELinux in enforced.
I'm not an expert in Android and SELinux, but would like to know if there is a way:
to workaround the check we see in the logs and work with the app in permissive mode
to make LineageOS work correctly under enforced
PS. It doesn't matter which way to set the SELinux mode. Whatever is done - through kernel, in init.d or in adb shell, the symptoms are exactly the same after the change.
Thanks
bytes85 said:
Hi,
I'm running LineageOS 15 (Android 8) on S5 mini. Everything is fine except one banking app that I really need. They validate on startup, whether the phone is rooted...
Click to expand...
Click to collapse
I don't have this device but, your best bet is to post this question within the following Unofficial LineageOS (since there's no Official LineageOS Oreo released yet) thread for your device.
https://forum.xda-developers.com/showthread.php?t=3678205
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT PROVIDE SUPPORT VIA PM UNLESS ASKED/REQUESTED BY MYSELF.
PLEASE KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE

[ROM][UNOFFICIAL][GAPPS][13] ArrowOS for Fire HD10 9th gen (maverick)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ArrowOS​
This is an alpha build, not intended for use as a daily driver!
This ROM requires the temporary unlock to work, along with TWRP!
Your device must be on the 7.3.1.0 launch firmware!
Code:
/*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, We will laugh at you.
* It is your fault because you chose to do all the modifications on your device.
* Remember projects like these and the work done on them is a hobby to the
* contributors and the team members, no one is working for you nor is getting paid for it
* have some respect for the work done by them since it is done purely on interest or a hobby
*/
ABOUT
ArrowOS is an Android Open Source Project based Android mobile operating system started with the aim of keeping things simple, clean and neat.
Website: https://arrowos.net
Telegram: Channel | TG Portal/Links
Github: https://github.com/ArrowOS
Code Review: review.arrowos.net
E-mail: arrowos.contact
PayPal: Donate to us
Blog: blog.arrowos.net
Checkout more documentation at (maintainership/contributing): Check this out
WHAT WORKS?
Everything except those mentioned on the not working list.
WHAT DOESN'T WORK?
Bluetooth audio
Hardware codecs
Brightness adjustment is buggy
SELinux permissive
Known performance issues
com.android.phone crashes from time to time
DRM
You tell me!
DOWNLOADS
Click here to Download
Read our blog article/post about:
* HOW-TO report a bug
* GAPPS and VANILLA variants
* Checking build integrity
GPL compliance:
ROM Source- https://github.com/ArrowOS
Kernel Source- https://github.com/amazon-maverick-dev/android_kernel_amazon_mt8183 (branch: 13.0-new)
Device Source- https://github.com/amazon-maverick-dev/android_device_amazon_maverick
Reserved #2
Reserved #3
Installed it on my device. Looking good! Are the bluetooth issues isolated to Bluetooth audio? I was unable to pair a bluetooth game controller or a mouse.
moomph said:
Installed it on my device. Looking good! Are the bluetooth issues isolated to Bluetooth audio? I was unable to pair a bluetooth game controller or a mouse.
Click to expand...
Click to collapse
Hey, it's possible that there are more Bluetooth issues than meets the eye, I didn't really do much real world testing since this is in very early stages.
I'd be happy to have a look if you could attach a logcat while trying to pair the game controller.
Hey, thanks for getting back. To preface, when I attempt to pair the controller, the UI in the "Connected devices" screen behaves as if it is connected for a second, but the controller disconnects and moves down to the list of "Saved devices". I saw similar behavior with a bluetooth mouse - it seems to pair, but then it disconnects immediately.
Simply running logcat results in a deluge of log messages - lots of errors amongst them.
When I run logcat | grep bluetooth and attempt to pair the controller, this is what I see. Pardon how massive this is:
Code:
09-23 11:44:53.264 22003 22214 I bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:113 drop: Dropping event MAX_SLOTS_CHANGE
09-23 11:44:53.281 22003 22214 I bluetooth: packages/modules/Bluetooth/system/main/shim/acl.cc:525 OnReadClockOffsetComplete: UNIMPLEMENTED
09-23 11:44:53.287 21733 21759 I ActivityManager: Start proc 10056:com.google.android.projection.gearhead:shared/u0a54 for broadcast {com.google.android.projection.gearhead/com.google.android.apps.auto.wireless.bluetooth.WifiBluetoothReceiver}
09-23 11:44:53.403 21733 21904 I ActivityTaskManager: START u0 {act=android.bluetooth.device.action.PAIRING_REQUEST flg=0x10000000 cmp=com.android.settings/.bluetooth.BluetoothPairingDialog (has extras)} from uid 1000
09-23 11:44:53.514 21733 22058 D CoreBackPreview: Window{90ec256 u0 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog}: Setting back callback OnBackInvokedCallbackInfo{[email protected]65, mPriority=0}
09-23 11:44:53.519 21733 22058 D CoreBackPreview: Window{97a6d06 u0 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog}: Setting back callback OnBackInvokedCallbackInfo{[email protected]92, mPriority=0}
09-23 11:44:53.562 21733 21748 I ActivityTaskManager: Displayed com.android.settings/.bluetooth.BluetoothPairingDialog: +153ms
09-23 11:44:53.760 10056 10056 I GH.WifiBluetoothRcvr: Connection action: android.bluetooth.device.action.ACL_CONNECTED, device E4:17:D8:85:79:73
09-23 11:44:53.863 29843 30332 I BistoWorker: (REDACTED) bluetoothConnectionStateChanged. Action: %s
09-23 11:44:54.793 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:44:58.628 369 369 I HwBinder:369_3: type=1400 audit(0.0:16620973): avc: denied { call } for scontext=u:r:init:s0 tcontext=u:r:bluetooth:s0 tclass=binder permissive=1
09-23 11:44:58.632 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:44:59.775 21733 22688 D CoreBackPreview: Window{90ec256 u0 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog}: Setting back callback null
09-23 11:44:59.787 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/vendor_specific_event_manager.cc:86 on_vendor_specific_event: Unhandled vendor specific event of type 0x52
09-23 11:44:59.787 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/vendor_specific_event_manager.cc:86 on_vendor_specific_event: Unhandled vendor specific event of type 0x52
09-23 11:44:59.788 21733 23979 W InputManager-JNI: Input channel object '90ec256 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog (client)' was disposed without first being removed with the input manager!
09-23 11:44:59.860 21733 22058 D CoreBackPreview: Window{97a6d06 u0 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog}: Setting back callback null
09-23 11:44:59.862 21733 22058 W InputManager-JNI: Input channel object '97a6d06 com.android.settings/com.android.settings.bluetooth.BluetoothPairingDialog (client)' was disposed without first being removed with the input manager!
09-23 11:45:00.152 21733 21758 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.UUID flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
09-23 11:45:00.152 21733 21758 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.UUID flg=0x10 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.broadcastreceiver.external.ExternalCommonBroadcastReceiver
09-23 11:45:00.152 21733 21758 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.UUID flg=0x10 (has extras) } to com.google.android.projection.gearhead/com.google.android.apps.auto.carservice.gmscorecompat.CarBluetoothReceiver
09-23 11:45:00.156 21733 21758 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
09-23 11:45:00.156 21733 21758 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.broadcastreceiver.external.ExternalCommonBroadcastReceiver
09-23 11:45:00.157 10918 17585 I NearbyDiscovery: FastPairHandler: Received action android.bluetooth.device.action.UUID [CONTEXT service_id=49 ]
09-23 11:45:00.274 22003 22214 I bluetooth: packages/modules/Bluetooth/system/gd/hci/le_scanning_manager.cc:639 stop_scan: Scanning already stopped, return!
09-23 11:45:02.037 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:45:02.249 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:45:02.681 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:45:03.315 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:45:03.534 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 11:45:04.136 22003 22003 I bt_stack_manage: type=1400 audit(0.0:16623299): avc: denied { call } for scontext=u:r:bluetooth:s0 tcontext=u:r:init:s0 tclass=binder permissive=1
09-23 11:45:04.136 369 369 I HwBinder:369_3: type=1400 audit(0.0:16623300): avc: denied { call } for scontext=u:r:init:s0 tcontext=u:r:bluetooth:s0 tclass=binder permissive=1
09-23 11:45:04.219 22003 22230 E bluetooth: packages/modules/Bluetooth/system/stack/btm/btm_sco.cc:950 btm_sco_on_disconnected: Unable to find sco connection
09-23 11:45:04.245 29843 30332 I BistoWorker: (REDACTED) bluetoothConnectionStateChanged. Action: %s
09-23 11:45:06.296 22003 22003 I bt_stack_manage: type=1400 audit(0.0:16624639): avc: denied { call } for scontext=u:r:bluetooth:s0 tcontext=u:r:init:s0 tclass=binder permissive=1
09-23 11:45:06.299 22003 22214 I bluetooth: packages/modules/Bluetooth/system/gd/hci/le_scanning_manager.cc:639 stop_scan: Scanning already stopped, return!
09-23 11:45:06.300 369 369 I HwBinder:369_3: type=1400 audit(0.0:16624640): avc: denied { call } for scontext=u:r:init:s0 tcontext=u:r:bluetooth:s0 tclass=binder permissive=1
Did this again and saw some other logs relevant looking logs that perhaps I somehow missed in the first dump:
Code:
09-23 13:09:33.240 22003 22214 W bluetooth: packages/modules/Bluetooth/system/gd/hci/hci_layer.cc:375 on_hci_event: Unhandled event of type 0xe5 (Unknown EventCode: 229)
09-23 13:09:33.467 22003 22230 W l2c_link: packages/modules/Bluetooth/system/stack/l2cap/l2c_link.cc:500 l2c_link_timeout: TODO: Remove this callback into bcm_sec_disconnect
09-23 13:09:33.467 22003 22230 I btm_acl : packages/modules/Bluetooth/system/stack/acl/btm_acl.cc:188 hci_btsnd_hcic_disconnect: Disconnecting peer:xx:xx:xx:xx:79:73 reason:Remote Terminated Connection comment:stack::l2cap::l2c_link::l2c_link_timeout All channels closed
09-23 13:09:33.562 22003 22230 E bluetooth: packages/modules/Bluetooth/system/stack/btm/btm_sco.cc:950 btm_sco_on_disconnected: Unable to find sco connection
09-23 13:09:33.562 22003 22230 I btm_acl : packages/modules/Bluetooth/system/stack/acl/btm_acl.cc:2569 btm_acl_iso_disconnected: ISO disconnection from GD, handle: 0x32, reason: 0x16
09-23 13:09:33.563 22003 22230 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3409 btif_av_acl_disconnected: btif_av_acl_disconnected: Peer XX:XX:XX:XX:79:73 : ACL Disconnected
09-23 13:09:33.565 22003 22161 W BatteryService: getBatteryService(): service is NULL
09-23 13:09:33.604 26918 27235 I BistoWorker: (REDACTED) bluetoothConnectionStateChanged. Action: %s
09-23 13:09:33.611 26918 27027 I BistoWorker: (REDACTED) Failed to get bistoDeviceInfo %s
09-23 13:09:33.615 22003 22073 D BluetoothDatabase: getBondedDevicesOrdered: Invalid address for device LocalStorage
09-23 13:09:33.624 26982 26982 I NearbyDiscovery: onAclChange: state=DISCONNECTED, device=XX:XX:XX:XX:79:73 [CONTEXT service_id=49 ]
Also, I found that the telephony service was failing and infinitely restarting, causing the deluge of error logs. Running the following solved it:
am service-restart-backoff disable com.android.phone
After further testing with the Bluetooth mouse, looking at the logs and UI behavior, it appears that the pairing does succeed. The device remains listed within the section of currently paired devices, and when I turn off the mouse, the UI updates accordingly and new log messages appear indicating a disconnection. However, a mouse pointer never materializes on screen during connection.

Categories

Resources