Skip to content

fix: crashes#4281

Merged
jamesarich merged 4 commits into
mainfrom
fix/crashes
Jan 21, 2026
Merged

fix: crashes#4281
jamesarich merged 4 commits into
mainfrom
fix/crashes

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

fixes various crashes seen in testing

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>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@codecov

codecov Bot commented Jan 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (7f7d189) to head (94ef493).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit fb6a4c9 Jan 21, 2026
9 checks passed
@jamesarich jamesarich deleted the fix/crashes branch January 21, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant