theos / theos

A cross-platform suite of tools for building and deploying software for iOS and other platforms.
https://theos.dev
Other
4.43k stars 1.08k forks source link

[suggestion] rootless libraries link against other rootless libraries #726

Closed H5GG closed 1 year ago

H5GG commented 1 year ago

What problem are you trying to solve?

Avoid using the /var/jb fixed path to link unrooted libraries, otherwise we won't be able to modify the /var/jb path or randomize it without recompiling the tweak.

Describe the solution you’d like

exampes: the install name of the first rootless libraries is "@rpath/usr/lib/libA/libA.dylib" the install name of the second rootless libraries is "@rpath/usr/lib/libB/libB.dylib"

1: libA.dylib link against libB.dylib with "@rpath/usr/lib/libB/libB.dylib" 2: add rpath "@loader_path/../../../" to libA.dylib

so the rpath does not need to contain any fixed path, and we can use the complete subpath of the library in the jb root directory for the install name. And this method is also officially supported by Apple.

Describe any alternatives you’ve considered

No response

Documentation, Adoption, Migration Strategy

No response

kirb commented 1 year ago

Really appreciate the idea, but I’m going to close this based on it being explained as impractical by the Procursus team here: https://github.com/opa334/Dopamine/issues/30#issuecomment-1517005681

H5GG commented 1 year ago

hi, bro, both me and procursusTeam re-tested and it really works~
https://github.com/opa334/Dopamine/issues/30#issuecomment-1517955245