diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 56eeb4bf..34da88c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,20 +12,13 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - name: cache - uses: actions/cache@v4 - with: - path: | - ~/.m2/repository - key: ${{ runner.os }}-cache-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-cache- - - run: choco install innosetup --version 6.3.3 + - run: choco install innosetup --version 6.4.0 - name: Set up JDK 11 uses: actions/setup-java@v4 with: java-version: 11 distribution: temurin + cache: gradle - uses: ilammy/msvc-dev-cmd@v1 # for nmake with: arch: x64 @@ -51,7 +44,7 @@ jobs: cd detours/src nmake - name: build launcher - run: mvn verify -B -P $env:RUNELITE_PROFILE + run: ./gradlew build -P RUNELITE_BUILD=$env:RUNELITE_PROFILE --no-daemon - name: x64 installer shell: bash run: ./build-win64.sh @@ -77,21 +70,14 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - name: cache - uses: actions/cache@v4 - with: - path: | - ~/.m2/repository - key: ${{ runner.os }}-cache-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-cache- - name: Set up JDK 11 uses: actions/setup-java@v4 with: java-version: 11 distribution: temurin + cache: gradle - name: build - run: mvn verify -B -P $RUNELITE_PROFILE + run: ./gradlew build -P RUNELITE_BUILD=$RUNELITE_PROFILE - name: linux-x64 run: ./build-linux-x86_64.sh - name: linux-aarch64 @@ -99,7 +85,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: jar - path: target/RuneLite.jar + path: build/libs/RuneLite.jar if-no-files-found: error - uses: actions/upload-artifact@v4 with: @@ -109,7 +95,7 @@ jobs: RuneLite-aarch64.AppImage if-no-files-found: error macos: - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/setup-python@v5 with: @@ -117,21 +103,14 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - name: cache - uses: actions/cache@v4 - with: - path: | - ~/.m2/repository - key: ${{ runner.os }}-cache-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-cache- - name: Set up JDK 11 uses: actions/setup-java@v4 with: java-version: 11 distribution: temurin + cache: gradle - name: build - run: mvn verify -B -P $RUNELITE_PROFILE + run: ./gradlew build -P RUNELITE_BUILD=$RUNELITE_PROFILE - name: clone create-dmg run: git clone https://github.com/runelite/create-dmg -b runelite-1.0 - name: build create-dmg @@ -161,4 +140,4 @@ jobs: name: macos-app path: | app.tar - if-no-files-found: error \ No newline at end of file + if-no-files-found: error diff --git a/.gitignore b/.gitignore index c3105e99..5c7b1784 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,4 @@ -target -nbactions.xml -nb-configuration.xml -/nbproject/ -project.properties -*.iml -.idea/ -.project -.settings/ -.classpath -dependency-reduced-pom.xml +.gradle +build +.idea RuneLiteSetup*.exe diff --git a/.jdk-versions.sh b/.jdk-versions.sh index 694ba55b..4d8a3317 100644 --- a/.jdk-versions.sh +++ b/.jdk-versions.sh @@ -1,28 +1,28 @@ # windows x64 -WIN64_VERSION=11.0.24+8 -WIN64_CHKSUM=78e10f7d025898b7dc7436b2bb986570283cca3cb4a654991a4f9671231da536 -WIN64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x64_windows_hotspot_11.0.24_8.zip +WIN64_VERSION=11.0.25+9 +WIN64_CHKSUM=052f09448d5b8d9afb7a8e5049d40d7fafa8f5884afe6043bb2359787fd41e84 +WIN64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jre_x64_windows_hotspot_11.0.25_9.zip # windows x86 -WIN32_VERSION=11.0.24+8 -WIN32_CHKSUM=fa9a6abdc28c4190a101ee8ab56c78426337007d391f063b9c24ec944eff80f6 -WIN32_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.24_8.zip +WIN32_VERSION=11.0.25+9 +WIN32_CHKSUM=ac760b5ed1cb96acb51b5feb8c04e2c200921a56ff6ab012a81c190c3c80778d +WIN32_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.25_9.zip # windows aarch64 -WIN_AARCH64_VERSION=11.0.24+8 -WIN_AARCH64_CHKSUM=bac491e89078ba88e8a4c85fb1458c9821670126359101e555818623baf0432a -WIN_AARCH64_LINK=https://aka.ms/download-jdk/microsoft-jdk-11.0.24-windows-aarch64.zip +WIN_AARCH64_VERSION=11.0.25+9 +WIN_AARCH64_CHKSUM=6dbd8b0966c84a0f65a2b61a4e10543f8326e815497b8092cbcda409a706feee +WIN_AARCH64_LINK=https://aka.ms/download-jdk/microsoft-jdk-11.0.25-windows-aarch64.zip # mac x64 -MAC_AMD64_VERSION=17.0.12+7 -MAC_AMD64_CHKSUM=331aceddc402263c5e47529234965927573ead684ea2b7a0358fbb6c279c1510 -MAC_AMD64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_x64_mac_hotspot_17.0.12_7.tar.gz +MAC_AMD64_VERSION=17.0.13+11 +MAC_AMD64_CHKSUM=bf9faf4540001a251e6bfb52b99c7ec5b1f36d3ebe94e104f61a30f173ba8c78 +MAC_AMD64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_x64_mac_hotspot_17.0.13_11.tar.gz # mac aarch64 -MAC_AARCH64_VERSION=17.0.12+7 -MAC_AARCH64_CHKSUM=5c1cb2cbd2ef3f2b529e2733d0ab55381e10c4c3607f4d62f2bf12f0942198bf -MAC_AARCH64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.12_7.tar.gz +MAC_AARCH64_VERSION=17.0.13+11 +MAC_AARCH64_CHKSUM=a886b8f2a50eca2e59b45ea59f5a2e8e9d27ff5b5b3b069443a70cda7f27c907 +MAC_AARCH64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.13_11.tar.gz # linux x64 -LINUX_AMD64_VERSION=11.0.24+8 -LINUX_AMD64_CHKSUM=e0c1938093da3780e4494d366a4e6b75584dde8d46a19acea6691ae11df4cda5 -LINUX_AMD64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x64_linux_hotspot_11.0.24_8.tar.gz +LINUX_AMD64_VERSION=11.0.25+9 +LINUX_AMD64_CHKSUM=84cd7101f39172a4db085fb52940595bb14dad6bc3afb5bf82ee497eceaf86d3 +LINUX_AMD64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.25_9.tar.gz # linux aarch64 -LINUX_AARCH64_VERSION=11.0.24+8 -LINUX_AARCH64_CHKSUM=1fe97cdaad47d7d108f329c6e4560b46748ef7f2948a1027812ade0bbc2a3597 -LINUX_AARCH64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.24_8.tar.gz +LINUX_AARCH64_VERSION=11.0.25+9 +LINUX_AARCH64_CHKSUM=e37ba6636e31f3c9191ac7e3fd0ab7fb354a2f3b320d68bfb95efd1e053134c9 +LINUX_AARCH64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.25_9.tar.gz diff --git a/appimage/runelite.desktop b/appimage/runelite.desktop index 63637be0..9524d472 100644 --- a/appimage/runelite.desktop +++ b/appimage/runelite.desktop @@ -1,7 +1,7 @@ [Desktop Entry] -Name=${project.build.finalName} -Comment=${project.description} -Exec=${project.build.finalName} +Name=${project.finalName} +Comment=${project.launcherDescription} +Exec=${project.finalName} Icon=runelite Terminal=false Type=Application diff --git a/build-linux-aarch64.sh b/build-linux-aarch64.sh index 1a05f666..038f973e 100755 --- a/build-linux-aarch64.sh +++ b/build-linux-aarch64.sh @@ -2,6 +2,9 @@ set -e +echo Launcher sha256sum +sha256sum build/libs/RuneLite.jar + pushd native cmake -DCMAKE_TOOLCHAIN_FILE=arm64-linux-gcc.cmake -B build-aarch64 . cmake --build build-aarch64 --config Release @@ -25,12 +28,12 @@ echo "$LINUX_AARCH64_CHKSUM linux_aarch64_jre.tar.gz" | sha256sum -c # Note: Host umask may have checked out this directory with g/o permissions blank chmod -R u=rwX,go=rX appimage # ...ditto for the build process -chmod 644 target/RuneLite.jar +chmod 644 build/libs/RuneLite.jar cp native/build-aarch64/src/RuneLite build/linux-aarch64/ -cp target/RuneLite.jar build/linux-aarch64/ +cp build/libs/RuneLite.jar build/linux-aarch64/ cp packr/linux-aarch64-config.json build/linux-aarch64/config.json -cp target/filtered-resources/runelite.desktop build/linux-aarch64/ +cp build/filtered-resources/runelite.desktop build/linux-aarch64/ cp appimage/runelite.png build/linux-aarch64/ tar zxf linux_aarch64_jre.tar.gz diff --git a/build-linux-x86_64.sh b/build-linux-x86_64.sh index 3a68308f..22deca54 100755 --- a/build-linux-x86_64.sh +++ b/build-linux-x86_64.sh @@ -2,6 +2,9 @@ set -e +echo Launcher sha256sum +sha256sum build/libs/RuneLite.jar + pushd native cmake -B build-x64 . cmake --build build-x64 --config Release @@ -25,12 +28,12 @@ echo "$LINUX_AMD64_CHKSUM linux64_jre.tar.gz" | sha256sum -c # Note: Host umask may have checked out this directory with g/o permissions blank chmod -R u=rwX,go=rX appimage # ...ditto for the build process -chmod 644 target/RuneLite.jar +chmod 644 build/libs/RuneLite.jar cp native/build-x64/src/RuneLite build/linux-x64/ -cp target/RuneLite.jar build/linux-x64/ +cp build/libs/RuneLite.jar build/linux-x64/ cp packr/linux-x64-config.json build/linux-x64/config.json -cp target/filtered-resources/runelite.desktop build/linux-x64/ +cp build/filtered-resources/runelite.desktop build/linux-x64/ cp appimage/runelite.png build/linux-x64/ tar zxf linux64_jre.tar.gz diff --git a/build-osx-aarch64.sh b/build-osx-aarch64.sh index 8b57a4dc..663b33e0 100755 --- a/build-osx-aarch64.sh +++ b/build-osx-aarch64.sh @@ -5,6 +5,9 @@ set -e APPBASE="build/macos-aarch64/RuneLite.app" build() { + echo Launcher sha256sum + shasum -a 256 build/libs/RuneLite.jar + pushd native cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -B build-aarch64 . cmake --build build-aarch64 --config Release @@ -24,9 +27,9 @@ build() { mkdir -p $APPBASE/Contents/{MacOS,Resources} cp native/build-aarch64/src/RuneLite $APPBASE/Contents/MacOS/ - cp target/RuneLite.jar $APPBASE/Contents/Resources/ + cp build/libs/RuneLite.jar $APPBASE/Contents/Resources/ cp packr/macos-aarch64-config.json $APPBASE/Contents/Resources/config.json - cp target/filtered-resources/Info.plist $APPBASE/Contents/ + cp build/filtered-resources/Info.plist $APPBASE/Contents/ cp osx/runelite.icns $APPBASE/Contents/Resources/icons.icns tar zxf mac_aarch64_jre.tar.gz diff --git a/build-osx-x64.sh b/build-osx-x64.sh index b0972f2c..322d19f2 100755 --- a/build-osx-x64.sh +++ b/build-osx-x64.sh @@ -5,6 +5,9 @@ set -e APPBASE="build/macos-x64/RuneLite.app" build() { + echo Launcher sha256sum + shasum -a 256 build/libs/RuneLite.jar + pushd native cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -B build-x64 . cmake --build build-x64 --config Release @@ -24,9 +27,9 @@ build() { mkdir -p $APPBASE/Contents/{MacOS,Resources} cp native/build-x64/src/RuneLite $APPBASE/Contents/MacOS/ - cp target/RuneLite.jar $APPBASE/Contents/Resources/ + cp build/libs/RuneLite.jar $APPBASE/Contents/Resources/ cp packr/macos-x64-config.json $APPBASE/Contents/Resources/config.json - cp target/filtered-resources/Info.plist $APPBASE/Contents/ + cp build/filtered-resources/Info.plist $APPBASE/Contents/ cp osx/runelite.icns $APPBASE/Contents/Resources/icons.icns tar zxf mac64_jre.tar.gz diff --git a/build-win-aarch64.sh b/build-win-aarch64.sh index 88887e51..3f25ff46 100644 --- a/build-win-aarch64.sh +++ b/build-win-aarch64.sh @@ -2,6 +2,9 @@ set -e +echo Launcher sha256sum +sha256sum build/libs/RuneLite.jar + cmake -S liblauncher -B liblauncher/buildaarch64 -A ARM64 cmake --build liblauncher/buildaarch64 --config Release @@ -82,7 +85,7 @@ jlink \ --add-modules jdk.zipfs cp native/build-aarch64/src/Release/RuneLite.exe build/win-aarch64/ -cp target/RuneLite.jar build/win-aarch64/ +cp build/libs/RuneLite.jar build/win-aarch64/ cp packr/win-aarch64-config.json build/win-aarch64/config.json cp liblauncher/buildaarch64/Release/launcher_aarch64.dll build/win-aarch64/ @@ -92,4 +95,4 @@ sha256sum build/win-aarch64/RuneLite.exe dumpbin //HEADERS build/win-aarch64/RuneLite.exe # We use the filtered iss file -iscc target/filtered-resources/runeliteaarch64.iss \ No newline at end of file +iscc build/filtered-resources/runeliteaarch64.iss \ No newline at end of file diff --git a/build-win32.sh b/build-win32.sh index 2d658ffd..d0c1bdca 100755 --- a/build-win32.sh +++ b/build-win32.sh @@ -2,6 +2,9 @@ set -e +echo Launcher sha256sum +sha256sum build/libs/RuneLite.jar + cmake -S liblauncher -B liblauncher/build32 -A Win32 cmake --build liblauncher/build32 --config Release @@ -22,7 +25,7 @@ fi echo "$WIN32_CHKSUM win32_jre.zip" | sha256sum -c cp native/build-x86/src/Release/RuneLite.exe build/win-x86/ -cp target/RuneLite.jar build/win-x86/ +cp build/libs/RuneLite.jar build/win-x86/ cp packr/win-x86-config.json build/win-x86/config.json cp liblauncher/build32/Release/launcher_x86.dll build/win-x86/ @@ -35,4 +38,4 @@ sha256sum build/win-x86/RuneLite.exe dumpbin //HEADERS build/win-x86/RuneLite.exe # We use the filtered iss file -iscc target/filtered-resources/runelite32.iss \ No newline at end of file +iscc build/filtered-resources/runelite32.iss \ No newline at end of file diff --git a/build-win64.sh b/build-win64.sh index b319537a..211c78b4 100755 --- a/build-win64.sh +++ b/build-win64.sh @@ -2,6 +2,9 @@ set -e +echo Launcher sha256sum +sha256sum build/libs/RuneLite.jar + cmake -S liblauncher -B liblauncher/build64 -A x64 cmake --build liblauncher/build64 --config Release @@ -22,7 +25,7 @@ fi echo "$WIN64_CHKSUM win64_jre.zip" | sha256sum -c cp native/build-x64/src/Release/RuneLite.exe build/win-x64/ -cp target/RuneLite.jar build/win-x64/ +cp build/libs/RuneLite.jar build/win-x64/ cp packr/win-x64-config.json build/win-x64/config.json cp liblauncher/build64/Release/launcher_amd64.dll build/win-x64/ @@ -35,4 +38,4 @@ sha256sum build/win-x64/RuneLite.exe dumpbin //HEADERS build/win-x64/RuneLite.exe # We use the filtered iss file -iscc target/filtered-resources/runelite.iss \ No newline at end of file +iscc build/filtered-resources/runelite.iss \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..89d93561 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +plugins { + java + checkstyle + id("com.github.johnrengelman.shadow") version "8.1.1" +} + +repositories { + mavenCentral() + maven { url = uri("https://repo.runelite.net") } +} + +group = "net.runelite" +version = "2.7.4-SNAPSHOT" +description = "RuneLite Launcher" + +dependencies { + implementation(libs.org.slf4j.slf4j.api) + implementation(libs.ch.qos.logback.logback.classic) + implementation(libs.net.sf.jopt.simple.jopt.simple) + implementation(libs.com.google.code.gson.gson) + implementation(libs.com.google.guava.guava) { + // compile time annotations for static analysis in Guava + // https://github.com/google/guava/wiki/UseGuavaInYourBuild#what-about-guavas-own-dependencies + exclude(group = "com.google.code.findbugs", module = "jsr305") + exclude(group = "com.google.errorprone", module = "error_prone_annotations") + exclude(group = "com.google.j2objc", module = "j2objc-annotations") + exclude(group = "org.codehaus.mojo", module = "animal-sniffer-annotations") + } + implementation(libs.net.runelite.archive.patcher.archive.patcher.applier) + compileOnly(libs.com.google.code.findbugs.jsr305) + compileOnly(libs.org.projectlombok.lombok) + annotationProcessor(libs.org.projectlombok.lombok) + testImplementation(libs.junit.junit) +} + +tasks.withType { + options.encoding = "UTF-8" + options.release.set(11) +} + +tasks.withType().configureEach { + isPreserveFileTimestamps = false + isReproducibleFileOrder = true +} + +sourceSets.create("java8") { + java.srcDirs("src/main/java8") +} + +tasks.jar { + from(sourceSets["java8"].output) + duplicatesStrategy = DuplicatesStrategy.WARN +} + +tasks.getByName("compileJava8Java") { + options.release.unset() + sourceCompatibility = "1.8" + targetCompatibility = "1.8" +} + +tasks { + processResources { + filesMatching("**/*.properties") { + val props = if (project.findProperty("RUNELITE_BUILD") as? String == "runelite") + arrayOf("runelite_net" to "runelite.net", + "runelite_128" to "runelite_128.png", + "runelite_splash" to "runelite_splash.png") + else arrayOf("runelite_net" to "", + "runelite_128" to "", + "runelite_splash" to "") + expand( + "project" to project, + *props + ) + } + } +} + +checkstyle { + toolVersion = "6.11.2" + configFile = file("checkstyle.xml") +} + +tasks.register("filterAppimage") { + from("appimage/runelite.desktop") + into("build/filtered-resources") + expand("project" to project) +} + +tasks.register("filterInnosetup") { + from("innosetup") { + include("*.iss") + } + into("build/filtered-resources") + expand("project" to project) { + escapeBackslash = true + } +} + +tasks.register("copyInstallerScripts") { + from("innosetup") { + include("*.pas") + } + // not really filtered, but need to be put next to the filtered installer scripts so they can pick them up + into("build/filtered-resources") +} + +tasks.register("filterOsx") { + from("osx/Info.plist") + into("build/filtered-resources") + expand("project" to project) +} + +tasks.shadowJar { + from(sourceSets.main.get().output) + from(sourceSets.getByName("java8").output) + minimize { + exclude(dependency("ch.qos.logback:.*:.*")) + } + archiveFileName.set(project.findProperty("finalName") as String + ".jar") + manifest { + attributes("Main-Class" to "net.runelite.launcher.Launcher") + } +} + +tasks.named("build") { + dependsOn("filterAppimage", "filterInnosetup", "copyInstallerScripts", "filterOsx", tasks.shadowJar) +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..a18f0efd --- /dev/null +++ b/gradle.properties @@ -0,0 +1,25 @@ +# Copyright (c) 2025, Adam +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +finalName=RuneLite +launcherDescription=Launcher for RuneLite client diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..c0d7378c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,44 @@ +# Copyright (c) 2025, Adam +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[versions] +ch-qos-logback-logback-classic = "1.2.9" +com-google-code-findbugs-jsr305 = "3.0.2" +com-google-code-gson-gson = "2.8.5" +com-google-guava-guava = "23.2-jre" +junit-junit = "4.12" +net-runelite-archive-patcher-archive-patcher-applier = "1.2" +net-sf-jopt-simple-jopt-simple = "5.0.1" +org-projectlombok-lombok = "1.18.20" +org-slf4j-slf4j-api = "1.7.25" + +[libraries] +ch-qos-logback-logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "ch-qos-logback-logback-classic" } +com-google-code-findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "com-google-code-findbugs-jsr305" } +com-google-code-gson-gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } +com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } +junit-junit = { module = "junit:junit", version.ref = "junit-junit" } +net-runelite-archive-patcher-archive-patcher-applier = { module = "net.runelite.archive-patcher:archive-patcher-applier", version.ref = "net-runelite-archive-patcher-archive-patcher-applier" } +net-sf-jopt-simple-jopt-simple = { module = "net.sf.jopt-simple:jopt-simple", version.ref = "net-sf-jopt-simple-jopt-simple" } +org-projectlombok-lombok = { module = "org.projectlombok:lombok", version.ref = "org-projectlombok-lombok" } +org-slf4j-slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "org-slf4j-slf4j-api" } diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml new file mode 100644 index 00000000..a2e8a453 --- /dev/null +++ b/gradle/verification-metadata.xml @@ -0,0 +1,466 @@ + + + + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..a4b76b95 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..cea7a793 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..f3b75f3b --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..9b42019c --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/innosetup/runelite.iss b/innosetup/runelite.iss index 5e65cdc4..d4955c91 100644 --- a/innosetup/runelite.iss +++ b/innosetup/runelite.iss @@ -11,25 +11,25 @@ ExtraDiskSpaceRequired=30000000 ArchitecturesAllowed=x64 PrivilegesRequired=lowest -WizardSmallImageFile=${basedir}/innosetup/runelite_small.bmp -SetupIconFile=${basedir}/innosetup/runelite.ico +WizardSmallImageFile=${project.projectDir}/innosetup/runelite_small.bmp +SetupIconFile=${project.projectDir}/innosetup/runelite.ico UninstallDisplayIcon={app}\RuneLite.exe Compression=lzma2 SolidCompression=yes -OutputDir=${basedir} +OutputDir=${project.projectDir} OutputBaseFilename=RuneLiteSetup [Tasks] Name: DesktopIcon; Description: "Create a &desktop icon"; [Files] -Source: "${basedir}\build\win-x64\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-x64\RuneLite.jar"; DestDir: "{app}" -Source: "${basedir}\build\win-x64\launcher_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-x64\config.json"; DestDir: "{app}" -Source: "${basedir}\build\win-x64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs +Source: "${project.projectDir}\build\win-x64\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-x64\RuneLite.jar"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-x64\launcher_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-x64\config.json"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-x64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs [Icons] ; start menu diff --git a/innosetup/runelite32.iss b/innosetup/runelite32.iss index b0368ac5..49ab58c6 100644 --- a/innosetup/runelite32.iss +++ b/innosetup/runelite32.iss @@ -11,25 +11,25 @@ ExtraDiskSpaceRequired=30000000 ArchitecturesAllowed=x86 x64 PrivilegesRequired=lowest -WizardSmallImageFile=${basedir}/innosetup/runelite_small.bmp -SetupIconFile=${basedir}/innosetup/runelite.ico +WizardSmallImageFile=${project.projectDir}/innosetup/runelite_small.bmp +SetupIconFile=${project.projectDir}/innosetup/runelite.ico UninstallDisplayIcon={app}\RuneLite.exe Compression=lzma2 SolidCompression=yes -OutputDir=${basedir} +OutputDir=${project.projectDir} OutputBaseFilename=RuneLiteSetup32 [Tasks] Name: DesktopIcon; Description: "Create a &desktop icon"; [Files] -Source: "${basedir}\build\win-x86\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-x86\RuneLite.jar"; DestDir: "{app}" -Source: "${basedir}\build\win-x86\launcher_x86.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-x86\config.json"; DestDir: "{app}" -Source: "${basedir}\build\win-x86\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs +Source: "${project.projectDir}\build\win-x86\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-x86\RuneLite.jar"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-x86\launcher_x86.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-x86\config.json"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-x86\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs [Icons] ; start menu diff --git a/innosetup/runeliteaarch64.iss b/innosetup/runeliteaarch64.iss index 3f9a20aa..875e9484 100644 --- a/innosetup/runeliteaarch64.iss +++ b/innosetup/runeliteaarch64.iss @@ -11,25 +11,25 @@ ExtraDiskSpaceRequired=30000000 ArchitecturesAllowed=arm64 PrivilegesRequired=lowest -WizardSmallImageFile=${basedir}/innosetup/runelite_small.bmp -SetupIconFile=${basedir}/innosetup/runelite.ico +WizardSmallImageFile=${project.projectDir}/innosetup/runelite_small.bmp +SetupIconFile=${project.projectDir}/innosetup/runelite.ico UninstallDisplayIcon={app}\RuneLite.exe Compression=lzma2 SolidCompression=yes -OutputDir=${basedir} +OutputDir=${project.projectDir} OutputBaseFilename=RuneLiteSetupAArch64 [Tasks] Name: DesktopIcon; Description: "Create a &desktop icon"; [Files] -Source: "${basedir}\build\win-aarch64\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-aarch64\RuneLite.jar"; DestDir: "{app}" -Source: "${basedir}\build\win-aarch64\launcher_aarch64.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "${basedir}\build\win-aarch64\config.json"; DestDir: "{app}" -Source: "${basedir}\build\win-aarch64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs +Source: "${project.projectDir}\build\win-aarch64\RuneLite.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-aarch64\RuneLite.jar"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-aarch64\launcher_aarch64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "${project.projectDir}\build\win-aarch64\config.json"; DestDir: "{app}" +Source: "${project.projectDir}\build\win-aarch64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs [Icons] ; start menu diff --git a/osx/Info.plist b/osx/Info.plist index d9e11de5..110e2949 100644 --- a/osx/Info.plist +++ b/osx/Info.plist @@ -3,11 +3,11 @@ CFBundleExecutable - ${project.build.finalName} + ${project.finalName} CFBundleIdentifier - ${project.groupId}.${project.artifactId} + ${project.group}.${project.name} CFBundleName - ${project.build.finalName} + ${project.finalName} CFBundleIconFile icons.icns CFBundleShortVersionString diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 673b26c6..00000000 --- a/pom.xml +++ /dev/null @@ -1,406 +0,0 @@ - - - - 4.0.0 - - net.runelite - launcher - 2.7.3-SNAPSHOT - RuneLite Launcher - Launcher for RuneLite client - - - UTF-8 - 1 - - net.runelite.launcher.Launcher - - - - https://github.com/runelite/launcher - scm:git:git://github.com/runelite/launcher - scm:git:git@github.com:runelite/launcher - HEAD - - - - - runelite - dav:https://repo.runelite.net - - - - - - central - https://repo.maven.apache.org/maven2 - - - runelite - RuneLite - https://repo.runelite.net - - - - - - central - https://repo.maven.apache.org/maven2 - - - runelite - https://repo.runelite.net - - - - - - org.slf4j - slf4j-api - 1.7.25 - - - ch.qos.logback - logback-classic - 1.2.9 - - - net.sf.jopt-simple - jopt-simple - 5.0.1 - - - com.google.code.gson - gson - 2.8.5 - - - com.google.code.findbugs - jsr305 - 3.0.2 - provided - - - com.google.guava - guava - 23.2-jre - - - - com.google.code.findbugs - jsr305 - - - com.google.errorprone - error_prone_annotations - - - com.google.j2objc - j2objc-annotations - - - org.codehaus.mojo - animal-sniffer-annotations - - - - - org.projectlombok - lombok - 1.18.20 - provided - - - net.runelite.archive-patcher - archive-patcher-applier - 1.2 - - - - junit - junit - 4.12 - test - - - - - RuneLite - - - - src/main/resources - - logback.xml - - true - - - src/main/resources - - logback.xml - - false - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 11 - - -h - target/headers - - - - - compile-java8 - - compile - - - 1.8 - 1.8 - - - ${project.basedir}/src/main/java8 - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - false - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.3 - - - package - - shade - - - true - - - - ${main.class} - - - - - ch.qos.logback:* - - ** - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.0.2 - - - copy-resources - validate - - copy-resources - - - ${basedir}/target/filtered-resources - - - appimage - true - - *.png - - - - innosetup - true - - *.bmp - - - - osx - true - - *.plist - - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - verify-style - process-classes - - check - - - - - checkstyle.xml - - ${project.build.sourceDirectory} - - - - net.runelite.maven - dependency-lock-plugin - 1.1 - - - verify - - verify - - - - - - - org.slf4j - slf4j-api - SHA-256:18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79 - - - ch.qos.logback - logback-classic - SHA-256:ad745cc243805800d1ebbf5b7deba03b37c95885e6bce71335a73f7d6d0f14ee - - - ch.qos.logback - logback-core - SHA-256:4a9ef7ed809b1fbc6992bf87d404087c247e7a9766e25bb84377b58ed5c9eb58 - - - net.sf.jopt-simple - jopt-simple - SHA-256:9f0c8d50fa4b79b6ff1502dbec8502179d6b9497cacbe17a13074001aed537ec - - - com.google.code.gson - gson - SHA-256:233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81 - - - com.google.guava - guava - SHA-256:5be9a7d05ba0ccd74708bc8018ae412255f85843c0b92302e9b9befa6ed52564 - - - com.google.code.findbugs - jsr305 - SHA-256:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7 - - - com.google.errorprone - error_prone_annotations - SHA-256:cb4cfad870bf563a07199f3ebea5763f0dec440fcda0b318640b1feaa788656b - - - com.google.j2objc - j2objc-annotations - SHA-256:2994a7eb78f2710bd3d3bfb639b2c94e219cedac0d4d084d516e78c16dddecf6 - - - org.codehaus.mojo - animal-sniffer-annotations - SHA-256:2068320bd6bad744c3673ab048f67e30bef8f518996fa380033556600669905d - - - org.projectlombok - lombok - SHA-256:ce947be6c2fbe759fbbe8ef3b42b6825f814c98c8853f1013f2d9630cedf74b0 - - - net.runelite.maven - dependency-lock-plugin - SHA-256:3a03d05adcbb095650e0a8e01b704ef214b0ba98e25d38835f70224b5fba68c2 - - - net.runelite.archive-patcher - archive-patcher-applier - SHA-256:ce932f3eeeb31021ae4d62108fdab23e18b7efd79833e4cd050e2d78d78c3347 - - - - - - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.12 - - - - - - - runelite - - runelite.net - runelite_128.png - runelite_splash.png - - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..bdea20a3 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +rootProject.name = "launcher" \ No newline at end of file diff --git a/src/main/java/net/runelite/launcher/ConfigurationFrame.java b/src/main/java/net/runelite/launcher/ConfigurationFrame.java index a633e6bf..24856018 100644 --- a/src/main/java/net/runelite/launcher/ConfigurationFrame.java +++ b/src/main/java/net/runelite/launcher/ConfigurationFrame.java @@ -32,6 +32,8 @@ import java.awt.event.ActionEvent; import java.awt.image.BufferedImage; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import javax.annotation.Nullable; import javax.imageio.ImageIO; import javax.swing.BorderFactory; @@ -57,6 +59,7 @@ public class ConfigurationFrame extends JFrame private final JCheckBox chkboxSkipTlsVerification; private final JCheckBox chkboxNoUpdates; private final JCheckBox chkboxSafemode; + private final JCheckBox chkboxIpv4; private final JTextField txtScale; private final JTextArea txtClientArguments; private final JTextArea txtJvmArguments; @@ -119,6 +122,12 @@ private ConfigurationFrame(LauncherSettings settings) Boolean.TRUE.equals(settings.safemode) )); + topPanel.add(chkboxIpv4 = checkbox( + "IPv4", + "Prefer IPv4 over IPv6", + Boolean.TRUE.equals(settings.ipv4) + )); + pane.add(topPanel); var midPanel = new JPanel(); @@ -198,6 +207,7 @@ private void save(ActionEvent l) settings.skipTlsVerification = chkboxSkipTlsVerification.isSelected(); settings.noupdates = chkboxNoUpdates.isSelected(); settings.safemode = chkboxSafemode.isSelected(); + settings.ipv4 = chkboxIpv4.isSelected(); var t = txtScale.getText(); settings.scale = null; @@ -227,6 +237,20 @@ private void save(ActionEvent l) LauncherSettings.saveSettings(settings); + // IPv4 change requires patching packr config + PackrConfig.patch(config -> + { + List vmArgs = (List) config.computeIfAbsent("vmArgs", k -> new ArrayList<>()); + if (settings.ipv4) + { + vmArgs.add("-Djava.net.preferIPv4Stack=true"); + } + else + { + vmArgs.remove("-Djava.net.preferIPv4Stack=true"); + } + }); + log.info("Updated launcher configuration:" + System.lineSeparator() + "{}", settings.configurationStr()); dispose(); diff --git a/src/main/java/net/runelite/launcher/FatalErrorDialog.java b/src/main/java/net/runelite/launcher/FatalErrorDialog.java index 259e118f..360463eb 100644 --- a/src/main/java/net/runelite/launcher/FatalErrorDialog.java +++ b/src/main/java/net/runelite/launcher/FatalErrorDialog.java @@ -35,6 +35,7 @@ import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import java.io.IOException; +import java.net.ConnectException; import java.net.SocketException; import java.net.UnknownHostException; import java.security.GeneralSecurityException; @@ -224,11 +225,19 @@ public static void showNetErrorWindow(String action, Throwable err) message += " Cannot assign requested address. This error is most commonly caused by \"split tunneling\" support in VPN software." + " If you are using a VPN, try turning \"split tunneling\" off."; } + // connect() returning SOCKET_ERROR: // WSAEACCES error formatted by NET_ThrowNew() else if (err.getMessage().equals("Permission denied: connect")) { message += " Your internet access is blocked. Firewall or antivirus software may have blocked the connection."; } + // finishConnect() waiting for connect() to finish: + // Java_sun_nio_ch_SocketChannelImpl_checkConnect throws the error, either from select() returning WSAEACCES + // or SO_ERROR being WSAEACCES. NET_ThrowNew adds on the "no further information". + else if (err instanceof ConnectException && err.getMessage().equals("Permission denied: no further information")) + { + message += " Your internet access is blocked. Firewall or antivirus software may have blocked the connection."; + } else { message += " Please check your internet connection."; diff --git a/src/main/java/net/runelite/launcher/FilesystemPermissions.java b/src/main/java/net/runelite/launcher/FilesystemPermissions.java index ea668117..55541222 100644 --- a/src/main/java/net/runelite/launcher/FilesystemPermissions.java +++ b/src/main/java/net/runelite/launcher/FilesystemPermissions.java @@ -170,12 +170,20 @@ private static boolean checkPermissions(File tree, boolean root) // Traverse only the top level directories, and limit the number of files checked, // to keep it speedy. The primary files which prevent the launcher and client from // working are all here (repository2, cache, logs, profiles2). + File[] files = tree.listFiles(); + if (files == null) + { + log.error("Unable to list files in directory {} (IO error, or is not a directory)", tree); + return false; + } + boolean ok = true; int numFiles = 0; - for (File file : tree.listFiles()) + for (File file : files) { if (file.isDirectory()) { + log.debug("Checking permissions of directory {}", file); if (root && !checkPermissions(file, false)) { ok = false; diff --git a/src/main/java/net/runelite/launcher/Launcher.java b/src/main/java/net/runelite/launcher/Launcher.java index 12f6a415..5bacdf2d 100644 --- a/src/main/java/net/runelite/launcher/Launcher.java +++ b/src/main/java/net/runelite/launcher/Launcher.java @@ -262,7 +262,7 @@ public static void main(String[] args) if (postInstall) { - postInstall(); + postInstall(settings); return; } @@ -343,7 +343,7 @@ public static void main(String[] args) } // update packr vmargs to the launcher vmargs from bootstrap. - PackrConfig.updateLauncherArgs(bootstrap); + PackrConfig.updateLauncherArgs(bootstrap, settings); // Determine artifacts for this OS List artifacts = Arrays.stream(bootstrap.getArtifacts()) @@ -593,6 +593,11 @@ private static List getJvmArgs(LauncherSettings settings) { var args = new ArrayList<>(settings.jvmArguments); + if (settings.ipv4) + { + args.add("-Djava.net.preferIPv4Stack=true"); + } + var envArgs = System.getenv("RUNELITE_VMARGS"); if (!Strings.isNullOrEmpty(envArgs)) { @@ -921,7 +926,7 @@ static boolean isJava17() return Runtime.version().feature() >= 16; } - private static void postInstall() + private static void postInstall(LauncherSettings settings) { Bootstrap bootstrap; try @@ -934,7 +939,7 @@ private static void postInstall() return; } - PackrConfig.updateLauncherArgs(bootstrap); + PackrConfig.updateLauncherArgs(bootstrap, settings); log.info("Performed postinstall steps"); } diff --git a/src/main/java/net/runelite/launcher/LauncherSettings.java b/src/main/java/net/runelite/launcher/LauncherSettings.java index 7ef83483..8d5e2484 100644 --- a/src/main/java/net/runelite/launcher/LauncherSettings.java +++ b/src/main/java/net/runelite/launcher/LauncherSettings.java @@ -26,6 +26,7 @@ import com.google.common.base.MoreObjects; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import java.io.File; import java.io.FileInputStream; @@ -65,6 +66,7 @@ class LauncherSettings boolean skipTlsVerification; boolean noupdates; boolean safemode; + boolean ipv4; @Nullable Double scale; List clientArguments = Collections.emptyList(); @@ -140,6 +142,7 @@ String configurationStr() " skip tls verification: {}" + System.lineSeparator() + " noupdates: {}" + System.lineSeparator() + " safe mode: {}" + System.lineSeparator() + + " ipv4: {}" + System.lineSeparator() + " scale: {}" + System.lineSeparator() + " client arguments: {}" + System.lineSeparator() + " jvm arguments: {}" + System.lineSeparator() + @@ -151,6 +154,7 @@ String configurationStr() skipTlsVerification, noupdates, safemode, + ipv4, scale == null ? "system" : scale, clientArguments.isEmpty() ? "none" : clientArguments, jvmArguments.isEmpty() ? "none" : jvmArguments, @@ -189,7 +193,9 @@ static void saveSettings(LauncherSettings settings) try { File tmpFile = File.createTempFile(LAUNCHER_SETTINGS, "json"); - var gson = new Gson(); + Gson gson = new GsonBuilder() + .setPrettyPrinting() + .create(); try (FileOutputStream fout = new FileOutputStream(tmpFile); FileChannel channel = fout.getChannel(); diff --git a/src/main/java/net/runelite/launcher/PackrConfig.java b/src/main/java/net/runelite/launcher/PackrConfig.java index 44fc1b7a..68aa7c8f 100644 --- a/src/main/java/net/runelite/launcher/PackrConfig.java +++ b/src/main/java/net/runelite/launcher/PackrConfig.java @@ -39,7 +39,11 @@ import java.nio.file.AtomicMoveNotSupportedException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Map; +import java.util.function.Consumer; import lombok.extern.slf4j.Slf4j; import net.runelite.launcher.beans.Bootstrap; @@ -47,7 +51,35 @@ class PackrConfig { // Update the packr config - static void updateLauncherArgs(Bootstrap bootstrap) + static void updateLauncherArgs(Bootstrap bootstrap, LauncherSettings settings) + { + String[] bootstrapVmArgs = getVmArgs(bootstrap); + if (bootstrapVmArgs == null || bootstrapVmArgs.length == 0) + { + log.warn("Launcher args are empty"); + return; + } + + List vmArgs = new ArrayList<>(Arrays.asList(bootstrapVmArgs)); + + // java.net.preferIPv4Stack needs to be set prior to libnet *loading* (it is read in net_util.c JNI_OnLoad). + // Failure to keep preferIPv4Stack consistent between libnet and java/net results in disagreements over + // which socket types can be used. + if (settings.ipv4) + { + vmArgs.add("-Djava.net.preferIPv4Stack=true"); + } + + Map env = getEnv(bootstrap); + + patch(config -> + { + config.put("vmArgs", vmArgs); + config.put("env", env); + }); + } + + static void patch(Consumer configConsumer) { var os = OS.getOs(); if (os != OS.OSType.Windows && os != OS.OSType.MacOS) @@ -71,7 +103,7 @@ static void updateLauncherArgs(Bootstrap bootstrap) } catch (IOException | JsonIOException | JsonSyntaxException e) { - log.warn("error deserializing packr vm args!", e); + log.warn("error deserializing launcher vm args!", e); return; } @@ -79,19 +111,11 @@ static void updateLauncherArgs(Bootstrap bootstrap) { // this can't happen when run from the launcher, because an invalid packr config would prevent the launcher itself // from starting. But could happen if the jar launcher was run separately. - log.warn("packr config is null!"); - return; - } - - String[] argsArr = getArgs(bootstrap); - if (argsArr == null || argsArr.length == 0) - { - log.warn("Launcher args are empty"); + log.warn("launcher config is null!"); return; } - config.put("vmArgs", argsArr); - config.put("env", getEnv(bootstrap)); + configConsumer.accept(config); try { @@ -117,14 +141,16 @@ static void updateLauncherArgs(Bootstrap bootstrap) log.debug("atomic move not supported", ex); Files.move(tmpFile.toPath(), configFile.toPath(), StandardCopyOption.REPLACE_EXISTING); } + + log.debug("patched packr config"); } catch (IOException e) { - log.warn("error updating packr vm args!", e); + log.warn("error updating launcher vm args!", e); } } - private static String[] getArgs(Bootstrap bootstrap) + private static String[] getVmArgs(Bootstrap bootstrap) { return Launcher.isJava17() ? getArgsJvm17(bootstrap) : getArgsJvm11(bootstrap); } diff --git a/src/main/java8/net/runelite/launcher/CertPathExtractor.java b/src/main/java8/net/runelite/launcher/CertPathExtractor.java index ef734bd3..84144ffc 100644 --- a/src/main/java8/net/runelite/launcher/CertPathExtractor.java +++ b/src/main/java8/net/runelite/launcher/CertPathExtractor.java @@ -26,7 +26,6 @@ import sun.security.provider.certpath.AdjacencyList; import sun.security.provider.certpath.SunCertPathBuilderException; -import sun.security.validator.ValidatorException; class CertPathExtractor { diff --git a/src/main/resources/net/runelite/launcher/launcher.properties b/src/main/resources/net/runelite/launcher/launcher.properties index 21f22234..96a3b3f3 100644 --- a/src/main/resources/net/runelite/launcher/launcher.properties +++ b/src/main/resources/net/runelite/launcher/launcher.properties @@ -1,10 +1,10 @@ runelite.launcher.version=${project.version} -runelite.discord.invite=https://${runelite.net}/redirect/launcher/discord -runelite.wiki.troubleshooting.link=https://${runelite.net}/redirect/launcher/troubleshooting +runelite.discord.invite=https://${runelite_net}/redirect/launcher/discord +runelite.wiki.troubleshooting.link=https://${runelite_net}/redirect/launcher/troubleshooting runelite.dnschange.link=https://1.1.1.1/dns/#setup-instructions -runelite.download.link=https://${runelite.net}/ +runelite.download.link=https://${runelite_net}/ runelite.bootstrap=https://static.runelite.net/bootstrap.json runelite.bootstrapsig=https://static.runelite.net/bootstrap.json.sha256 runelite.main=net.runelite.client.RuneLite -runelite.128=${runelite.128} -runelite.splash=${runelite.splash} \ No newline at end of file +runelite.128=${runelite_128} +runelite.splash=${runelite_splash} \ No newline at end of file diff --git a/tools/update-jre.py b/tools/update-jre.py index 9d6f344a..b4bff8ae 100644 --- a/tools/update-jre.py +++ b/tools/update-jre.py @@ -2,6 +2,9 @@ import urllib.request import json +ver11 = '11.0.25+9' +ver17 = '17.0.13+11' + def fetch_jre(prefix, version_range, arch, os): url = 'https://api.adoptium.net/v3/assets/version/' + urllib.parse.quote(version_range) + '?' params = { @@ -46,9 +49,6 @@ def fetch_microsoft_jre(prefix, version, arch, os): print(prefix + "CHKSUM=" + shasum) print(prefix + "LINK=https://aka.ms/download-jdk/microsoft-jdk-" + urlversion + "-" + os + "-" + arch + ".zip") -ver11 = '11.0.24+8' -ver17 = '17.0.12+7' - fetch_jre('WIN64_', ver11, 'x64', 'windows') fetch_jre('WIN32_', ver11, 'x86', 'windows') fetch_microsoft_jre('WIN_AARCH64_', ver11, 'aarch64', 'windows')