question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ios detection broken?

See original GitHub issue

I was just testing with my iphone (xs / ios 14.6) and noticed it was returning the default tier…

Looking into things, I see the magic pixel number returned by deobfuscateAppleGPU is not 801621810 or 8016218135. Instead it is returning 80162181255.

It then defaults to the renderer that was passed in, causing it to find nothing since it is obfuscated. When deobfuscateAppleGPU fails to find a matching magic pixel, I think it should return all ipad / iphone chipsets.

i.e. something like

      const { oldChipsets, newChipsets } = deviceInfo?.isIpad
        ? {
            oldChipsets: ['apple a12x gpu'],
            newChipsets: ['apple a9x gpu', 'apple a10 gpu', 'apple a10x gpu']
          }
        : {
            oldChipsets: ['apple a9 gpu', 'apple a10 gpu'],
            newChipsets: [
              'apple a11 gpu',
              'apple a12 gpu',
              'apple a13 gpu',
              'apple a14 gpu'
            ]
          };
      renderers = (
        {
          // iPhone 11, 11 Pro, 11 Pro Max (Apple A13 GPU)
          // iPad Pro (Apple A12X GPU)
          // iPhone XS, XS Max, XR (Apple A12 GPU)
          // iPhone 8, 8 Plus (Apple A11 GPU)
          '80162181255': newChipsets,
          // iPhone SE, 6S, 6S Plus (Apple A9 GPU)
          // iPhone 7, 7 Plus (Apple A10 GPU)
          // iPad Pro (Apple A10X GPU)
          '8016218135': oldChipsets
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
        } as any
      )[pixels.join('')] ?? [...newChipsets, ...oldChipsets];

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
baptistebrielcommented, Sep 22, 2021

Hey there! Just tested the example on an iMac M1, and it’s returning tier: 1

{
  "gpu": "apple m1 (Apple M1)",
  "isMobile": false,
  "tier": 1,
  "type": "FALLBACK"
}

Shouldn’t it be treated as a good performance device? I am also getting the same with iPhone 12 (apple gpu) Thanks a lot for this lib anyway!

2reactions
Gustedcommented, Aug 20, 2021

Would be great if @Gusted could have a look as well but don’t worry if it doesn’t fit your schedule +1

Just came back from a vacation, and school is starting in ~2 weeks again. So I can take some looks but I won’t be able to do make a big PR or anything like that.

I had a quick look over the spreadsheet and must say that apple has done a fair job at obfuscating the relevant “detection property”. Detecting the difference between iPad models will be a bit easier than between the iPhone models, the iPad models seems to have different screen size(and properly reported by the browser) which is a point that you can have them “separated” into smaller groups. Also the newest(?) iPad Pro seems to use a M1 chip which is a guarantee change in the float point precision which according to the spreadsheet seems to be true and the 2 using the M1 chip also report different screen sizes so those 2 can you already detect reliable.

A solution for the iPads will to be have the float point precision + screen sizes which will give you ~50%+ of the way there.

for the iPhones… I always wondered why each iteration of the iPhone is such similair to the previous one, and this only just confirm it 😄. So this will need a tricky one, maybe something that can difference the behavior of apple’s chips(as each iteration came with a more better etc etc apple chip) something closely related to some kind of precision, but good enough that it’s notice-able between these iterations of models.

Regards, Gusted

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detect that screen is broken to al… | Apple Developer Forums
If the user broke the screen, the iphone can detect that the screen is broken and how do I display a message about...
Read more >
Baby crying? Glass breaking? Easily turn your iPhone into a ...
You can use your iPhone to detect the sound of glass breaking so you can notify the authorities safely from your bedroom.
Read more >
iPhone 14's crash detection is terrifying with false alarms
The new car crash detection system on iPhone 14 has the potential to save lives. However, a false alarm can also be quite...
Read more >
Skiers accidentally setting off iPhone 14 Crash Detection ...
Shortly after the iPhone 14 launched this fall, the new Crash Detection feature was found to be unintentionally triggered by roller coasters ...
Read more >
How to detect that the app is running on a jailbroken device?
You can detect through code that if the app is running on a jail broken device or not. Through that way you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found