Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if iPad is black or white via code? [duplicate]

I was wondering if there was a way to tell if an iPad is black or white via code? A simple Google search hasn't turned up anything.

like image 707
Shredder2794 Avatar asked Apr 20 '12 05:04

Shredder2794


2 Answers

The serial number on the iPhone gives you all this info, you just need to map the code for colour to the colour itself.

Typical format of the iPhone SN is as follows: AABCCDDDEEF

AA = Factory and Machine ID
B = Year of Manufacturing (9 is 2009/2019, 0 is 2010/2020, 1 is 2011 and so on)
CC = Production Week (01 is week 1 of B, 11 is week 11 of B and so on)
DDD = Unique Identifier
EE = Color (A4=black)
F = size (S=16GB, T=32GB)

http://www.pressbyte.com/640/decode-iphone-hardware-information-serial-number/

This link may be helpful for getting the S/N.

like image 165
Jack Avatar answered Nov 11 '22 06:11

Jack


The color of an Apple device can be found by parsing its serial number. You can use I/O Kit to get the serial number. Please refer to:

Differentiate between black and white iPhones?

Using IOKit to return Mac's Serial number returns 4 extra characters

But you need to be cautious because it is possible for Apple to reject your app (I haven't tried to use libIOKit.a in my app yet):

If I access the iPhone serial number inside an app, is it allowed in the App Store?

like image 39
Hailei Avatar answered Nov 11 '22 06:11

Hailei