Android Question SMS delete after send

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
With the newer Android versions, I'm pretty sure only the primary messaging app can add to/delete from the send/receive log (and is responsible for doing so).
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Starting from Android 5+ (or so) only the default messaging app can delete SMS.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
hello @DonManfred . Thanks for answering. It's not good because if we need to use SMS as a tool for specific system messages couldn't be nice leave sometimes unintelligible data for user in sms sent list ... I noticed that hangouts has the option to manage sms... so, that's why it requests to be set has default sms app before doing that. This means also that to have SMS delete rights the app must to be able also to send, receive, provide gui and all the other sms functions right?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Hangout can do this because the user or set as default sms manager.

You could do it too, becoming your default message manager app. This means that your app must have all the messaging features like the app pre-installed on your device.

There is a tutorial that explains how to create an app to manage text messages to make it default. Obviously it would replace the pre-installed one
https://www.b4x.com/android/forum/t...messages-in-the-background.20103/#post-116193
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
You will understand that this limit is related to a security problem. Some apps sent messages without the user's knowledge and then deleted them so the user remained unaware.
They could send personal data such as location, received phone calls, etc., almost a spy app.

There were also apps that erased timed messages sent to certain preset numbers to cover up the betrayals. After 5 minutes of sending or receiving text messages, they were deleted. Thus there was no risk of being discovered
.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
For me looks like a security concern based on outdated technologies. If there is a spy app installed in the phone the preferential way to send data will be clearly the internet. In SMS, even the user doesn't have the the SMS in list (if erased), the carrier could give at least a list of destination phones (this doesn't happen with data messages).
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
It's not quite as you think. It's not certain that the Spy app data has as an internet preferential lane. I can guarantee you that it's quite the opposite, and often the best systems for spying were (or are) formed by a mixer between data transmission with text messages and the internet.
I will not dwell on explaining why texting is always a good method of transmission, because it is not the right forum for this purpose.

In any case, even before it was not possible to delete the messages, because the message database is located within the App that manages them and not in the operating system. So inaccessible.

Previously, however, it was possible to receive messages before the main message handling app. It was possible to decide whether the message could also be sent to other applications listening to messages.
To do this you had to put a higher number of priorities than the other Apps that accessed the message chain. And each App decided whether to return the message received to the rest of the chain or not.

Now the messages receive them first only the App set by the user as the main one. and can decide if others who are listening can receive it. Others can only read messages but do not prevent the rest of the chain from receiving them.

Apps like WhatsApp read messages to receive the activation code when first started.

Only the main messaging app can prevent others from reading a received message.
 
Last edited:
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Thanks @Star-Dust , I agree. I think that up to Android version 4.0 receiving messages could be intercepted and blocked avoiding to be passed to messages chain... but like @DonManfred told things changed since android 5+...
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
It's not good because if we need to use SMS as a tool for specific system messages couldn't be nice leave sometimes unintelligible data for user in sms sent list ...
Then you should re-think your approach, using SMS or perhaps email where you will leave a "trace" then is out of the question, to send technical data or other non-user-friendly data should be handled under the hood, for that you will have to develop a sender and receiver (using PHP on the server side for example).
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Yes, I know @NJDude . But for some system data the only possible channel is SMS. A good example is an app which uses SMS to authenticate the number entered by the user (like WhatsApp). I developed an app that does this "whatsapp autentication". But I don't allow the user to type the code: I intercept the sms received with an Intent and call a server function (POST) that will validate the pair code & phone and the register as valid. I really would like that the SMS was deleted from received because many reasons:
- I use a keyword before the numeric code received - then, I can test the message before send the POST request to server. Of course that if I had a possibility to delete the message as soon as received I would preserve the keyword avoiding the server script even to be triggered by non authorized requests.
- The code standards (number of digits, interval an so on) could be preserved also...
- This would avoid a hacker to check the code BEFORE being detected by app (stopping the app, I don't know...) and activate the app in another phone (of course, a totally hypothetical possibility but with millions of users somebody will try)

I could list MANY reasons why it's not interesting to have SMS messages out of the control but... whatever, this is a SYSTEM behavior and we need to live with this - even WhatsApp needs..
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I would step away from using SMS at all for authentication, the way you are explaining it has some flaws, first is the intercepting thing, that could break at any time if Google decides in its infinite wisdom to change permissions, and second, you are messing with SMS which is a "personal" app, attempting to "delete" stuff can be seen (and in a way it is) a privacy concern.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
SMS is always needed if you have to confirm the phone number - even WhatsApp uses this. A WorkAround could be using a phone call (like: type the code that you see on phone screen and so on...). But it's much more complicated because needs to integrate a programmable switch connected to database (I already done this using Asterisk)... I don't know other way to confirm the phone number as to get from sim card is not guaranteed .
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
WhatsApp has solved the problem (in part) of Hackers, sending a number that has no particular meaning, it is probably random. So that there is nothing to be seen from that code.

The only thing that needs to be the same is set in the server and is associated with a unique number that is generated together with the MacAddr of WiFi. In IOS is codificaot in um way for Android in another.
This protocol can be found on the internet because it has already been emulated by some parallel applications.

WhatsApp is aware that some are able to overcome its system, and makes continuous updates that allow to detect intruders and bannarli for life.

But the security issue is long, you should talk about it with a Hacker :p
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
That's what I implemented... A random code sent by sever thru SMS. The Android starts a POST job when receive this sms and the server validades. The code has lifetime of 2 minutes and this is the backdoor... it's normal to have a delay (in Brazil about 15 seconds) to receive the SMS. If you enable the internet to request the code and disable after, with another phone stopped at the same step, it's possible to copy the message contents and send it to another phone using a third device... then the user will be able to register the app in a phone that doesn't have the number typed... but really, this is A LOT of work to get what???o_O And besides the supposed hacker must to have access to the original target phone... no way.
 
Upvote 0
Top