Skip to content

identify on a phone that refuses input events - #54

Merged
abrignoni merged 2 commits into
mainfrom
no-input-identify
Nov 17, 2026
Merged

abrignoni merged 2 commits into
mainfrom
no-input-identify

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

identify now works on phones that refuse adb input events, following Maxitelmo's steps in #53.

  • One trackball roll of 0 by 0 first. If it is refused, a chained row says so and no tap, swipe or key is sent after it.
  • About phone is kept as it first shows. With no IMEI there, *#06# goes in the dialer's intent, and HOME is sent as an intent.
  • screenshots_without_tree no longer crashes on a refused swipe.
  • Tested with made-up screens only. Maxitelmo offered to try it on his phones.

🤖 Generated with Claude Code

A Xiaomi (HyperOS, Android 15) refuses every adb input event with an
INJECT_EVENTS SecurityException, and identify ended in a traceback.
Now the first refusal is noticed and no tap, swipe or key is sent after
it. About phone is kept as it first shows, *#6# goes in the dialer's
intent, and the launcher is brought back with an intent.
screenshots_without_tree stops at the first screen instead of crashing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Maxitelmo

Copy link
Copy Markdown
Contributor

Tried #54 (e5865f2) on the Xiaomi 25098RA98G (HyperOS, Android 15), from the source on Windows 11, 17 November 2026.

With the screen on, it works. input_refused was chained with the SecurityException and nothing else was sent. About phone's first screen was kept (screenshot and view tree). tel:*%2306%23 opened the Google dialer's dialog, both IMEIs were read (check digit right), and the dialog was kept cut to its bounds (944 × 1697 of 1080 × 2400); its view tree holds only the dialog, nothing from the dialer behind it. HOME brought the launcher to the front. Call log: same count and newest entry before and after. verify passes (7 rows, 4 of 4 files). About 20 s.

The screen turned off in my first two runs. Same branch, same phone, a few minutes earlier: both ended with "no dialog with an IMEI was read; on most phones the code only fills the field", imeis_in_dialog: 0. The first had dialog_package: com.google.android.dialer, the second com.android.systemui, and after each the phone was mWakefulness=Dozing with the keyguard up. This phone turns its screen off 60 s after the last touch, and with input refused nothing can keep it on (the pulse from #41 is input too), so the run only works if it starts soon after the examiner last touched the phone. Run by hand with the screen on, the same intent showed the dialog within half a second. In the third run I watched dumpsys power every second: Awake the whole time.

What it takes from the examiner. On a phone that refuses input, only the examiner can keep the screen on. For identify a touch just before it starts is enough: the run takes about 20 s and this phone waits 60 s. Changing the screen timeout, or "Stay awake" (while charging) in Developer options (the same screen where USB debugging is turned on), would also do it, but both change the phone under examination, so I would leave them as a last resort and record them if used.

Since dumpsys power is read only, maybe identify could check mWakefulness=Awake (and the keyguard) right before the dial on a phone that refuses input. When the screen is off it could say so and ask the examiner to touch the screen and try again, instead of "the code only fills the field", which on this phone is not what happened.

Smaller things on this phone. The first screen of About phone has no "Modelo" row (it shows "Nombre del dispositivo" with the marketing name), so no model was read. The dialog also shows the MSISDN of the SIM, which identify does not take as a phone number; I do not know if you want it.

Not tried yet. The Nubia, the Samsung and the TCL on this branch.


Tested and written by @Maxitelmo with help from Claude Opus 5.5 (Anthropic).

@Maxitelmo

Copy link
Copy Markdown
Contributor

Four more runs of #54 (e5865f2) on the same Xiaomi, and a correction to my last comment: the screen turning off was only part of it.

For runs 4 to 7 I turned on "Stay awake" (while charging) on this test phone, and checked dumpsys power every 3 s for 90 s before the run and again after it: Awake the whole time, keyguard down.

Run Screen IMEIs read from the dialog
1 turned off during or right after the run 0 (dialog_package the dialer)
2 off before the dial 0 (com.android.systemui)
3 on 2
4 on, "Stay awake" 0 (dialog_package the dialer)
5 on, "Stay awake" 1
6 on, "Stay awake" 0 (dialog_package the dialer)
7 on, "Stay awake" 2

verify passes on all seven, and the call log was the same before and after each.

By hand, between runs 4 and 5, the same intent three times in a row (HOME in between, as the branch does), reading the view tree 1 s and 3 s after am start -W: every time the dialer's dialog with android:id/button1 and both IMEIs, in both readings.

So the dialog does come up; my guess is that the single reading at 2.5 s sometimes catches it before it is there, or before both IMEIs are filled in (run 5 read one of two). With the screen on, runs 3 to 7 went 2, 0, 1, 0, 2, so it may also have to do with the dialog the previous run left open behind HOME. I have not confirmed either. If it is the timing, reading again for a few seconds until the dialog has its OK button and the IMEIs it shows stop changing would cover it. The screen check from my last comment would still be worth keeping for phones without "Stay awake".

The Nubia, the Samsung and the TCL are still to be run on this branch.


Tested and written by @Maxitelmo with help from Claude Opus 5.5 (Anthropic).

@Maxitelmo

Copy link
Copy Markdown
Contributor

#54 (e5865f2) on the Samsung SM-G990E (One UI 8, Android 16), same day, from the source on Windows 11.

The phone takes input, so there was no input_refused row and identify walked About phone as before: 4 screenshots, end confirmed, model, IMEI, phone number and serial read from the first one. verify passes. 71 s.

Right after, on the same phone, 0.2.0 (1d38b3f): 4 screenshots, the same four values, verify passes, 69 s. So nothing changed here.

The Nubia and the TCL are still to be run on this branch.


Tested and written by @Maxitelmo with help from Claude Opus 5.5 (Anthropic).

From the Xiaomi runs on #54: one reading at 2.5 s missed IMEIs the
dialog showed, and with the screen off nothing was read. The dialog is
now read each second until it shows OK and the same IMEIs twice, and
the screen state from dumpsys power is checked before reading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni

Copy link
Copy Markdown
Owner Author

Thank you, Maxi. The table made it easy to see.

4c5e74d on the same branch does both of your suggestions:

  • The screen's state is read from dumpsys power before About phone and again before the dialer, and chained. If it is not Awake, the run stops there and the note says to wake and unlock the phone and run it again, instead of the "only fills the field" line.
  • The dialog is read every second, up to 8 times, until it has its OK button and two readings in a row show the same IMEIs. The row records how many readings it took.

I left the model and the MSISDN alone for now. "Nombre del dispositivo" is the marketing name, not the model, so it should not fill that field.

Could you run the Xiaomi a few times with the screen on, once with it off, and the Nubia and the TCL when you get to them?

@abrignoni
abrignoni merged commit dae919e into main Nov 17, 2026
7 checks passed
@abrignoni
abrignoni deleted the no-input-identify branch November 17, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants