You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable sending of SMSMessages longer than 160 characters, with sent and delivery confirmation (#20)
* added files to .gitignore
* removed modules.xml, as it was added to .gitignore
* added to .gitignore all patterns present in default .gitignore generated by Android Studio
* checkSetup() is not performed for messages sent without listeners
* messages too long to fit into a single SMS are split into multiple messages and sent (still have to implement passing of PendingIntents)
* implemented sent confirmation for multipart text message, code needs to be polished and optimized
* removed duplicate `for` cycle
* inglobated setState() method into setReceived()
* removed useless check for null listener, as it cannot be null
* fixed specification, added TODO
* removed unused import
* changed HIDDEN_CHARACTER from a Unicode character to a GSM character;
removed useless intentAction local variable;
fixed import in a test.
* added a TODO;
now when SMSSentBroadcastReceiver calls a listener because message sending failed, it passes to the listener the SentState with most occurrences
* improved comments and formatting
* removed duplicate TODO
* fixed comments and TODOs
* added method reconstructMessage()
* fixed TODOs and authors
* removed usage of WeakReference<>
* improved performance of method onReceive(), now sentState given to the listener is not the one with most occurrences, but the first one to contain an error.
* added a timestamp to Message to distinguish messages with equal Peer and content but sent (or received) in different moments, also added methods equals() and hashCode() to allow comparison of messages;
bumped minimum SDK version to 19 (Android 4.4 KitKat, released in 2013) to allow usage of Objects.hash().
* modified SMSReceivedBroadcastReceiver to handle multi-part text messages;
SMSPeer accepts null or empty Strings in its constructors, as messages can be received by unknown numbers.
* added author
* added check for GSM characters, for now if the message contains other characters it won't be considered valid
* removed timestamp, as it's not actually useful
* removed sentState field from SMSPart, as it's now useless
* use binary search on ordered array messageParts instead of linear search
* fixed TODOs; formatting
* modified SMSDeliveredBroadcastReceiver to handle multi-part text messages;
SMSHandler now handles all messages as multi-part text messages (composed by only 1 part if they fit a single SMS);
removed handling of single SMS messages from SMSSentBroadcastReceiver
* fixed documentation
* removed useless multiplication in SMSPeer.hashCode()
* added TODOs
* added zeroes padding to messageCounter when converted to a String, to make binary searches on intent actions' names work correctly;
converted messageCounter to a long, to avoid overflows when intents are being created too quickly.
* fixed GSM characters regex
* split GSM_CHARACTERS_REGEX into two regex, to avoid doing identical checks multiple times when looking for characters from the GSM extension set;
checkMessageText() correctly parses messages to find if they fit MAX_MSG_TEXT_LEN
* moved SMSPeer.telephoneNumber validity check to when messages are sent, because we might receive SMS messages from peers who don't have a valid phone number (such as carriers)
* fixed a comparison in SMSManager;
added TODOs to remind me of classes to test;
started writing instrumented test for SMS reception.
* first successful attempt at receiving a dummy SMS message, however this method relies on SMSManager.getInstance().sendMessage() working correctly.
* marked tests in SMSPeerTest which need to be moved to SMSManager tests;
used Mockito to verify if SMSReceivedBroadcastReceiver receives messages, but it doesn't work at the moment.
* removed an hardwiring
* Implemented Google Library
Still everything to test
* adapted test to new SMSManager public interface
* Rewritten tests, fixed one class, added emulator exception
* Codacy improvements
* Applied suggested changes:
+ Added author tag (and standardized specs)
* Modified parseMessage() structure
* Extracted exception messages into static final fields
* Extracted RegEx string into static final field
* Used String.format()
- Removed fail() assertions
* updated Mockito; added a TODO; fixed a test.
* renamed test, to be the same as the class it's testing
* updated TODOs
* skeleton of class SMSManagerInstrumentedTest; formatting
* formatting; tried to mock SmsManager in SMSManagerInstrumentedTest, but I can't because final classes cannot be mocked.
* deleted all instrumented tests because I won't be able to get them to work before the review
* removal of code used for instrumented tests
* removal of code used for instrumented tests
* imported powermock, removed methods used only in tests
* used PowerMock in test to mock static method SmsManager.getDefault()
* added TODO; added author; formatting; moved tests on Peer's number validity to SMSManagerTest, because the check happens when the SMSMessage is sent.
* added tests for messages containing Unicode characters and characters from the GSM extension table.
* Update README.md
* Changes:
+ Added exception types
- Removed throws clause on unchecked exceptions
* Enhanced tests
* Updated gradle
* added tests for messages containing Unicode characters and characters from the GSM extension table.
* added test for addPadding()
* improved performance of checkMessageTest()
* improved code after automated inspection
* formatting; added author.
* fixed imports
* improved performance of checkMessageText by avoiding multiple calls of String.matches() when the message contains Unicode characters.
* fixed documentation of SMSPeer
* improved performance of checkMessageText() by removing a useless check
* removed a useless variable, improved documentation
* fixes requested by Mattia Fanan in his code review: #20
* removed unused import
* removed `equals()` and `hashCode()` from interface `Message`
* Test Fixes:
Major fixes:
* Overridden prefix auto-detection
Small fixes:
* Syntax and typo fixes
* changes requested by Marco Mariotto in his code review: #20
* fixed errors resulting from merge
* removed useless imports
* added missing specifications.
* added message to exception thrown in SMSManager
* removed SMSPart and SMSPartTest, since BroadcastReceivers now use a counter; removed method addPadding() in SMSManager since its only use was for binary searches on SMSPart arrays
* combined nested if statements
* renamed all occurrences of UTF-16 to UCS-2, since that's the name of the encoding used in SMS messages
* removed Map used to keep track of different messages coming from different addresses, since that can't happen;
reorganized methods and added try-catch statements for possible exceptions, as in AOSP's Messaging app.
* formatting
* removed duplicate import
* fixed specifications
Co-authored-by: Cogno-Marco <marco.cognolato.98@gmail.com>
Co-authored-by: Matteo Carnelos <matteo.carnelos@studenti.unipd.it>
0 commit comments