Skip to content

fix: Resolve permission errors by replacing run-as with su#1

Merged
ksg97031 merged 1 commit intomainfrom
fix/run-as-problem
Sep 29, 2025
Merged

fix: Resolve permission errors by replacing run-as with su#1
ksg97031 merged 1 commit intomainfrom
fix/run-as-problem

Conversation

@ksg97031
Copy link
Owner

@ksg97031 ksg97031 commented Sep 29, 2025

Resolve the facebook#92 issue. (Verified working on Galaxy, Android 13)


The previous run-as command was unstable on certain devices and Android versions, sometimes failing to acquire the necessary permissions.

This commit resolves the issue by directly looking up the application's UID based on its data directory ownership and then using the su command to switch to that user. This approach is more robust and explicitly uses the application's permissions.

Change-set: run-as '${app}' -> su $(su -c 'stat -c "%u" /data/data/${app}')
Note: This change requires a rooted device.

@ksg97031 ksg97031 self-assigned this Sep 29, 2025
@ksg97031 ksg97031 merged commit 75676f7 into main Sep 29, 2025
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.

1 participant