Archive for October 21, 2019

Monday, October 21, 2019

How Kernel Prelinking Works on macOS Catalina (or Not)

Objective Development:

The kernel is the first component of the operating system to start. It has no other tools available. In particular there is no way to check code signatures, and all file system access is very hard at this point. Apple therefore decided to prelink the bare kernel with all kernel extensions every time the kernel or one of the extensions is updated, and to start only that prelinked kernel at boot time.

[…]

Since the prelinked kernel is on a read-only volume, it cannot be updated directly. Apple had to conceive a new mechanism for updates.

[…]

When you reboot or shut down your machine, launchd stops all processes. Then it remounts the system volume in read/write mode. This is possible because launchd has the entitlement com.apple.private.apfs.mount-root-writeable-at-shutdown. Then it runs /var/install/shove_kernels to copy the new kernel.

But apparently this doesn’t actually work. So to update a kernel extension you need to disable System Integrity Protection or manually trigger a kernel update after booting into macOS Recovery.

Safari Security Code AutoFill

kyro:

the pm at apple who came up with sms verification code auto-fill deserves a nobel prize

Dan Hill:

Yea this is hands down one of the most elegant features I’ve used. Solved a real problem, simply, with no effort on my part.

Ricky Mondello:

The idea for Security Code AutoFill came out of a small group of software engineers working on what we thought was a much more ambitious project. It wasn’t a PM, it wasn’t just one person, and it wasn’t what we set out to do initially.

It started as a small side idea we had while designing something very different. We jotted it down, tabled it for weeks, and then picked it up after the “more ambitious” project wasn’t panning out. It was hard, but I’m so glad we changed focus.

Even with a gem of an idea, it was still just an idea. Ideas are obviously super important — they’re necessary, but not sufficient. Here, the end result came from the idea, teamwork, and execution.

Years later, I’m still so proud of the team for making this feature happen. The team combined expertise from several areas to ship magic that worked on day 1, while asking nothing of app and website developers, without giving anyone your text messages. This still inspires me!

This is a really great feature, and it’s reliable. I wish there were a way to use it with third-party Mac browsers. As far as I know, they have no way to access SMS at all, except perhaps by snooping the Notification Center database.

Previously:

Font Substitution and Missing Text

Michel Fortin:

I recently found a bug in my work-in-progress-next-major-version of Counterparts Lite where text in certain languages was not showing up in the text editor.

[…]

It is important to know however that there’s a crucial difference between changing the font in willProcessEdting and in didProcessEditing:

  • willProcessEditing is called before font substitution. Any font you set while in willProcessEditing will get substituted with an appropriate font for characters not available in the font you choose.

  • didProcessEditing is called after font substitution. If you change the font while in didProcessEditing there will be no further font substitution, and thus you should make sure the font you set can display all the characters.

iTunes XML and Music in Catalina

Dani Deahl:

According to Apple, the new Music app, which replaces iTunes, removes support for automatically syncing playlists with third-party apps using XML. XML file support is a popular organizational feature for DJs who use it to sort tracks into playlists and utilize the “Share iTunes Library XML with other applications” option to seamlessly transmit data between apps.

[…]

Tons of popular DJ apps, like Rekordbox and Traktor, read XML files and relied on iTunes’ syncing feature.

[…]

A statement from Apple initially said XML would not be supported within the app. This story has also been updated to clarify that Music supports a new method for automatically syncing playlists that third-party apps can be updated to support.

Nick Heer:

I’d love to hear a good explanation of why XML music libraries are no longer supported in Catalina. This seems to be arbitrary.

Not even a preference or a way to script it.

Ewan Spence:

Since iTunes 11 Apple has offered an SDK to access the iTunes library without going through the iTunes XML file, and this sandboxed approach continues to work on Catalina. Yes there should be a cut-off point, but that should be communicated well in advance and any mitigating action is promised should be delivered.

Kirk McElhearn:

DJs don’t use iTunes to play music, but they do use its powerful organizational tools to manage and find music, which is then played by specific apps for DJing. Those apps accessed the XML file simply to find the locations of files and play them; with the ability to dump an XML file, nothing much should change, other than the need to do this manually.

[…]

The big problem here is that developers, aware of this change since the initial beta release of macOS Catalina, have not done the necessary work to update their software. Apple provides an iTunesLibrary framework, available since iTunes 11, which allows developers to directly access the .itl file used to store information about the Music app’s library. Some developers of DJ apps have already made the transition. It’s not that hard to learn how to use this instead of using the XML file.

Jamie Zawinski (tweet):

As someone who has used the various iTunes APIs extensively, I can make this authoritative statement:

Hahahahahahahahaha, no.

The XML files are the only way to make anything work.

Also note that the article appears to say that one of the features they removed was the ability to export and import playlists as XML files. The fact that there is an API that lets you interrogate the contents of the iTunes library does not change the fact that people out there have a lot of those XML files that they use on a daily basis, since that’s the interchange format between iTunes and various DJ software.

Also, ITLibrary is a read-only interface. So tell me how I use that write ObjC code to take my old XML files and then tell iTunes, “make a playlist from these tracks”?

Kirk McElhearn:

In the macOS Catalina Music app, you can no longer have this file created automatically, but you can create it manually.

[…]

To do this, choose File > Library > Export Library, name the file, and save it.

Peter N Lewis:

They changed iTunes bundle ID when they renamed it to Music. That seems unnecessary and annoying.

The bundle identifier for Contacts is still com.apple.AddressBook.

Matthias Gansrigler:

I love those optimized apps!

Peter Steinberger:

With the new iTunes-is-now-shoved-into-Finder there’s now no more progress indicator for a manual backup? Button is gray and you gotta wait. (Not that the progress was very accurate, but still).

Damien Petrilli:

The split of iTunes had one (overlooked) effect: the media keys / touch bar / AirPods play button only controls the music App and not the TV App if you are watching videos.

Damien Petrilli:

Another perk of killing iTunes I guess. Playing local videos used to be energy efficient, not anymore.

It’s even worst than Safari and Xcode cumulated.

Damien Petrilli:

After iOS, macOS Music App:

1. You barely see the difference between the active and disabled gray
2. The active gray is lighter than disabled gray.

Luna259:

I can’t right click on songs to get things like the metadata or file location, it sometimes refuses to close, the UI glitches (the pause button doesn’t change to play when paused) and the three dots menu doesn’t work for any of the songs or albums

Kirk McElhearn:

What Do You Think of the New macOS Media Apps that Replace iTunes?

Currently, 29% like them, 57% miss iTunes, and the rest don’t have a preference.

Ed Starkie:

After the Catalina update, all of my music in iTunes was gone except for 7 or 8 items from the iTunes store. Otherwise ~32 GB of music gone.

Grady Booch:

I truly loathe/abhor/execrate/abominate/curse/ahathematize and generally do not like the new @Apple Music app that comes with Catalina.

(It broke much of my album art, it is buggy with regard to sorting, and it is less customizable with regard to presentation.)

Previously:

Update (2019-10-25): Doug Adams:

  1. ITLibrary does not know about Work and Movement tags.
  2. ITLibrary does not know the difference between playlists in the Music app and playlists in the TV app. You can ask for discrete music tracks or TV tracks or movie tracks, but not discrete playlists from either app.
  3. ITLibrary does not know what a subscription playlist is. It’s an Apple Music playlist you have added to your library. ITLibrary sees it as a Regular playlist.
  4. Ditto Loved and Disliked for tracks
  5. Ditto Loved and Disliked for playlists
  6. ITLibrary does not distinguish among types of cloud tracks (uploaded, matched, duplicate, etc)
  7. ITLibrary does not provide a Track ID which is used to correlate the tracks in a playlist to their library entries and vice versa.

And I’m sure I’ve run into other minor impediments. Wait, bonus gripe: converting decimal persistent IDs to hexidecimal.

Update (2019-11-02): Adam Bell:

Cool.

Update (2019-11-06): See also: Casey Liss.

FSF Missed the Cloud and Mobile

Stefano Maffulli (via Hacker News):

The point that everybody misses is that Stallman’s views on software don’t matter anymore. The FSF should have nurtured and grown new leaders a long time ago, leaders who looked into the future, understand cloud and mobile computing and their threats to a free society.

[…]

I had the first inkling that the Free Software Foundation and the free software movement was heading to for a crash when the GPLv3 was being drafted in 2005. At the time, I was leading the Italian chapter of Free Software Foundation Europe and it was clear to me that RMS didn’t have a grasp of where the industry was going. He was laser focused on closing the embedded device loophole, preventing what he called the TiVoization of free software. All around him, not a single voice could argue strongly enough about the Google issue that later would become the *-as-a-service loophole and cloud issue.

[…]

Right after the GPLv3 came out, Google was relieved they could continue doing business as usual, Linux kept its license and the FSF waged war against Debian and Mozilla. Stallman led the FSF out of the most important focus for the future because he wanted a pure free software operating system for his laptop? Definitely feels that way: he wanted zero binary blobs in device drivers, zero non-free Javascript. His dream of a pure operating system was there, almost close enough to touch. Meanwhile, the concept of computers evolved to include mobile phones and cloud. And those are just evil.

Much has been written lately about Richard Stallman the person, but what of his movement? I’m not sure whether it’s anyone’s fault, or what could have been done differently, but it definitely feels like the moment has passed. His concerns may be more relevant than ever, but the world has changed so that the avenues to address them seem increasingly futile. Open-source software is more widely used, but platforms and services are increasingly locked down. Free software didn’t bring the expected freedom.

Previously:

WKWebView Scroll Position

Brent Simmons:

In NetNewsWire, I use JavaScript evaluation with a WKWebView to get the current scroll position.

It broke in Catalina. I used document.body.scrollTop to get the y position, which appears to always return 0 now.

Workaround: window.pageYOffset seems to work.

Phil Dokas:

The workaround I found was document.documentElement.scrollTop. This one’s mutable where window.pageYOffset is read-only.

It’s a long road to replace the WebView APIs that worked for so long.

Matt Netkow (via Michael Love):

Recently, Apple introduced a new App Submission warning stating that they are formally deprecating UIWebView. We wanted to let the Ionic community know what this warning is all about and how the Ionic team plans to address it.

[…]

Sometime in the future, iOS apps may be blocked from release to the App Store when Apple decides to enforce blocking apps that use UIWebView.

[…]

The Cordova team is actively discussing a plan to move forward. This will take time as they plan the best way to move forward without severely impacting users.

Previously: