Skip to content

Added SU paths for root validation checks.#21

Open
teja8352 wants to merge 1 commit intocapacitor-community:masterfrom
teja8352:feature/added-root-validations-for-android
Open

Added SU paths for root validation checks.#21
teja8352 wants to merge 1 commit intocapacitor-community:masterfrom
teja8352:feature/added-root-validations-for-android

Conversation

@teja8352
Copy link
Copy Markdown

Added SU paths for root validation checks.

Issue Found: Magisk rooting was not identified.

@ryaa ryaa requested a review from andreimuha-ionic January 13, 2026 09:52
Copy link
Copy Markdown
Collaborator

@andreimuha-ionic andreimuha-ionic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @teja8352 .

I see an issue in the current checkSuBinary() implementation:
the list now includes common system directories (/system/, /system/bin/, /data/local/, /sbin/, /system/xbin/, etc.).
Since the check uses new File(path).exists(), this can return true on non-rooted devices and cause false positives.

For SU detection, it’s better to keep only specific root artifacts (files like .../su, Superuser.apk, and specific Magisk indicators), not base directories.

I suggest removing directory paths and adding tests for clean/rooted scenarios (including Magisk).

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