Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad practice(?) #1

Open
opa334 opened this issue Apr 21, 2023 · 3 comments
Open

Bad practice(?) #1

opa334 opened this issue Apr 21, 2023 · 3 comments

Comments

@opa334
Copy link

opa334 commented Apr 21, 2023

Detecting the rootlessness of the jailbreak at runtime should be avoided, instead the latest theos and rootless.h should be used.

The only point of this would be to support Xina, and for that the better solution is to just use rootful paths as it correctly binpatches most of them. More obscure paths still need to be redirected manually, but 99% of tweaks do not use these.

@opa334 opa334 changed the title Bad practice Bad practice(?) Apr 21, 2023
@jjolano
Copy link
Owner

jjolano commented Apr 21, 2023

Hi opa, yes I am aware of the new rootless macros.

I agree that tweaks being rootless at compile-time rather than runtime is best practice - performance and design wise, however I do require this for the time being for compatibility reasons. Even though I chose not to provide support for Xina, I still consider it a valid userbase to at least try and have Shadow functional without breaking other platforms. Unfortunately, even with the binpatching there have been random (inconsistent) issues with Shadow before I implemented runtime rootless. Shadow does primarily deal with file paths, so I suppose it may be more sensitive to the binpatching.

I do believe the detection method used here should be (for the most part) solid and reliable, without causing any issues for now.

@opa334
Copy link
Author

opa334 commented Apr 21, 2023

I have updated the macros with a xina support flag, not upstreamed yet but I will make a PR to theos soon
https://github.com/opa334/headers/blob/master/rootless.h

@jjolano
Copy link
Owner

jjolano commented May 4, 2023

So the main issue I have with that and the original rootless.h is that it queries the filesystem - and that is slow. RootBridge does not rely on any file system checks and even stores the rootless result in memory through its (shared) object.. I would think its basically one step away from compile time at that point.

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

No branches or pull requests

2 participants