moezbhatti / qksms

The most beautiful SMS messenger for Android
https://qklabs.com/download
GNU General Public License v3.0
4.46k stars 1.06k forks source link

Block by keyword #228

Open bleketux opened 8 years ago

bleketux commented 8 years ago

It would be the next great feature if you could implement block by keyword function on blocker feature. Block by keyword is filtering unknown incoming sms by a list of keyword defined by a user. Thank you.

CoREse commented 7 years ago

I want it too!

ghost commented 7 years ago

I'm not really into android, it's a quick one hour hack. I had to update the build.gradle as per android studios suggestion otherwise builds failed. I also changed these files:

And added:

I removed INTERNET permission entirely, me and my friends have a little obsession with sms stuff not leaking into net. It's not perfect but gets the job done.

The filter has a syntax:

Todo:

I'm late for work already, gotta go. check my account you'll find the repo. have fun.

ghost commented 7 years ago

Well, I guess it was too developerish for my friends taste. I'm making it simpler: one option for regex, one for black listed words. If it turns out to be good I'd make a PR. if you have any suggestion for a better user experience do tell me please.

bleketux commented 7 years ago

I'm excited, finally somebody care to implement this feature :) How can I tested?

ghost commented 7 years ago

well... I was in a hurry. Currently in the first run the app adds some persian words to the black list, but it'll be easy (and quicker, changed the list implementation) to remove them.

The Internet access is completely removed.

the complex syntax mentioned above is also removed. there's two menu options: add regex pattern, add blacklisted words.

apart from those, everything works as expected. You can find the code here: https://github.com/loolooyyyy/qksms

And a pre compiled apk here, you must remove the original qksms before! https://koosha.cc/sms.apk

bleketux commented 7 years ago

Awesome. I'll try it, and hopefully a lot spam message will be filtered within the next week. I hope the blacklisted word is case insensitive. I'll get back to you soon. Thanks.

ghost commented 7 years ago

It is. the idea is to have language specific text preprocessors, toLowerCase for English, dummySpaceRemover for persian, ...

bleketux commented 7 years ago

Currently there is 13 persian words. I cannot delete the persian word, and I cannot add more than 5 english words. So totally there's 18 words (persian and english). Every time I remove the persian words, it's reappear. And everytime I add another english word, it's dissapear.

ghost commented 7 years ago

that's strange. I'll try to fix it tonight.

hukkin commented 7 years ago

@loolooyyyy, thanks for the effort, I always wanted to see this feature. I wish you'll make a pull request so that we'd get your changes upstream.

ghost commented 7 years ago

https://github.com/moezbhatti/qksms/pull/733

liweijian commented 7 years ago

@loolooyyyy Great thanks for your work.

There's a lot of spam message from a sender start with number 1069, I was wondering if we could configure QKSMS to make it in being read status and don't send any notification to Android system some day?

1069
ghost commented 7 years ago

@liweijian That should already be the default behavior? if a message is identified as spam, then no notification is sent to user and the message is marked as read. This is also the case for the future messages from that sender even if they don't contain the spam words/patterns (the sender is permanently blocked on first occurrence of a spam message)

liweijian commented 7 years ago

@loolooyyyy

Thanks for your reply.

I was wondering if maybe we could mark all the message prefix of 1069 as read automatically. Because the senders' number change all the time. For example, futu5 would send sms to me using 10691111 today, but they will use 10692222 tomorrow.

ghost commented 7 years ago

I thought regex pattern matching and word blacklisting would be a good solution for ***holes keep changing their number, because the messages usually follow the same pattern and have similar words. But why not? let's do it.

edit: I just realized the characters in screensshot have totally changed. Number prefix blocking seems the only solution.

ghost commented 7 years ago

@liweijian done. please test.

bleketux commented 7 years ago

Currently there is 13 persian words. I cannot delete the persian word, and I cannot add more than 5 english words. So totally there's 18 words (persian and english). Every time I remove the persian words, it's reappear. And everytime I add another english word, it's dissapear.

@loolooyyyy, have you checked it yet?

ghost commented 7 years ago

@bleketux sure, persian words removed, and the list works as expected. I tested up to 40 words and 10 patterns. What is your android version?

P.S: a pre-compiled version is at https://koosha.cc/sms.apk but the internet access is removed so no internet related service would work (jabber and stuff).

bleketux commented 7 years ago

It work great. Thanks. I wonder, is it work if filtering part of the word? for example: if I add "card" to word list, then if I receive a message containing "creditcard", it will be considered as spam, right? or should I add "*card*"?.

btw, my android version is 6.0, using huawei emui 4.0

ghost commented 7 years ago

For the word blacklist option, It's a simple java's String.contains(yourWord). The quotes are just to make it clear, don't put quotes around the word in the app.

"card" (notice there is NO spaces around the word):

" card " (notice the spaces around the word):

I just realized it won't match card! (with the exclamation mark), because we added spaces around the word. So you won a free card! come and get it won't be matched. Not so good. What I'm going to do is to check for word boundary instead, so card and card! or even card, will match but creditcard won't match.

For full control over filtering, you can resort to pattern matching. It follows Java regex rules (it is actually java regex): https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html It can get complicated for non technical users or worse, a mistake can cause all messages to be blocked though!

liweijian commented 7 years ago

@loolooyyyy Great thanks

bleketux commented 7 years ago

Hmm, maybe not only with exclamation mark, I got a message like this: you can buy using cash/card at blabla and it won't match. (yes, there's no spaces around the word "card")

I know that it's not good to match part of the word. If I want to do it, I have to use regex pattern right? Since I'm not that technical, please provide me regex sample to match part of the word. Thanks.

And, is it possible to add a trigger (a button maybe) to rerun our new added block rules through all message? hehe sorry for asking to much request :smile:

moezbhatti commented 6 years ago

It's great that you guys are modifying the app to have a workaround for yourselves!

I don't plan on adding this feature in the public version of QKSMS however, so I'm going to be closing the issue

bleketux commented 6 years ago

Oh no... :( but wait... you said public version, is there any other version that going to implement this feature? ;)

moezbhatti commented 6 years ago

@bleketux by that I meant that you're welcome to implement it yourself! but I do not plan on contributing to it. sorry about that!

moezbhatti commented 6 years ago

I've changed my mind about implementing this, thought about it some more and I think that it would be really great for specific use cases

bleketux commented 6 years ago

Great news... thanks... 🥇 😄

raniesantos commented 6 years ago

it would be really great for specific use cases

@moezbhatti YES, IT IS. For example, friends or family members that always nag you about a particular topic. You obviously don't want to completely shut them out, you just want to not be notified and bothered when they bring specific things up.

I've been checking various Android SMS apps, the only decent apps I found that have this are EvolveSMS and Go SMS Pro.

Evolve is kind of okay but the dev has 2 SMS apps and they focus on the other one more (Pulse SMS). I don't like Go. If you finally add this to QK that would be absolutely great.

ToRuDev commented 6 years ago

@moezbhatti You lead the project so the cards are in your hands ;) But any chance that this functionality will be implemented soon? About the fork of @loolooyyyy I can't do it nor judging the quality of coding, but what is your point of view? The pull is not OK for you?

catscarlet commented 6 years ago

@loolooyyyy Hey sir, can you make your package works as this: "Block message, no sound alert, but still have a special info on statusbar"

Cause most annoying SMS is sent by useful company, I would check if there would be some important message got blocked by accident.

Beachless commented 5 years ago

Just adding my request to this one... My country actually specifies by law that users need to be given the option to opt out of communications so most of the spam we get contain keywords like "opt out" "STOP>OUT" and whatever creative phrases they can come up with. I really miss the keyword filters on the native phone apps when I switch to QKSMS and in the end I always switch back so would be great if this feature made it into the app.

confluence commented 5 years ago

This would be a very useful feature for me. I keep getting spam which is virtually identical but comes from constantly changing numbers. It's extremely frustrating.

markd89 commented 4 years ago

Just another friendly request. I get SMS messages trying to sell me "CBD" from lots of random numbers.

Great app and thanks for considering!

mddvul22 commented 4 years ago

This will be great. I get a lot of spam with a specific name in it, that isn't mine. The ability to block all of that spam will be great!

sitaramc commented 4 years ago

Hi

Thanks for a great product!

Sorry for being so naive, but what does "Up Next" mean (I notice this issue is in that set in the tracker). Current latest is 3.8.1, so does "Up Next" mean 3.9 or 4.0?

I have to say this is easily the most anticipated feature for me. No other open source SMS software has it, and it looks like I'm not the only one who's very eager to see it.

thanks again

SkylerRingtail commented 3 years ago

Fervently seconding what @mddvul22 said. I've been getting 3+ spam messages a day for the past 6 months addressed to someone with a completely different name. All I desperately want is an SMS app with custom keyword/keyphrase filtering so I can manage my own blocklist rather than rely on a third party. I'm to the point where I'm tempted to write the dang thing myself if I knew a lick of Android programming...

(What's especially infuriating is Google's messaging app catches the spam 75% of the time, but still notifies me each time. Why would I want an interrupting notification about spam? Let me turn that off too! But I digress...)

moezbhatti commented 3 years ago

Up next means 3.9. This will be one of the very next few things I work on

beigirad commented 3 years ago

@moezbhatti 3.9.4 is out, even though of #1724 this feature didn't deliver yet.

Beachless commented 3 years ago

@moezbhatti 3.9.4 is out, even though of #1724 this feature didn't deliver yet.

Maybe if someone shares @moezbhatti phone number we can speed up the process by sending a message with the same word a few times a day until he gets around to this feature :)

That was just a joke please don't take it negatively.

424778940z commented 3 years ago

This still in the "coming soon" box lol. I was almost purchase and donate... then I noticed it is not there yet...

birth23 commented 3 years ago

Will this ever be implemented or just a false promise?

toymil commented 3 years ago

Will this ever be implemented or just a false promise?

Was there ever a promise?
Anyway, this is open source, anyone can contribute (especially needed for personal projects like this).

424778940z commented 3 years ago

Was there ever a promise?

Well it's in the "coming soon" list, which has been a while but still nothing. This is the major feature that me and lots of other people in this issue needs, and I believe most of us are happy to pay for it if implemented. Otherwise the official Samsung SMS app already has most features this app has.

No mean to be rude to developer, great work for an opensource app. But I really hope he implement this feature as so many people requested.

raniesantos commented 1 year ago

The year is 2023. 😐

renyhp commented 1 year ago

+1 for this request! I came here hoping to find this feature but unfortunately it's not here yet.

Perflyst commented 1 year ago

Simple SMS Manager by SimpleMobileTools added support for blocking keywords for incoming messages . An update with this feature is not released yet but hopefully will be soon.

Vinu-Suhas commented 7 months ago

bro whats the issue here ? whats the obstacle ?