Skip to content

Route DEX analysis exceptions to exceptionHandler#13

Merged
Howard20181 merged 2 commits intodocsfrom
copilot/sub-pr-2
Feb 10, 2026
Merged

Route DEX analysis exceptions to exceptionHandler#13
Howard20181 merged 2 commits intodocsfrom
copilot/sub-pr-2

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 10, 2026

Addresses feedback from PR #2 where dex.visitDefinedClasses() exceptions were silently dropped, potentially leaving invocation/field maps partially populated without observable failure.

Changes

  • HookBuilderImpl.java:796-797: Replace catch (Throwable ignored) with routing to exceptionHandler when configured
// Before
} catch (Throwable ignored) {
}

// After  
} catch (Throwable e) {
    if (exceptionHandler != null) exceptionHandler.test(e);
}

This aligns with the exception handling pattern used throughout the method (lines 777-779, 804-805) where DEX analysis errors are reported via the optional user-configured handler.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… ignoring

Co-authored-by: Howard20181 <40033067+Howard20181@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on implementing unfinished features Route DEX analysis exceptions to exceptionHandler Feb 10, 2026
Copilot AI requested a review from Howard20181 February 10, 2026 14:20
@Howard20181 Howard20181 marked this pull request as ready for review February 10, 2026 14:20
Copilot AI review requested due to automatic review settings February 10, 2026 14:20
@Howard20181 Howard20181 merged commit 650743f into docs Feb 10, 2026
@Howard20181 Howard20181 deleted the copilot/sub-pr-2 branch February 10, 2026 14:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates DEX analysis error handling in HookBuilderImpl so exceptions thrown during dex.visitDefinedClasses() are no longer silently ignored and can be reported via the optional user-configured exceptionHandler.

Changes:

  • Route dex.visitDefinedClasses() failures to exceptionHandler instead of swallowing them.
Comments suppressed due to low confidence (1)

helper/src/main/java/io/github/libxposed/helper/HookBuilderImpl.java:1873

  • Potentially confusing name: method doMatch also refers to field parameterCount (as this.parameterCount).
            final int parameterCount;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +796 to 798
} catch (Throwable e) {
if (exceptionHandler != null) exceptionHandler.test(e);
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This catch block always suppresses exceptions from dex.visitDefinedClasses() regardless of the exceptionHandler’s return value. HookBuilder.setExceptionHandler() is documented as returning false to rethrow; consider honoring that contract here (e.g., rethrow when handler is null or returns false) so callers can fail fast instead of continuing with potentially partial analysis results.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants