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.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.
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.
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.akhileshg1988 wrote:Bro, I have Xiaomi Redmi 1S and the ROM I'm using is Colt ROM (Android version 7.1.2).