Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deobfuscate GPU vendor name on iOS 12.2+ and Safari 14+ #7

Closed
TimvanScherpenzeel opened this issue Nov 6, 2019 · 16 comments
Closed

Comments

@TimvanScherpenzeel TimvanScherpenzeel self-assigned this Nov 6, 2019
@TimvanScherpenzeel TimvanScherpenzeel changed the title Research if the changes to hide the GPU vendor name on iOS effect the functioning of the library Research if the changes to hide the GPU vendor name on iOS 12.2+ effect the functioning of the library Nov 6, 2019
@TimvanScherpenzeel
Copy link
Collaborator Author

From what I can quickly see on my iPhone 8 (13.1.3) it reports the GPU name just fine.

@pqml
Copy link

pqml commented Nov 7, 2019

Hi,

I tested on several iOS devices (iPhone 7+ with iOS 12 , iPhone 7 with iOS 13, iPhone X with iOS 13.2)

detect-gpu wrongly reports their GPU as apple a12x bionic gpu (This is the iPad Pro GPU chip)

On https://webglreport.com/ they are all referred as Apple GPU

@TimvanScherpenzeel
Copy link
Collaborator Author

Thanks @pqml for your report! I'll have a look if I'm able to add a workaround without drastically increasing the library size. I've updated the user agent library to handle the new ipadOS user agent which should help with classifying it.

@TimvanScherpenzeel TimvanScherpenzeel changed the title Research if the changes to hide the GPU vendor name on iOS 12.2+ effect the functioning of the library Research if the changes to hide the GPU vendor name on iOS 12.2+ effects the functioning of the library Nov 7, 2019
@TimvanScherpenzeel TimvanScherpenzeel added the help wanted Extra attention is needed label Nov 7, 2019
@TimvanScherpenzeel
Copy link
Collaborator Author

TimvanScherpenzeel commented Nov 7, 2019

Active Theory does a CPU benchmark to pick a GPU. This could work reasonably well but I would need to inform if they would be okay with me modifying it and open sourcing it.

Screenshot 2019-11-07 at 16 07 36

Perhaps I can use a similar principle, use https://github.com/Strernd/cpu-benchmark/blob/master/index.js (or another CPU benchmark) and write my own tests.

That said I would like to avoid using these hacks as it causes the library to require more maintenance (with new product releases and devices getting older) than I have time for.

@luruke
Copy link

luruke commented Nov 7, 2019

Interesting @TimvanScherpenzeel – I'm wondering how that would work when the phone is doing other stuff in background (updates, notifications...)

@Samsy
Copy link

Samsy commented Nov 7, 2019

Hum, hard to rely on those tests

https://medium.com/@Samsy/detecting-apple-a10-iphone-7-to-a11-iphone-8-and-b019b8f0eb87

That would be a 100% way to differentiate them, ridiculous way... but still

@TimvanScherpenzeel
Copy link
Collaborator Author

TimvanScherpenzeel commented Nov 7, 2019

Hum, hard to rely on those tests

https://medium.com/@Samsy/detecting-apple-a10-iphone-7-to-a11-iphone-8-and-b019b8f0eb87

That would be a 100% way to differentiate them, ridiculous way... but still

Thanks for your research on it 💯

I'll have a look if I can codegolf your findings down using vanilla WebGL and if it is able to detect all the different GPU's reliably.

Tracking branch here: https://github.com/TimvanScherpenzeel/detect-gpu/tree/add-apple-gpu-samsy

@TimvanScherpenzeel
Copy link
Collaborator Author

TimvanScherpenzeel commented Nov 7, 2019

Had some time this evening to look into it and was able to port @Samsy 's Three.js implementation to vanilla WebGL. You can have a look at it here: https://github.com/TimvanScherpenzeel/detect-gpu/blob/add-apple-gpu-samsy/src/internal/deobfuscateRendererString.ts. Would like to add / test all the affected models in question but I don't have many of them.

@Samsy
Copy link

Samsy commented Nov 7, 2019

Will test it tomorrow !
Would love to see credits in there too if that's possible ;)

Many thanks !

@TimvanScherpenzeel
Copy link
Collaborator Author

Will test it tomorrow !
Would love to see credits in there too if that's possible ;)

Many thanks !

Thanks, I’ve added your article and link to the source 🙂

@TimvanScherpenzeel
Copy link
Collaborator Author

In terms of testing I was able to test various devices on Browserstack except for the latest iPhone 11. I'm thinking about combining the resolution test with these findings to be able to narrow them down further.

Screenshot 2019-11-08 at 15 44 27

@Ben-Mack
Copy link

Hi @TimvanScherpenzeel, Is the check ready? Could you merge it into master?

@TimvanScherpenzeel
Copy link
Collaborator Author

Hi @Ben-Mack, the check partly there but not yet fully ready. I had stopped working on it as I didn't have the means to properly test the solution nor did I have a need in my job to work on it. You are welcome to contribute checks that could narrow down the GPU version more accurately. As it currently stands I feel the amount of code and the obscure complexity of it doesn't bring enough benefits to add it to master.

@TimvanScherpenzeel
Copy link
Collaborator Author

@Samsy @Ben-Mack Safari 14+ also appears to obfuscate its renderer as 'apple gpu'. Seeing as Safari is only ran on Apple products we could possibly narrow it down quite a bit. The current implementation returns 'fallback' as mentioned in #25.

I've opened an MR to track progress: #26

If any of you would like to help or have ideas how this could be solved it would be greatly appreciated.

@TimvanScherpenzeel TimvanScherpenzeel changed the title Research if the changes to hide the GPU vendor name on iOS 12.2+ effects the functioning of the library Deobfuscate GPU vendor name on iOS 12.2+ ans Safari 14+ Sep 28, 2020
@TimvanScherpenzeel TimvanScherpenzeel changed the title Deobfuscate GPU vendor name on iOS 12.2+ ans Safari 14+ Deobfuscate GPU vendor name on iOS 12.2+ and Safari 14+ Sep 28, 2020
@TimvanScherpenzeel
Copy link
Collaborator Author

Will be included in the 2.0 release

@TimvanScherpenzeel TimvanScherpenzeel added fixed in upcoming release and removed help wanted Extra attention is needed labels Oct 7, 2020
@TimvanScherpenzeel
Copy link
Collaborator Author

Included in release 2.0.0: https://www.npmjs.com/package/detect-gpu/v/2.0.0

Thanks for all the input!

By combining this implementation with other meta data (screen size, user agent) the results from my testing are shown to be accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants