-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): allow to get method code (#2305)
- Loading branch information
Showing
7 changed files
with
124 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
20 changes: 20 additions & 0 deletions
20
jadx-core/src/test/java/jadx/tests/api/utils/assertj/JadxMethodNodeAssertions.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package jadx.tests.api.utils.assertj; | ||
|
||
import org.assertj.core.api.AbstractObjectAssert; | ||
|
||
import jadx.core.dex.nodes.MethodNode; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class JadxMethodNodeAssertions extends AbstractObjectAssert<JadxMethodNodeAssertions, MethodNode> { | ||
public JadxMethodNodeAssertions(MethodNode mth) { | ||
super(mth, JadxMethodNodeAssertions.class); | ||
} | ||
|
||
public JadxCodeAssertions code() { | ||
isNotNull(); | ||
String codeStr = actual.getCodeStr(); | ||
assertThat(codeStr).isNotBlank(); | ||
return new JadxCodeAssertions(codeStr); | ||
} | ||
} |
This file contains 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
This file contains 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