Allow to blacklist numbers in the telephony plugin
ClosedPublic

Authored by nicolasfella on Feb 14 2018, 9:30 PM.

Details

Summary

Depends on D10519

Allow to specify a newline separated list of blocked numbers. This can be useful for 2FA/TAN that could be leaked to the desktop.

The protection is incomplete because the notification might be leaked trough the notificationsplugin anyway (T6651).

Test Plan

Block my number, send SMS to self -> only notification from Notificationsplugin is shown.
Unblock it again -> both notifications are shown

Diff Detail

Repository
R225 KDE Connect - Android application
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nicolasfella requested review of this revision.Feb 14 2018, 9:30 PM
nicolasfella created this revision.
albertvaka accepted this revision.Feb 17 2018, 10:04 AM
albertvaka added a subscriber: albertvaka.

Looks good :)

This revision is now accepted and ready to land.Feb 17 2018, 10:04 AM
mtijink requested changes to this revision.Feb 18 2018, 8:41 PM
mtijink added a subscriber: mtijink.

Only works when specifying an international number, not a national number.

Maybe use something like this: https://developer.android.com/reference/android/telephony/PhoneNumberUtils.html#compare(java.lang.String,%20java.lang.String)?

This revision now requires changes to proceed.Feb 18 2018, 8:41 PM

Only works when specifying an international number, not a national number.

Maybe use something like this: https://developer.android.com/reference/android/telephony/PhoneNumberUtils.html#compare(java.lang.String,%20java.lang.String)?

I was aware of that issue. I had no easy solution, but this looks promising, thanks :)

Use PhoneNumberUtils.compare.
Untested because I can't send SMS atm.

mtijink accepted this revision.Feb 24 2018, 2:27 PM

That works for me!

This revision is now accepted and ready to land.Feb 24 2018, 2:27 PM
This revision was automatically updated to reflect the committed changes.