WiFix - Fixes regional Wi-Fi problems in Android 4.0

Search This thread

fardjad

Senior Member
Mar 31, 2011
92
305
www.fardjad.com
:) Saw it and edited my post.... But as i said above,, changed settings dont stick... so cant connect...

OK -- Finally did something and got it working :):):)

Using WiFix should give you exact same effect as it's changing the WiFi country code (by interacting with secure settings provider.)
I think I should also release the debug version to see what's the problem (the day after tomorrow maybe.)
 

gregferns

Senior Member
Sep 19, 2009
1,191
136
Mumbai
Xiaomi Poco F1
OnePlus Nord
I can't do it right now (I'm busy with... errh, exams!)
These kinds of problems require extended discussion though.
After a few days maybe :)

Man,, take care of your studies first... You'll be very happy later.
And modding will always happen... Bet of luck..

btw, your Wifix had not worked when i tried first hence i had written the
lnog post,, but i will try again over the weekend...

regards
greg
 

tytung

Senior Member
Jun 21, 2010
3,574
15,005
sites.google.com
Just used sqlite editor from Market (any would work) and changed in /data/data/com.android.providers.settings/databases/settings.db value "wifi_country_code" to EN for example and that's it. And you need root for this. But change it every time after reboot.

I created a flashable zip file which using init.d/99_wifi_country_code_fix to fix "wifi_country_code" value at boot.
Please flash WiFi_country_code_update_for_ICS.zip and see if it works or not.
I don't have this SIM-card related WiFi issue, so someone needs to help test it.

The content of init.d/99_wifi_country_code_fix is as follows.
Code:
export DB=/data/data/com.android.providers.settings/databases/settings.db
sqlite3 $DB "update secure set value='en' where name='wifi_country_code' and value='';"
 

redbaron

Senior Member
Jan 25, 2006
75
12
Tbilisi
I created a flashable zip file which using init.d/99_wifi_country_code_fix to fix "wifi_country_code" value at boot.
Please flash WiFi_country_code_update_for_ICS.zip and see if it works or not.
I don't have this SIM-card related WiFi issue, so someone needs to help test it.

The content of init.d/99_wifi_country_code_fix is as follows.
Code:
export DB=/data/data/com.android.providers.settings/databases/settings.db
sqlite3 $DB "update secure set value='en' where name='wifi_country_code' and value='';"

Thanks, my device doesn't support flashing zip file (I think so), can I put this script to init.d using root explorer?
 

tytung

Senior Member
Jun 21, 2010
3,574
15,005
sites.google.com
Thanks, my device doesn't support flashing zip file (I think so), can I put this script to init.d using root explorer?

Yes, you can.
Your device must support busybox run-parts /system/etc/init.d method and have sqlite3 in /system/xbin/ folder.
I think all rooted device supports busybox.
You also need to set the permissions once you copy them to your device. (Do it only once.)
Code:
chown 0:2000 /system/etc/init.d/99_wifi_country_code_fix
chmod 755 /system/etc/init.d/99_wifi_country_code_fix
chown 0:2000 /system/xbin/sqlite3
chmod 755 /system/xbin/sqlite3

755 means changing permissions using root explorer
Owner: Read, Write, and Execute
Group: Read and Execute
Others: Read and Execute

0:2000 means changing the file owner using root explorer to "0 - root" and "2000 - shell".
 
Last edited:

fardjad

Senior Member
Mar 31, 2011
92
305
www.fardjad.com
I created a flashable zip file which using init.d/99_wifi_country_code_fix to fix "wifi_country_code" value at boot.
Please flash WiFi_country_code_update_for_ICS.zip and see if it works or not.
I don't have this SIM-card related WiFi issue, so someone needs to help test it.

The content of init.d/99_wifi_country_code_fix is as follows.
Code:
export DB=/data/data/com.android.providers.settings/databases/settings.db
sqlite3 $DB "update secure set value='en' where name='wifi_country_code' and value='';"

Before I start making WiFix, I tried setting wifi_country_code with an init.d script and this ain't gonna work for these obvious reasons:
  1. WiFi country code is set after boot completed and init.d scripts are executed very soon for this. (a workaround would be to add a 120 sec. dealy with sleep, but it doesn't look clean however…)
  2. Whenever the network state changes (well, most of the times, specially when you go into airplane mode and go online again) , WiFi country code changes.
  3. Also in your script, you used UPDATE statement which fails because WiFi country code column doesn't exists at the time of script execution, INSERT is a more reasonable thing but won't work as I explained.

These are exactly why I made this application instead of a flashable init.d script :)

Anyways thanks for your contribution, and also for your kernel :D (I'm currently using tytung_ICS_Beta8 on my HD2)
 
Last edited:

redbaron

Senior Member
Jan 25, 2006
75
12
Tbilisi
Before I start making WiFix, I tried setting wifi_country_code with an init.d script and this ain't work for these obvious reasons:
  1. WiFi country code is set after boot completed and init.d scripts are executed very soon for this. (a workaround would be to add a 120 sec. dealy with sleep, but it doesn't look clean however…)
  2. Whenever the network state changes (well, most of the times, specially when you go into airplane mode and go online again) , WiFi country code changes.
  3. Also in your script, you used UPDATE statement which fails because WiFi country code column doesn't exists at the time of script execution, INSERT is a more reasonable thing but won't work as I explained.

These are exactly why I make this application instead of a flashable init.d script :)

Agree it didn't worked :( I'll wait for apk
 

tytung

Senior Member
Jun 21, 2010
3,574
15,005
sites.google.com
Before I start making WiFix, I tried setting wifi_country_code with an init.d script and this ain't work for these obvious reasons:
  1. WiFi country code is set after boot completed and init.d scripts are executed very soon for this. (a workaround would be to add a 120 sec. dealy with sleep, but it doesn't look clean however…)
  2. Whenever the network state changes (well, most of the times, specially when you go into airplane mode and go online again) , WiFi country code changes.
  3. Also in your script, you used UPDATE statement which fails because WiFi country code column doesn't exists at the time of script execution, INSERT is a more reasonable thing but won't work as I explained.

These are exactly why I make this application instead of a flashable init.d script :)

Anyways thanks for your contribution, and also for your kernel :D (I'm currently using tytung_ICS_Beta8 on my HD2)

OK.
Thanks for the detailed explanation. :)
 

fardjad

Senior Member
Mar 31, 2011
92
305
www.fardjad.com
Update

Sorry for begin late, the new version uploaded :)

Change log:
  • Changed minimum SDK version and API Level to 3
  • Minor layout changes
  • Minor bug fixes

If you're updating via WiFix Manager you may have to remove WiFix first and then update.
It's highly recommended to upgrade WiFix Manager as well.

I also added 4EXT Touch Recovery support to recovery flashable zip, but I can't test it.
Someone please confirm if it's working (and report if there's a problem.)
 
Last edited:

Blaze7

Senior Member
Jul 30, 2008
129
5
Sorry for begin late, the new version uploaded :)

Change log:
  • Changed minimum SDK version and API Level to 3
  • Minor layout changes
  • Minor bug fixes

If you're updating via WiFix Manager you may have to remove WiFix first and then update.
It's highly recommended to upgrade WiFix Manager as well.

I also added 4EXT Touch Recovery support to recovery flashable zip, but I can't test it.
Someone please confirm if it's working (and report if there's a problem.)

The zipped version does not work on HTC Sensation ICS. Installing through clockwork fails. I am using 4EXT. The apk seems to work. Also the display looks weird when you open the application, it looks like the UI does not fit the resolution, previous version looked ok.
 
  • Like
Reactions: fardjad

fardjad

Senior Member
Mar 31, 2011
92
305
www.fardjad.com
The zipped version does not work on HTC Sensation ICS. Installing through clockwork fails. I am using 4EXT. The apk seems to work. Also the display looks weird when you open the application, it looks like the UI does not fit the resolution, previous version looked ok.

Thanks for testing :)
Actually recovery flashable is working fine in ClockworkMod on my device.
Could you please post the 4Ext recovery error message and a screenshot from WiFix manager?
 
Last edited:

Blaze7

Senior Member
Jul 30, 2008
129
5
Thanks for testing :)
Actually recovery flashable is working fine in ClockworkMod on my device.
Could you please post the 4Ext recovery error message and a screenshot from WiFix manager?

Here is the screenshot from 4EXT as well as from the app.
 

Attachments

  • screenshot_2012-01-26.23.25.25.jpg
    screenshot_2012-01-26.23.25.25.jpg
    22.2 KB · Views: 465
  • 2012-01-26_23-51-17.jpg
    2012-01-26_23-51-17.jpg
    14 KB · Views: 396
Last edited:

telerian

Senior Member
Jul 3, 2011
185
3
Not working for me. I am using a Chinese tablet with ICS 4.0.1. Wifi was fine until I inserted a 3G USB dongle and now wifi never works again until I do factory reset

I installed the manager and installed WiFix. The tablet is rooted (I can access the /system read and write) and su binary is installed
I am looking in catlog and I see the country being set to eg (Egypt) and a line like this

ActivityManager Start proc com.fardjad.android.wifix for broadcast com.fardjad.android.wifix/.EventReciver: pid=729 uid=10049 gids={1015}

and wifi still stuck on turning on wifi

Plz help



Latest update

You are app does set the value but for me incorrectly (select query output below)

222|wifi_country_code|EN

I did insert manually with US instead of EN and it works, can you make a version with US instead of EN (EN is not a country code) or better make an option to choose the value :D
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 205
    WiFi Fix for Android 4.0

    Description

    I recently found out many people in certain countries no matter what kinds of devices they're using, have issues with WiFi when SIM-Card is inserted.

    I realized that changing the WiFi Country Code solves the problem and made an application that does this automatically on each boot and on network state changes.

    Installation

    It's pretty easy; first of all you should root your device.

    Then install WiFixManager.apk.



    Start WiFix Manager from applications menu and tap Install WiFix (allow SuperUser permission.)



    Once installed, you're ready to go. The application will change the country code when needed. You can also invoke it manually by dialing *#94349# (*#WIFIX#) and pressing the call button (don't forget to press call button; it's not a MSL code).



    Updates

    You can check for updates and install them via WiFix Manager.



    Code:
    Change Log:
    1/14/12 WiFix V1.0, WiFix Manager V1.1:
    Initial Release
    1/25/12 WiFix 1.1, WiFix Manager V1.2:
    Changed minimum SDK version and API Level to 3
    Minor layout changes
    Minor bug fixes
    1/30/12 WiFix 1.2, WiFix Manager V1.3:
    Added custom country code support
    7/3/12 WiFix V1.2, WiFix Manager V1.31:
    Minor layout bug fixes
    Compiled with Android SDK 14
    12/9/12 WiFix V1.2, WiFix Manager V1.32
    Minor bug fixes (Device compatibility improvement.)
    Added reboot prompt after installation and removal.
    Compiled with Android SDK 16
    Known Issues

    Sometimes when you reboot your phone with WiFi turned on, you won't have internet access (you can't open webpages, download files etc.) even though it says it's already connected to your AP.
    This issue can be fixed by turning WiFi Off and On or dialing *#WIFIX# as described before.

    For ROM Cookers

    By placing WiFix.apk in /system/app you'll have a WiFix enabled ROM.
    If you're publishing that ROM, please include a link to this thread :)

    Newer fix by XDA Member HTCZ715E

    As of today, most of the manufacturers (including HTC and Sony) solved this Wi-Fi issue with their ROMs. Fortunately, there's no need for WiFix anymore.

    For those who still have issues with custom ROMs and WiFix, try this.
    11
    any one try this app by recovery method in 4.3 or 4.4 not apk type .....work with him or also freeze ?
    Hmm.. Upgraded N7 3g 2012 from 4.2.2 to 4.4.2 and got similar problem, wifix didn't help, so I tried "manual" method for wifixing. Looks like the only problem was in tablename. Option wifi_country_code moved (as for 4.4) from "secure" to "global" table of /data/data/com.android.proveders.settings/databases/settings.db , so general method forr changing country code still works.

    I wrote a short script (tried to run as init.d - but it has no sense as country code is beeing read from simcard when all init.d scripts are finished), so i used free Script Manager - SManager (https://play.google.com/store/apps/details?id=os.tools.scriptmanager) to launch script after boot.

    That's script code (just changed wifi_country_code location):
    Code:
    #!/bin/sh
    sleep 10
    sqlite3 /data/data/com.android.providers.settings/databases/settings.db "INSERT INTO global (name, value) VALUES ('wifi_country_code', 'EU');"
    svc wifi disable
    sleep 10
    svc wifi enable
    Also i've added sleep for 10 seconds for ensure that sim data is already read, and added wifi down - sleep - wifi up for reestablish network connection (as i'm using n/g network for old devices, so Nexus is connected in g-mode to my router when script is executed).

    Instruction:
    1. Download sqlite3 binary from any source (I've got it from xda http://xdaforums.com/showpost.php?p=45442929&postcount=2) and move it to /system/xbin, set permissions 755 (rwx-rx-rx)

    2. Save script to internal SD-card, f.e. as "fix_country_code.sh",

    3. Install script-manager, that is able to run scripts on boot, and set to execute script with root rights (like on screenshot if SManager is used). Also it's possible to test script w/o reboot
    10

    Hi everyone,

    Here's few tips to help you get your wifi working:


    Requirements:

    Rooted android phone.


    Steps:

    1. Download Market Unlocker (Google it, as you might not find the APK on Google play).

    2. After download is complete, open it and give Root privileges.

    3. On last tab, pick USA T Mobile, and wait until you see "Your mobile have changed to T Mobile successfully".

    4. Make sure Wifi is off and reboot your device.




    Notes:


    1. When you reboot your phone, make sure the wifi is off, or your wifi will freeze as usual.

    2. after reboot or boot up, make sure not to enable wifi until you see your mobile signal working(Means the mobile
    is not still searching for signal).

    3. Market unlocker should change your mobile SIM Code every time you reboot (It will give a
    notification). in case you are not sure if it worked, open market unlocker and pick USA T Mobile again.

    4. Open Wifi and Violla.

    happy rooting.
    4
    I was using this app on evervolv ics 4.0.4 and it worked nice.
    Now i have switched to evervolv 4.2.2 and it doesnt work. It works if i tap on "install wifix", put my phone on airplane mode and restart it. Then i can use wifi, until i connect to the phone netwrok again. After that again wifi doesnt work.

    Can you update the app?
    And can you open source it?
    Thanx a lot ;)
    4
    Can I suggest something?

    Why not make a flashable zip so "wifix.apk" can be flashed directly to "system/app" without having to use "wifixmanager.apk"

    Of course :)

    Here it is.