[G4 Q&A, Help & Troubleshooting] dominik-p:
WiFi Fix - always all channels on 2.4 GHz

IMPORTANT:

Only for advanced users!

You are an advanced user if you know exactly what you are doing.

You are an advanced user if you know what to do if something went wrong.

You are NOT an advanced user if you know how to do copy+paste.

You can bring your smartphone into a state, so it no longer works.

I am not responsible for anything. The following instructions are only suggestions.

Hello,

I want to show you a way how you prevent your LG G4 to limit wireless channels to 1-11.

This happens when no SIM card is inserted or if the airplane mode is activated.

You get messages like:

"Some Wi-Fi networks unavailable due to unknown location" (English)

"Einige Wi-Fi-Netzwerke sind wegen des unbekannten Standorts nicht verfügbar" (German)

"Algunas redes Wi-Fi no están disponibles debido a una ubicación desconocida" (Spanish)

I studied the log entries and found a line that said "[LGE_PATCH] For Country code DC. ....".

After a long search in the code I have discovered the place that is responsible for the limitation.

It is located in the wifi-service and it sets the WifiCountryCode to "DC" if your location could not be obtained.

For me living in Germany it should be "DE".

The WifiCountryCode named "wifi_country_code" is stored in the "global" table of "/data/data/com.android.providers.settings/databases/settings.db".

Changing it has no effect as it is overwritten instantly.

So we need to modify the program code of "wifi-service".

According to this post: http://xdaforums.com/showpost.php?p=64636618&postcount=8

this guide seems to work on other models from LG and newer Android versions too.

You have to search for the wifi-service.odex file and replace "DC" with your two-letter country code.

Alter the paths of the instructions if you use another phone than LG G4 with Android 5.1 Lollipop!

The following instructions show how to do it on the LG G4 with Android (5.1) Lollipop.

Prerequisites:

ROOT

USB debugging enabled

Procedere:

Connect your G4 to your computer.

Open the command promt and enter the following lines:

adb shell
mkdir /sdcard/wifi-service
cp /system/framework/arm64/wifi-service.odex /sdcard/wifi-service/64wifi-service.odex

Now a file named "64wifi-service.odex" is on your internal memory located in the folder "wifi-service".

Copy the file to your computer.

Now you have to edit the file.

Don't use the "editor" on windows, use Notepad++

With Strg+F search for "DDD".

You will find exactly one line that contains this::

"DATE_TIME DBG DC DCM DDD DDFName"

Change the value "DC" to "DE" for example (search the internet for the two-letter country code of your country (ISO 3166-1 alpha-2))

"DATE_TIME DBG DE DCM DDD DDFName"

Save the file.

Delete the file "64wifi-service.odex" on your smartphone.

Copy the edited file from your computer to the folder "wifi-service" on your smartphone.

Go back to the command prompt and type this:

su

You should see an confirmation promt on your smartphone that asks to grant root rights.

Confirm the message.

The command promt should change from $ to # now.

To verify your rights type this:

id

You should see "uid=0" etc.

Now type in the following lines (I recommend to execute each row seperately):

mount -o remount,rw /system
cd /system/framework/arm64
cp wifi-service.odex /sdcard/wifi-service/64wifi-service.odex.bak
rm wifi-service.odex
cd /sdcard/wifi-service
cp 64wifi-service.odex /system/framework/arm64/wifi-service.odex
cd /system/framework/arm64
chown 0:0 wifi-service.odex
chmod 0644 wifi-service.odex
echo "restart device"

Check the outputs. There must be no errors!

After hitting the Enter button the last line should output "restart device".

In the folder "wifi-service" on your internal storage you find the original "wifi-service.odex".

It is named "64wifi-service.odex.bak".

Restart your smartphone now.

As from now it does not matter whether a SIM card is inserted or if the airplane mode is activated.

The WiFi channels are no longer limited to 1-11. You can now always use 12 and 13.

Did the instructions help you?

Please give a "Thanks!"

Thank you ;)

For users who speak German:

I wrote this guide in German at first. You can find it on android-hilfe.de

Title: "LG G4 WLAN Fix - immer alle Kanäle"

http://www.android-hilfe.de/thema/lg-g4-wlan-fix-immer-alle-kanaele.710265/