GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

See SafetyNet requests logs

Open iTrooz opened this issue 2 years ago • 10 comments

Is your feature request related to a problem? Please describe. Sometimes applications won't open because they detect "an unusual device". I think it would be a nice thing to know if they got this information by running a SafetyNet test, or by other means

Describe the solution you'd like A "Requests log" button in the SafetyNet tab to show which applications have recently requested an attestation, when, and possibly more information

Describe alternatives you've considered

Additional context I know this wouldn't solve a lot of problems with SafetyNet, but it would still help in some cases. And in general, I would like to know when an application use the SafetyNet API

I'm willing to work on this and submit a PR, if you're okay with the feature

iTrooz avatar Jun 10 '22 21:06 iTrooz

Hey @mar-v-in, sorry for pinging

I just would like to know if such a feature would be merged if I implemented it I've seen you are active in the pull requests section, but I did not want to make the feature before knowing if it was going to be merged

Thanks for your answer !

iTrooz avatar Jul 25 '22 17:07 iTrooz

Yes, a display of previous SafetyNet requests and there result (similar to information about push messages) certainly would make sense.

mar-v-in avatar Jul 27 '22 08:07 mar-v-in

(similar to information about push messages)

I never saw such a thing in microg. Is this in the master branch as of now ?

iTrooz avatar Jul 29 '22 21:07 iTrooz

I never saw such a thing in microg. Is this in the master branch as of now?

You can find a list of applications using push notifications in microG settings.

I would personally also be interested in a similar feature for SafetyNet requests, such that I know which apps use it and which don't.

Danacus avatar Jul 30 '22 09:07 Danacus

You can find a list of applications using push notifications in microG settings.

Ooh, right. The feature I'm proposing would be a bit different tho, since it would be a short-timed (the information will be stored in the service, and lost when the service restarts) list of requests, and not of applications

Do you think it would be useful to store a "time of the last SafetyNet request" information for each application, like in the push notifications ? (Not saying I will do it, but why not if I have time for it too)

iTrooz avatar Jul 30 '22 15:07 iTrooz

For me, either option would work. I think I want the same thing as you: figure out if an application uses SafetyNet. Both options would give the answer to that question.

Danacus avatar Jul 30 '22 15:07 Danacus

the information will be stored in the service, and lost when the service restarts

The SafetyNet service is an on-demand service that's only meant to remain started as long as at least one app is using it.

I'd rather propose to create a SafetyNet request log with the package name, timestamp, nonce and result information (success / failure / error message (in case of network error or rate limit exceeded). Old records probably should be removed after 14 days.

A full log has the advantage that you can see if one app regularly does SafetyNet requests in the background or just on demand. But I see your point that a simpler version might be sufficient.

mar-v-in avatar Jul 30 '22 22:07 mar-v-in

The SafetyNet service is an on-demand service that's only meant to remain started as long as at least one app is using it.

Oops

I'd rather propose to create a SafetyNet request log with the package name, timestamp, nonce and result information (success / failure / error message (in case of network error or rate limit exceeded).

I was currently going with that + the key used and the resulting JWT object

Old records probably should be removed after 14 days.

Okay !

A full log has the advantage that you can see if one app regularly does SafetyNet requests in the background or just on demand. But I see your point that a simpler version might be sufficient.

Oh, right. I never thought about this case. I'll be going with this then

iTrooz avatar Jul 30 '22 23:07 iTrooz

I propose also to put a size limit, if there are too much apps that use SafetyNet regularly then the data will grow up too much in 14 days.

ale5000-git avatar Aug 04 '22 15:08 ale5000-git

Okay, I'll make some tests against the SQLite db to see where the limit should be

(I'm still coding this btw, I'm just going other stuff at the same time)

iTrooz avatar Aug 04 '22 15:08 iTrooz

The corresponsing PR has been merged, so I think this issue should be closed, right?

fynngodau avatar Mar 20 '23 17:03 fynngodau