xfarrow / locatemydevice

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

App crashes when trying to chose whitlisted contacts #3

Closed kevin0t closed 1 year ago

kevin0t commented 1 year ago

Steps to reproduce - setup password then add whitelisted contacts - app crashes. Tested on Android v12 Motorola g App version 1.0.2 refer crash logs

xfarrow commented 1 year ago

Thank you for your submission, I will work on it as soon as possible.

xfarrow commented 1 year ago

For some reason, on my Android12 emulator, the issue does not arise. I will keep looking into the issue, in the meantime, would you mind to share how the phone number you're trying to add looks like? (no need to share the real phone number, I just would like to know if it contains some characters that are unrecognized by the app). Does it crash on every phone number?

Thank you for your patience.

Reference if any programmer might like to contribute to this issue: The error happens to be on this line https://github.com/xfarrow/locatemydevice/blob/main/src/app/src/main/java/com/xfarrow/locatemydevice/WhitelistContactsActivity.java#L98 because phoneIndex is -1.

kevin0t commented 1 year ago

Does it crash on every phone number?

Yes it crashes on every phone number.

I use simple contacts as my phonebook. On pressing the '+' sign in whitelist menu , i chose the 'simple contacts app' and i am redirected to the list view of my contacts appearing by their names. If i then select any contact , it redirects back to 'locate my phone' app but still has the whitelisted contacts empty. Then it will crash a second after it.

Maybe the problem is with simple contacts ? coz i think it does not allow other apps to read the contacts. i'll try to use another contacts app.

Also if i could add numbers manually, would work around it.

xfarrow commented 1 year ago

Yes it's definitely the use of the app "Simple Contacts" making the app crash. I do not know wether it's my or their issue. I will investigate into it.

In the meantime, I will add the possibility to manually add the phone number, thank you for the suggestion!

kevin0t commented 1 year ago

Thanks for making this project. 👍

I have almost the same vision and requirement for such a service.

xfarrow commented 1 year ago

The crash shouldn't happen any longer and I added the functionality to manually add whitelisted phone numbers, as requested.

Unfortunately it is still impossible to add a contact from the app "Simple Contacts". I opened an issue in their repo because the problem seems to be (according to me) on their part.

Thank you for your feedback and inputs! If you like this app you may consider giving it a little star :-)

kevin0t commented 1 year ago

Thanks for adding manual functionality , it solved the problem for me without needing to install other contacts app. I also think the problem is on simple contacts side.

Edit : The toast notification warning which appears when selecting numbers from incompatible third party contacts app , gets cut due to the new android 12 design of it. Screenshot_20221029-194421-673.png

xfarrow commented 1 year ago

Now we are able to get contacts from Simple-Contacts as well! Just uploaded the release. We don't need to fix this toast 'cause won't be shown anymore (hopefully) :)