How Apple hides new functionality in iOS: isYoMamaWearsCombatBootsActive

13 years ago (github.com)

BeOS had is_computer_on() and is_computer_on_fire() APIs:

  int32 is_computer_on(void)

  Returns 1 if the computer is on. If the computer isn't on, the value returned
  by this function is undefined.

  double is_computer_on_fire(void)

  Returns the temperature of the motherboard if the computer is currently on
  fire. If the computer isn't on fire, the function returns some other value. 

http://www.tycomsystems.com/beos/bebook/the%20kernel%20kit/s...

  • Another Good one from Objective C:

    2012-08-31 00:26:19.773 App[1676:907] * -[__NSCFCalendar components:fromDate:toDate:options:]: fromDate cannot be nil

    I mean really, what do you think that operation is supposed to mean with a nil fromDate?

    An exception has been avoided for now.

    A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil.

    Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):

Without getting into the IT-sexism-blah-blah, 'your mother wears combat boots' isn't just a folksy turn of phrase: it's a fifties-era impugnment of lesbianism. So unless you want to sound a lot more Republican than you were probably intending, you should probably stop wondering why you don't have more female friends, coworkers, and partners. And by the way, a foot in the mouth is so gay.

Here's another easter egg - it's a sarcastic warning if you try to perform date operations on a nil date:

" -[__NSCFCalendar components:fromDate:]: date cannot be nil

I mean really, what do you think that operation is supposed to mean with a nil date?

An exception has been avoided for now.

A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil. Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):"

Source: http://stackoverflow.com/questions/12505833/what-kind-of-sar...

I don't understand, what does this function do? Is it a reference to something? Or just a simple easter egg?

  • Apple ships iOS beta builds before announcing new hardware. They obviously don't want to leak information about new functionality like HDR support too early. So they use a special string "YoMamaWears..." meaning of which is known only to people in the appropriate team. Then, when iPhone 5s is finally released, they easily find-and-replace the obfuscated methods with proper identifiers.

    • It does look like an HDR placeholder, or one hell of a coincidence.

      From `AVCaptureFigVideoDevice.h`

          -- (BOOL)isYoMamaWearsFancyGlasses;
          -- (void)setYoMamaWearsFancyGlassesDetectionEnabled:(BOOL)arg1;
          -- (BOOL)isYoMamaWearsFancyGlassesDetectionEnabled;
          -- (BOOL)isYoMamaWearsFancyGlassesDetectionSupported;
          +- (BOOL)isHighDynamicRangeScene;
          +- (void)setHighDynamicRangeSceneDetectionEnabled:(BOOL)arg1;
          +- (BOOL)isHighDynamicRangeSceneDetectionEnabled;
          +- (BOOL)isHighDynamicRangeSceneDetectionSupported;

      1 reply →

  • It's a feature flag, but it's one that user's don't have easy access to. Pretty much every big software company does this, because it's a very effective way of testing new code. I know MS, Amazon, and Google all have tooling designed to facilitate just this sort of thing.

    Let's say you've rewritten core parts of some system, but you've also added new features that didn't exist before. Often times such changes are inextricably bound together. On the one hand you may want some users to test out the new code to make sure it works correctly, but on the other hand the new features you've added may not be fully "baked" so you want to restrict their use. That's where secret feature flags come in.

I wonder whether Apple will decide to change their strategy of aggressively guarding upcoming products before they are launched, under Cook's leadership.

I was following a couple of 'rumor' blogs prior to the iPhone launches earlier this week and I believe they had managed to 'leak' and publish details on the iPhone 5C and 5S pretty spot on.

EDIT: rather than referring to the variable names in the OP, I'm referring to the more overarching strategy of guarding the features of their to-be-launched products.

  • I doubt it, that's more of a cultural thing instilled by Jobs, it's sort of entrenched as the "Apple way" of doing things. Big Cultural changes in an org typically come about when things are going badly.

    The leaking is going to be hard to stop because Apple largely outsources its manufacturing and is now closely watched (compared to pre-ipod and iphone days). It's hard to enforce secrecy along the entire process when the process is run by third parties and spread around the world.

  • I wondered the same thing, especially after Phil Schiller's comment: "a few of you probably saw some shots on the Web...and that's cool!"

The method's name is actually "isYoMamaWearsCombatBootsSupported". That being said, it's nice to see developers at big companies having fun.

Must be a tradition, the old Newton had some interesting names for functions in its API dealing with horses.

I definitely love those kind of easter eggs.

There are also similar methods in the Android SDK:

UserManager.isUserAGoat() link: http://developer.android.com/reference/android/os/UserManage...

Log.wtf() link: http://developer.android.com/reference/android/util/Log.html..., java.lang.Throwable)

AdapterViewFlipper.fyiWillBeAdvancedByHostKThx() link: http://developer.android.com/reference/android/widget/Adapte...

  • There is also WTF in WebKit source.

    It stands for Web Template Framework, but it's funny it appears all the time in crash reports:

    http://google.com/search?q=wtf+webkit+crash

    For example:

        Thread 2 name:  WebThread
        Thread 2 Crashed:
        0   JavaScriptCore                  0x32a97d46 WTF::StringImpl::hash() const + 42
        1   JavaScriptCore                  0x32a97c6a WTF::HashTable<WTF::StringImpl*, WTF::StringImpl*, WTF::IdentityExtractor<WTF::StringImpl*>, WTF::StringHash, WTF::HashTraits<WTF::StringImpl*>, WTF::HashTraits<WTF::StringImpl*> >::lookupForWriting(WTF::StringImpl* const&) + 18
        2   JavaScriptCore                  0x32a9b028 std::pair<WTF::HashTableIterator<WTF::StringImpl*, WTF::StringImpl*, WTF::IdentityExtractor<WTF::StringImpl*>, WTF::StringHash, WTF::HashTraits<WTF::StringImpl*>, WTF::HashTraits<WTF::StringImpl*> >, bool> WTF::HashTable<WTF::StringImpl*, WTF::StringImpl*, WTF::IdentityExtractor<WTF::StringImpl*>, WTF::StringHash, WTF::HashTraits<WTF::StringImpl*>, WTF::HashTraits<WTF::StringImpl*> >::add<WTF::StringImpl*, WTF::StringImpl*, WTF::IdentityHashTranslator<WTF::StringImpl*, WTF::StringImpl*, WTF::StringHash> >(WTF::StringImpl* const&, WTF::StringImpl* const&) + 448
        3   JavaScriptCore                  0x32a9ae30 WTF::AtomicString::addSlowCase(WTF::StringImpl*) + 96
        4   WebCore                         0x31bade0c WebCore::AtomicHTMLToken::initializeAttributes(WTF::Vector<WebCore::HTMLToken::Attribute, 10ul> const&) + 232

  • There's been balmy little bits of stuff like this all the way through OSX and iOS for ages, though maybe not quite as flippant.

    Every Mac has the kernel extension "Dont Steal Mac OS X.kext" for example, which loads into RAM a short poem.

        There once was was a user that whined 
        his existing OS was so blind, 
        he'd do better to pirate 
        an OS that ran great 
        but found his hardware declined. 
        Please don't steal Mac OS! 
        Really, that's way uncool.

    • I wonder if this has (or had had) some legal significance.

      I remember some issues with the Apple II rom being copied and that they had to add a "Copyright Apple" or something similar to the binary data.

      3 replies →

    • I can definitely understand that, having pulled and Android app from the store because of piracy recently. (in app purchase is really hard to circumvent by pirates, but apps where you pay upfront are pirated like crazy)

      4 replies →

    • Didn't Jobs say "Great Artists Steal."?

      Users who are artists must heed these wise words.

      All Hail the Cult Leader.

      As for this "poem", I've seen better from kids in elementary school. This speaks to the creative aptitude of Apple's kernel engineers. Certainly not the strongpoint of their workforce.

      What sort of royalties or up-front payments did CMU get for letting Apple use their kernel?

      2 replies →

    • Every Maccard on the planet seems to think pirating OS X is an oh so terrible thing to do (to the point that parent post is bringing up poems about it like its a cute, non-weird thing). At the same time pirating everything else on the planet seemingly is OK.

      I've never understood the rationale behind this.

      Keep in mind I'm a software developer myself and run strictly non-pirated software, and open-source as much as possible. You could never make me replace a Linux desktop with a limited OS X experience, and I see no reason what so ever to put in the effort to pirate it.

      But why is it worse to pirate a OS with bad hardware-support out of the box than pirating... say Microsoft Office? I'm just curious what's up with that.

      34 replies →

  • These are not the same, as these are left in production. The code names in the iOS binaries were later replaced by their real functionality as it no longer needed to be secret.

I'd be interested to see the "easter eggs" that drain the battery within 12 hours.

  • 12 hours is a good battery life is it not? Admittedly, the iOS7 BETAs have cut my own down to the point where I have to make sure my phone is on 100% before a 4-5 hour night out so I know I'll have battery to use it by the end of the night.

    Although I suspect that'll be fixed post-beta