artnc / chronofile

Personal time tracking app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG][PRIVACY CONCERN] Blocking access to location also blocks possibility to save!?

HarriBuh opened this issue · comments

As the title says. If I denied the app access to my location, the app will either crash or not allow me to save an entry.

Error log:

[Device Model]: Pixel 7
[Display]: TQ3A.230901.001
[Android Version]: 13
[Android API Level]: 33
[Process ID]: 21876
[CPU ABI]: none
[Package Name]: com.chaidarun.chronofile
[Version Name]: 1.0.3
[Version Code]: 4
[Error Type]: JVM
[Crash Time]: 2023-10-02T09:12:17.089
[Stack Trace]:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chaidarun.chronofile/com.chaidarun.chronofile.GraphActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3644)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3781)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.NullPointerException
at com.chaidarun.chronofile.GraphActivity.onCreate(:8)
at android.app.Activity.performCreate(Activity.java:8342)
at android.app.Activity.performCreate(Activity.java:8321)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3625)
... 12 more

The app records the location of each entry, which can be viewed later by long-pressing an entry and tapping the location icon.

.. and why isn't this option optional then? I can imagine that I'm not the only one

private fun getLocation(callback: (Pair<Double, Double>?) -> Unit) {
try {
locationClient.lastLocation.addOnCompleteListener {
if (it.isSuccessful && it.result != null) {
callback(Pair(it.result.latitude, it.result.longitude))
} else {
callback(null)
}
}
return
} catch (e: SecurityException) {
Log.i(TAG, "Failed to get location")
}
callback(null)
}

Don't allow the application permission, and you'll be fine?

Read what I wrote in the opening post. It crashes when I do this. And it won't save my entries, but there may be another reason behind the latter.

Edit:
I can confirm now, that denying access to location also blocks the option to save.
I could reproduce it by temporarily granting the app location access- saving worked.
I strongly hope the dev does reconsider his programming, because this is nonsense. @artnc

Thanks for the report.

.. and why isn't this option optional then? I can imagine that I'm not the only one

As stated in the readme's first sentence, I made this app for myself.

The app doesn't make any network calls or request such permissions. Saving GPS coordinates is a privacy concern if you don't trust the security of a file stored locally on your own phone. In that case, please feel free to submit a fix, wait indefinitely for one, or not use this free app.

As soon as you make a code public and everybody is free to use it, the "the app is for myself" becomes redundant. Either keep it private and unpublished or deal with the consequences/ responsibility.

@HarriBuh this isn't a product, you are equally responsible for any changes that you want in the application.

@dcousens Can't argue with that, because my knowledge in this field is limited. If what you wrote was correct, I will withdraw my complaint. it's just that I've seen security concerns like unnecessary permissions can be a threat to privacy and that most developers on GitHub have been willing to remove these codes from their apps.