-
Notifications
You must be signed in to change notification settings - Fork 57
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 Safari 14+ (MacOS) #47
Comments
This article is about GPU detection of iPhones using the floating point precision. It works for iPhone 7 vs iPhone 8 and +. Maybe we could investigate to get more precision? |
@bastienrobert we are currently using an optimised version of that in https://github.com/TimvanScherpenzeel/detect-gpu/blob/9b2b19726499439b545c084a569a16300ab2de7f/src/internal/deobfuscateAppleGPU.ts#L19-L118. Some earlier research for handling iOS 12.2+ iPhones / iPads specifically was done in #7. It could be worth testing to see if we can get different floating point numbers on different Mac GPU's. |
I think it is safe to say Safari only runs on Mac devices. From https://gfxbench.com/result.jsp I was able to gather the following list of possible GPU's (I'll update this comment with more data related to the specific devices).
|
Agree with that |
Sadly it appears that the benchmark data we use from gfxbench is quite outdated and Apple has been using a plethora of different GPUs over the years. I think we can do some preliminary boxing of categories based on the screen size but at this point in time I don't see a feasible way to reasonably accurately determine the GPU. Another challenge is that even if we are able to narrow down the scope it will be very hard to evaluate our implementation because you will need access to physical devices (Browserstack does that with mobile devices and tablets but desktops are virtualised). This is one of the reasons why I prefer using detect-gpu for setting defaults in the application so that a user can pick the rendering quality themselves. I'll leave this ticket open for now, any ideas are welcome :) |
Is safari manipulating the screen dimensions? Iphone 11 pro max has a 6,5 inch screen(2688x1242) and the Iphone 12 pro max has a 6,7 inch screen(2778x1284). Otherwise you could reliably* detect those 2 apart. |
Interesting, the benchmark data reports both as having
|
Ah.. wait a second, this is because of recent change where we include internalBenchMarkResults.ts, the resolution has been reported wrongly there: detect-gpu/scripts/internalBenchmarkResults.ts Lines 92 to 99 in 6f21403
|
Aha, phew 😅 Safari isn't faking screen dimensions. |
And that issue should be fixed now in 3.1.2 nice job! 🎈 |
Fixed in 3.1.3, I had mistakingly not ran |
I'm seeing a problem in Safari 15 (Technology Preview Release 127) on macOS 11.4 on an iMac with an AMD Radeon Pro 580 8GB GPU. The demo page (which appears to be loading the latest 3.1.9 release) incorrectly identifies the tier of this GPU:
On Chrome and Firefox, however, it is identified correctly:
Let me know if there's anything I can do to help or any tests I can run. |
@TimvanScherpenzeel – Apologies, I misread your last comment to indicate that you'd fixed this problem in Safari 14. I see this is still an ongoing issue. Happy to help by running any tests. |
Hi @CaelanStewart, you are correct that this is an open problem due to the obfuscation that Apple does. |
we could probably get quite far by detecting different models of apple laptops based on screen resolutions.. unless they are connected to an external display that is |
@TimvanScherpenzeel I noticed you mentioned Active Theory's solution in #7 and mentioned it's a hacky way (I agree), but I want to point to their solution is based on 51Degrees/Renderer in case it helps. They do exactly the same but have excluded the CPU Benchmarking from their code. |
Currently Safari 14 obfuscates the renderer string as 'apple gpu' preventing an accurate match.
https://github.com/TimvanScherpenzeel/detect-gpu/blob/de0e8d4695a0a6d8f8dcc424af68714ada2e76f7/src/internal/deobfuscateAppleGPU.ts#L119
A possible solution could be to have a lookup table of possible GPUs iMacs and Macbooks can have and matching on that with extra metadata (devicePixelRatio, screenSize, user agent).
Open for any suggestions / PR's 😃
The text was updated successfully, but these errors were encountered: