Operation on SMS

Post your questions and help other users.

Moderator: Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Operation on SMS

Post by Desmanto » 21 Dec 2017 11:41

bogdyro wrote:Yes, using the notification system is a good option also, but more difficult to parse it's text reliably I think.
I think that deleting a wrong sms is not an issue as the _id is unique. Every time a message arrive you immediately process it, remove it's notification and create another one. That way each arrived message would have it's own notification (associated with another _id of that message). Not very elegant but safer. I'm not thinking about spamming situations here... :)
So that's what I was doing in the flow.
Trigger fired (sms received or notification)
- read the last record in the database (it can only be the last since it takes only a few ms to do the actions)
- get the _id of the message and eventually check it's sender and text
- remove the messaging notif and create your own that contains the message _id and a DELETE button
- clicking a DELETE button on the notification uses the message _id to delete it (doesn't matter if it's not the last anymore)

If 10 messages arrive per second it's not gonna be pretty, assuming the flow execution won't stop you would get 10 different notifications from AM (by unchecking parallel execution). If you want to delete multiple spam messages at once, yes, you would have to check the timestamp. To not loop over the whole list you could limit yourself to the last 10 messages. I think they should be read first in a list variable and do the checking outside sql because doing a WHERE clause on text that has special characters is very error prone.
For notification, I simply use all the same variable from the trigger, put them to the new automagic notification. To protect from multiple consecutive sms, we should make it become 2 flows.

One to harvest the _id and should be executed very quick, store the result in glovar list or map. The other can wait, use AEP - Wait, by popping up the _id from the glovar and show the message one at a time.
akhileshg1988 wrote:Bro, I have Xiaomi Redmi 1S and the ROM I'm using is Colt ROM (Android version 7.1.2).
It seems the app give you the non-PIE sqlite3. Non-PIE binary are not supported anymore since lollipop, for security reason. It maybe easier to download Titanium Backup and copy the sqlite3 directly from there. You can find it at /data/data/com.keramidas.TitaniumBackup/files/sqlite3. Or if you have the apk already, you can explore the apk using MiXplorer or any zip opener app; browse to /assets/sqlite3.armeabi.pie. Copy this out, put it at /system/xbin, rename it to sqlite3 (without the armeabi.pie). Then change the permission to 755 (rwxr-xr-x). All can be done using MiXplorer.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Re: Operation on SMS

Post by bogdyro » 21 Dec 2017 12:46

https://1drv.ms/u/s!Al05p_HdswE0ix6MMu03PJQkG1GK

You can download my file here. Android 7.1.1 should work(arm64)
Follow desmanto's instructions for installation.

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: Operation on SMS

Post by akhileshg1988 » 21 Dec 2017 15:32

bogdyro wrote:https://1drv.ms/u/s!Al05p_HdswE0ix6MMu03PJQkG1GK

You can download my file here. Android 7.1.1 should work(arm64)
Follow desmanto's instructions for installation.
Downloaded the file from the given link, placed it in /system/bin and then executed the flow manually.
Again got an error saying
"sush: <stdin>[1]: sqlite3: can't execute: Permission denied
"
Guide further please.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Operation on SMS

Post by Desmanto » 21 Dec 2017 15:46

akhileshg1988 wrote: Downloaded the file from the given link, placed it in /system/bin and then executed the flow manually.
Again got an error saying
"sush: <stdin>[1]: sqlite3: can't execute: Permission denied
"
Guide further please.
Change the permission to 755. You can use root explorer or MiXplorer to do it.
BTW, bodgyro's sqlite3 file is exactly the same as the one from Titanium Backup. It is for generic arm and already PIE.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: Operation on SMS

Post by akhileshg1988 » 22 Dec 2017 01:44

Eureka. It worked.
Eureka. It worked.
:D :D :D

The flow now works as intended, brothers. I'm highly obliged.
I'll now try to implement it as per my liking.
Any other instructions for me?

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: Operation on SMS

Post by akhileshg1988 » 22 Dec 2017 02:17

Brother!
What was this block for?
Attachments
Screenshot_20171222-073648.png
Screenshot_20171222-073648.png (94.83 KiB) Viewed 18333 times

bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Re: Operation on SMS

Post by bogdyro » 22 Dec 2017 10:37

Just an attempt to delete the sms using native java functions. Doesn't work, you can just delete it.

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: Operation on SMS

Post by akhileshg1988 » 22 Dec 2017 13:41

bogdyro wrote:Just an attempt to delete the sms using native java functions. Doesn't work, you can just delete it.
Just like I thought.
Thanks a lot anyway.

Post Reply