[Fix] Wifi Fix for ivanich's CyanogenMod

jinxul

Senior Member
Sep 5, 2010
99
115
0
Tehran
hi,
well, as you know there is problem with CyanogenMod(and some other aosp roms) wifi in some countries and the problem is due to wifi_country_code value inside global database.
so after reading HTCZ715E amazing guide i made this flashable zip for those who still have problem with wifi in ivanich's CyanogenMod.


Installation
  • flash it via recovery(no need to wipe)


Credits:
@ivanich for his awesome rom
@HTCZ715E for WiFi Country Problem Solving guide
 

Attachments

Last edited:

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
@jinxul if it's only related to the record in the global table of settings storage database, I thought, wouldn't it be easier to use an init.d script with an addon.d script?

For example:
Code:
#!/system/bin/sh

# Set wifi country code
sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global set value=nz where name='wifi_country_code';"
 
Last edited:
  • Like
Reactions: reza_and

jinxul

Senior Member
Sep 5, 2010
99
115
0
Tehran
@jinxul if it's only related to the record in the global table of settings storage database, I thought, wouldn't it be easier to use an init.d script with an addon.d script?

For example:
Code:
#!/system/bin/sh

# Set wifi country code
sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global set value=nz where name='wifi_country_code';"
the main problem is in the telephony-common.jar. every time that wifi turns on framework will rewrite the record on its own... so framework has to be patched(and all that will do is to stop rewriting wifi_country_code on every time wifi turns on).
i also put an script in the zip(similar to this) to change the value back to null but that's just for those who don't want to wipe their data(cause its wont work if there is already a value for wifi_country_code)

so init.d wont do anything as long as framework isnt patched.
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
the main problem is in the telephony-common.jar. every time that wifi turns on framework will rewrite the record on its own... so framework has to be patched(and all that will do is to stop rewriting wifi_country_code on every time wifi turns on).
i also put an script in the zip(similar to this) to change the value back to null but that's just for those who don't want to wipe their data(cause its wont work if there is already a value for wifi_country_code)

so init.d wont do anything as long as framework isnt patched.
I thought that but when I changed mine to 'us' and toggled wifi on and off a few times and connected to network it didn't revert back for me. I tried 'uk' too but couldn't find any networks when turning wifi on.
 

jinxul

Senior Member
Sep 5, 2010
99
115
0
Tehran
I thought that but when I changed mine to 'us' and toggled wifi on and off a few times and connected to network it didn't revert back for me. I tried 'uk' too but couldn't find any networks when turning wifi on.
reboot is required when you change it manually.. system wont just read it like that unless you tell it to do so, and you cant do that with sqlite3. you need an app/service with WRITE_SETTINGS permission (android.permission.WRITE_SETTINGS).
 
  • Like
Reactions: this4you and hinxnz

Harakhti

Senior Member
Aug 27, 2012
468
135
0
25
Budapest
Let me chime in:

Similar Wi-Fi issues have been persistent across my previous two devices running Android 5+. Setting the Wireless channel of your network to 11 or below (U.S. standard) fixed it. If you don't live in a too dense area - eg. have free uninterfered channels in that scale - then I suggest using those. EU channels (12,13) break far too often due to this specific issue which seems either upstream or hardware-specific. To your information, the three (with this) tested devices all have BCM4329 Wireless modems.

If anyone tries this instead, let me know if it worked here as well.
 
Last edited:

this4you

Senior Member
Feb 20, 2013
206
188
0
Tehran
interlan.app
as i said in OP i dont have cm11 so i need telephony-common.jar for it. find it (system/framework/telephony-common.jar) and give it to me.
there I found it as you directed me and Just Uploaded or should I say posted here for you to get it patched
However it is to say that once I tried the Guide to patch the file but it did not work at all and I faced FC at phone state
actually I could not find the line mentioned in the guide to edit that ...

by the way I`M proud of you
 

this4you

Senior Member
Feb 20, 2013
206
188
0
Tehran
interlan.app
try this and let me know the result.
Thank you ill try it now
in a minute ...

---------- Post added at 08:22 AM ---------- Previous post was at 08:05 AM ----------

try this and let me know the result.
Thank yooooooooooooooooooou It worked !!:good:

I wounder is it possible to put the patched telephony-common.jar inside the Zipped ROM and replaced the old one ?

it may sound rude but as the last request can I upload the vanich's CyanogenMod`s telephony-common.jar ?
 

jinxul

Senior Member
Sep 5, 2010
99
115
0
Tehran
Thank you ill try it now
in a minute ...

---------- Post added at 08:22 AM ---------- Previous post was at 08:05 AM ----------



Thank yooooooooooooooooooou It worked !!:good:

I wounder is it possible to put the patched telephony-common.jar inside the Zipped ROM and replaced the old one ?

it may sound rude but as the last request can I upload the vanich's CyanogenMod`s telephony-common.jar ?
  1. unzip the rom, replaced it then zip it. it should do the job.
  2. sure.. which one is it?(cm11 or 12)
 
  • Like
Reactions: this4you

this4you

Senior Member
Feb 20, 2013
206
188
0
Tehran
interlan.app
  1. unzip the rom, replaced it then zip it. it should do the job.
  2. sure.. which one is it?(cm11 or 12)
up to here I was to use viper`s ROM cause of KK`S wifi issues but here you wiped out the nightmare , and I must give you a big thanks...:good:

and again cm-11-20150607-UNOFFICIAL-pyramid ...
but i have to download it first and then upload it here
 

this4you

Senior Member
Feb 20, 2013
206
188
0
Tehran
interlan.app
up to here I was to use viper`s ROM cause of KK`S wifi issues but here you wiped out the nightmare , and I must give you a big thanks...:good:

and again cm-11-20150607-UNOFFICIAL-pyramid ...
but i have to download it first and then upload it here
here you go the telephony-common.jar of cm-11-20150607-UNOFFICIAL-pyramid
 

Attachments