This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
forked from PojavLauncherTeam/PojavLauncher
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstreamify profiles (PojavLauncherTeam#2765)
* add Arc capes DNS injector * Bug fix: Arc DNS injector breaks on Java 17 Error: Failed to inject cache! java.lang.reflect.InaccessibleObjectException: Unable to make java.net.InetAddress$CachedAddresses(java.lang.String,java.net.InetAddress[],long) accessible: module java.base does not "opens java.net" to unnamed module @4157f54e * Validate assets even if it’s fully downloaded (PojavLauncherTeam#2730) * Update MinecraftDownloaderTask.java Co-authored-by: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
- Loading branch information
1 parent
d7556c3
commit 0b4d775
Showing
16 changed files
with
1,047 additions
and
7 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
plugins { | ||
id 'java-library' | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_7 | ||
targetCompatibility = JavaVersion.VERSION_1_7 | ||
} | ||
jar { | ||
manifest { | ||
attributes("Manifest-Version": "1.0", | ||
"PreMain-Class": "git.artdeell.arcdns.ArcDNSInjectorAgent") | ||
} | ||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/")) | ||
} |
20 changes: 20 additions & 0 deletions
20
arc_dns_injector/src/main/java/git/artdeell/arcdns/ArcDNSInjectorAgent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package git.artdeell.arcdns; | ||
|
||
public class ArcDNSInjectorAgent { | ||
public static void premain(String args) { | ||
System.out.println("Arc Capes DNS Injector"); | ||
System.out.println("Parts of Alibaba's DCM library were used, please read https://github.com/alibaba/java-dns-cache-manipulator/blob/main/README.md for more info"); | ||
try { | ||
String[] injectedIps = new String[]{args}; | ||
if (CacheUtilCommons.isJavaVersionAtMost8()) { | ||
CacheUtil_J8.setInetAddressCache("s.optifine.net", injectedIps, CacheUtilCommons.NEVER_EXPIRATION); | ||
} else { | ||
CacheUtil_J9.setInetAddressCache("s.optifine.net", injectedIps, CacheUtilCommons.NEVER_EXPIRATION); | ||
} | ||
System.out.println("Added DNS cache entry: s.optifine.net/"+args); | ||
}catch (Exception e) { | ||
System.out.println("Failed to inject cache!"); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.