Monthly Archives: February 2018

Stupid Email Tricks

I’ve been working on adding play-by-email support to my turn-based game server. The first problem I hit was that the PGP signatures on the server’s messages were invalid when I checked them on my email client. This led to lots of debugging and unit tests in my crypto utility. That’s not really wasted effort, but it also wasn’t the problem.

It turns out that even though the RFC limit on line length is 1000 characters and there are well-known implementation limits that are only slightly lower, there exists somewhere in the chain from Google AppEngine to Apple Mail some chunk of code that inserts newlines into lines that are much shorter. I didn’t do exhaustive testing, but it seems to happen before 80. The perfectly valid signatures were being rendered invalid because somebody was altering the message after the server signed it and handed it off to the transport agent.

The solution I chose was to use WordUtils from commons-text and to wrap the message at 70 characters before signing. This seems to work. It’s just kind of dumb that it’s necessary, but it’s a good reminder that the thing in your inbox may not actually be the thing sent to you by whomever, and that PGP signing your messages is a good idea even if you don’t encrypt them.

Why I Don’t Write Native Apps

Xcode sucks. That’s why.

Seriously.

This evening I thought, “Hmm, maybe for my next project I’ll see about writing an iOS client for my turn based game server.” So I started looking at a Swift tutorial (the language irritates me so far, but that’s just because so far all the syntactic sugar is solving problems I don’t actually have) and it didn’t seem too difficult. So then I went looking for a PGP library that would work with Swift, and I found one.

So then I cloned the project to my Mac and tried to build it. Build failed. Why? Well, it turns out that I needed to install a utility called xcpretty. No idea why, but that was easily solved. Then the build failed again. Why? Because some $@%! Ruby script wouldn’t execute. (Ruby? WTF? I thought this was an Objective C or maybe Swift compiler!) So then I had to get all comfortable looking for what Ruby wanted. Three scenes of Thor: Ragnarok later, I figured out to gem install xcodeproj and now the build goes a bit farther, but now I’ve got another cryptic error message about how the link failed because the linker couldn’t find the OpenPGP ObjectivePGP framework. The framework that the project is supposed to build.

You know what happens if I have a project open in IDEA and it’s missing a dependency? The missing dependency is underlined in red and the IDE will pop open a window where I could locate the missing thing. You know what happens in Eclipse, with the same situation? Same thing. MPW? Xcode? Nah. Apple’s developer tools reckon that it’s enough just to say, “Nah, that didn’t work.” User-hostile and user-abusive interface.

So.

Xcode sucks.

Sweet, It Works!

Last post I wrote about wanting to write a text-only Twitter client. So, now I’ve done that. It’s not 100% functional and there are still aspects of JavaFX UI that I’m wrestling with (getting buttons to line up the way I want seems to be way harder than it ought to be), but I reckon the application’s ready for people to try out. Currently I’m only building a MacOS installer, but if you’re interested and you want to give it a whirl, you can grab it at https://keybase.pub/sbeitzel/. I’m calling it “TwitterCrank”, since it’s sort of a Twitter client for cranky people (me). Things it does: read your feed, posts tweets, reply to tweets, retweet tweets. Things it doesn’t do (yet): handle direct messages. Things it doesn’t do (and won’t): display inline images, autoplay video, insert promoted tweets in your feed.