[TUTORIAL]Install wifi fix on CM7 - Optimus One, P500 Android Development

Hi guys this is my first tutorial on xda and i hope you enjoy it. This is a mini guide to put battery drain fix on CM7 by mik_os.
This is a thread for those that don't wanna search manually how to put fix in CM thread.
1.Download Gscript from market
2.Long-touch an empty space of your home:
-Add item
-Add shortcut
-Gscript Lite
4.Now a little screen will appear.Do not touch anything.
5.Press menu key and select add script
6.Now another little screen will appear.Set your script title,and ensure there's a tic on "Needs su" checkbox.
7.In "script"textbox type:
Code:
iwconfig wlan0 txpower 15
iwconfig wlan0 power on
10.Tap "save"and select your newly created script
11.Turn on Wi-Fi
12.Run script shortcut
DONE!
TIP:To ensure that you have fix on type this in Terminal Emulator:
Code:
iwconfig wlan0
With Wi-Fi always on check Power-Tx value. It must be under 20. If it is not,run again script and check again.
YOU MUST RUN SCRIPT EVERY TIME YOU TURN ON WIFI

Do you have any idea how the wifi is toggled? Maybe this can be added to it.

Is this useful for wifi tethering
Sent from my LG-P500 using XDA App

Txpower = 5 is ok?

ccdreadcc said:
Txpower = 5 is ok?
Click to expand...
Click to collapse
18-19 is the common value . 5 is too little and you don't save a lot of battery
the command to save battery is iwconfig wlan0 power on

Can't this script work with tasker ? For example when you enable WiFi, tasker will automatically enable the script. Hmmm..

badeaioan said:
Can't this script work with tasker ? For example when you enable WiFi, tasker will automatically enable the script. Hmmm..
Click to expand...
Click to collapse
through an app yes it works but it's always a workaround

It's an ugly workaround,but works
Sent from my LG-P500 using Tapatalk

this is the fix http://forum.xda-developers.com/showpost.php?p=12022556&postcount=1003

A semi-permanent fix to wifi battery drain is here: http://forum.xda-developers.com/showpost.php?p=12027166&postcount=1039

Related

[TIP]Changing wifi mac id

Thanks to Redpik;
Redpik said:
Using rootexplorer or adb write in this file /data/misc/wifi/config this line "cur_etheraddr=xx:xx:xx:xx:xx:xx" with your mac address. This is pretty permanent
Sent from my LG-P970 using XDA
Click to expand...
Click to collapse
George Jetson said:
I success change wifi mac id with this path:
1.install busybox
2.terminal emulator or adb shell with cmd
3.wifi turn on
4.entered this line
busybox ip link set wlan0 address xx:xx:xx:xx:xx:xx
5.done
Click to expand...
Click to collapse
you should add the Tag [TIP] on the thread title. nice tip thanks.
This method is not permanent. Once wifi gets disabled or phone rebooted mac reverts to original. In my case 0.
Redpik said:
This method is not permanent. Once wifi gets disabled or phone rebooted mac reverts to original. In my case 0.
Click to expand...
Click to collapse
Yes my mac reverts original too.Sorry everyone.
hmmm... in system/etc/wifi, find "nvram.txt"
You will see, "macaddr=".
Try to change there.. or add another "macaddr=" at the very bottom.
Reboot and see if it stays and changed.
The problem with CM7 is that nvram files has the correct mac address, but in wifi settings is still 0:. So there's another file that overwrites this (i guess)
The permanent solution is to change it through Hyperterminal. Only that there's no hidden menu to change AP CP usb mode. :|
Edit : I found a way, someone posted it on rootwiki forum. If nvram.txt has the original mac address just write in /data/misc/wifi/config cur_etheraddr=xx:xx:xx:xx:xx:xx with the mac address. It's working.
George Jetson said:
I success change wifi mac id with this path:
1.install busybox
2.terminal emulator or adb shell with cmd
3.wifi turn on
4.entered this line
busybox ip link set wlan0 address xx:xx:xx:xx:xx:xx
5.done
Click to expand...
Click to collapse
Is that permanent, or will back when reboot?
Sent from my LG-P970 using Tapatalk
Using rootexplorer or adb write in this file /data/misc/wifi/config this line "cur_etheraddr=xx:xx:xx:xx:xx:xx" with your mac address. This is pretty permanent
Sent from my LG-P970 using XDA
Hi Redpik,
you could at least mention, who found this about /data/misc/wifi/config, right?
Greetings
BTW, I usually do something like:
Code:
adb shell 'echo cur_etheraddr=XX:XX:XX:XX:XX:XX >> /data/misc/wifi/config'
Works only, if you are directly root when connecting via adb.
dreamind said:
Hi Redpik,
you could at least mention, who found this about /data/misc/wifi/config, right?
Greetings
BTW, I usually do something like:
Code:
adb shell 'echo cur_etheraddr=XX:XX:XX:XX:XX:XX >> /data/misc/wifi/config'
Works only, if you are directly root when connecting via adb.
Click to expand...
Click to collapse
Yes, it was you. Sorry if i upset you. I was really searching everywhere so in a hurry to provide intel for the others, i said someone. My bad. Thanks.

[Q] How to enable Ad-Hoc in custom ROM?

Hello.
I've just installed Achotjan's SDE ROM. Rom is great for me and I would like to keep it on my phone, but...I use Ad-Hoc network in my home, I haven't got a router so I can't use WiFi. Please tell me how to enable Ad-Hoc on this ROM. I've already tried to enable the standard but no result...
Please for fast reply
Using root browser or any of those,
navigate to /system/etc
find tiwlan.ini -edit
and find those lines:
WiFiAdhoc = 0
WiFiWmmPS = 0 # Use 1 on WiFi test in order to configure PS to work in WMM mode
Change to:
WiFiAdhoc = 1
WiFiWmmPS = 0 # Use 1 on WiFi test in order to configure PS to work in WMM mode
That should do the trick
Sent from my ST18i using XDA
Not working
Did you save the changes? View the file again to make sure the changes stick. Did you restart the phone after changing the adhoc value?
[edit] googled this up for you: http://forum.xda-developers.com/showthread.php?t=1253087
Also:
http://mobilecon.info/fix-wifi-adhoc-problem.html
And:
http://forum.xda-developers.com/showthread.php?t=1260621
if none good, might just be easiest to do this:
http://forum.xda-developers.com/showthread.php?t=1559172
Sent from my ST18i using XDA
Of course I saved the changes and restarted the phone. And none of these solutions is not working

WiFi Channel 13

I have an original Samsung Galaxy Tab 7" and am having trouble connecting to my wireless network, as my router is set (on purpose) to channel 13. Due to congestion, I am unable to select a different channel (1-11).
Is there anything I can do to enable my GT-P9000 to support Channel 13? It's rooted & running CyanogenMod + cdesai's Jelly-Bean ROM (cm-10-20120730-EXPERIMENTAL-p1-cdesai). All my other devices (iPad/iPhone) appear to support Channel 13, so I just need to get this working now.
I'm sure it's probably just a matter of setting the device to support EU WiFi standards, but am unsure how to do this....
Any ideas?
strawdog74 said:
I'm sure it's probably just a matter of setting the device to support EU WiFi standards, but am unsure how to do this....
Any ideas?
Click to expand...
Click to collapse
Success!!
I solved my own question, for those stumbling across this thread, simply do the following :-
1. Install SSHDroid on the device
2. Install PuTTy on your computer (SSH terminal emulator)
3. Connect to your device by entering the HOSTNAME or IP address into PuTTy
4. Login using user=root password=admin
5. Paste the following command into the terminal :-
sqlite3 /data/data/com.android.providers.settings/databases/settings.db "INSERT INTO secure (name, value) VALUES ('wifi_country_code', 'EU');"
6. Restart wifi or Reboot device
I am now able to see my WiFi network on Channel 13 using WiFi Analyzer (a very useful app by the way).
Can't you just run terminal app rather than SSH from PC?
Sent from my GT-P1000 using xda app-developers app
''Wifix manager'' can set this without using the scripts, just type in the advanced ''EU'' or whatever country code you want.
Sent from my GT-P1000

[GUIDE][Difficulty: Intermediate] Disable Pattern/Pin/Password Lock using Shell

Since Marshmallow, I haven't been able to disable Pattern/PIN/Password (P3) using Secure Setting. I'm sure many others might be facing the same issue. So here's a guide on how to disable P3 using Shell commands.
Step 1. Set a P3 and remember it.​Step 2. Create a new Task named Disable Lock. Add Run Shell and under it type the following command​
Code:
mv /data/system/gatekeeper.pattern.key /data/system/gatekeeper.pattern.key.disabled;
mv /data/system/gatekeeper.password.key /data/system/gatekeeper.password.key.disabled;
mv /data/system/locksettings.db-wal /data/system/locksettings.db-wal.disabled;
mv /data/system/locksettings.db-shm /data/system/locksettings.db-shm.disabled;
mv /data/system/locksettings.db /data/system/locksettings.db.disabled;
reboot
Tick Use Root​Step 3. Create a new Task named Lock. Add Run Shell and under it type the following command​
Code:
mv /data/system/gatekeeper.pattern.key.disabled /data/system/gatekeeper.pattern.key;
mv /data/system/gatekeeper.password.key.disabled /data/system/gatekeeper.password.key;
mv /data/system/locksettings.db-wal.disabled /data/system/locksettings.db-wal;
mv /data/system/locksettings.db-shm.disabled /data/system/locksettings.db-shm;
mv /data/system/locksettings.db.disabled /data/system/locksettings.db;
reboot
Tick Use Root​Step 4. Now if you want to disable P3 just run Disable Lock Task and when your privacy is under danger, run Lock Task.​
Explanation: In Step 2 you rename files which store P3 data into ".disabled" which makes the files unreadable and thus your P3 is disabled. And in Step 3 we effectively nullify Step 2 restoring our old P3
PS: Run Disable Lock Task only if you have locked your phone using P3
PPS: Run Lock Task only if you have run Disable Lock Task
PPPS: I have personally used Pattern, PIN, and Password, so let me know in the comment section if you are able to successfully disable Fingerprint and Iris Scanner using above technique.
this is a very interesting approach.If I understand it correctly, you will have to reboot each time, right? is there anyway to bypass that, resulting a simple with on/off like the way secure setting works? maybe a kind of system force refresh?
alienyd said:
this is a very interesting approach.If I understand it correctly, you will have to reboot each time, right? is there anyway to bypass that, resulting a simple with on/off like the way secure setting works? maybe a kind of system force refresh?
Click to expand...
Click to collapse
Yeah, you have to reboot everytime you want to disable/enable lock. And I honestly don't know if there's any simple ON/OFF like in Secure Setting, I just discovered this method on an random forum. And I thought of posting the ideology here, since I'm sure many are not able to use Secure Setting to disable lock the same since Marshmallow.
I accidentally deleted those files , how to restore them ?
Midhun3! said:
I accidentally deleted those files , how to restore them ?
Click to expand...
Click to collapse
Are you using a custom ROM?
Yes
Midhun3! said:
Yes
Click to expand...
Click to collapse
Ok, try flashing your custom ROM. If that doesn't work, extract your custom ROM and copy pasting those deleted files to your phone.
this would have been great if not for the reboot. It just takes to long to reboot today's phones.
Sent from my LG-H815 using Tapatalk
I confirm the procedure works on rooted N LG VPad.
I will test on O LG G3 and report back.
I confirm that it works on android Oreo.
Now I would like to know where exactly did you find these commands. You said it was on anther forum. Please provide more info, maybe it proves to be a source of more interesting profiles and tasks.
Sent from my crDroid "O" powered LG-D855 using Tapatalk
I just checked one need not reboot, even a soft reboot does the job. Remove the "reboot" from the above commands. Create new shell task with "killall zygote" . Soft reboot is faster
My setup is
Honor 9 Lite
LineageOS 15.1
My intention is to
Set Fingerprint+PIN
Then, remove PIN and let Fingerprint remain.
Following KiranGadge911's instructions, I enter the following
Code:
adb shell
su
mv /data/system/locksettings.db /data/system/locksettings.db.disabled
reboot
The other files don't exist
/data/system/gatekeeper.password.key
/data/system/gatekeeper.pattern.key
/data/system/locksettings.db-shm
/data/system/locksettings.db-wal
I entered my fingerprint, after that it stayed stuck on "Android is starting..." message, indefinitely.
I've tried this twice, and had to Factory Reset twice. :silly:
If you have the same setup, let me know how you remove pin/password, in order to have fingerprint only.
@KiranGadge911 can this only be done if you have root? I have been looking for this exact approach, except not reboot but shutdown. However, I dont have root and I dont know if rooting my phone (OnePlus 6) violates any warranty.
Reason why I need this is that the phone (maybe others too) has a function that starts the phone based on schedule. I think it's great to be able to shut down the phone and let it start automatically at a given point.
However, if I haven't disabled any pin/password, I won't be reachable by phone.
This is where your solution comes in handy (although I think it would need to disable the SIM pin as well).

how to auto override force dark mode in android Q

In AOSP based android Q roms, there is a force dark option in developer settings whoich makes almost all apps to be appreaded in dark mode.
This option gets unselected after reboot.
One has to enable it after every reboot.
However it's possible to enable it by default after reboot.
For rooted phone.
Just add the following line in your build.prop file
debug.hwui.force_dark=true
Thats all.
It's working in my phone. Tested.
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Hit a thanks to me if you are benifited.
Screenshots.??
Screenshot
Hmmmm.
Screenshot for many apps.?
Thanks
LoveFootJob said:
Hmmmm.
Screenshot for many apps.?
Thanks
Click to expand...
Click to collapse
look at your back....its there already
[email protected] said:
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Click to expand...
Click to collapse
Hi
How did you manage that?
As far as I know, setprop needs root or it won't work unless it's done via adb on a computer
Sent from my SM-N976B using XDA Labs
paolo200 said:
Hi
How did you manage that?
As far as I know, setprop needs root or it won't work unless it's done via adb on a computer
Click to expand...
Click to collapse
No...it will work...
Just auto execute it after every reboot thru tasker
[email protected] said:
No...it will work...
Just auto execute it after every reboot thru tasker
Click to expand...
Click to collapse
Ok. Thanks.
May I ask what is the action to use within tasker?
Sent from my SM-N976B using XDA Labs
davidking2893 said:
First, turn off regular dark mode (if enabled) and reboot your cell phone. Then, toggle the override-dark-mode option in developer settings and restart the settings app. This will force all apps into the override-dark-mode color scheme. Thats' it.
Click to expand...
Click to collapse
Question is how to do it auto after reboot
[email protected] said:
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Hit a thanks to me if you are benifited.
Click to expand...
Click to collapse
I don't get you. Can you give a detailed tutorial?
Not working
Im on a non-rooted Galaxy S10e [Android 10, OneUI 2.0]. If I run the command with tasker, it gives me the following message ("Ausführen" is german and means "execute", "Fehler" means "error"):
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/Shell runBackground setprop debug.hwui.force_dark true root: false timeout: -1
05.06.39/Shell start process-thread ID 672
05.06.39/E add wait type Shell1 time 2147483647
05.06.39/E add wait type Shell1 done
05.06.39/E add wait task
05.06.39/E Fehler: 1
If I do it with the app "Android Terminal Emulator" it gives me the following error:
:/ $ setprop debug.hwui.force_dark true
setprop: failed to set property 'debug.hwui.force_dark' to 'true'
Either way, it doesnt work for me. Does anybody know what could be the issue here? Ive also tried setting it to "1" instead of "true", same result. Setting the real setting to enabled or disabled doesnt matter either.
RnKn98 said:
Im on a non-rooted Galaxy S10e [Android 10, OneUI 2.0]. If I run the command with tasker, it gives me the following message ("Ausführen" is german and means "execute", "Fehler" means "error"):
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/Shell runBackground setprop debug.hwui.force_dark true root: false timeout: -1
05.06.39/Shell start process-thread ID 672
05.06.39/E add wait type Shell1 time 2147483647
05.06.39/E add wait type Shell1 done
05.06.39/E add wait task
05.06.39/E Fehler: 1
If I do it with the app "Android Terminal Emulator" it gives me the following error:
:/ $ setprop debug.hwui.force_dark true
setprop: failed to set property 'debug.hwui.force_dark' to 'true'
Either way, it doesnt work for me. Does anybody know what could be the issue here? Ive also tried setting it to "1" instead of "true", same result. Setting the real setting to enabled or disabled doesnt matter either.
Click to expand...
Click to collapse
In Samsung phone setprop command is diff i guess... Google it for command.
[email protected] said:
In Samsung phone setprop command is diff i guess... Google it for command.
Click to expand...
Click to collapse
Do you have proof it's working for non root??
[email protected] said:
In Samsung phone setprop command is diff i guess... Google it for command.
Click to expand...
Click to collapse
First thanks for the answer , but...
I dont think its different. The getprop command (getprop debug.hwui.force_dark) works fine, gives me true if its turned on.
If i do the setprop command over adb (adb shell setprop debug.hwui.force_dark true) it also works fine.
The only thing not working is the setprop command executed directly on my device. Which lets me conclude that i probably need root?
RnKn98 said:
First thanks for the answer , but...
I dont think its different. The getprop command (getprop debug.hwui.force_dark) works fine, gives me true if its turned on.
If i do the setprop command over adb (adb shell setprop debug.hwui.force_dark true) it also works fine.
The only thing not working is the setprop command executed directly on my device. Which lets me conclude that i probably need root?
Click to expand...
Click to collapse
No... Its working in non rooted device... Tested.
There may be one more thing... Shell need to have write secure settings permission. Its permission issue.
[email protected] said:
In AOSP based android Q roms, there is a force dark option in developer settings whoich makes almost all apps to be appreaded in dark mode.
This option gets unselected after reboot.
One has to enable it after every reboot.
However it's possible to enable it by default after reboot.
For rooted phone.
Just add the following line in your build.prop file
debug.hwui.force_dark=1
Thats all.
It's working in my phone. Tested.
Hit a thanks to me if you are benifited.
Click to expand...
Click to collapse
Hello,
Thank you so much for your solution that works very well on my rooted phone :good:
1) I would like to know how to totally disable this feature if I no longer want the override force-dark someday please ?
2) Actually, how to force the rest of the remaining white applications to become black please ?
Thank you in advance for your help.
Cordially
MobAndro said:
Hello,
Thank you so much for your solution that works very well on my rooted phone :good:
1) I would like to know how to totally disable this feature if I no longer want the override force-dark someday please ?
2) Actually, how to force the rest of the remaining white applications to become black please ?
Thank you in advance for your help.
Cordially
Click to expand...
Click to collapse
Just switch off dark theme... Force dark need not to be changed. Add dark theme icon in qs header
[email protected] said:
Just switch off dark theme... Force dark need not to be changed. Add dark theme icon in qs header
Click to expand...
Click to collapse
Hello,
I've been using the dark mode since I bought my S10.
I discovered the override force-dark a few days ago then I realized that after the reboot this option was disabled on its own and every time.
I did some research to have it automatically and I came across your tuto that worked very well for me. Only some applications had problems with the override force-dark.
Since yesterday, I don't know why now the override force-dark disables itself. When I turn it on, it immediately turns off itself without even restarting.
I don't understand what's going on because this option was automatically activated after each reboot.
I didn't again even touch the build.prop either...
MobAndro said:
Hello,
I've been using the dark mode since I bought my S10.
I discovered the override force-dark a few days ago then I realized that after the reboot this option was disabled on its own and every time.
I did some research to have it automatically and I came across your tuto that worked very well for me. Only some applications had problems with the override force-dark.
Since yesterday, I don't know why now the override force-dark disables itself. When I turn it on, it immediately turns off itself without even restarting.
I don't understand what's going on because this option was automatically activated after each reboot.
I didn't again even touch the build.prop either...
Click to expand...
Click to collapse
It's tough to tell the problem from here. U hv to find it.
[email protected] said:
It's tough to tell the problem from here. U hv to find it.
Click to expand...
Click to collapse
Do you think that I can delete this line "debug.hwui.force_dark=1" and put it back in the build.prop again after reboot please ?
Because it's the first time that I've modified this system file so I'm not used to manipulating it...
Thank you in advance for your answer.

Categories

Resources