From b3a720a415e577d1a93f5d49b3ad4498bdd67a53 Mon Sep 17 00:00:00 2001 From: Gary Mathews Date: Thu, 12 Sep 2019 10:30:17 -0700 Subject: [PATCH] fix(ios): include new iphone models into os extension (#11212) Fixes TIMOB-27395 --- common/Resources/ti.internal/extensions/node/os.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/Resources/ti.internal/extensions/node/os.js b/common/Resources/ti.internal/extensions/node/os.js index 2321af006b6..5896957988f 100644 --- a/common/Resources/ti.internal/extensions/node/os.js +++ b/common/Resources/ti.internal/extensions/node/os.js @@ -206,6 +206,12 @@ if (isIOS) { // Now a giant hack for looking up CPU info for OS.cpus() on iOS // https://www.theiphonewiki.com/wiki/List_of_iPhones const AppleMap = { + // iPhone 11 Pro Max + 'iPhone12,5': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ], + // iPhone 11 Pro + 'iPhone12,3': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ], + // iPhone 11 + 'iPhone12,1': [ 'Apple A13 Bionic @ 2.66 GHz', 2660 ], // iPhone XR 'iPhone11,8': [ 'Apple A12 Bionic @ 2.49 GHz', 2490 ], // iPhone XS Max @@ -337,7 +343,7 @@ if (isIOS) { */ const cpuModelAndSpeed = (model) => { const trimmed = model.replace(' (Simulator)', '').trim(); - return AppleMap[trimmed]; + return AppleMap[trimmed] || [ 'Unknown', 0 ]; }; // override cpus impl OS.cpus = () => {