shevery icon indicating copy to clipboard operation
shevery copied to clipboard

Termux can't be authorized via rish – permission request is launched (START_SUCCESS) but no dialog ever appears, and Termux never shows in the authorized apps list

Open Debugg3rDetected opened this issue 1 month ago • 5 comments

Requirements

  • [x] I am using the latest version from GitHub Releases.
  • [x] I am using a standard, tested ROM (no custom/untested forks).
  • [x] I have searched existing issues and this is not a duplicate.
  • [x] I am providing text logs, not screenshots of logs.

Shizuku Version

14.6.0

Operation Mode

ADB Mode

Device Model & OS Version

motorela moto e 14 android 14

Steps to Reproduce

Hi, and thanks for your work on Shevery. I'm unable to authorize Termux to use Shevery through rish. When I run rish in Termux, the request reaches Shevery and the system reports that the permission activity started successfully. But no dialog is shown, Termux is never added to the authorized apps list, and rish ends with "Request timeout". Background I used the original Shizuku first and granted Termux access. It worked. I then switched to Shevery. Termux (F-Droid build) still showed as authorized and worked. I later uninstalled the F-Droid Termux and installed the GitHub build (0.118.3). Since then I can't authorize it again. So the same setup worked before. The only things that changed are the Termux build and the Shizuku implementation. Environment Android 14 (SDK 34) Shevery 14.6.0. I also tried 14.5.0 and got the same result. Compatibility stub (moe.shizuku.privileged.api) installed, v14.6.0. I also reinstalled it. Termux 0.118.3 (GitHub build), package com.termux Shevery is running, and I tried both wireless debugging and TCP mode (port 5555). Steps to reproduce Start Shevery. Export the rish files from Shevery into Termux (~/.rish/rish and rish_shizuku.dex). Run chmod 400 ~/.rish/rish_shizuku.dex. Replace the PKG placeholder in rish with com.termux (the exported file has RISH_APPLICATION_ID="PKG"). Run export RISH_APPLICATION_ID=com.termux, then rish -c id. Expected: a permission dialog appears, and after I accept it Termux is listed as authorized. Actual: no dialog appears, and rish fails with: Request timeout. The connection between the current app (com.termux) and Shizuku app may be blocked by your system... What the logs show (details in the attached shevery_rish_logs.txt) [1] sh -x ~/.rish/rish -c id shows the script runs correctly and reaches app_process (SDK 34, dex is read-only). It then times out. [2] logcat captured right after running rish (11-01 17:19:35): The rikka.shizuku.intent.action.REQUEST_BINDER broadcast from Termux (uid 10470) is received by com.hamondev.shevery/moe.shizuku.manager.receiver.ShizukuReceiver and finishes in 10 ms. Right after that: START u0 {act=com.hamondev.shevery.intent.action.REQUEST_PERMISSION cmp=com.hamondev.shevery/moe.shizuku.manager.authorization.RequestPermissionActivity} ... from uid 2000 ... result code=START_SUCCESS. Focus moves to RequestPermissionActivity (task #1438) and returns to Termux about 47 ms later. No dialog window ever shows, and the authorized list stays empty. So the request is delivered and the activity is launched, but the UI never appears and the request is never completed. [4] In Shevery's built-in terminal, pm grant com.termux moe.shizuku.manager.permission.API_V23 fails with SecurityException: Package com.termux has not requested permission .... I'm including it only as evidence of what I tried. What I already tried Disabled all battery optimizations and background restrictions for Termux and Shevery. Toggled TCP mode, reinstalled the compatibility stub, and tried versions 14.5.0 and 14.6.0. Looked for a "Display over other apps" permission for Shevery and couldn't find one. That might be related, since the dialog doesn't show even though the activity starts. Question Could the permission activity be finishing immediately or failing to show a window on Android 14? Is there anything else I should capture, such as a more detailed logcat filtered to RequestPermissionActivity, or a full run with debug output? I'm happy to provide it. Thanks!

Logcat / Crash Logs

shevery_rish_logs.txt

Debugg3rDetected avatar Nov 01 '26 16:11 Debugg3rDetected

🤖 AI Triage

No repository files were read to verify the authorization activity flow, and the issue relies on runtime intent logs rather than source code confirmation. Please provide stack traces or logs from RequestPermissionActivity itself to confirm why the UI fails to display.

Note: this is an automated AI bot (Gemini); its verdict isn't 100% accurate and can be wrong. The bot doesn't read or reply to further comments in this thread — if it got this wrong, ping a human maintainer.

github-actions[bot] avatar Nov 01 '26 16:11 github-actions[bot]

Hi @Debugg3rDetected,

Thank you for the detailed logs and report. Your suspicion was 100% accurate: the permission activity was indeed finishing immediately (~47 ms) before displaying any dialog.

Root Cause

In RequestPermissionActivity.kt, getLaunchedFromUid() (invoked via reflection) returns -1 on your device/ROM. When extrasTrusted was false and callerUid evaluated to -1, the code executed:

if (!extrasTrusted) {
    uid = callerUid // overwrote valid intent uid (10470) with -1!
    ...
}
if (uid == -1) {
    finish()
    return
}

This discarded the valid client UID and request parameters passed by the Shevery server, triggering an immediate finish() before the Compose dialog could be composed.

Fix & Test Build

The fix has been committed in 469a925 (hotfix 14.6.2, versionCode 48):

  • uid from the intent is no longer overridden when callerUid <= 0.
  • pid and requestCode are properly preserved for server-initiated permission requests so confirmation dispatch succeeds.

Could you please test the APK from the latest CI build run to verify if this resolves the issue on your Moto E14?

  • Build run: https://github.com/HmnDev-Tech/shevery/actions/runs/41333346032
  • Artifact: Download shevery-release (or shevery-debug) from the Artifacts section at the bottom of the run page.

Let us know how it goes!

HmnDev-Tech avatar Nov 01 '26 17:11 HmnDev-Tech

Hi,

Thanks again for the fast turnaround. I tested the CI build and, unfortunately, the problem is still there. I've tried to make this as complete as possible, including a comparison against the original Shizuku on the same device, so you can see exactly where the behaviour differs.

What I tested

  • Installed the shevery-release APK from the CI run for 469a925. To rule out a wrong install, I compared hashes: the installed base.apk and the APK from the artifact have the same sha256 (c650d873102c091ceac0cca1b8dd6ebea072b2e9c92f113c142a6a5b81637624).
  • The app still reports 14.6.1 / versionCode 48 (not 14.6.2), so I can't tell from the app itself whether the fix is included. Could you confirm that this artifact really contains 469a925?
  • Clean setup: removed ~/.rish, re-exported the rish files from Shevery, chmod 400 on the dex, replaced the "PKG" placeholder with com.termux, exported RISH_APPLICATION_ID=com.termux.
  • Shevery was running (id in its terminal shows uid=2000(shell)).
  • Termux 0.118.3 (GitHub build), Android 14 (SDK 34). Battery optimisation was already disabled for both apps earlier.

What happens with Shevery

Running sh ~/.rish/rish -c id in Termux:

  • prints "Permission denied"
  • no permission dialog is shown at all
  • Termux is not added to the authorized apps list

What the log shows (attached: shevery_rish_logs_v2.txt, one attempt, logcat main+system)

  • REQUEST_BINDER from Termux (uid 10470) reaches ShizukuReceiver in 3 ms.
  • The rish client logs "Received server binder, attaching application for com.termux" and "serverUid=2000, version=14".
  • Right after, RequestPermissionActivity is started from uid 2000 with result code START_SUCCESS.
  • About 37 ms later the focus is back on Termux. The activity never creates a window and "Displayed ...RequestPermissionActivity" is never logged.

Comparison with the original Shizuku (attached: original_shizuku_rish_log.txt)

To check whether Termux or the device is the cause, I removed Shevery's compatibility stub (it uses the same package name), installed the original Shizuku, paired through wireless debugging, exported the rish files from it into a fresh ~/.rish and ran the very same steps in the same Termux.

It works: the permission dialog appears, I accept it, and rish -c id prints uid=2000(shell). In the log, the sequence is the same up to START_SUCCESS, but then the activity creates its windows (a type=2 and a type=1 window), logs "Displayed ...RequestPermissionActivity +125ms", and stays on screen until I accept (about 1 s). So Termux, the rish files and the device are fine; the difference is only in what happens after RequestPermissionActivity starts.

Also worth noting

  • This matches your earlier analysis (the activity finishing right after being started), and my first log on 14.6.0 showed the same ~47 ms pattern. The behaviour on this CI build looks identical, which is why I suspect either the fix isn't in this artifact or it doesn't cover this path.
  • The same setup used to work: Termux (F-Droid build) was authorized under the original Shizuku and stayed authorized after I switched to Shevery. The problem only appeared after reinstalling Termux from GitHub and trying to authorize it again.

What I can do next

I'm happy to test any build or branch you point me to, try the debug artifact, or capture more logs, for example with extra logging around RequestPermissionActivity's finish() path if you add it to a test build.

Thanks!

orig_filtered.txt shevery_rish_logs_v2.txt

Debugg3rDetected avatar Nov 02 '26 00:11 Debugg3rDetected

Hi @Debugg3rDetected, thanks for the detailed logs. A fix is ready in PR #350 (commit 21ac225), and the CI build for that commit succeeded.

Please test this build:

  1. Download the shevery-release APK from the run: https://github.com/HmnDev-Tech/shevery/actions/runs/41375649281 (Artifacts section, at the bottom of the page). The shevery-debug APK from the same run also works.
  2. Install it over the current build. If Android refuses because the signature differs, uninstall Shevery first and reinstall.
  3. In Termux, run rish -c id and tap through the authorization prompt. The dialog should now appear, and approving it should let rish -c id return uid=0.

If the dialog still does not appear, please send the output of this on your device right after the request:

logcat -d | grep -E "RequestPermissionActivity|ShizukuService"

That will show whether the activity is being displayed now. Please also include your device model, Android version, and Termux version.

LandonMoran avatar Nov 02 '26 02:11 LandonMoran

Hi,

Thanks, the build from the CI run for PR #350 (21ac225) fixes it for me.

After installing it over the previous build, running rish -c id in Termux now shows the authorization dialog. I approved it, Termux appeared in the authorized apps list, and rish -c id printed uid=2000(shell) (2000 rather than 0 because I'm using wireless debugging, not root).

I'm attaching the filtered log of this successful attempt (shevery_rish_success_log.txt). Since I also attached failing logs earlier, you can use them as a before/after reference for the code path. What it shows, on Android 14 (SDK 34) with Termux 0.118.3 (GitHub build):

  • REQUEST_BINDER from Termux reaches ShizukuReceiver in about 5 ms
  • the rish client logs "Received server binder, attaching application for com.termux" and "serverUid=2000, version=14"
  • RequestPermissionActivity is started from uid 2000 (START_SUCCESS), creates its windows, and this time logs "Displayed ...RequestPermissionActivity +164ms"
  • after I accept, the task is closed and rish proceeds ("remote exit", "exited with 0")

The line "access /data/data/com.termux/files/home failed with 13: Permission denied" also shows up, but it's harmless: the same line appears with the original Shizuku when authorization works.

One small thing I noticed: the About page of this build shows version 14.6.0, which is older than the 14.6.1 shown by the previous CI build (and the 14.6.2 you mentioned). It might just be that the version name isn't bumped on that branch, but I wanted to mention it in case it's unintended, since it makes it hard to tell builds apart from the app itself.

Hopefully the log is useful for regression checks or testing on your side. Thanks a lot for the quick fix and for being so responsive. I'll leave my separate feature request open, since it's only a fallback now. shevery_rish_success_log.txt

Debugg3rDetected avatar Nov 02 '26 06:11 Debugg3rDetected