【问题标题】:How to tell if iPad is black or white via code? [duplicate]如何通过代码判断 iPad 是黑色还是白色? [复制]
【发布时间】:2012-05-01 17:10:28
【问题描述】:

我想知道是否有办法通过代码判断 iPad 是黑色还是白色? 一个简单的谷歌搜索没有发现任何东西。

【问题讨论】:

  • 如果你能得到iPad的序列号。

标签: ios ipad cocoa-touch ios5


【解决方案1】:

iPhone 上的序列号为您提供了所有这些信息,您只需将颜色代码映射到颜色本身。

iPhone SN 的典型格式如下: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/

此link 可能有助于获取 S/N。

【讨论】:

    【解决方案2】:

    Apple 设备的颜色可以通过解析其序列号来找到。您可以使用 I/O Kit 获取序列号。请参考:

    Differentiate between black and white iPhones?

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

    但您需要谨慎,因为 Apple 可能会拒绝您的应用(我还没有尝试在我的应用中使用 libIOKit.a):

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-05
      • 2021-06-23
      • 2012-04-04
      • 1970-01-01
      • 2018-04-03
      • 2021-04-14
      • 2018-05-25
      • 2021-05-05
      相关资源
      最近更新 更多