Hangouts Dials Wrong Country Prefix

I'm in the US, my locale settings are set to en-US, the carrier my phone is using is in the US, yet Hangouts would dial +44 before every phone number.

Why?

My SIM came from the UK, and its country code is gb, and this is apparently the ONLY thing Hangouts looks at when dialing numbers. Not the device's current locale settings, your current location, or any normally user-set option.

On boot, Android will initialize its telephony system based on the SIM card. I noticed this was set on my device:

gsm.sim.operator.iso-country=gb

Setting it to us got Hangouts to dial +1 instead of +44. That would get reset after a boot, so I tried making it permanent by setting it in build.prop, but it was still being overwritten after boot - Android reads the SIM and will change the value of gsm.sim.operator.iso-country again.

My "solution" was to then set a script to set the value, and get that script to run after boot.

Some ROMs (such as CyanogenMod) had support for init.d, but that hasn't worked in a while.

Instead of trying to get init.d working, I've found there are a few apps that will run a script on startup.

My current favorite is Boot Shell, which requires a 99¢ unlock to run scripts. Why this program? It's simple, it looks nice, its memory footprint was relatively low (30MB vs 80MB that a similar program used), and I didn't notice it lingering in the background after boot.

I recommend blocking its Notifications, so you don't get a notice on every boot.

Current country code script (as recent as 2016-09-01): countrycode.zip (~1KB)

1) Install Boot Shell and its Pro Unlock
2) Extract the countrycode.sh script to /sdcard/Boot_Shell/Scripts/
3) Run Boot Script and enable the startup script