[HTC One SV] BrateloSlava:
Hello!

After buying this phone model, I was horrified to learn, that he does not want to connect to my wi-fi router in the 5 GHz range. :mad:

Full description of the problem and how to resolve it are described in this and this topics.

I have carefully read both topics and the following materials:

MccTable.java

Mobile country code

Dalvik opcodes

I tried all the proposed solutions and they are not quite like me. I decided to do everything a little bit differently.

telephony-common\smali\com\android\internal\telephony\MccTable.smali

OLD

.method public static countryCodeForMcc(I)Ljava/lang/String;
.locals 2
.parameter "mcc"

.prologue
.line 124
invoke-static {p0}, Lcom/android/internal/telephony/MccTable;->entryForMcc(I)Lcom/android/internal/telephony/MccTable$MccEntry;

move-result-object v0

.line 126
.local v0, entry:Lcom/android/internal/telephony/MccTable$MccEntry;
if-nez v0, :cond_0

.line 127
const-string v1, ""

.line 129
:goto_0
return-object v1

:cond_0
iget-object v1, v0, Lcom/android/internal/telephony/MccTable$MccEntry;->iso:Ljava/lang/String;

goto :goto_0
.end method

NEW

.method public static countryCodeForMcc(I)Ljava/lang/String;
.locals 2
.parameter "mcc"

.prologue
.line 124
invoke-static {p0}, Lcom/android/internal/telephony/MccTable;->entryForMcc(I)Lcom/android/internal/telephony/MccTable$MccEntry;

move-result-object v0

.line 126
.local v0, entry:Lcom/android/internal/telephony/MccTable$MccEntry;
[COLOR="Red"]# if-nez v0, :cond_0[/COLOR]

.line 127
[COLOR="red"] const-string v1, "us"[/COLOR]

.line 129
:goto_0
return-object v1

:cond_0
iget-object v1, v0, Lcom/android/internal/telephony/MccTable$MccEntry;->iso:Ljava/lang/String;

goto :goto_0
.end method

framework\smali\android\net\wifi\WifiStateMachine.smali

OLD

.method private setCountryCode()V
.locals 3

.prologue
.line 3780
iget-object v1, p0, Landroid/net/wifi/WifiStateMachine;->mContext:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string/jumbo v2, "wifi_country_code"

invoke-static {v1, v2}, Landroid/provider/Settings$Global;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

.line 3782
.local v0, countryCode:Ljava/lang/String;
if-eqz v0, :cond_0

invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z

move-result v1

if-nez v1, :cond_0

.line 3783
const/4 v1, 0x0

invoke-virtual {p0, v0, v1}, Landroid/net/wifi/WifiStateMachine;->setCountryCode(Ljava/lang/String;Z)V

.line 3787
:cond_0
return-void
.end method

NEW

.method private setCountryCode()V
.locals 3

.prologue
.line 3780
iget-object v1, p0, Landroid/net/wifi/WifiStateMachine;->mContext:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string/jumbo v2, "wifi_country_code"

invoke-static {v1, v2}, Landroid/provider/Settings$Global;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

.line 3782
.local v0, countryCode:Ljava/lang/String;
if-eqz v0, :cond_0

invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z

move-result v1

if-nez v1, :cond_0

.line 3783
[COLOR="Red"] const-string v0, "us"[/COLOR]

const/4 v1, 0x0

invoke-virtual {p0, v0, v1}, Landroid/net/wifi/WifiStateMachine;->setCountryCode(Ljava/lang/String;Z)V

.line 3787
:cond_0
return-void
.end method

Result - archive for installation through TWRP:

- for 3G model (K2_U)

- for LTE model (K2_UL). If not work, try this

Try, check, write the results.

Enjoy!