@@ -118,57 +118,3 @@ async def rename_variable(class_name: str, method_name: str, variable_name: str,
118118 params ["ssa" ] = ssa
119119
120120 return await get_from_jadx ("rename-variable" , params )
121-
122-
123- async def add_comment (target_type : str , class_name : str , comment : str , method_name : str = None , field_name : str = None , style : str = "LINE" ) -> dict :
124- """
125- Adds a comment to a class, method, or field in the decompiled code.
126-
127- Args:
128- target_type: Type of target ("class", "method", or "field")
129- class_name: Fully qualified class name
130- comment: The comment text to add
131- method_name (optional): Method name (required for method comments, can include full signature for overloaded methods)
132- field_name (optional): Field name (required for field comments)
133- style (optional): Comment style (default: "LINE")
134- - "LINE": Single-line comment (// comment)
135- - "BLOCK": Multi-line block comment (/* comment */)
136- - "BLOCK_CONDENSED": Condensed block comment (/* comment */)
137- - "JAVADOC": Javadoc style (/** comment */)
138- - "JAVADOC_CONDENSED": Condensed Javadoc (/** comment */)
139-
140- Returns:
141- dict: Confirmation of comment addition with style information
142-
143- MCP Tool: add_comment
144- Description: Adds explanatory comments to decompiled code elements (classes, methods, or fields) with customizable comment styles
145-
146- Examples:
147- # Add single-line comment to a class (default style)
148- add_comment("class", "com.example.MyClass", "This class handles user authentication")
149-
150- # Add block comment to a method
151- add_comment("method", "com.example.MyClass", "Validates user credentials\\ nChecks password hash\\ nReturns auth token",
152- method_name="validateUser", style="BLOCK")
153-
154- # Add Javadoc to overloaded method
155- add_comment("method", "com.example.MyClass", "Validates user with email\\ n@param email User email\\ n@return true if valid",
156- method_name="com.example.MyClass.validateUser(java.lang.String):boolean",
157- style="JAVADOC")
158-
159- # Add comment to a field
160- add_comment("field", "com.example.MyClass", "User session token", field_name="sessionToken", style="LINE")
161- """
162- params = {
163- "target_type" : target_type ,
164- "class_name" : class_name ,
165- "comment" : comment ,
166- "style" : style
167- }
168-
169- if method_name :
170- params ["method_name" ] = method_name
171- if field_name :
172- params ["field_name" ] = field_name
173-
174- return await get_from_jadx ("add-comment" , params )
0 commit comments