Skip to content

Commit e775361

Browse files
committed
Merge branch 'main' into dependabot/github_actions/actions/checkout-5
2 parents 5de21d3 + 3103d02 commit e775361

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
dependencies {
14-
val jadxVersion = "1.5.2-SNAPSHOT"
14+
val jadxVersion = "1.5.2"
1515
val isJadxSnapshot = jadxVersion.endsWith("-SNAPSHOT")
1616

1717
// use compile only scope to exclude jadx-core and its dependencies from result jar

src/main/java/org/ajsmith/jadx/plugins/nativelibraries/NativeLibrariesPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public JadxPluginInfo getPluginInfo() {
2020
.name("Native Library Info")
2121
.description(DESCRIPTION)
2222
.homepage("https://github.com/andyjsmith/jadx-native-libraries-plugin")
23-
.requiredJadxVersion("1.5.2, r2372")
23+
.requiredJadxVersion("1.5.2, r2472")
2424
.build();
2525
}
2626

src/main/java/org/ajsmith/jadx/plugins/nativelibraries/components/NativeRoot.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import jadx.api.plugins.gui.JadxGuiContext;
77
import net.fornwall.jelf.ElfFile;
88
import net.fornwall.jelf.ElfSymbol;
9+
import net.fornwall.jelf.ElfSymbolTableSection;
910
import org.jetbrains.annotations.NotNull;
1011
import org.jetbrains.annotations.Nullable;
1112
import org.slf4j.Logger;
@@ -48,7 +49,14 @@ public void loadFromResource(ResourceFile resource) {
4849

4950
// Parse symbols to find exported methods
5051
ElfFile elf = ElfFile.from(bytes);
51-
for (ElfSymbol symbol : elf.getDynamicSymbolTableSection().symbols) {
52+
53+
ElfSymbolTableSection dynSymSection = elf.getDynamicSymbolTableSection();
54+
if (dynSymSection == null) {
55+
LOG.debug("No dynamic symbol table section was found");
56+
return;
57+
}
58+
59+
for (ElfSymbol symbol : dynSymSection.symbols) {
5260
String name = symbol.getName();
5361
if (!NativeMethod.isJavaMethod(name)) continue;
5462

src/test/java/org/ajsmith/jadx/plugins/nativelibraries/TestUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.ajsmith.jadx.plugins.nativelibraries;
22

3+
import jadx.api.JadxArgs;
4+
import jadx.api.JadxDecompiler;
35
import jadx.api.ResourceFile;
46
import jadx.api.ResourceType;
57
import org.ajsmith.jadx.plugins.nativelibraries.components.NativeLibrary;
@@ -13,7 +15,9 @@
1315

1416
public class TestUtils {
1517
protected static NativeLibrary createMockLibrary() {
16-
return new NativeLibrary(ResourceFile.createResourceFile(null, "lib.so", ResourceType.LIB), null);
18+
JadxArgs args = new JadxArgs();
19+
JadxDecompiler jadx = new JadxDecompiler(args);
20+
return new NativeLibrary(ResourceFile.createResourceFile(jadx, "lib.so", ResourceType.LIB), null);
1721
}
1822

1923
protected static File getSampleFile(String fileName) throws URISyntaxException {

0 commit comments

Comments
 (0)