Changing the country code (country code) Wi-Fi AC 5Ghz range {ROOT}
Author : Collected spaces of the Internet and adapted to udobovareniya.
Firmware : GS 9.5.19.0 (OEIMIFA) / deodeks, but should work on other deodeksirovannyh. ROOT is required.
Description :
Our Xiaomi Redmi Note 5 in the range of Wi-Fi 5GHz sees not all the channels could. The range of permissible in this area determines the frequencies the phone after reading from a SIM card country code when it is initialized. Therefore, to view Wi-Fi channels 149-165 in Belarus, for example, is not enough to change the region for enhanced phone settings, such as Venezuela or the United States. Wi-Fi, he sees, but after the phone reboots, or rub a network or stand-alone mode the phone again considers the country code and disable the extended range by turning the Wi-Fi on the local (allowed).
To prevent this from happening, you need to make the desired region for us (good US) file /system/framework/wifi-service.jar. After that, the region received from the SIM card will be ignored. Ready modified file can be downloaded from the link at the end of the post. Proceed.
1. Make a backup of partition System;
2. Put the file manager downloaded file wifi-service.jar in the folder / system / framework / with replacement;
3. Set a right to it, "the letter D" (the same as in neighboring files);
4. Reboot in rekaveri, cache cleaning and doing dalvik cache, load the phone. The first launch will take longer than usual. Done!For others, such devices, or to change to another, different from the US region, instruction on self-change file wifi-service.jar:
It is necessary:
1. Download and install the program
Batch ApkTool (Post by bursoft # 30280158)2. Copy of phone System folder, even though the file manager, even through the ABD, or get it from the archive with deodeksom for your Smart;
3. Copy the contents of the System folder to the folder smartphone _system program;
4. Copy the contents of the folder System / framework smartphone _framework folder program;
5. Put the file system / framework / wifi-service.jar from the smartphone to a folder _INPUT_JAR program.
6. Adjust the program as the image below (see. Below "ext. Screenshots").
84 - API choice in accordance with your version of Android;
87 - to gather in expert mode - YES;
88 - Remove debug information - YES;
89 - To sign the APK result - NO.
7. decompile our wifi-service.jar command "06"
8. Go on the way BatchApkTool \ _INPUT_JAR \ wifi-service \ smali \ com \ android \ server \ wifi and open the file with a text editor WifiServiceImpl.smali.
9. Find the line data:
.method public setCountryCode (Ljava / lang / String; Z) V
.registers 9
const-string / jumbo v2, "WifiService"
new-instance v3, Ljava / lang / StringBuilder;
invoke-direct {v3}, Ljava / lang / StringBuilder; -><init>() V
const-string / jumbo v4, "WifiService trying to set country code to"
invoke-virtual {v3, v4}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3, p1}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
const-string / jumbo v4, "with persist set to"
invoke-virtual {v3, v4}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3, p2}, Ljava / lang / StringBuilder; ->append (Z) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava / lang / StringBuilder; ->toString () Ljava / lang / String;
move-result-object v3
invoke-static {v2, v3}, Landroid / util / Slog; ->i (Ljava / lang / String; Ljava / lang / String;) I
invoke-direct {p0}, Lcom / android / server / wifi / WifiServiceImpl; ->enforceConnectivityInternalPermission () V
iget-object v2, p0, Lcom / android / server / wifi / WifiServiceImpl; ->mLog: Lcom / android / server / wifi / WifiLog;
const-string / jumbo v3, "setCountryCode uid =%"
invoke-interface {v2, v3}, Lcom / android / server / wifi / WifiLog; ->info (Ljava / lang / String;) Lcom / android / server / wifi / WifiLog $ LogMessage;
move-result-object v2
invoke-static {}, Landroid / os / Binder; ->getCallingUid () I
move-result v3
int-to-long v4, v3
invoke-interface {v2, v4, v5}, Lcom / android / server / wifi / WifiLog $ LogMessage; ->c (J) Lcom / android / server / wifi / WifiLog $ LogMessage;
move-result-object v2
invoke-interface {v2}, Lcom / android / server / wifi / WifiLog $ LogMessage; ->flush () V
invoke-static {}, Landroid / os / Binder; ->clearCallingIdentity () J
move-result-wide v0
iget-object v2, p0, Lcom / android / server / wifi / WifiServiceImpl; ->mCountryCode: Lcom / android / server / wifi / WifiCountryCode;
invoke-virtual {v2, p1}, Lcom / android / server / wifi / WifiCountryCode; ->setCountryCode (Ljava / lang / String;) Z
invoke-static {v0, v1}, Landroid / os / Binder; ->restoreCallingIdentity (J) V
return-void
.end method
If you have a register 8, then change it to 9 if there was a 9 - then put 10. Etc.
Under the line
const-string / jumbo v2, "WifiService"insert row
const-string / jumbo v5, "US"In this line, write
v5If you have had a register 8,
v6- if there was a = 9, etc.
Further, even in the two places are located in the lines
p1and change it to
v5or
v6depending on your former value register.
Ready code changes are highlighted in red:
.method public setCountryCode (Ljava / lang / String; Z) V
.registers10
const-string / jumbo v2, "WifiService"
const-string / jumbo v6, "US"
new-instance v3, Ljava / lang / StringBuilder;
invoke-direct {v3}, Ljava / lang / StringBuilder; -><init>() V
const-string / jumbo v4, "WifiService trying to set country code to"
invoke-virtual {v3, v4}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3,v6}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
const-string / jumbo v4, "with persist set to"
invoke-virtual {v3, v4}, Ljava / lang / StringBuilder; ->append (Ljava / lang / String;) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3, p2}, Ljava / lang / StringBuilder; ->append (Z) Ljava / lang / StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava / lang / StringBuilder; ->toString () Ljava / lang / String;
move-result-object v3
invoke-static {v2, v3}, Landroid / util / Slog; ->i (Ljava / lang / String; Ljava / lang / String;) I
invoke-direct {p0}, Lcom / android / server / wifi / WifiServiceImpl; ->enforceConnectivityInternalPermission () V
iget-object v2, p0, Lcom / android / server / wifi / WifiServiceImpl; ->mLog: Lcom / android / server / wifi / WifiLog;
const-string / jumbo v3, "setCountryCode uid =%"
invoke-interface {v2, v3}, Lcom / android / server / wifi / WifiLog; ->info (Ljava / lang / String;) Lcom / android / server / wifi / WifiLog $ LogMessage;
move-result-object v2
invoke-static {}, Landroid / os / Binder; ->getCallingUid () I
move-result v3
int-to-long v4, v3
invoke-interface {v2, v4, v5}, Lcom / android / server / wifi / WifiLog $ LogMessage; ->c (J) Lcom / android / server / wifi / WifiLog $ LogMessage;
move-result-object v2
invoke-interface {v2}, Lcom / android / server / wifi / WifiLog $ LogMessage; ->flush () V
invoke-static {}, Landroid / os / Binder; ->clearCallingIdentity () J
move-result-wide v0
iget-object v2, p0, Lcom / android / server / wifi / WifiServiceImpl; ->mCountryCode: Lcom / android / server / wifi / WifiCountryCode;
invoke-virtual {v2,v6}, Lcom / android / server / wifi / WifiCountryCode; ->setCountryCode (Ljava / lang / String;) Z
invoke-static {v0, v1}, Landroid / os / Binder; ->restoreCallingIdentity (J) V
return-void
.end method
10. Save and close the file. The window BatchApkTool press "07" to recompile (reassembly) our wifi-service.jar.
11. Taking our modified wifi-service.jar in _OUT_JAR folder and execute the instructions on the items from the beginning of Lent.
Installation : Manual (required to back up System section)
Download :
Ready file with the changed region in the United States:
wifi-service.jar(578.93 KB)
The original file from deodeks firmware 5.9.19:
wifi-service.jar(725.44 KB)
All that you do, do at your own peril and risk!
Since this modification was not yet here, I recommend to raise the cap threads.Post has been editedDima_Apatity - 11.08.18, 12:39Reason for editing: In the header