lukeaschenbrenner / TxtNet-Browser

An app that lets you browse the web over SMS
GNU General Public License v3.0
1.09k stars 27 forks source link

"SMS generic failure" Error - Verizon/CDMA Issue #3

Closed fierytechknowhows closed 1 year ago

fierytechknowhows commented 1 year ago

I am having problems too. I can use unstop in the Samsung messages app and txtnet browser and I get a response back from the server. But when I try to go to any website it just says loading and gives an "SMS generic failure" error and I don't receive any SMS messages for the url. I'm wondering if anyone else is getting the same "SMS generic failure" message since I haven't seen it anywhere else on here.

lukeaschenbrenner commented 1 year ago

Hello, Sorry for the late reply. Can you confirm whether or not the initial request message is sent or not? If it is not sent, can you attempt to manually send the message with the following contents using your default SMS app, with TxtNet browser open in the background? I am curious if the server response is received and parsed at all.

àà@(:ÆS3SSøöv)8G7G1ø1YakfÅ+6,¥*Ç)3Um#&:U¥;¡Càààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààà

Please note that as of right now the server is down, I am working on getting it up ASAP once I fund more Twilio credits in the account. Thanks for your patience and I appreciate the help resolving this bug.

fierytechknowhows commented 1 year ago

Screenshot_20221115-144217_Messages There is no response from the server when I send what you suggested but stop and unstop works.

lukeaschenbrenner commented 1 year ago

Thank you for the reply. I will start the server in the next couple days and let you know ASAP when it is ready so that you can retry.

fierytechknowhows commented 1 year ago

Ok thanks I hope it works and by the way I love this idea of being able to browse the web over sms when an internet connection isn't available.

lukeaschenbrenner commented 1 year ago

Thanks, it is a pretty cool concept! The server should be back up for the time being. Please retry the sending the message with TxtNet Browser open in the background and let me know how it goes. It's likely I will need to send you a debug version of the app in order to figure out exactly where the point of failure is, but this is a good first step.

fierytechknowhows commented 1 year ago

yes the server works and when I send that message you suggested it gives 2 different processes than the 1 it gave before and txtnet loads example domain so I assume the server is fully responsive and working but the txtnow browser still gives SMS generic failure when I try to load any webpage. Yes maybe you could try sending me a debug version of the app and I'll see if that works.

lukeaschenbrenner commented 1 year ago

That's good to know. I'll work on getting that sent out to you sometime soon. Thanks for the help thus far!

fierytechknowhows commented 1 year ago

How will you send the apk?

lukeaschenbrenner commented 1 year ago

I'll probably just throw it into a github repo or attach a google drive link, hopefully one of those methods will work for you?

fierytechknowhows commented 1 year ago

Ya either will work

fierytechknowhows commented 1 year ago

The google drive option would probably be faster though.

fierytechknowhows commented 1 year ago

So which method will you do?

lukeaschenbrenner commented 1 year ago

Sorry for the delays. I'll work on getting a Google Drive link to you later today, if possible.

fierytechknowhows commented 1 year ago

Oh ok thanks, I hope that version of the app works.

lukeaschenbrenner commented 1 year ago

@fierytechknowhows Hello, I modified the app to attempt to log the specific error code associated with the "SMS generic failure" bug. This should greatly assist in diagnosing the root cause of the problem. Please delete any current version of the app on your phone and install this APK: https://drive.google.com/file/d/195xcrRNLUR9h_kfbM1UZP2oIfZEwYGfe/view When you encounter the error again, a file should be written to the path " /storage/emulated/0/Android/data/com.txtnet.txtnetbrowser/logFile.txt ". On recent Android versions, you may need to use an app like Explorer to be able to access this folder. Please let me know what the contents of this file are!

fierytechknowhows commented 1 year ago

In the log file there was this 2022-11-21 20:44:27.770 I/: Unknown Error code: -1. This should never happen!

lukeaschenbrenner commented 1 year ago

Well... That's exactly what I was hoping not to see haha. Looks like this is going to be harder to fix than I anticipated. Can you please tell me the exact model number of your phone (probably located in Settings -> About Phone) and Android version? In the coming weeks I will work on creating an app that tests a few different methods of sending SMS, and hopefully at least one of those methods will work. Thanks for your help so far.

fierytechknowhows commented 1 year ago

My model is a Samsung Galaxy S20 FE 5G (SM-G781V) and I am running Android 12 with One UI 4.1 and I also hope that one of those methods of sending SMS works.

fierytechknowhows commented 1 year ago

have you made any progress on creating an app that tests different methods of sending SMS?

fierytechknowhows commented 1 year ago

@lukeaschenbrenner Hi it's been a while and I'm wondering if you're still monitoring this page and also if you have made any progress on creating an app that tests different methods of sending SMS. I hope you are able to find a method of sending SMS that works

lukeaschenbrenner commented 1 year ago

@fierytechknowhows Life has gotten busy for me lately with college final exams, but I've finally finished my last exam. I'm shifting focus back to this project again and I'll have an update for you soon! Thanks for your continued interest.

fierytechknowhows commented 1 year ago

Hi it has been a while again and I was wondering what the status is on creating an app that tests different methods of sending SMS. Oh by the way I still have the same S20 FE 5G but I have recieved and updated to android 13 now just in case that makes a difference in how you create an app version that tests different SMS methods.

lukeaschenbrenner commented 1 year ago

Hi @fierytechknowhows , I appreciate your patience. I had taken up a pretty large undertaking working on a major server update, so most of my time this past month has been devoted to getting the compression and decompression library functional on Android. But I really do appreciate your willingness to get this working! If everything goes according to plan I should have an APK for you to test around this weekend. I have looked into the problem a little bit more, is your phone by any chance a dual-sim? (Can you find your phone's model number in settings?)

fierytechknowhows commented 1 year ago

My model is the U.S. S20 FE 5G (SM-G781V) with a single sim and not the international S20 FE 4G (SM-G780V) which is a dual sim. I hope the apk works when you send it this weekend. I appreciate your effort in this project.

lukeaschenbrenner commented 1 year ago

Interesting. I have seen that the issue likely arises due to one of three things when no error code is supplied: 1) The phone is dual-sim with no default SIM selected 2) The message being sent is too long (this should never occur in TxtNet Browser because messages are multipart) 3) The message contains unsupported characters

To test the possibility of options 2 and 3, I've whipped up a quick sample app. All it does is send two text messages to a US Google Voice number I have registered when you press the button. Let me know what your results are and we can go from there:

https://drive.google.com/file/d/1aBC2tQ75RcAduY0MF390i4YvKWum87_k/view

Thank you for waiting and continuing to help.

fierytechknowhows commented 1 year ago

It sent "test message" twice to the google voice number.

lukeaschenbrenner commented 1 year ago

@fierytechknowhows I'm beginning to wonder if this issue might be related to the server phone number - can you try to visit a longer url (Even something like https://github.com/lukeaschenbrenner/TxtNet-Browser/issues/3 would work ) through TxtNet browser, with the server phone number set to the string "+19133360765"? There isn't a server attached to this number, but I'm just looking to see if the request SMS will send at all.

fierytechknowhows commented 1 year ago

I tried that but nothing was sent to the number from the app. So I think the problem is the app isn't sending the requests for a URL. Do you have any ideas for what else you could do?

lukeaschenbrenner commented 1 year ago

Are you still getting the SMS generic failure error for the Google voice number, or is it failing silently?

fierytechknowhows commented 1 year ago

Yes it still gives the same error even with that number.

lukeaschenbrenner commented 1 year ago

Okay, thanks for testing. I'm going to update the SMS test app to perform some tests on certain strings in order to see what your carrier is rejecting. I will get back to you soon with that updated APK. Given your phone's model number, you have service with Verizon, correct? IIRC another person with this issue was also on Verizon with a Samsung.

fierytechknowhows commented 1 year ago

Yep my carrier is Verizon.

lukeaschenbrenner commented 1 year ago

@fierytechknowhows I have a new, exciting (read: highly unstable!) build of the SMS Test app for you to test. It will attempt to send about 125 text messages (each separate) to a number you specify (you can leave it at default, it makes no difference as long as the number is real). Please note that due to Android's OS structure, you will likely see this message as things progress:

https://github.com/lukeaschenbrenner/2345675432/blob/master/SMS_Test_Sender.png?raw=true

Simply keep pressing allow until the job is over. It might take a couple minutes to get through.

Hopefully the app doesn't crash, but I can't make any guarantees. When it is over, please screenshot the list of failed characters. (there isn't a direct indication that it's over, but when characters stop showing up for a while, it's probably done.)

https://drive.google.com/file/d/1OOjkFpJDEtIXNncR3K2MPoIZ96hKdG8b/view

fierytechknowhows commented 1 year ago

None of the characters failed to send they all successfully sent.

lukeaschenbrenner commented 1 year ago

@fierytechknowhows Thank you for the report. It seems like your carrier has no issues sending each character individually - so it must be some combination of characters that trips it up. I've created a new build of the tester that has 12 crafted messages to send, which should hopefully give us some more insight. 3 of the 12 are taken directly from a TxtNet browser server response at 160 characters, so we should see them fail to send if everything is consistent.

I updated the Google Drive link with the newest apk. Thanks again for helping test.

fierytechknowhows commented 1 year ago

These are the failed messages from the app and this is what was sent from the app. It sent a weird blank message. It happens every time so its not a one time glitch. I also tried changing the number to one of my other numbers and it received the other 2 but not the blank one. Screenshot_20230209_150402_SMS Test Sender Screenshot_20230209_150425_Messages

lukeaschenbrenner commented 1 year ago

Interesting, thanks for the report. I was seeing the same behavior with the blank message - that's just the newline character. It seems that most carriers don't deliver it, which isn't entirely unheard of. In the original development of the app, I had to avoid placing a newline at the end of a message because carriers tend to remove trailing newlines.

As far as the failed characters go, it seems like there is some combination of characters that your carrier is simply refusing to send. If you can, try to send the three sequences of characters here to a phone number using your default SMS app. Before you send each message, verify that the character limit is full (hopefully your SMS app shows the character limit near the text input, it should read something like 160/160). If all three messages succeed to send and are received exactly the same as they were sent (please check on this too!) Then I will modify the test SMS sender app to test one of these failed strings by beginning at one character and slowly increasing the character count until the full string is sent. This should give us a better idea of what is breaking and when. If any of the 3 strings fails to send, you could try to do this yourself by deleting characters until it does send. If you see that when you paste the message it exceeds the character limit (shows anything over 160 characters or indicates that the message is being split), also let me know.

lukeaschenbrenner commented 1 year ago

Oops, the first string in the pastebin has an extra whitespace prepended to the text. Please make sure not to copy that.

fierytechknowhows commented 1 year ago

None of them failed to send and they all checked out as the exact same on both ends. But i did notice that each one is being split up into 3 sms messages. It shows 41/3 for all 3 of them.

lukeaschenbrenner commented 1 year ago

Ah... That could be the issue. I'll get back to you about a potential solution, but it sounds like at least one character is causing your phone to consider that message as 3 separate messages. I won't get into the technical side of things but if you've ever inserted an emoji in a text you'll see that the amount of characters per sms goes down from 160 to 70. For some bizarre reason, your phone is interpreting one of the characters as an emoji-type character. I can try to develop a test app that manually tries to send texts of 160 characters with each character filling the entire text. Alternatively, if you have time, you could try to remove characters from the text field until you see the left side of the character counter change significantly. Thanks for the report!

fierytechknowhows commented 1 year ago

Yes you should create a test app that sends 160 of each character

lukeaschenbrenner commented 1 year ago

Yes you should create a test app that sends 160 of each character

@fierytechknowhows Done. In order to avoid blocking the main thread, the failed characters won't appear until they are all completely sent. I tested on my end and received 114 SMS messages (out of 115 possible, due to recipient not parsing the newline character which is entirely ok). Let me know how it goes.

fierytechknowhows commented 1 year ago

There were only 86 messages but it didn't show the failed characters

lukeaschenbrenner commented 1 year ago

I've found the bug behind not displaying characters - I didn't catch it originally because I had no unsent messages on my phone. Please update your app (using the same link above, new version uploaded). Thanks again!

Also, that is a concernedly low amount of characters getting through... Hopefully we have a better picture of the issue upon seeing the failed character list. I'm mostly confident the bug was fixed, but let me know if anything goes awry.

fierytechknowhows commented 1 year ago

These were the failed characters: £, ¥, è

lukeaschenbrenner commented 1 year ago

Interesting. Thank you very much for helping me narrow the issue down. Just to confirm, can you tell me how many texts your default SMS app considers each character when copied 160 times? You can paste the text from here if that helps. This is likely an issue that I'll have to contact Samsung themselves about in order to resolve... I'm not sure about the scale of this issue though as far as how many models of Samsung phones it affects.

fierytechknowhows commented 1 year ago

It showed 41/3 for each of the 160 characters which is 2 messages and 41 characters left for the 3rd message

lukeaschenbrenner commented 1 year ago

Thank you for testing. I am almost completely confident that this is an OS-level issue, so I will try to get in contact with Samsung to see if they can issue a software update. Before I do, just to make absolutely sure this isn't another issue, can you please download Messages by Google and set it as your default SMS app? Then, please try to paste the 3 messages you just tried and verify that messages by Google also shows 41/3. If it shows "0", please try to send the message and verify that the message sends successfully. I doubt this should be an issue with the SMS app you are using, but I just want to make sure. If it is successful, I may attempt to re-initialize the Twilio number to check the encoding that the message is received as.

fierytechknowhows commented 1 year ago

Yep it still showed 41/3 in Google messages

lukeaschenbrenner commented 1 year ago

@fierytechknowhows , I've been in touch with Samsung Developer Technical Support and they are asking for some information in order to further understand the bug. I've created a new build of the SMS Test Sender app that logs information a little better. If you can, please screen record yourself all the way from when you first open the app to when the operation completes (I have changed it so it will tell you when all texts are sent). You will be provided with a button to copy some log info; please press the button and paste it into a response here. Also, attach the screen recording here or email it to my personal email (available in GitHub profile). Finally, please include your phone's build number (I am told that on your phone, it should be found under Settings > About Phone > Software Information > Build Number). Thank you very much! I'm glad to see that Samsung was responsive to the issue, so if everything is as expected and it is an OS-level issue, you should see a software update eventually roll out.