-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathiOSHardware.cs
290 lines (281 loc) · 12.4 KB
/
iOSHardware.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
using Foundation;
namespace Xamarin.iOS
{
[Preserve(AllMembers = true)]
class iOSHardware
{
private readonly iOSChipTypeMap _chipTypeMap;
public iOSHardware()
{
_chipTypeMap = new iOSChipTypeMap();
}
public iOSChipType GetChipType(string hardware) => _chipTypeMap.GetChipType(hardware);
public string GetModel(string hardware)
{
if (hardware.StartsWith("iPhone"))
{
switch (hardware)
{
case "iPhone14,2":
return "iPhone 13 Pro";
case "iPhone14,3":
return "iPhone 13 Pro Max";
case "iPhone14,4":
return "iPhone 13 mini";
case "iPhone14,5":
return "iPhone 13";
case "iPhone13,1":
return "iPhone 12 mini";
case "iPhone13,2":
return "iPhone 12";
case "iPhone13,3":
return "iPhone 12 Pro";
case "iPhone13,4":
return "iPhone 12 Pro Max";
case "iPhone12,8":
return "iPhone SE (2nd generation)";
case "iPhone12,5":
return "iPhone 11 Pro Max";
case "iPhone12,3":
return "iPhone 11 Pro";
case "iPhone12,1":
return "iPhone 11";
case "iPhone11,2":
return "iPhone XS";
case "iPhone11,4":
case "iPhone11,6":
return "iPhone XS Max";
case "iPhone11,8":
return "iPhone XR";
case "iPhone10,3":
case "iPhone10,6":
return "iPhone X";
case "iPhone10,2":
case "iPhone10,5":
return "iPhone 8 Plus";
case "iPhone10,1":
case "iPhone10,4":
return "iPhone 8";
case "iPhone9,2":
case "iPhone9,4":
return "iPhone 7 Plus";
case "iPhone9,1":
case "iPhone9,3":
return "iPhone 7";
case "iPhone8,4":
return "iPhone SE";
case "iPhone8,2":
return "iPhone 6S Plus";
case "iPhone8,1":
return "iPhone 6S";
case "iPhone7,1":
return "iPhone 6 Plus";
case "iPhone7,2":
return "iPhone 6";
case "iPhone6,2":
return "iPhone 5S Global";
case "iPhone6,1":
return "iPhone 5S GSM";
case "iPhone5,4":
return "iPhone 5C Global";
case "iPhone5,3":
return "iPhone 5C GSM";
case "iPhone5,2":
return "iPhone 5 Global";
case "iPhone5,1":
return "iPhone 5 GSM";
case "iPhone4,1":
return "iPhone 4S";
case "iPhone3,3":
return "iPhone 4 CDMA";
case "iPhone3,1":
case "iPhone3,2":
return "iPhone 4 GSM";
case "iPhone2,1":
return "iPhone 3GS";
case "iPhone1,2":
return "iPhone 3G";
case "iPhone1,1":
return "iPhone";
}
}
if (hardware.StartsWith("iPod"))
{
switch (hardware)
{
case "iPod9,1":
return "iPod touch 7G";
case "iPod7,1":
return "iPod touch 6G";
case "iPod5,1":
return "iPod touch 5G";
case "iPod4,1":
return "iPod touch 4G";
case "iPod3,1":
return "iPod touch 3G";
case "iPod2,1":
return "iPod touch 2G";
case "iPod1,1":
return "iPod touch";
}
}
if (hardware.StartsWith("iPad"))
{
switch (hardware)
{
case "iPad14,2":
return "iPad mini (6th generation) Wi-FI + Cellular";
case "iPad14,1":
return "iPad mini (6th generation) Wi-FI";
case "iPad13,11":
return "iPad Pro (12.9-inch) (5th generation) Wi-Fi + Cellular";
case "iPad13,10":
return "iPad Pro (12.9-inch) (5th generation) Wi-Fi + Cellular";
case "iPad13,9":
return "iPad Pro (12.9-inch) (5th generation) Wi-Fi";
case "iPad13,8":
return "iPad Pro (12.9-inch) (5th generation) Wi-Fi";
case "iPad13,7":
return "iPad Pro (11-inch) (3rd generation) Wi-Fi + Cellular";
case "iPad13,6":
return "iPad Pro (11-inch) (3rd generation) Wi-Fi + Cellular";
case "iPad13,5":
return "iPad Pro (11-inch) (3rd generation) Wi-Fi";
case "iPad13,4":
return "iPad Pro (11-inch) (3rd generation) Wi-Fi";
case "iPad13,2":
return "iPad Air (4th generation) Wi-Fi + Cellular";
case "iPad13,1":
return "iPad Air (4th generation) Wi-Fi";
case "iPad12,2":
return "iPad (9th Generation) Wi-Fi + Cellular";
case "iPad12,1":
return "iPad (9th generation) Wi-Fi";
case "iPad11,7":
return "iPad (8th Generation) Wi-Fi + Cellular";
case "iPad11,6":
return "iPad (8th Generation) Wi-Fi";
case "iPad11,4":
return "iPad Air (3rd generation) Wi-Fi + Cellular";
case "iPad11,3":
return "iPad Air (3rd generation) Wi-Fi";
case "iPad11,2":
return "iPad mini (5th generation) Wi-Fi + Cellular";
case "iPad11,1":
return "iPad mini (5th generation) Wi-Fi";
case "iPad8,12":
return "iPad Pro (12.9-inch) (4th generation) Wi-Fi + Cellular";
case "iPad8,11":
return "iPad Pro (12.9-inch) (4th generation) Wi-Fi";
case "iPad8,10":
return "iPad Pro (11-inch) (2nd generation) Wi-Fi + Cellular";
case "iPad8,9":
return "iPad Pro (11-inch) (2nd generation) Wi-Fi";
case "iPad8,8":
return "iPad Pro 12.9-inch (3rd Generation)";
case "iPad8,7":
return "iPad Pro 12.9-inch (3rd generation) Wi-Fi + Cellular";
case "iPad8,6":
return "iPad Pro 12.9-inch (3rd Generation)";
case "iPad8,5":
return "iPad Pro 12.9-inch (3rd Generation)";
case "iPad8,4":
return "iPad Pro 11-inch";
case "iPad8,3":
return "iPad Pro 11-inch Wi-Fi + Cellular";
case "iPad8,2":
return "iPad Pro 11-inch";
case "iPad8,1":
return "iPad Pro 11-inch Wi-Fi";
case "iPad7,12":
return "iPad (7th generation) Wi-Fi + Cellular";
case "iPad7,11":
return "iPad (7th generation) Wi-Fi";
case "iPad7,6":
return "iPad (6th generation) Wi-Fi + Cellular";
case "iPad7,5":
return "iPad (6th generation) Wi-Fi";
case "iPad7,4":
return "iPad Pro (10.5-inch) Wi-Fi + Cellular";
case "iPad7,3":
return "iPad Pro (10.5-inch) Wi-Fi";
case "iPad7,2":
return "iPad Pro 12.9-inch (2nd generation) Wi-Fi + Cellular";
case "iPad7,1":
return "iPad Pro 12.9-inch (2nd generation) Wi-Fi";
case "iPad6,12":
return "iPad (5th generation) Wi-Fi + Cellular";
case "iPad6,11":
return "iPad (5th generation) Wi-Fi";
case "iPad6,8":
return "iPad Pro 12.9-inch Wi-Fi + Cellular";
case "iPad6,7":
return "iPad Pro 12.9-inch Wi-Fi";
case "iPad6,4":
return "iPad Pro (9.7-inch) Wi-Fi + Cellular";
case "iPad6,3":
return "iPad Pro (9.7-inch) Wi-Fi";
case "iPad5,4":
return "iPad Air 2 Wi-Fi + Cellular";
case "iPad5,3":
return "iPad Air 2 Wi-Fi";
case "iPad5,2":
return "iPad mini 4 Wi-Fi + Cellular";
case "iPad5,1":
return "iPad mini 4 Wi-Fi";
case "iPad4,9":
return "iPad mini 3 Wi-Fi + Cellular (TD-LTE)";
case "iPad4,8":
return "iPad mini 3 Wi-Fi + Cellular";
case "iPad4,7":
return "iPad mini 3 Wi-Fi";
case "iPad4,6":
return "iPad mini 2 Wi-Fi + Cellular (TD-LTE)";
case "iPad4,5":
return "iPad mini 2 Wi-Fi + Cellular";
case "iPad4,4":
return "iPad mini 2 Wi-Fi";
case "iPad4,3":
return "iPad Air Wi-Fi + Cellular (TD-LTE)";
case "iPad4,2":
return "iPad Air Wi-Fi + Cellular";
case "iPad4,1":
return "iPad Air Wi-Fi";
case "iPad3,6":
return "iPad (4th generation) Wi-Fi + Cellular (MM)";
case "iPad3,5":
return "iPad (4th generation) Wi-Fi + Cellular";
case "iPad3,4":
return "iPad (4th generation) Wi-Fi";
case "iPad3,3":
return "iPad 3 Wi-Fi + Cellular (CDMA)";
case "iPad3,2":
return "iPad 3 Wi-Fi + Cellular (GSM)";
case "iPad3,1":
return "iPad 3 Wi-Fi";
case "iPad2,7":
return "iPad mini Wi-Fi + Cellular (MM)";
case "iPad2,6":
return "iPad mini Wi-Fi + Cellular";
case "iPad2,5":
return "iPad mini Wi-Fi";
case "iPad2,4":
return "iPad 2 Wi-Fi";
case "iPad2,3":
return "iPad 2 CDMA";
case "iPad2,2":
return "iPad 2 GSM";
case "iPad2,1":
return "iPad 2 Wi-Fi";
case "iPad1,1":
return "iPad";
}
}
if (hardware == "i386" || hardware == "x86_64")
return "Simulator";
if (hardware == "mac")
return "Mac";
return (hardware == "" ? "Unknown" : hardware);
}
}
}