Skip to content

add SpamBlocker to BlockingManager - #802

Open
aj3423 wants to merge 1 commit into
quik-sms:masterfrom
aj3423:feat/integrate-spamblocker
Open

add SpamBlocker to BlockingManager#802
aj3423 wants to merge 1 commit into
quik-sms:masterfrom
aj3423:feat/integrate-spamblocker

Conversation

@aj3423

@aj3423 aj3423 commented May 14, 2026

Copy link
Copy Markdown

Add app SpamBlocker as a screening provider, for SMS content screening.

@Kevinf63

Copy link
Copy Markdown

@aj3423 you're a legend for doing this, greatly appreciated!

@aj3423
aj3423 force-pushed the feat/integrate-spamblocker branch from 0ff6e01 to 2f1d5eb Compare May 15, 2026 15:29
@aj3423

aj3423 commented May 15, 2026

Copy link
Copy Markdown
Author

Oops, sorry, fixed a bug that after selecting SpamBlocker as the blocking manager, it still shows "QUIK", now it shows "SpamBlocker" correctly.

image

@Inhishonor Inhishonor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this!

I have a few general questions:

  • Should a general interface be defined elsewhere and then a new app has to just extend that interface for everything it would like to use?
  • Should an interface be defined and the protocol to be expanded for automatic detection of all apps with the PublicSMSScreeningService?

Do you want to implement any of these comments, or do you want me to take this over? (No problem either way)

Comment on lines +127 to +128
// If either version of Should I Answer? is installed and SIA is enabled, build the
// intent to request a rating

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not understanding this comment. Is it necessary?

Comment on lines +43 to +56
const val action = "sms.screening.provider.PublicSMSScreeningService"

const val smsScreening = 1
const val smsScreeningResult = 2

// request
const val keyNumber = "number"
const val keySmsContent = "smsContent"
const val keySimSlot = "simSlot"

// response
const val keyShouldBlock = "shouldBlock"
const val keyReason = "reason" // Why the message is blocked or allowed
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be moved to a specific file or module where all of the protocol related things should live? Rather than redefining it for every new app.

Comment on lines +43 to +59
const val action = "sms.screening.provider.PublicSMSScreeningService"

const val smsScreening = 1
const val smsScreeningResult = 2

// request
const val keyNumber = "number"
const val keySmsContent = "smsContent"
const val keySimSlot = "simSlot"

// response
const val keyShouldBlock = "shouldBlock"
const val keyReason = "reason" // Why the message is blocked or allowed
}


const val SpamBlockerPackageName = "spam.blocker"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the const vals need to be upper case with underscores.

// If the intent isn't null, bind the service and wait for a result. Otherwise, don't block
if (intent != null) {
val r = context.bindService(intent, this, Context.BIND_AUTO_CREATE)
Log.i("quik spamblocker", "bind service: $r")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Timber here.

what = Protocol.smsScreening
data = bundleOf(Protocol.keyNumber to address)
replyTo = Messenger(IncomingHandler { response ->
Log.i("quik spamblocker", "shouldBlock: ${response.shouldBlock}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timber here as well.

@aj3423

aj3423 commented May 26, 2026

Copy link
Copy Markdown
Author

Should a general interface be defined elsewhere and then a new app has to just extend that interface for everything it would like to use?

I don't know, i'm okay with either. An interface doesn't seem necessary as the current protocol is just some integers/strings, it will definitely be useful later on for complex features like timeout handling. Maybe we can start simple and see.

Should an interface be defined and the protocol to be expanded for automatic detection of all apps with the PublicSMSScreeningService?

Here's the code for client listing:

https://github.com/aj3423/sms_screening_demo/blob/0df225a50fe3928b632354b71df8ee480f14c0c7/demo_sms_app/src/main/java/demo/sms/app/Client.kt#L196-L206
and
https://github.com/aj3423/sms_screening_demo/blob/0df225a50fe3928b632354b71df8ee480f14c0c7/demo_sms_app/src/main/java/demo/sms/app/Client.kt#L45-L54

That code is an demo SMS app, it also handles timeout. (the repo is AI generated)

Do you want to implement any of these comments, or do you want me to take this over?

Please take over this and feel free to change anything, I'll update SpamBlocker accordingly.

@JeffKwasha

Copy link
Copy Markdown

This is the most important PR
QUIK's own blocking is ... difficult.

SpamBlocker shows what, why, and has really smart features like allowing everything for a few hours if you call 911, or pizza updates if you just used the pizza app.

I only wish it worked on voicemail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants