Skip to content

Commit 4a0bd69

Browse files
authored
Merge pull request #366 from Polyfrost/develop-v0
2 parents 04f6ec1 + c17c03e commit 4a0bd69

File tree

9 files changed

+129
-19
lines changed

9 files changed

+129
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ OneConfig is a free, open sourced configuration library by [Polyfrost](https://p
1818
</details>
1919

2020
### How to get:
21-
For beginners, we recommend using [SkyClient](https://skyclient.co/), a free and open-sourced mod installer. For more technical users, all of our mods, including [Hytils](https://github.com/Polyfrost/Hytils-Reborn), [CrashPatch](https://github.com/Polyfrost/crashpatch), [EvergreenHUD](https://github.com/Polyfrost/EvergreenHUD), and [Chatting](https://github.com/Polyfrost/chatting) have full support, and come with OneConfig. Mods which use [Vigilance](https://github.com/EssentialGG/Vigilance) are also supported through our [compatability layer](https://docs.polyfrost.cc/oneconfig/config/compatibility).
21+
For beginners, we recommend using [SkyClient](https://skyclient.co/), a free and open-sourced mod installer. For more technical users, all of our mods, including [Hytils](https://github.com/Polyfrost/Hytils-Reborn), [CrashPatch](https://github.com/Polyfrost/crashpatch), [EvergreenHUD](https://github.com/Polyfrost/EvergreenHUD), and [Chatting](https://github.com/Polyfrost/chatting) have full support, and come with OneConfig. Mods which use [Vigilance](https://github.com/EssentialGG/Vigilance) are also supported through our [compatibility layer](https://docs.polyfrost.cc/oneconfig/config/compatibility).
2222

2323
### Is it a client?
2424
While it may look like OneConfig is a client, in reality it's actually a standalone mod. You can actually [see for yourself](https://github.com/Polyfrost/OneConfig-Bootstrap), it doesn't come with any mods of it's own. It's left up to the user to decide which mods they want to actually use.

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ blossom {
4040
}
4141

4242
repositories {
43-
maven("https://repo.polyfrost.cc/releases")
43+
maven("https://repo.polyfrost.org/releases")
44+
maven("https://repo.polyfrost.org/snapshots")
4445
}
4546

4647
val relocated = registerRelocationAttribute("relocate") {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ deencapsulation = "42b829f373"
1616
caffeine = "2.9.3"
1717
mixin = "0.7.11-SNAPSHOT"
1818

19-
lwjgl = "1.0.0-alpha26"
19+
lwjgl = "1.0.0-alpha29"
2020
fabric-asm = "v2.3"
2121

2222
[libraries]

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
gradlePluginPortal()
44
maven("https://repo.polyfrost.org/releases")
55
}
6-
val pgtVersion = "0.6.2"
6+
val pgtVersion = "0.6.6"
77
plugins {
88
id("org.polyfrost.multi-version.root") version pgtVersion
99
id("org.polyfrost.defaults") version pgtVersion

versions/build.gradle.kts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ loom {
7575
}
7676

7777
repositories {
78-
maven("https://repo.polyfrost.cc/releases")
78+
maven("https://repo.polyfrost.org/releases")
79+
maven("https://repo.polyfrost.org/snapshots")
7980
}
8081

8182
val relocatedCommonProject = registerRelocationAttribute("common-lwjgl") {
@@ -165,20 +166,11 @@ dependencies {
165166
}
166167
}
167168

168-
val repackedVersions = when (platform.mcVersion) {
169-
in 10809..11202 -> listOf(RepackedVersion.LEGACY)
170-
in 11203..11802 -> listOf(RepackedVersion.PRE119NOARM, RepackedVersion.PRE119ARM)
171-
else -> listOf(RepackedVersion.POST119)
172-
}
173-
174-
repackedVersions.forEachIndexed { index, version ->
175-
val configuration = configurations.create("tempLwjglConfiguration$index")
176-
177-
compileOnly(configuration("cc.polyfrost:lwjgl-$version:${libs.versions.lwjgl.get()}"){
178-
isTransitive = false
179-
})
180-
shadeNoPom(implementationNoPom(prebundle(configuration, "lwjgl-$version.jar"))!!)
181-
}
169+
val configuration = configurations.create("tempLwjglConfiguration0")
170+
compileOnly(configuration("cc.polyfrost:lwjgl-legacy:${libs.versions.lwjgl.get()}") {
171+
isTransitive = false
172+
})
173+
shadeNoPom(implementationNoPom(prebundle(configuration, "lwjgl-legacy.jar"))!!)
182174

183175
modRuntimeOnly("me.djtheredstoner:DevAuth-" +
184176
(if (platform.isForge) { if (platform.isLegacyForge) "forge-legacy" else "forge-latest" } else "fabric")
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* This file is part of OneConfig.
3+
* OneConfig - Next Generation Config Library for Minecraft: Java Edition
4+
* Copyright (C) 2021~2023 Polyfrost.
5+
* <https://polyfrost.cc> <https://github.com/Polyfrost/>
6+
*
7+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8+
*
9+
* OneConfig is licensed under the terms of version 3 of the GNU Lesser
10+
* General Public License as published by the Free Software Foundation, AND
11+
* under the Additional Terms Applicable to OneConfig, as published by Polyfrost,
12+
* either version 1.0 of the Additional Terms, or (at your option) any later
13+
* version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* Lesser General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Lesser General Public
21+
* License. If not, see <https://www.gnu.org/licenses/>. You should
22+
* have also received a copy of the Additional Terms Applicable
23+
* to OneConfig, as published by Polyfrost. If not, see
24+
* <https://polyfrost.cc/legal/oneconfig/additional-terms>
25+
*/
26+
27+
package cc.polyfrost.oneconfig.internal.hacks;
28+
29+
import cc.polyfrost.oneconfig.internal.OneConfig;
30+
31+
import javax.net.ssl.KeyManagerFactory;
32+
import javax.net.ssl.SSLContext;
33+
import javax.net.ssl.TrustManagerFactory;
34+
import java.security.KeyStore;
35+
36+
public class SkyClientUpdaterHack {
37+
public static final SkyClientUpdaterHack INSTANCE = new SkyClientUpdaterHack();
38+
39+
public SSLContext getSSLContext() {
40+
try {
41+
KeyStore keystore = KeyStore.getInstance("JKS");
42+
keystore.load(SkyClientUpdaterHack.class.getResourceAsStream("/polyfrost_backup.jks"), "changeit".toCharArray());
43+
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
44+
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
45+
kmf.init(keystore, null);
46+
tmf.init(keystore);
47+
SSLContext ctx = SSLContext.getInstance("TLS");
48+
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
49+
return ctx;
50+
} catch (Exception e) {
51+
OneConfig.LOGGER.warn("Failed to load keystore. Web requests may fail on older Java versions", e);
52+
return null;
53+
}
54+
}
55+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* This file is part of OneConfig.
3+
* OneConfig - Next Generation Config Library for Minecraft: Java Edition
4+
* Copyright (C) 2021~2023 Polyfrost.
5+
* <https://polyfrost.cc> <https://github.com/Polyfrost/>
6+
*
7+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8+
*
9+
* OneConfig is licensed under the terms of version 3 of the GNU Lesser
10+
* General Public License as published by the Free Software Foundation, AND
11+
* under the Additional Terms Applicable to OneConfig, as published by Polyfrost,
12+
* either version 1.0 of the Additional Terms, or (at your option) any later
13+
* version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* Lesser General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Lesser General Public
21+
* License. If not, see <https://www.gnu.org/licenses/>. You should
22+
* have also received a copy of the Additional Terms Applicable
23+
* to OneConfig, as published by Polyfrost. If not, see
24+
* <https://polyfrost.cc/legal/oneconfig/additional-terms>
25+
*/
26+
27+
package cc.polyfrost.oneconfig.internal.mixin;
28+
29+
import cc.polyfrost.oneconfig.internal.hacks.SkyClientUpdaterHack;
30+
import org.spongepowered.asm.mixin.Dynamic;
31+
import org.spongepowered.asm.mixin.Mixin;
32+
import org.spongepowered.asm.mixin.Pseudo;
33+
import org.spongepowered.asm.mixin.Unique;
34+
import org.spongepowered.asm.mixin.injection.At;
35+
import org.spongepowered.asm.mixin.injection.Inject;
36+
import org.spongepowered.asm.mixin.injection.Redirect;
37+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
38+
39+
import javax.net.ssl.HttpsURLConnection;
40+
import java.io.InputStream;
41+
42+
@Pseudo
43+
@Mixin(targets = "mynameisjeff.skyblockclientupdater.UpdateChecker", remap = false)
44+
public class SkyClientUpdaterMixin {
45+
46+
@Unique private HttpsURLConnection oneconfig$connection;
47+
48+
@Dynamic("SCC 1.3.6 or below. If this doesn't apply, Minecraft should still work fine.")
49+
@Redirect(method = "setupConnection", at = @At(value = "INVOKE", target = "Lkotlin/jvm/internal/Intrinsics;checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V"))
50+
private void fixSSLOnOlderSCC(Object connection, String error) {
51+
this.oneconfig$connection = (HttpsURLConnection) connection;
52+
}
53+
54+
@Dynamic("SCC 1.3.6 or below. If this doesn't apply, Minecraft should still work fine.")
55+
@Inject(method = "setupConnection", at = @At(value = "INVOKE", target = "Ljavax/net/ssl/HttpsURLConnection;getInputStream()Ljava/io/InputStream;"))
56+
private void fixSSLOnOlderSCC(String url, CallbackInfoReturnable<InputStream> cir) {
57+
if (this.oneconfig$connection != null) {
58+
this.oneconfig$connection.setSSLSocketFactory(SkyClientUpdaterHack.INSTANCE.getSSLContext().getSocketFactory());
59+
}
60+
}
61+
}

versions/src/main/resources/mixins.oneconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"OptifineConfigMixin",
1818
"RedactionNameHighlightMixin",
1919
"ShaderGroupAccessor",
20+
"SkyClientUpdaterMixin",
2021
"VigilantMixin",
2122
"WorldClientMixin"
2223
]
166 KB
Binary file not shown.

0 commit comments

Comments
 (0)