`set_system_proxy` via `rish` never works on SFA
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 38.1k
- Forks
- 4.6k
- Avg merge
- 19d 15h
- Merged PRs (30d)
- 1
Description
set_system_proxy via rish never works on SFA
Env: SFA + Shizuku, config
inbounds: [{type:"mixed", listen:"127.0.0.1", listen_port:7777, set_system_proxy:true}], no tun.
Expected: NewSystemProxy finds exported rish + rish_shizuku.dex
and runs settings put global http_proxy with shell privilege (no VPN slot).
Actual: always root or system (adb) permission is required for set system proxy,
no matter where the files are placed (files/, cache/, external files/,
sing-box/ subdirs, correct uid/gid/context/perms).
Root cause (core):
common/settings/proxy_android.go:23relies onC.FindPath("rish").constant/path.go:30+constant/path_unix.go:9only search
[".", "/etc", "/usr/share", "/usr/local/etc", "/usr/local/share"]
(plusHOME-based entries ifHOMEis set).- On
GOOS=android(Unix branch, Goos/file.go:531),
UserCacheDir/UserConfigDirrequireXDG_*/HOME.
Trigger (SFA app, SagerNet/sing-box-for-android):
Application.kt:57-108 passes basePath/filesDir, workingPath/externalFiles,
tempPath/cacheDir to libbox Setup, but never sets HOME/XDG_* nor
chdirs (libbox/setup.go has no Chdir; sWorkingPath ≠ process cwd,
usually /). Hence FindPath can never hit any app directory.
Suggest (either side fixes it):
- core: resolve
rishviafilemanager.BasePath/sWorkingPath,
or add arish_pathoption / absolute-path support; - app:
setenv("HOME", basePath)(orcwd→workingPath) on startup.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with common/settings/proxy_android.go and constant/path.go plus constant/path_unix.go to trace how FindPath locates rish. Compare those assumptions with Application.kt:57-108 and libbox/setup.go, then reproduce the supplied SFA configuration. Done means set_system_proxy discovers the exported rish files and applies the global proxy without requiring root, system/ADB permission, or a VPN slot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kotlin
- Domain
- mobile-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100