aj3423 / SpamBlocker

Android Call/SMS blocker.
MIT License
506 stars 25 forks source link

Add phone number verification #202

Open Ilithy opened 3 days ago

Ilithy commented 3 days ago

The feature

Hi; Would it be possible to add caller phone number verification (via external APIs)?

I found two (private) organizations providing free keys for their number verification APIs; in the free version they are limited to 100 requests per month, which seems sufficient if SpamBlocker does not send requests when calling via known phone numbers (sms or call logs and contacts). It will (probably) be necessary for users to add their own keys for the APIs (I think). The information received during the analysis could be displayed in the call notification.

I do not know the extent of the complexity of integrating these APIs, but this would be an extremely useful addition, what do you think of it?

API info link: numlookupapi.com https://numverify.com/

Thanks.

aj3423 commented 2 days ago

Ah, since there is a free plan and it claims to support 232 countries, I'll add this feature in the next release v4.0.

Here's the proposal:

Ilithy commented 2 days ago

Wow, that's an extremely fast positive response, thank you very much.

Your proposal, and the various points specified are of exemplary practicality, it seems perfect to me.

With your permission, I will allow myself to check the CGU and privacy policy of these services in order to propose an update of your own privacy policy with the idea of ​​maintaining a clear approach to the possible processing of user's personal data (in case they decide to use these services, which will happen).

Thanks again.

wildstray commented 2 days ago

There is also another supplier for phone number verification thru APIs: https://captainverify.com/it/api-hlr.html I cannot wait for a version with this feature!

Ilithy commented 2 days ago

There is also another supplier for phone number verification thru APIs: https://captainverify.com/it/api-hlr.html I cannot wait for a version with this feature!

Thanks for this additional provider, it will be useful. Small clarification, if I understood @aj3423's feedback on the implementation of this feature, these providers will not be added, we will have the possibility to add requests to the APIs of any provider:

  • There will be a new section "Query Online", just like the automation section, you can integrate multiple APIs.

this is less "turnkey", but much much more powerful :)

aj3423 commented 2 days ago

With your permission, I will allow myself to check the CGU and privacy policy

Yes, please, I appreciate that.

There is also another supplier for phone number verification thru APIs: https://captainverify.com/it/api-hlr.html

There will be presets for all these sites, just like the FTC-DNC workflow, import it, modify the API_KEY and it should be ready. I'll email the provider, asking for the approval of integrating their API in this app. I won't be adding any API without their approval, however, you should be able to compose any request you want :smirk:

Ilithy commented 1 day ago

Hi;

With your permission, I will allow myself to check the CGU and privacy policy

Yes, please, I appreciate that.

Thank to you, your application is just awesome.

I have already created a modified and clarified version (on the processing of data from third-party services), I will propose it to you when it is useful (this gives me time to refine the details)

There will be presets for all these sites, just like the FTC-DNC workflow, import it, modify the API_KEY and it should be ready.

Thanks for the additional information; it's really great.

If I may ask a question, if (for example) one of my contacts calls me, will it pass all the rules, up to the verification(s), will it pass them? If yes, is it possible to prevent phone numbers known by SpamBlocker from passing this (or these) verification(s)?

I'll email the provider, asking for the approval of integrating their API in this app. I won't be adding any API without their approval, however, you should be able to compose any request you want 😏

For the approvals of the use of the apis, if they provide free access to their apis, I do not think it is necessary to ask them for this authorization, but I completely respect your decision.

an api provider to consider: ipqualityscore

Thanks and good night

aj3423 commented 1 day ago

If I may ask a question, if (for example) one of my contacts calls me, will it pass all the rules, up to the verification(s), will it pass them?

It works like this: All the filters are sorted by their priority in decending order, then the number will be checked by them one by one. Contacts priority is 10, if it matches a contact, the checking will stop immediately, the rest filters (including the APIs) will be skipped. Previously I said the API priority would be 0, but on second thought, it should be -1, which means it will only be checked when it passes ALL other filters , including the blacklist rules that have priority 0.

For the approvals of the use of the apis, if they provide free access to their apis, I do not think it is necessary to ask them for this authorization, but I completely respect your decision.

Good point. But I'll try it first to see how it goes, I guess they will allow it anyway.

Ilithy commented 1 day ago

It works like this: All the filters are sorted by their priority in decending order, then the number will be checked by them one by one. Contacts priority is 10, if it matches a contact, the checking will stop immediately, the rest filters (including the APIs) will be skipped. Previously I said the API priority would be 0, but on second thought, it should be -1, which means it will only be checked when it passes ALL other filters , including the blacklist rules that have priority 0.

Thank you for your enlightening answer, and your kindness, (I am stupid, but thank you for answering...) On the other hand, the functioning of SpamBlocker is exemplary.

Good point. But I'll try it first to see how it goes, I guess they will allow it anyway.

I understand, I accept and respect it, I really hope for positive answers too ^^

aj3423 commented 2 hours ago

There's more work to improve the UI/translation, but the feature is ready https://github.com/aj3423/SpamBlocker/actions/runs/12098420189

Here's the template for apilayer.net:

{
    "id": 3,
    "desc": "test",
    "actions": [
        {
            "type": "ParseIncomingNumber",
            "internationOnly": false,
            "autoCC": false,
            "fixedCC": "33"
        },
        {
            "type": "HttpDownload",
            "url": "http://apilayer.net/api/validate?access_key=API_KEY&number={number}&country_code=&format=1",
            "header": ""
        },
        {
            "type": "ParseQueryResult",
            "negativeSig": "(\"valid\":false)",
            "negativeFlags": 5,
            "positiveSig": "(\"valid\":true)",
            "positiveFlags": 5,
            "categorySig": "",
            "categoryFlags": 5
        }
    ],
    "enabled": true
}

For numberlookup.net:

{
    "id": 2,
    "desc": "",
    "actions": [
        {
            "type": "ParseIncomingNumber",
            "internationOnly": false,
            "autoCC": true,
            "fixedCC": "33"
        },
        {
            "type": "HttpDownload",
            "url": "https://api.numlookupapi.com/v1/validate/{number}",
            "header": "apikey: API_KEY"
        },
        {
            "type": "ParseQueryResult",
            "negativeSig": "(\"valid\":false)",
            "negativeFlags": 5,
            "positiveSig": "(\"valid\":true)",
            "positiveFlags": 5,
            "categorySig": "",
            "categoryFlags": 5
        }
    ],
    "enabled": true
}

I don't know how to test the captainverify.com, it always shows error:

"message":"Api key not valid"

I've tried generating new keys, but same error.