instead, which did indeed show the message on the device but also caused some exception visible via adb logcat (and left the AdbIME in a weird state:
11-23 11:35:07.201 9975 9975 E AndroidRuntime: FATAL EXCEPTION: main
11-23 11:35:07.201 9975 9975 E AndroidRuntime: Process: com.android.adbkeyboard, PID: 9975
11-23 11:35:07.201 9975 9975 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=ADB_INPUT_TEXT flg=0x400010 (has extras) } in com.android.adbkeyboard.AdbIME$AdbReceiver@b33f63e
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1800)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:942)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7924)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at com.android.adbkeyboard.AdbIME$AdbReceiver.onReceive(AdbIME.java:102)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1790)
11-23 11:35:07.201 9975 9975 E AndroidRuntime: ... 9 more
11-23 11:35:07.236 694 694 E BpTransactionCompletedListener: Failed to transact (-32)
if (intent.getAction().equals(IME_MESSAGE)) {
String msg = intent.getStringExtra("mcode"); // Get message.
String[] mcodes = msg.split(","); // Get mcodes in string.
if (mcodes != null) {
int i;
should probably be changed to this:
if (intent.getAction().equals(IME_MESSAGE)) {
String msg = intent.getStringExtra("mcode"); // Get message.
if (msg != null) {
String[] mcodes = msg.split(","); // Get mcodes in string.
int i;
to avoid raising an exception if the mcode string is missing.
Trying an empty mcode in addition to msg still caused the exception:
This didn't seem to do anything on the device. The
pkg=Hello?
bit in theadb shell
output didn't seem right, so I triedinstead, which did indeed show the message on the device but also caused some exception visible via
adb logcat
(and left the AdbIME in a weird state:Looking at line 102, it seems that
msg
was null.I think that part of the code
should probably be changed to this:
to avoid raising an exception if the
mcode
string is missing.Trying an empty
mcode
in addition tomsg
still caused the exception:The "working?" text was still submitted.
This is on Android 13 (LineageOS).