diff --git a/.gitignore b/.gitignore index 3f1e3d52..d76acf3c 100644 --- a/.gitignore +++ b/.gitignore @@ -117,4 +117,4 @@ run/ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !gradle-wrapper.jar ##Don't ignore the agent -!dark-matter-danger/src/main/resources/jar/instrumentation_agent.jar +!dark-matter-danger/src/main/resources/jar/dark_matter_instrumentation_agent.jar diff --git a/dark-matter-danger/build.gradle b/dark-matter-danger/build.gradle index 3af0466e..5b4ee826 100644 --- a/dark-matter-danger/build.gradle +++ b/dark-matter-danger/build.gradle @@ -6,7 +6,7 @@ jar { manifest { attributes( "Manifest-Version": "1.0", - "Agent-Class": "me.melontini.dark_matter.danger.InstrumentationAgent", + "Agent-Class": "me.melontini.dark_matter.danger.instrumentation.InstrumentationAgent", "Can-Retransform-Classes": "true", "Can-Redefine-Classes": "true" ) diff --git a/dark-matter-danger/src/main/java/me/melontini/dark_matter/danger/instrumentation/InstrumentationAccess.java b/dark-matter-danger/src/main/java/me/melontini/dark_matter/danger/instrumentation/InstrumentationAccess.java index ce891370..f5169680 100644 --- a/dark-matter-danger/src/main/java/me/melontini/dark_matter/danger/instrumentation/InstrumentationAccess.java +++ b/dark-matter-danger/src/main/java/me/melontini/dark_matter/danger/instrumentation/InstrumentationAccess.java @@ -164,7 +164,7 @@ public static void bootstrap(boolean bootstrap) { try { final String name = ManagementFactory.getRuntimeMXBean().getName(); - final Path jarPath = Paths.get(GAME_DIR, AGENT_DIR, "instrumentation_agent.jar"); + final Path jarPath = Paths.get(GAME_DIR, AGENT_DIR, "dark_matter_instrumentation_agent.jar"); final File jar = jarPath.toFile(); DarkMatterLog.info("Attaching instrumentation agent to VM."); @@ -172,7 +172,7 @@ public static void bootstrap(boolean bootstrap) { if (!Files.exists(jarPath)) { createAgentJar(jarPath, jar); } else { - try (InputStream stream = InstrumentationAccess.class.getClassLoader().getResourceAsStream("jar/instrumentation_agent.jar")) { + try (InputStream stream = InstrumentationAccess.class.getResourceAsStream("jar/dark_matter_instrumentation_agent.jar")) { if (stream != null) { byte[] bytes = stream.readAllBytes(); if (!Arrays.equals(Files.readAllBytes(jarPath), bytes)) { @@ -181,7 +181,7 @@ public static void bootstrap(boolean bootstrap) { createAgentJar(jarPath, jar); } } else { - throw new NullPointerException("Couldn't find included \"jar/instrumentation_agent.jar\"!"); + throw new NullPointerException("Couldn't find included \"jar/dark_matter_instrumentation_agent.jar\"!"); } } } @@ -202,13 +202,13 @@ public static void bootstrap(boolean bootstrap) { private static void createAgentJar(Path jarPath, File jar) throws IOException { Files.createDirectories(jarPath.getParent()); - try (InputStream stream = InstrumentationAccess.class.getClassLoader().getResourceAsStream("jar/instrumentation_agent.jar")) { + try (InputStream stream = InstrumentationAccess.class.getClassLoader().getResourceAsStream("jar/dark_matter_instrumentation_agent.jar")) { if (stream != null) { try (FileOutputStream outputStream = new FileOutputStream(jar)) { outputStream.write(stream.readAllBytes()); } } else { - throw new NullPointerException("Couldn't find included \"jar/instrumentation_agent.jar\"!"); + throw new NullPointerException("Couldn't find included \"jar/dark_matter_instrumentation_agent.jar\"!"); } } } diff --git a/dark-matter-danger/src/main/resources/jar/instrumentation_agent.jar b/dark-matter-danger/src/main/resources/jar/dark_matter_instrumentation_agent.jar similarity index 100% rename from dark-matter-danger/src/main/resources/jar/instrumentation_agent.jar rename to dark-matter-danger/src/main/resources/jar/dark_matter_instrumentation_agent.jar