xfarrow / locatemydevice

Application miming Google's Find My Device through SMS
GNU General Public License v3.0
109 stars 11 forks source link

Support location info when location services are off #4

Closed kevin0t closed 1 year ago

kevin0t commented 1 year ago

I tried using the option 'locate' and 'cellinfo' , both of which gave me a reply of 'location is not enabled'.

i thought making the app as a 'Device admin' app would grant it the permission to toggle location services on/off. But seems like it wasn't able to do so. Do i need to manually give it permission of _write_securesettings as its the case in findmydevice app or there is some work yet to be done on this feature ?

xfarrow commented 1 year ago

Unfortunately it is not possible to do so. If you try to add the option write_secure_settings you will receive an error. It is not possible to grant this permission to third-party applications.

kevin0t commented 1 year ago

Okay , but in case of findmydevice app they asked to grant the app _write_securesettings through an adb command . The app seemed to have gotten the permission when queried. I didn't test their app functionality fully though. Do their app have the same limitations ?

One of the key features for me is location info and almost every one keeps their location services off.

xfarrow commented 1 year ago

@karano-techie Thank you for your info! I will try to implement this. Unfortunately I didn't test this functionality in Find My Device as well, but I will!

alekksander commented 1 year ago

there is similar app that enables and disables gps itself to acquire requested info: https://github.com/Seva-coder/Finder

it's not as feature rich as locatemydevice, doesn't seem to be developed anymore but doesn't have that password option (which is more secure ofc, but also quite confusing and to me redundant as "LMD" (or any configurable phrase here) is already doing the same job as "0000" in my understanding).

until locatemydevices has no wifi enabling/disabling implementent i personally cannot rely on it ( i rarely use gps and keep it disabled 99% of the time phone is up). please consider it :)

xfarrow commented 1 year ago

@alekksander thank you for your suggestion! I will look into this app to see how they are able to automatically enable GPS and implement the functionality as soon as possible.

About the phrase/password: you are absolutely right. The phrase can be seen as a sort of password as well, but I decided to implement it just to be a mnemonic word, allowing the user to remember what they are communicating with. For example is not immediately clear what writing "xLg61g locate" means whereas writing "LMD xLg61g locate" gives more clarity, according to me, but I am open to any suggestions :)

until locatemydevices has no wifi enabling/disabling implementent

did you mean GPS enabling/disabling? Because locatemydevice has such a wifi enabling/disabling functionality (only APIs lower than 29, tho).

kevin0t commented 1 year ago

To just add a note to this , 'wifi' option is also dependent on location services state , even if wifi is 'on' on the phone. It will still show "location is off , unable to execute command" with wifi on. (tested on Android 12) (You may already be aware of this). The app has 'wifi control' special app access but seems it is also dependent on location services. wifi ssid info provide a good amount of info for one to guess the location.

xfarrow commented 1 year ago

@karano-techie yes, Android developers figured out that one can guess a person's location by performing a scan of their nearby wifi networks, hence, a wifi scan won't work if the location permission & toggle isn't on.

In the next release all of this can be bypassed thanks to the adb command, as requested :)

xfarrow commented 1 year ago

Hey, I am asking for your advice :) Do you think that the app should automatically enable location services if these are off and LMD 0000 locate is received, or should it be a separate option like locationservices-on?

Your point of view is precious :)

kevin0t commented 1 year ago

I think the location services should be automatically tuned on when using command LMD 0000 locate . It doesn't make much sense for a normal user to execute an additonal command for accessing location info.

'locate' command should first check for current state of location services , if its 'off' it should try to turn it on and then proceed to provide location info.

Same should be the case when 'wifi' command is executed as its dependent on location services.

The location services could be kept on for a limited period like 10 mins after which its turned off by the app again automatically.

If possible , we could also include a feedback message to the user that " location services turned on succesfully" or "failed to start location" incase anything goes wrong at the start. I am guessing fixing location may take a few seconds to few minutes , so this could provide the user a feedback that location services are working and is in the process of fixing one. Or else we could chose to skip it , if it creates too much noise.

Would love to try this function soon :)

alekksander commented 1 year ago

did you mean GPS enabling/disabling?

yes.

app should automatically enable location services if these are off

auto on/off. otherwise i'll have to remind about location enabling sms to my wife every time she uses this app ;)

would such "locationservices-on" do anything extra comparing to automated task?

xfarrow commented 1 year ago

Thank you for your feedbacks guys :smile_cat:

would such "locationservices-on" do anything extra comparing to automated task?

No, nothing extra, so yeah it makes sense to be an automatic feature

xfarrow commented 1 year ago

It is now possible to do so. You can download it here https://github.com/xfarrow/locatemydevice/releases/tag/v1.1-beta

As you can see, it is a beta release because I have not tested the accuracy of the GPS sensor if the latter gets turned on moments before its usage. I could not find any documentation about it.

I'll close the issue but the comments will be open still to receive your feedbacks :-)

kevin0t commented 1 year ago

Thanks for implementing this so quickly :) , a huge addition to the apps functionality.

It was successfully able to turn the location on with command , though for some reason in my case it didn't provide the coordinates with that one command itself. It gave me location coordinates , when issuing the 'locate' command the second time. Sometimes it didn't even give the coordinates after multiple attempts. Its not a deal breaker for me as it still does the job . I am sure you'll figure out this too. I think this feature would cover most of the users requirements and functions.

Also i guess you are going to inlcude instructions for granting write_secure_settings permission in the official release.