Skip to content

Simplify bytecode instrumentation implementation#2094

Closed
fractalwrench wants to merge 1 commit intomainfrom
refactor-bytecode-instrumentation
Closed

Simplify bytecode instrumentation implementation#2094
fractalwrench wants to merge 1 commit intomainfrom
refactor-bytecode-instrumentation

Conversation

@fractalwrench
Copy link
Copy Markdown
Member

Goal

Begins refactoring bytecode instrumentation by creating a single MethodVisitor that can be configured via its parameters to instrument a specific function in a given class.

Testing

Relied on existing test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner April 15, 2025 09:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@fractalwrench fractalwrench marked this pull request as draft April 15, 2025 10:47
@fractalwrench fractalwrench force-pushed the refactor-bytecode-instrumentation branch 3 times, most recently from 8a59a4e to 09417d7 Compare April 15, 2025 11:08
@fractalwrench fractalwrench requested a review from Copilot April 15, 2025 11:25
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.

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

embrace-gradle-plugin/src/main/java/io/embrace/android/gradle/plugin/instrumentation/visitor/WebViewClientOverrideMethodAdapter.kt:30

  • Calling visitInsn(Opcodes.RETURN) after super.visitEnd() may be redundant or lead to unreachable code; please verify if this extra RETURN instruction is necessary.
visitInsn(Opcodes.RETURN)

@fractalwrench fractalwrench force-pushed the refactor-bytecode-instrumentation branch from 09417d7 to 5b36b41 Compare April 15, 2025 11:39
@fractalwrench fractalwrench marked this pull request as ready for review April 15, 2025 14:47
@fractalwrench fractalwrench force-pushed the refactor-bytecode-instrumentation branch from 5b36b41 to 3606d52 Compare April 15, 2025 14:49
Copy link
Copy Markdown
Contributor

@priettt priettt left a comment

Choose a reason for hiding this comment

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

Looks good! Why did we need a WebViewClientOverride?

@fractalwrench fractalwrench force-pushed the refactor-bytecode-instrumentation branch from 3606d52 to ae17a86 Compare April 15, 2025 15:30
@fractalwrench
Copy link
Copy Markdown
Member Author

The bytecode instrumentation is different depending on whether the onPageStarted method has been overridden or not in the webview implementation.

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