feat(gui): add "copy as smali reference" to context menu - #2955
Open
anandghegde wants to merge 1 commit into
Open
anandghegde wants to merge 1 commit into
anandghegde wants to merge 1 commit into
Conversation
Copy original class/method/field reference in smali format, e.g. `Lcom/example/Cls$Inner;->method(I[Ljava/lang/String;)V`.
anandghegde
force-pushed
the
feat/gui-copy-smali-reference
branch
from
September 15, 2026 16:40
8eb0d3c to
c3cbc17
Compare
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.
❗ Please review the guidelines for contributing
Description
Adds a Copy as smali reference item to the code area context menu (next to "Copy Reference" from #2863). It copies the original (not renamed) Dalvik descriptor of the class, method or field under the caret:
Lcom/example/Outer$Inner;Lcom/example/Outer$Inner;->method(I[Ljava/lang/String;)VLcom/example/Outer$Inner;-><init>(JLjava/lang/Object;)VLcom/example/Outer$Inner;->names:[[Ljava/lang/String;This is the format used in smali files, apktool/baksmali patching, and hooking tools, and it is what JEB's "copy signature" gives you. Right now in jadx you have to put it together by hand from the smali view, which is slow and easy to get wrong once code is deobfuscated or renamed.
Implementation notes:
TypeGen.signature,MethodInfo.getShortId) and reads the rawClassInfo/MethodInfo/FieldInfo, so user renames and deobfuscation aliases are ignored.ActionModelentry, action class,CodeAreapopup registration, and the i18n key in allMessages_*.propertiesfiles (commented English in the non-English files).Testing
jadx.gui.ui.action.CopySmaliReferenceActionTest(based onIntegrationTest) checks the output for an outer class and a nested$Innerclass, a constructor<init>, primitive and array arguments/returns (I,J,[Ljava/lang/String;,[Z), fields (I,[[Ljava/lang/String;), and that a renamed class/method still produces the original descriptor../gradlew :jadx-gui:test: 52 tests, 0 failures (2 skipped, same as before), includingTestI18n../gradlew :jadx-gui:spotlessCheck :jadx-gui:checkstyleMain :jadx-gui:checkstyleTest: passed.I used Claude Code to help write this change. I reviewed the code and tests myself.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QBWFWqjbUQGS1c9LsM2bxX