Saagar Jha writes about macOS and iOS internals, debugging, Swift, and low-level programming topics.
Commenters value his detailed macOS walkthroughs, like the one on private logging, and cite his iOS JIT and ptrace post and his package manager opinions.
Come on, you know me better than that.
In this case, the comment fit the conversation. The original comment was a short, pithy, and rather sarcastic one that was, nonetheless, correct. They pointed out that we need to write higher-Quality software, in order to give folks like the NSO people fewer “hooks.” The NSO folks are smart, dedicated people, that, in other circumstances, we would admire for their creativity and intelligence. They often take advantage of mistakes (or deliberate decisions) made by folks that we may find less admirable.
I like this community and medium, and sincerely want to be a “good citizen.” The opportunity to interact with people like you, is a privilege that I respect and value. We may not always agree on everything, but I find many of your contributions to be inspiring, educational, and relevant, so I appreciate you. You have taught me lessons, and have changed my mind, and, I’m sure, will continue to do so. You have great insight, knowledge, and experience, which I value, and appreciate you sharing it (for example: https://saagarjha.com/blog/2023/12/22/swift-concurrency-waits-for-no-one/). People like you, are why I like this place. We have no social interaction, so I have no idea if we’d get along, IRL. I would like to think we would, but I’m often wrong, and not afraid to promptly admit it.
For myself, I try to participate by making very specific suggestions, and “keeping it focused on me.” I don’t attack others, even if I find what they say…
Honestly, they're both very good, and any discussion of this is going to be almost bordering on opinion and little else.
Here are a few potential downsides:
- The 'kool kids' tend to use brew -- so sometimes you end up with packages that are not in the ports ecosystem. That said, the total number of ports is, I believe, about 4x larger than brew's formulae. But take that number with a pinch of salt.
- Every time you upgrade the OS (e.g. 10.14 to 10.15) you need to effectively reinstall ports. This sounds hard, but it isn't -- it's also well documented [1]. It's because they link against various OS-specific foundations.
- Very rarely you run into apt-style "dependency hell". This has only happened to me once or twice in ~15 years of using it, and is easily fixed.
The upsides:
- All that being said, it's rock stable
- The documentation is excellent
- It doesn't come with google analytics by default (unlike brew -- which is opt-out, I should say)
- Macports retains the entire dependency tree of a package and offers both source and binary builds
A more detailed comparison could be found e.g. here: https://saagarjha.com/blog/2019/04/26/thoughts-on-macos-package-managers/
[1] https://trac.macports.org/wiki/Migration
Beyond any TOS issues there has always been a technical issue where an app store app cannot write to memory that is marked executable for security purposes.
This prevents JIT's but does not prevent an interpreter from functioning since an interpreter does not directly generate machine code and execute it, it simply reads the code to interpret as data and executes through its own engine.
Most modern JS engines JIT which is why you don't see say electron / node / chromium based stuff on iOS, a lot of it has to do with V8 requiring the ability to JIT.
Hermes does not JIT so it sidesteps the technical limitations on iOS then its just a matter of passing review.
There where some ways around this that have been patched and Apple has recent introduced an official entitlement but does not allow it in the app store yet:
https://saagarjha.com/blog/2020/02/23/jailed-just-in-time-compilation-on-ios/
https://9to5mac.com/2020/11/06/ios-14-2-brings-jit-compilation-support-which-enables-emulation-apps-at-full-performance/
To me it appears they admit that iSH allows scripting (ummm, obviously), and that scripting is against Apple’s policy (as we all know). From one of their articles: “Soon after we released iSH without apk, we found users who had figured out a way to get apk back using wget and were posting about this throughout the internet”.
They argue that Apple’s policy should be changed to allow scripting: https://saagarjha.com/blog/2020/11/08/fixing-section-2-5-2/
It looks to me that Apple’s main reason for not allowing scripting is to prevent an app from deploying other apps within itself (preventing any competition with the app store), with a secondary reason being security for users (harder to argue against).
I can’t see Apple ever allowing a shell app into the store, as that would turn your iDevice into a general purpose computer.
wait a sec...I recognize that name. I only know how to enable private logging thanks to your detailed and informative blog post! Seriously, it's one of the favorite macOS things I've read in a while. I loved the step by step walk through using gdb you showed.
Though just today I saw that apparently an enterprise policy config can enable private logging in 10.15.3+ without having to disable SIP. https://georgegarside.com/blog/macos/sierra-console-private/
For reference for others: this is the blog post by OP on enabling private logging in Catalina. check it out! https://saagarjha.com/blog/2019/09/29/making-os-log-public-on-macos-catalina/#enabling-private_data-by-hand
There is an opt-in developer mode on iOS. You can compile and install any software you want on your own iPad; no paid Apple developer account needed.
There’s even a way to get W^X memory regions on iOS by abusing ptrace: https://saagarjha.com/blog/2020/02/23/jailed-just-in-time-compilation-on-ios/
It can’t be submitted to the App Store or deployed with TestFlight, but you can build and install an app using that hack just fine on your own device.
Open source browser vendors, like Firefox and Chromium, could provide builds that enable a full browser engine experience on iOS devices, were they to think it worth the effort.