Skip to content

Fix rish output capture broken by Shizuku 'Entering shell...' banner - #47

Closed
jairjacom wants to merge 16 commits into
Graywizard888:mainfrom
jairjacom:main
Closed

jairjacom wants to merge 16 commits into
Graywizard888:mainfrom
jairjacom:main

Conversation

@jairjacom

Copy link
Copy Markdown

Problem

On Android 17 (dev preview) with the thedjchi/Shizuku fork, the rish shell prints Entering shell... to stdout before executing commands.

This breaks every $(rish -c "...") output capture in Enhancify because the banner gets mixed into the result:

# Expected:
result=$(rish -c "pm install ...") # result = "Success"

# Actual on Android 17 / thedjchi Shizuku:
result=$(rish -c "pm install ...") # result = "Entering shell...\nSuccess"

String comparisons like [ "$result" == "Success" ] silently fail, causing installs to appear broken with no error message.

Fix

Added a rish_c() wrapper function that strips the banner line before returning output:

rish_c() { rish -c "$@" | grep -v "^Entering shell\.\.\."; }

All $(rish -c "...") output captures replaced with $(rish_c "...").

Backward compatible — grep -v is a no-op when the banner is absent (Android 14/15/16, standard Shizuku, other OEMs).

Files changed

  • system/rish-install.sh
  • system/rish-uninstall.sh
  • modules/system/rish.sh
  • modules/system/root.sh

Note: modules/constants.sh line 19 (rish -c 'exit' &> /dev/null) is intentionally left unchanged — output is discarded there, only exit code matters.

Tested on

  • Device: Pixel 9 Pro XL (Android 17 dev, thedjchi/Shizuku fork)
  • App: Piko-Instagram 439.0.0.37.89
  • Result: Install + dex optimization completed successfully

jairjacom and others added 16 commits August 17, 2026 15:36
Recent versions of the thedjchi/Shizuku fork (Android 17 dev) print
'Entering shell...' to stdout before executing rish commands. This
pollutes all $(rish -c "...") output captures, causing string
comparisons like "Entering shell..." == "Success" to fail silently.

Add rish_c() wrapper in each affected file that pipes rish output
through grep -v to strip the banner. Backward-compatible: grep -v is
a no-op on systems where the banner is absent (Android 14/15/16).

The Rish detection check in constants.sh (rish -c 'exit' &> /dev/null)
is intentionally left unchanged as it discards output and relies on
the exit code only.
- install.sh: downloads launcher from jairjacom fork instead of OG repo
- enhancify: update check and download URLs point to jairjacom/Enhancify
- fetchSrc(): add null guard so no crash when fork has no releases yet
- aapt2 binary URL left pointing to Graywizard888/Custom-Enhancify-aapt2-binary (separate repo, unchanged)
…cher

These changes are not needed for the upstream PR — only the rish_c() fix
belongs upstream. Keeping install.sh and enhancify pointing to the OG repo.
- enhancify launcher now checks jairjacom/Enhancify releases (not upstream)
- install.sh downloads launcher from jairjacom fork
- SpecManager.sh changelog fetch points to jairjacom/Enhancify
- Restore enhancify and install.sh (deleted upstream in v6.2.2)
- Add GitHub Actions workflow: auto-creates release on version tag push
Scheduled workflow runs daily at 9 AM UTC:
- Checks if Graywizard888/Enhancify has a new release
- If yes, merges upstream/main into fork main
- Clean merge: pushes tag + creates GitHub release automatically
- Conflict: aborts merge, opens a GitHub issue with fix instructions
- Guards against duplicate tags before pushing
Our rish_c() wrapper only filtered stdout and used grep -v, which
silently dropped real output when the banner shared a line with
content (e.g. "Entering shell...Success"). The upstream PR Graywizard888#50 fix
(built by arena-ai-coding-agent for Graywizard888) shadows rish()
itself instead of requiring every call site to opt in, filters both
stdout and stderr separately, and strips the banner as a prefix
instead of deleting the whole line - fixing both gaps.

Verified via bash -n on all touched files and a mock-rish smoke test
covering banner-alone, banner+content same line, banner on stderr,
no-banner backward compat, and exit-code preservation on failure.
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