kpwn / yalu102

incomplete iOS 10.2 jailbreak for 64 bit devices by qwertyoruiopz and marcograssi
Do What The F*ck You Want To Public License
1.77k stars 554 forks source link

Rework Reload Script. #386

Closed ReddestDream closed 7 years ago

ReddestDream commented 7 years ago

This change should get Substrate completely working after jailbreak without the need to reload the System or Apple Watch LaunchDaemons and should have no regressions. It should also speed up the process going from tapping "go" after a reboot back to the jailbroken state since it reduces the number of daemons that need to be loaded/reloaded.

I noticed @kpwn's concern about reloading daemons in my pull request for the HDMI fix, and I thought: "What if instead of reloading so many daemons and risking breaking things, we only reloaded the daemons we really needed to reload?"

@coolstar gave me the idea for this approach. He said he had been doing something like this on iOS 9.3.3 to fix things when Substrate failed, so it should always work to get Substrate going.

I've tested this on my iPad Pro and iTouch 6G (both iOS 10.2), and Substrate is still working correctly, HDMI adapter is still working, and I have not noticed any other issues. The process of going from the unjailbroken state after reboot back to the jailbroken state is also sped up on both my devices. I don't have an Apple Watch, however, so I am unable to test that. :/

I'm making this pull request seeking additional testing (especially of Apple Watch interactions) and approval of the overall approach. I admit I do not fully understand how the exploits work, and if there is a need to unload/reload other daemons that I have not observed, I will gladly add them back. I just realized from my experiments to figure out how to fix HDMI that the basic exploit still works without reloading daemons. Thx.

eriksmets commented 7 years ago

I always thought the reloading-userland-part was necessary to inject substrate into every process and enable hooking lowlevel-stuff.

ReddestDream commented 7 years ago

@eriksmets Same, but now I don't think as much is necessary as you might think. Go ahead and give this a try and see if any hooking actually breaks. I'd appreciate feedback.

timonline commented 7 years ago

@ReddestDream have iPhone 5S, iPhone 6S+, and an iPad Air 1 but no Apple Watch. Would you like me to test the new commit?

ReddestDream commented 7 years ago

@timonline Sure. Thx.

timonline commented 7 years ago

@ReddestDream first time it successfully jailbroke and tweaks were working however, as soon as the screen turned off i couldn't turn it back on. I could however, still SSH to it.

Had to force reboot and re-jailbreak, this time worked fine. Even tested turning the screen off, back on and re-entering the password

ReddestDream commented 7 years ago

@timonline Ah. Okay. Maybe it was just a fluke that the screen got stuck. Haven't seen anything like that here. Thanks for checking. :)

timonline commented 7 years ago

@ReddestDream no problem

kpwn commented 7 years ago

Absolutely no.

ReddestDream commented 7 years ago

@kpwn Why not? Like, seriously. I'd like to know. No disrespect.

Why do all these daemons need to be reloaded like this? And if it's not necessary, why do it?

dareal68 commented 7 years ago

@kpwn If you do not agree with this approach, I think you should give your point of view rather than answer "No"

kpwn commented 7 years ago

This is absolutely not OK to do, breaks a lot of tweaks, is not proper, ijap00 level stuff, etc etc etc.

I believe issues are caused by how I patch AMFI. I can just patch it differently.

ReddestDream commented 7 years ago

@kpwn Okay. I get that. What tweaks does it break? I can test them and unload/reload the needed daemons.

I'm just thinking that perhaps limiting what we reload out of /System/Library/LaunchDaemons will prevent issues like the one I found with the HDMI adapter . . .

I believe issues are caused by how I patch AMFI. I can just patch it differently.

Ah. Okay. Thx for looking into it. We can help test. :)

kpwn commented 7 years ago

see, both the only-reload-what-is-needed and reload-all-but approaches work in theory, but in practice they are both wrong. I can argue that the former is however even more wrong than the latter. A semi-tether jailbreak should guarantee a full userland reload.

ReddestDream commented 7 years ago

@kpwn Okay. I get your point. If you can fix AMFI so that userland can be fully reloaded without breaking anything, that's cool. I was just worried that we would see more issues creeping up with "minor" daemons like what I found with fud/HDMI . . . :/

Thank you for your explanation! :)

dareal68 commented 7 years ago

@kpwn Thank you for explaining us the situation, I'm looking forward for another AMFI patch. We are here to help, just ask for testing if you need us.

ReddestDream commented 7 years ago

We are here to help, just ask for testing if you need us.

👍