News for hackers. Stuff that matters.
Re:Apple Is Sending URLs to Tencent? by saagarjha on Sunday October 13, 2019 @04:10PM (#21242628)
Took a quick look, and this appears to be enabled if [NSLocale.currentLocale.countryCode isEqualToString:@"CN"]:

  char ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2(void * _block) {
      rax = [NSLocale currentLocale];
      rax = [rax retain];
      r14 = [[rax countryCode] retain];
      [rax release];
      rbx = [r14 isEqualToString:@"CN"] != 0x0 ? 0x1 : 0x0;
      [r14 release];
      rax = rbx;
      return rax;
  }
Update: the code for Tencent Safe Browsing seems to be very similar to that which talks to Google, down to it being under a "Google" namespace, the API endpoints being named the same, and performing hashing which seems to match the "Update API" here: https://developers.google.com/safe-browsing/v4/update-api. I think this is just "whatever Google could see before, Tencent can see now, if you're in China". I'm no expert, so I have no idea if that's k-anonymous or whatever if Tencent/Google decide they want to track you, but in either case it's just shifting who's getting your hashes.
Re:Apple Is Sending URLs to Tencent? by eastendguy on Sunday October 13, 2019 @05:30PM (#21243193)
> if [NSLocale.currentLocale.countryCode isEqualToString:@"CN"]:

So even for US and EU based users the data is send to Tencent just because they enabled Chinese language support? Who programmed that?

Re:Apple Is Sending URLs to Tencent? by Gaelan on Sunday October 13, 2019 @06:07PM (#21243479)
iOS has separate region and language settings. Quick look at Apple docs suggests that this is the former.
Re:Apple Is Sending URLs to Tencent? by gowld on Monday October 14, 2019 @03:02AM (#21245826)
No, it's the latter.

In NSLocale, "region" is a subtype of language, as in a regional dialect, not an independent dimension.

https://developer.apple.com/documentation/foundation/nslocal...

https://developer.apple.com/library/archive/documentation/Ma...

Re:Apple Is Sending URLs to Tencent? by dchest on Tuesday October 15, 2019 @02:37AM (#21256064)
Nope, [[NSLocale currentLocale] countryCode] returns Region country code from settings. The same code is also used for language region, so you can end up with something like zh_US.
Re:Apple Is Sending URLs to Tencent? by toxik on Sunday October 13, 2019 @05:35PM (#21243231)
I wonder if there are similar oversights with the US locale, seeing as a lot of developers prefer English interfaces to the somewhat craptastic localizations.
Re:Apple Is Sending URLs to Tencent? by jhanschoo on Monday October 14, 2019 @01:36PM (#21250737)
CN is the country code, not the language code. zh-CN is simplified chinese localized to mainland China. If you want simplified chinese try something like zh-HK or zh-SG.

But there is valid criticism to be had that Apple should be signposting more visibly the differences between its settings for CN and outside CN.

Re:Apple Is Sending URLs to Tencent? by Aperocky on Sunday October 13, 2019 @06:27PM (#21243609)
Your data is sent to Google otherwise.
Re:Apple Is Sending URLs to Tencent? by eastendguy on Monday October 14, 2019 @03:59AM (#21246068)
...which is what I strongly prefer (rule of law and all that). Of course, as others have said, on-device processing would be the best.
Re:Apple Is Sending URLs to Tencent? by solidangle on Sunday October 13, 2019 @05:58PM (#21243415)
Not just EU and US based users, but also Hong Kong and Taiwan based users.
Re:Apple Is Sending URLs to Tencent? by yorwba on Sunday October 13, 2019 @07:54PM (#21244164)
Hong Kong, Macao and Taiwan all have their own ISO 3166 codes and users there are unlikely to accidentally set the region to CN, since the difference between simplified and traditional characters is quite obvious.
Re:Apple Is Sending URLs to Tencent? by giancarlostoro on Sunday October 13, 2019 @06:13PM (#21243519)
This sounds like the more dangerous story here. What the heck?
Re:Apple Is Sending URLs to Tencent? by bidluo on Sunday October 13, 2019 @06:36PM (#21243678)
Google is blocked in China so naturally they'd need a Chinese alternative, with everything going on it's easy to fear monger but people need to chill out a bit. Locale is probably one of the least intrusive ways to determine location, using GPS would probably cause an even further problem if people realise that there's a backdoor to avoid location permission

Any company that markets/releases in China and relies on some google service (maps/safe search/safety net/google sign in/firebase/etc) need to find an alternative, not because everyone is on the Chinese payroll but more often than not these services are business critical.

Re:Apple Is Sending URLs to Tencent? by busymom0 on Sunday October 13, 2019 @07:14PM (#21243923)
Wouldn't the locale be set to CN for phones which are in non-china countries too?
Re:Apple Is Sending URLs to Tencent? by ptlu on Sunday October 13, 2019 @08:52PM (#21244408)
Language and Locale are separate preferences. You can mix and match however you want on iOS.
Re:Apple Is Sending URLs to Tencent? by giancarlostoro on Sunday October 13, 2019 @10:17PM (#21244766)
Oh I see. That is where I got confused then.
Re:Apple Is Sending URLs to Tencent? by rocqua on Sunday October 13, 2019 @05:04PM (#21243021)
What kind of code am I looking at, it seems pretty cool. I this some automatically 'reverse compiled' assembly?

In any case, I'd love to know how you generated this. Would be very cool to get something similar out of an executable.

Re:Apple Is Sending URLs to Tencent? by saagarjha on Sunday October 13, 2019 @05:08PM (#21243042)
It's "decompilation" of a block invoke for Backend::Google::SSBUtilities::shouldConsultWithTencent() taken by opening /System/Library/PrivateFrameworks/SafariSafeBrowsing.framework/SafariSafeBrowsing in Hopper Disassembler.
Re:Apple Is Sending URLs to Tencent? by carol0987 on Wednesday October 16, 2019 @09:57PM (#21278265)
SafariSafeBrowsing.framework
Re:Apple Is Sending URLs to Tencent? by elwell on Sunday October 13, 2019 @05:07PM (#21243039)
> ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2

I'm glad I don't use Objective-C... That's some Java level function naming there.

Edit: may have spoke too soon, appears to be possible reverse engineered / decompiled?

Re:Apple Is Sending URLs to Tencent? by lelf on Sunday October 13, 2019 @05:21PM (#21243132)

  bash$ c++filt <<< ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2
  invocation function for block in Backend::Google::SSBUtilities::shouldConsultWithTencent()
Edit: what are downvotes for? That is the standard way to decipher C++ mangling, using built-in (binutils) tools.
Re:Apple Is Sending URLs to Tencent? by msbarnett on Sunday October 13, 2019 @05:22PM (#21243139)
You’re looking at the method name after the compiler got done mangling type information into it for the linker. The human-readable name that (what appears to be an anonymous block) likely appears within in the source code appears to be “shouldConsultWithTencent” in a namespace (class?) “Backend::Google::SSBUtilities”.

The other line noise encodes return and argument types via the process of Name Mangling: https://en.wikipedia.org/wiki/Name_mangling

Re:Apple Is Sending URLs to Tencent? by saagarjha on Sunday October 13, 2019 @05:09PM (#21243054)
This is a block invoke for a mangled C++ function. You'd know it as a lambda inside of Backend::Google::SSBUtilities::shouldConsultWithTencent().
Re:Apple Is Sending URLs to Tencent? by jimktrains2 on Sunday October 13, 2019 @05:14PM (#21243090)
It appears to be the symbol in the binary. C++ also does similar things. It's called mangling. https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling

It's also the reason you sometimes need to extern c or otherwise mark symbols being exported via a c-abi in c++ so that they don't get mangled.