App/Script to block numbers remotely

Look what I found

/data/user_de/0/com.android.providers.blockednumber/databases/blockednumbers.db

Here’s my database. Android 16, so check that yours is the same.

blockednumbers.zip (779 Bytes)

Can probably script a remote updater

Oh great, that should work, thanks!

Will check it out soon

Here ya go, just change the URL:

https://github.com/alltechdev/alltech.dev/raw/refs/heads/main/update-blocked-db.sh

@admins did you change the way to format code? Doesn’t work like it used to.

You might want to add an hourly check to this

You can use this to get the uid

stat -c '%u:%g' /data/user_de/0/com.android.providers.blockednumber/databases/blockednumbers.db

Added to the script

You can test it with:

curl ``https://alltech.dev/update-blocked-db.sh`` | sh

Make an rc and you should be good

@ys770

Will be used to block AI text numbers mainly.

If you give me a list of numbers I can make you an app. Would need root though dunno if that’s a dealbreaker.

might try to do it myself, still working on a list

How you gonna stop them from removing the list?

From the contacts app

its for the tcl phones, dont think you can unblock somoeone from contacts. but i can make the file read only, thats one option

You can use chattr if it exists on the phone.

The chattr command in Linux is used to change file attributes on a Linux file system. When used with the +i flag, it makes a file or directory immutable.

Learned about it recently because that’s what tuxprotect uses to enforce DNS.

was going to try that

Noice let me know if it works

@ys770

So, chattr +i breaks the database…

But, chmod 440 works! Rules stay intact, and contacts cannot make changes.

Thanks for saving me some time! :slight_smile:

Want to have a race to see who can make an app faster? Lol

You updating with GitHub? Where you hosting the list? Your own server?

Gonna share the list?

Don’t mind sharing the list. Dont think i can start on the app until next week though. The reason i want to do it is because a lot of yeshivos that buy from me want the Ai text numbers blocked, my plan was that they will tell me what numbers to block and i’ll just update the list…

I’ll make you a deal.

You give me the list, and I make you an app that also gets shared here.

Will use root though. Can possibly pull it off with a non root boot script but that isn’t great for the average user. And I dunno if that would even work. Someone with more experience may know.

Deal. Root is fine. Not sure if the TCL has device specific things that need special attention in this case…

Just send me the database

Are there allot of numbers?

You want it to run on boot? Every set amount of time?

How does this work? You’d push the app to their phones? Auto grant su? Or you can send them updates (in that case an RC with the script might be better).

Hope I’m not biting more of than I could chew. Should hopefully be good.

Would be an app in the ROM. Every boot/6 hours

Will take care of su