fix shading injected client, remove assertion mandate

This commit is contained in:
TheRealNull
2020-12-24 13:44:24 -05:00
parent 67f4cf10bb
commit eba3866e1a
5 changed files with 11 additions and 18 deletions

1
.gitignore vendored
View File

@@ -24,3 +24,4 @@ runelite-client/dependencies.txt
.vscode
.factorypath
hs_err_pid*.log
/runelite-client/src/main/resources/net/runelite/client/injected-client.oprs

View File

@@ -43,7 +43,7 @@ public class Injector extends InjectData implements InjectTaskHandler
new RSApi(rsapi)
);
inject();
save(new File("../runelite-client/src/main/resources/net/runelite/client/injected-client.jar"));
save(new File("../runelite-client/src/main/resources/net/runelite/client/injected-client.oprs"));
}
public static void main(String[] args)

View File

@@ -127,7 +127,7 @@ tasks {
processResources {
dependsOn(":injector:build")
finalizedBy("filterResources")
finalizedBy("filterResources", "packInjectedClient")
}
register<Copy>("filterResources") {
@@ -149,6 +149,12 @@ tasks {
filteringCharset = "UTF-8"
}
register<Copy>("packInjectedClient") {
from("src/main/resources/")
include("**/injected-client.oprs")
into("${buildDir}/resources/main")
}
jar {
manifest {
attributes(mutableMapOf("Main-Class" to "net.runelite.client.RuneLite"))

View File

@@ -262,20 +262,6 @@ public class RuneLite
final boolean developerMode = true;
if (developerMode)
{
boolean assertions = false;
assert assertions = true;
if (!assertions)
{
SwingUtilities.invokeLater(() ->
new FatalErrorDialog("Developers should enable assertions; Add `-ea` to your JVM arguments`")
.addBuildingGuide()
.open());
return;
}
}
PROFILES_DIR.mkdirs();
log.info("RuneLite {} (launcher version {}) starting up, args: {}",

View File

@@ -139,8 +139,8 @@ public class ClientLoader implements Supplier<Applet>
// create the classloader for the jar while we hold the lock, and eagerly load and link all classes
// in the jar. Otherwise the jar can change on disk and can break future classloads.
File oprsInjected = new File(System.getProperty("user.home") + "/.openosrs/cache/injected-client.jar");
InputStream initialStream = RuneLite.class.getResourceAsStream("injected-client.jar");
if (oprsInjected.length() != RuneLite.class.getResource("injected-client.jar").getFile().length())
InputStream initialStream = RuneLite.class.getResourceAsStream("injected-client.oprs");
if (oprsInjected.length() != RuneLite.class.getResource("injected-client.oprs").getFile().length())
FileUtils.copyInputStreamToFile(initialStream, oprsInjected);
classLoader = createJarClassLoader(oprsInjected);