Ο Sauric απαντάει στην πρόκληση της RipDev:
(This is the author of MobileSubstrate.) Ok, I would normally totally ignore something like this, but now you are getting into the world of personal misinformation. :(
For the record, my day job actually is (at least often) doing these kind of hacks. I have spent the last few years doing embedded ARM development, working for a client that wants code they wrote 20 years ago to work on their new device, often without source code or documentation. This requires drastic reverse engineering efforts and various hooks into the code.
Now/, however, my day job is iPhone/Android development, and has been for months. After I released Cycorder I started spending less and less time doing consulting, and now I simply don’t do it at all.
Finally, my PhD work is in “Post-Compile-Time Code Modification and Optimization”. As an undergraduate I even published a paper on hooking method calls in pre-existing Java applications (which is actually more difficult than doing the same for C/Objective-C, as you can’t just back-patch the already loaded code).
I therefore find your assertions that my expertise is lacking in this area surprising ;P.
You also happen to be making a couple incorrect claims about my work, which I will now address. As an example: the way I do C hooking /definitely/ allows multiple hooks to coexist. I highly recommend reading the code again: each time someone hooks the function, they will lift out a trampoline which contains code to call the previous hook.
This is difficult to see as it is a side effect of the hooking process as opposed to an explicit feature, so I understand why you missed it. To be honest, even I have to rethink through why it works if I haven’t looked at it in a couple months.
In the case of MobileSafety’s signal hooks, you have a point, but it is a dubious one: remember that inserted libraries are loaded before the original application. This means that the application is going to be forced to hook them after I do: I can’t stop those hooks, and can only hope that they call through to me afterwards. The only time there should be another handler I’d have to call through to is if another library made such a hook.
I will, therefore, fix this issue, but it should be made very clear that this is not even remotely the big deal you are making it out to be, and that your specific complaint about “insert a full-fledged GUI application” is simply false. Even then, the entire concept of the argument is weird: the mobile safe mode mechanism /only/ hooks SpringBoard.
Past that, you make a few correct, but unimportant claims: the fact that MobileSubstrate attempts to use Objective-C’isms when possible ever so slightly slows it down. However, when you are already hooking Objective-C messages this cost isn’t noticeable. I would love to see some high-level numbers where you show the costs.
Specifically, for example, I can’t imagine the startup penalty of MobileSubstrate is even measurable. An application already takes about two seconds to load. I know that all of the measurements I’ve done simply haven’t mattered.
As for the 50-400 instructions per hook, that is only going to cause issues when you are hooking something at the lowest possible depths of a program (where only a foolish developer used Objective-C to begin with). Think about it: what is the hook even doing? It’s probably/hopefully going to be sending a number of further messages, which will swamp the couple hundred nanoseconds you are concerned about.
That said, I agree: it would be nice to provide that option, and I thank you for the suggestion. The next version of MobileSubstrate will also support an IMP pass-through method of calling the next hook (although given that, as you say, it is slightly more bothersome to the developer, I doubt many people will prefer it).
This is one of the wonderful aspects of open source: you were able to read MobileSubstrate, and give me a useful suggestion. A patch would have been even cooler, but this is still awesome.
On that note, I didn’t even know that Mobile Enhancer was something that third parties could use. (To be very frank: I wasn’t even certain that Mobile Enhancer did anything similar to MobileSubstrate until today.) Is there any documentation for it, or any examples? If you Google search for it you just get confused users trying to guess what it is for. One gets the feeling that you preferred that technology to be for RiPDev’s internal usage on their projects, not something to be used by everyone.
Really, AFAIK, MobileSubstrate is in use by as many people as it is only because I wrote WinterBoard, which I designed because A) SummerBoard was dead, B) I don’t remember FaceLift fully working on 2.x at the time, and C) even if it did, it was commercial anyway and I felt the most bang-for-the-buck could be had giving that part away. While doing this, everyone really wanted WinterBoard to be open source, especially given that SummerBoard simply got abandoned and FaceLift was stagnating.
Originally, therefore, I simply wrote it. At that same time, a number of other people /also/ wanted to hook things, and were coming to me for the techniques (which, as you know, were more complex on 2.x due to the new Objective-C ABI). I just kept pointing them to WinterBoard’s source code. As far as I still know, this is because no one knew how to use Mobile Enhancer to do this, assuming that they even were able to.
After a couple weeks of this, I finally decided to abstract that part of the code out of WinterBoard into a library, in order to A) make this easier and B) allow the hooks to be centralized (which makes installing them much simpler: too many developers were messing up their installation programs and SWOD’ing people’s devices). So that’s the story of why it was written.
If Mobile Enhancer had been “out there” and documented (which something that is closed source kind of has to be to be usable ;P), maybe no one would have come to me, and maybe no one would be using Mobile Substrate. You never know.
Συζήτηση στο forum: PseudoSubstrate vs MobileSubstrate
You might also like
More from Cydia
Ο δημοφιλής Έλληνας developer Ηλίας Λιμναίος κατάφερε να ξεκλειδώσει τη δυνατότητα επικοινωνίας του iPhone με NFC συσκευές! Η επικοινωνία κοντινού πεδίου (Near Field Communication, NFC) αποτελεί μια πρότυπη τεχνολογία συνδεσιμότητας, η οποία διαδίδεται και εξελίσσεται ραγδαία με κύριο σκοπό τη λύση αρκετών …
Ο nikosgnr μας ενημερώνει σχετικά με το PickPocket, ένα νέο Cydia Tweak το οποίο υπόσχεται να προστατέψει την iOS συσκευή σας με τρόπους που η Apple δεν έχει ακόμη (;) προσθέσει στο λειτουργικό της σύστημα: Το PickPocket είναι πλέον ο βασιλιάς των …
Ο mod vrachamis του iPhoneHellas forum μας ενημερώνει σχετικά το Traverse, ένα πολλά υποσχόμενο tweak που επιτρέπει στον χρήστη να εμπλουτίσει τα αναδυόμενα μενού των εφαρμογών της iOS συσκευής του, με εκατοντάδες επιπλέον επιλογές. Το 3D Touch hardware engine έχει κάνει την εμφάνιση του …
Ο mod nikosgnr του iPhoneHellas forum μας ενημερώνει σχετικά με το App Admin, ένα νέο Cydia tweak που μας επιτρέπει να κατεβάσουμε μία πρότερη έκδοση εφαρμογής από αυτήν που διατίθεται αυτή τη στιγμή στο App store... απευθείας από την iOS συσκευή …
Ευχάριστα νέα για όσους χρήστες Jailbroken συσκευών αρέσκονται στο παραμετροποιούν την εμφάνιση της συσκευής τους, καθώς το WinterBoard αναβαθμίστηκε και πλέον είναι συμβατό και με το iOS 9. Σύμφωνα με τον Saurik, η αναβάθμιση του WinterBoard (v0.9.3919) δοκιμάστηκε από τον ίδιο τον Surenix (γνωστό από …