Turn on GPS, at least on rooted phone? (feature request)
Hi, I'd like to use your app (which is nice!), but I usually don't let the GPS activated on my device. Can't the app activate it, at least on rooted devices?
An app like Tasker, which can reproduce the same thing as your app, can activate the GPS. It would be great if your app were able to turn it on also (without Tasker of course).
Thank you!
No, unfortunately android don't allow enable gps, only if device is rooted. Now such function not implemented (app was designed for "normal" devices :). But it may be useful feature, I'll think about adding it.. But it enables wifi for searching nets (and then returns it state to original)
+1 to this! It would be very useful!
Personally, I am using Tasker in the meantime. You can recreate almost the same thing, I just wasn't able (yet) to hide the incoming and outgoing sms with Tasker. But for sure 'Finder' would be nice with the option for rooted phone to enable GPS... +1 for the author in all cases!
You don't need a rooted device to activate GPS. If you have ADB you can give any App the permission to activate GPS. Currently I develop a fork of this App. When I'm ready I can make a pull request.
You don't need a rooted device to activate GPS. If you have ADB you can give any App the permission to activate GPS. Currently I develop a fork of this App. When I'm ready I can make a pull request.
I'm ready and made a pull request. I hope Seva will merge it :smiley:.
so how did it end? it's ready to be implemented? would be incredible if it's preference for certain numbers only (not global option) and it we have instruction how to do it (simple adb commands) in readme.
Would like to know as well.
Unfortunally Seva has not yet merged my pull request.
If you want, you can install the attached APK. This is a build of my pull request. But you have to uninstall the APP from the F-Droid first (all settings will be lost), because my build is not signed.
An updated readme can you find here: https://github.com/Seva-coder/Finder/blob/4ef56c4c3dff9fbab5f03d514e99b0e892442985/README.md
Please let me know if it works for you.
so how did it end? it's ready to be implemented? would be incredible if it's preference for certain numbers only (not global option) and it we have instruction how to do it (simple adb commands) in readme.
I have implemented it as a global option. Maybe if I have time I can implement it on number level.
Hello! I had tested GPS auto activation, it really works! Thanks to @domkrm The only thing is that "google play protect" warn when installing app, may be because "write_secure_setting" in manifest I tagged version as a release (v1.9) and F-Droid should compile it at soon
So there is no toggle for it? It works out of the box for all trusted number?
You have a toogle to turn this feature on for all trusted numbers or turn it off for all trusted numbers (default is off). But there is no option to enable it only for some of the trusted numbers.
I just upgraded to v1.9, changed the setting via adb and then in the app, sent a query from another phone... and the GPS did not activate. Any other thing to do?
I just upgraded to v1.9, changed the setting via adb and then in the app, sent a query from another phone... and the GPS did not activate. Any other thing to do?
After the ADB command, have you enabled the option in the App settings?
"and then in the app" He has
"and then in the app" He has
You're right. I will try it later with the new version from F-Droid myself.
I just upgraded to v1.9, changed the setting via adb and then in the app, sent a query from another phone... and the GPS did not activate. Any other thing to do?
I have tested a fresh install on LineageOS 16. I executed the ADB command and enabled the option in the App settings. Then I send a request to myself and GPS is activated automatically.
Which Android version do you have? Maybe you can take a look in the Logcat?
on my MIUI (xiaomi) beside enabling ADB in phone settings, I also enabled "changing settings via ADB" permission in dev options (near ADB enabling). Is the command executed without errors?
i confirm it works. unmodified, unrooted android 8.1. this is very nice to see, thank You both! it also disables gps after coordinates are send, so i wonder how „max gps run time" and „pause between scans” affect this?
„max gps run time" - if phone can't get coordinates during this time (weak gps signal or it completely absent) app will stop trying get position to save battery. In this case SMS will contain error and battery charge. Also if accuracy less than seted, app will wait when accuracy become normal, but only during this time. In this case coordinates will be sent anyway (also with bad accuracy) „pause between scans” - this pause used to scan wifi nets
I just retried with same result - GPS icon doesn't appear, and Finder never sends the sms answer with the position. Here is my logcat (started/stopped around the receipt of the sms query). At first sight, gps seems to start correctly but then I see exceptions at lines 2266 (note that I'm not expert neither in android dev nor in logcat...): logs.txt
My phone is a S7 running a slightly modified Samsung Pie rom (with Magisk and Microg notably).
@OhSoGood but does Tasker works well (can enable gps) on this phone? lines below 2266 looks strange, like location is disabled. As I understand from log, your system use org.fitchfamily.android.dejavu location provider, may be it has some problems...
Found a work around for this issue that might help fix it.
First followed the detailed steps to be able to enable GPS automatically:
- Connecting phone through ADB.
- Running
adb shell pm grant ru.seva.finder android.permission.WRITE_SECURE_SETTINGS - in Finder's settings, check "Turn Location on automatically".
This did not work. Realized that upon request, GPS signal turns on for a fraction of a second, than turns back off and returns a" GPS not enabled" text message.
Noticed that upon a WiFi request, WiFi is turned on automatically, as well as GPS. However GPS signal is not full - but on battery saving mode.
Workaround:
- In settings, toggle "Pause between scans" to about 60 (together with the default 3 WiFi scans, this will leave GPS open for 3 minutes).
- Send a WiFi request to phone.
- about 5-10 seconds after the WiFi request, send GPS request.
This should do the trick.
In essence, once the WiFi request enables battery saving GPS, the GPS request will fully enables GPS and return a location. Just make sure the WiFi scan will take long enough for the GPS to receive a fix.
Down side is that WiFi requests will take longer to return.
@Seva-coder I am not a programmer, but hopefully this will help identify the issue and create a solution.
What android version are you using?
On Sat, Dec 5, 2020, 4:59 AM forensicolten [email protected] wrote:
Found a work around for this issue that might help fix it.
First followed the detailed steps to be able to enable GPS automatically:
- Connecting phone through ADB.
- Running adb shell pm grant ru.seva.finder android.permission.WRITE_SECURE_SETTINGS
- in Finder's settings, check "Turn Location on automatically".
This did not work. Realized that upon request, GPS signal turns on for a fraction of a second, than turns back off and returns a" GPS not enabled" text message.
Noticed that upon a WiFi request, WiFi is turned on automatically, as well as GPS. However GPS signal is not full - but on battery saving mode.
Workaround:
- In settings, toggle "Pause between scans" to about 60 (together with the default 3 WiFi scans, this will leave GPS open for 3 minutes).
- Send a WiFi request to phone.
- about 5-10 seconds after the WiFi request, send GPS request.
This should do the trick.
In essence, once the WiFi request enables battery saving GPS, the GPS request will fully enables GPS and return a location. Just make sure the WiFi scan will take long enough for the GPS to receive a fix.
Down side is that WiFi requests will take longer to return.
@Seva-coder https://github.com/Seva-coder I am not a programmer, but hopefully this will help identify the issue and create a solution.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Seva-coder/Finder/issues/7#issuecomment-739247944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFYTD5BEWOP7I65FVUKXWJLSTIVELANCNFSM4HZQG6NA .
Lineage 17.1 (Android 10).
Apologies for the late response.
What android version are you using?
I also hit this issue, per forensicolten's comment I was able to wifi search and then gps search, and that worked.
Samsung S9+, stock android 10, via sprint / T-Mobile.
Yup, not working as intented on LineageOS 17
"wifi search first" hack doesn't work for me when battery optimization is enabled :disappointed: