HomePod detection located in High Sierra…

Ok. This is news to me. So the “AudioAccessory” and “HomePod” are not the same things? That is. Not for IMFoundation.framework:

#define NSNotFound    NSIntegerMax

void * +[IMDeviceSupport marketingNameForModel:](void * self, void * _cmd, void * arg2) {
    r15 = arg2;
    if ([r15 rangeOfString:@"iPod"] == NSNotFound) {
            rbx = @"iPad";
            if ([r15 rangeOfString:rbx] == NSNotFound) {
                    rbx = @"iPhone";
                    if ([r15 rangeOfString:rbx] == NSNotFound) {
                            rbx = @"Mac";
                            if ([r15 rangeOfString:rbx] == NSNotFound) {
                                    if ([r15 rangeOfString:@"AppleTV"] == NSNotFound) {
                                            if ([r15 rangeOfString:@"Watch"] == NSNotFound) {
                                                    rbx = @"HomePod";
                                                    if ([r15 rangeOfString:@"AudioAccessory"] == NSNotFound) {
                                                            rbx = @"Mac";
                                                    }
                                            }
                                            else {
                                                    rbx = @"Apple Watch";
                                            }
                                    }
                                    else {
                                            rbx = @"Apple TV";
                                    }
                            }
                    }
            }
    }
    else {
            rbx = @"iPod touch";
    }
    rax = rbx;
    return rax;
}

So basically what happens here is that if it finds an “AudioAccessory” (as product/model identifier) then it returns “HomePod”. So that we, the users, know what it is. Fine. Not a big deal.

The string “HomePod” can also be found in Sharing.framework

Time to get some food. I’m hungry…

Edit: Right. Someone spotted an error – see comments. Fixed. Thank you. Back to my food now.

Cool. I also found some interesting strings. I think that this is for a (future) HomePod setup app on Mac’s.

	<key>MY_HOME</key>
	<string>My Home</string>

	<key>ROOM_BATHROOM</key>
	<string>Bathroom</string>
	<key>ROOM_BEDROOM</key>
	<string>Bedroom</string>
	<key>ROOM_DEFAULT</key>
	<string>Default Room</string>
	<key>ROOM_DINING_ROOM</key>
	<string>Dining Room</string>
	<key>ROOM_GARAGE</key>
	<string>Garage</string>
	<key>ROOM_HALLWAY</key>
	<string>Hallway</string>
	<key>ROOM_KITCHEN</key>
	<string>Kitchen</string>
	<key>ROOM_LIVING_ROOM</key>
	<string>Living Room</string>
	<key>ROOM_MASTER_BEDROOM</key>
	<string>Master Bedroom</string>
	<key>ROOM_OFFICE</key>
	<string>Office</string>
	<key>ROOM_PATIO</key>
	<string>Patio</string>

I can’t remember it, but haven’t we seen this before? For the AppleTV maybe?

5 thoughts on “HomePod detection located in High Sierra…

  1. I’m not sure if I’m reading this wrong, but it looks to me like it returns “Mac” only when “AudioAccessory” is NSNotFound?
    This seems to be about mapping internal product names to marketing names, so when it matches “AudioAccessory” it’ll return “HomePod” – kind of like how it returns “iPod touch” when it finds ‘iPod”, or “Apple TV” instead of “AppleTV”

  2. Hi Pike, how are you?
    It’s still a obj-c code (in swift 4.0 era) … Anyway this piece of code looks hilarious to me.
    This is what the above statement should be inside their implementation:

    if ([arg2 rangeOfString:@”AudioAccessory”] == NSNotFound) { // last resort
    // OMG, I’ll return “Mac” because maybe this is not made by Apple!! cry cry
    return @”Mac”;
    }

    So if made by Samsung or Sony you still continue to see an Apple stuff lol

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s