opa334 / Dopamine

Dopamine is a semi-untethered jailbreak for iOS 15 and 16
MIT License
3.2k stars 1.54k forks source link

Plans for randomizing the /var/jb path #42

Closed H5GG closed 1 year ago

H5GG commented 1 year ago

I know it's hard, but I have to work hard in this direction, rootless is a great initiative, and the entire jailbreak community has put in a lot of effort.

I know that /var/jb has been discussed two years ago, please forgive me for being absent from this historical moment due to health reasons, and in the past year the entire jailbreak community has updated a large number of tools based on /var/jb And the basic library. It is impossible for everyone to rewrite all the code now, especially on the eve of Fugu15Max's upcoming public release.

But randomizing the /var/jb path is not hopeless, it is still a thing worth planning and thinking about. All basic jailbreak tools and libraries of ios15 are open source, such as fugu15max, procursus bootstrap, theos, dkpg, sileo, zebra, etc. As long as we put in the time, sooner or later we can get a rootless jailbreak that randomizes the /var/jb path.

However, it is not enough for us to only have a jailbreak tool and basic library, almost no one just wants a jailbreak tool without the support of third-party jailbreak software. Most people care more about the jailbreak apps and jailbreak brought after jailbreak tweaks.

So although we can modify and recompile jailbreak tools and base libraries to randomize /var/jb in the future, no one can recompile all third-party jailbreak apps/tweaks, especially a large number of third-party closed source Jailbreak apps/tweaks. This is our biggest concern.

Fortunately, there are still ways to alleviate this problem. We don't need to randomize the /var/jb path immediately, nor do we need to modify and recompile all jailbreak tools and basic libraries immediately.

We only need to adjust the interactive interface of jailbreak apps/tweask and rootless jailbreak, we let jailbreak developers no longer rely on the fixed path of /var/jb to code. In this way, we can randomize /var/jb in the future , and maintain good compatibility with third-party jailbreak apps/tweaks, at least not needing to re-modify and recompile all third-party apps/tweaks.

Implementation: We do not modify the fixed path of /var/jb at present, we only need to add a fixed environment variable pointing to /var/jb to all processes, and the code written for the fixed path of /var/jb will not be invalid immediately , is still compatible.

Environment variables can be easily hidden from specific processes (apps) in the future, and environment variables are very easy to use and code in c/c++/obj-c/swift/shell scripts.

We can lead jailbreak apps/tweaks developers to use this environment variable, and inform developers that the /var/jb path will be changed/randomized in the future.

This plan doesn't solve all problems right away, but at least it makes our subsequent work of randomizing /var/jb easier to implement.

wwpp3399 commented 1 year ago

good

segg21 commented 5 months ago

^ This. Proof apps is starting to detect /var/jb symlink, even when not in jailbroken state. The only fix for this is deleting the symlink every time using Filza :/

Due to the nature of tweaks depending on this symlink to be permanent, I don't think there's a way to have var/jb randomized for each device. Would've been a good thought before Dopamine went this far in rootless development.

For those who run into apps detecting jailbreak, the only resolution is deleting var/jb. There's no need to factory reset your entire device. This also will not delete your jb environment. /var/jb symlink would be restored next time you jailbreak.

Thought I would share since it took me a while to figure out what an app was detecting to consider my device being jailbroken.