fix: crashes#4281
Merged
Merged
Conversation
This commit adds the `org.apache.http.legacy` library to the Android Manifest. This library is required for compatibility with certain network operations on newer Android versions. It is marked as not required (`android:required="false"`) to allow the application to run on devices where the library is not present. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit addresses a crash that occurred when ProGuard/R8 removed the `aboutlibraries.json` file, which is necessary for the "About" screen to display third-party library information. The `Libs.Builder()` call is now wrapped in a `try-catch` block. If an `IllegalStateException` is thrown (indicating the JSON file is missing), the exception is logged, and the `LibrariesContainer` is prevented from rendering, thus avoiding the crash. A `keep.xml` resource file has also been added to explicitly instruct ProGuard/R8 to retain the `@raw/aboutlibraries` resource, preventing it from being stripped out during release builds. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit enhances the robustness of the TCP interface by addressing potential null pointer and IO exceptions during write/flush operations. - **Null Safety:** The `outStream` property is now nullable (`OutputStream?`) to safely handle cases where `sendBytes` or `flushBytes` are called before a connection is established. Writes and flushes are now guarded by null checks. - **Error Handling:** `sendBytes` and `flushBytes` now wrap stream operations in `try-catch` blocks to handle `IOException`. If an exception occurs, the connection is properly torn down by calling `onDeviceDisconnect`. - **State Management:** `outStream` is explicitly set to `null` in `onDeviceDisconnect` to ensure a clean state after disconnection. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4281 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes various crashes seen in testing