VREMSoftwareDevelopment / WiFiAnalyzer

Android application to analyze WiFi signals.
https://vremsoftwaredevelopment.github.io/WiFiAnalyzer/
GNU General Public License v3.0
3.24k stars 606 forks source link

Feature Request: option to automatically "disable wifi scan throttling" via root permissions #315

Closed Jon8RFC closed 3 years ago

Jon8RFC commented 3 years ago

An option to allow for disabling and re-enabling the wifi scan throttling, automatically, if the app has root permissions granted.

I couldn't find a specific example since I'm not a software developer, but I found this (for another setting within developer options) which may help to create the appropriate code:

Process proc = Runtime.getRuntime().exec(new String[]{"su","pm grant YOUR_APP_PACKAGE_NAME android.permission.WRITE_SECURE_SETTINGS", "settings put secure mock_location 1"});

proc.waitFor();

int value = Settings.Secure.getInt(getContentResolver(), Settings.Secure.ALLOW_MOCK_LOCATION);

SOP.OUT("mock_location::::::::::::::::::::::::::::::::: " + value);

With that, an "EXIT" button and/or an exit sequence (by using the Android "back" soft key to back out of the app) which would also re-enable the scan throttling upon closing the app.

This would be an excellent way to preserve battery life, automatically.

VREMSoftwareDevelopment commented 3 years ago

Duplicate #238

Jon8RFC commented 3 years ago

For anyone else with the skills to write the code for a pull request...

Using root, this will grant a non-system app the permissions to change system settings in developer options, from within the application itself: http://lifepluslinux.blogspot.com/2015/10/using-writesecuresettings-permission-on.html

Just need to find the appropriate call, or whatever it is, to change the wifi scan throttling flag, similarly to how the same person above changed the ADB Debug setting for their widget/app: https://github.com/alseambusher/adb-toggle