Passes JVM user.language arg to application.. This is important
Hook battery / PR-target hook battery (push) Successful in 11s

This commit is contained in:
Hammer
2026-07-21 15:19:51 -04:00
parent 2e892c4ef4
commit 15b81a210f
34 changed files with 133 additions and 1405 deletions
+30 -94
View File
@@ -2,9 +2,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.threerings.getdown</groupId>
<groupId>net.affliction</groupId>
<artifactId>getdown</artifactId>
<version>1.8.11-SNAPSHOT</version>
<version>1.0.0</version>
</parent>
<artifactId>getdown-launcher</artifactId>
@@ -21,7 +21,7 @@
<dependencies>
<dependency>
<groupId>com.threerings.getdown</groupId>
<groupId>net.affliction</groupId>
<artifactId>getdown-core</artifactId>
<version>${project.version}</version>
<optional>true</optional>
@@ -29,7 +29,7 @@
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>samskivert</artifactId>
<version>1.12-SNAPSHOT</version>
<version>1.13</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -82,79 +82,6 @@
</executions>
</plugin>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>proguard</goal></goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-base</artifactId>
<version>${proguard.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-core</artifactId>
<version>${proguard-core.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<proguardVersion>${proguard.version}</proguardVersion>
<outputDirectory>${project.build.directory}</outputDirectory>
<outjar>${project.build.finalName}.jar</outjar>
<injar>${project.build.finalName}.jar</injar>
<assembly>
<inclusions>
<inclusion>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown-core</artifactId>
</inclusion>
<inclusion>
<groupId>com.samskivert</groupId>
<artifactId>samskivert</artifactId>
<filter>
!**/*.java,
!**/swing/RuntimeAdjust*,
!**/swing/util/ButtonUtil*,
!**/util/CalendarUtil*,
!**/util/Calendars*,
!**/util/Log4JLogger*,
!**/util/PrefsConfig*,
!**/util/SignalUtil*,
com/samskivert/Log.class,
**/samskivert/io/**,
**/samskivert/swing/**,
**/samskivert/text/**,
**/samskivert/util/**
</filter>
</inclusion>
<inclusion>
<groupId>jregistrykey</groupId>
<artifactId>jregistrykey</artifactId>
</inclusion>
</inclusions>
</assembly>
<obfuscate>true</obfuscate>
<options>
<option>-keep public class com.threerings.getdown.** { *; }</option>
<option>-keep public class ca.beq.util.win32.registry.** { *; }</option>
<option>-keepattributes Exceptions, InnerClasses, Signature</option>
</options>
<libs>
<lib>${rt.jar.path}</lib>
</libs>
<addMavenDescriptor>false</addMavenDescriptor>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -175,6 +102,32 @@
</archive>
</configuration>
</plugin>
<!-- Shadow (fat) jar plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.threerings.getdown.launcher.GetdownApp</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<finalName>${project.artifactId}-all</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
@@ -203,23 +156,6 @@
<activation>
<file><exists>${java.home}/jmods/java.base.jmod</exists></file>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<configuration>
<libs>
<lib>${java.home}/jmods/java.base.jmod</lib>
<lib>${java.home}/jmods/java.desktop.jmod</lib>
<lib>${java.home}/jmods/java.logging.jmod</lib>
<lib>${java.home}/jmods/java.scripting.jmod</lib>
<lib>${java.home}/jmods/jdk.jsobject.jmod</lib>
</libs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -1,149 +0,0 @@
//
// Getdown - application installer, patcher and launcher
// Copyright (C) 2004-2018 Getdown authors
// https://github.com/threerings/getdown/blob/master/LICENSE
package com.threerings.getdown.launcher;
import java.io.StringReader;
import java.net.InetAddress;
import java.net.URL;
import org.junit.Test;
import static org.junit.Assert.*;
public class ProxyUtilTest {
static String[] strs (String... strs) { return strs; }
static String[] findPAC (String code, String url) throws Exception {
return ProxyUtil.findPACProxiesForURL(new StringReader(code), new URL(url));
}
static void testPAC (String code, String url, String... expectedProxies) throws Exception {
assertArrayEquals(expectedProxies, findPAC(code, url));
}
@Test public void testPACProxy () throws Exception {
// we use the Graal JavaScrip VM for testing, because JDK15 no longer bundles Nashorn, but
// it does not support calling back into Java unless we set this compatibility property
System.setProperty("polyglot.js.nashorn-compat", "true");
String EXAMPLE0 =
"function FindProxyForURL(url, host) {\n" +
" if (shExpMatch(host, '*.example.com')) { return 'DIRECT'; }\n" +
" if (isInNet(host, '10.0.0.0', '255.255.248.0')) {\n" +
" return 'PROXY fastproxy.example.com:8080';\n" +
" }\n" +
" return 'PROXY proxy.example.com:8080; DIRECT';\n" +
"}\n";
testPAC(EXAMPLE0, "http://test.example.com/", "DIRECT");
testPAC(EXAMPLE0, "http://10.0.1.1/", "PROXY fastproxy.example.com:8080");
testPAC(EXAMPLE0, "http://chicken.gov/", "PROXY proxy.example.com:8080", "DIRECT");
String EXAMPLE1 =
"function FindProxyForURL(url, host) {" +
" if (isPlainHostName(host) || dnsDomainIs(host, '.mozilla.org')) {" +
" return 'DIRECT';" +
" } else {" +
" return 'PROXY w3proxy.mozilla.org:8080; DIRECT';" +
" }" +
"}";
testPAC(EXAMPLE1, "http://test.example.com/", "PROXY w3proxy.mozilla.org:8080", "DIRECT");
testPAC(EXAMPLE1, "http://www.mozilla.org/", "DIRECT");
testPAC(EXAMPLE1, "http://foo.mozilla.org/", "DIRECT");
testPAC(EXAMPLE1, "http://localhost/", "DIRECT");
String EXAMPLE2 =
" function FindProxyForURL(url, host) {\n" +
" if ((isPlainHostName(host) || dnsDomainIs(host, '.mozilla.org')) &&\n" +
" !localHostOrDomainIs(host, 'www.mozilla.org') &&\n" +
" !localHostOrDomainIs(host, 'merchant.mozilla.org')) {\n" +
" return 'DIRECT';\n" +
" } else {\n" +
" return 'PROXY w3proxy.mozilla.org:8080; DIRECT';\n" +
" }\n" +
" }";
testPAC(EXAMPLE2, "http://test.example.com/", "PROXY w3proxy.mozilla.org:8080", "DIRECT");
testPAC(EXAMPLE2, "http://www.mozilla.org/", "PROXY w3proxy.mozilla.org:8080", "DIRECT");
testPAC(EXAMPLE2, "http://www/", "PROXY w3proxy.mozilla.org:8080", "DIRECT");
testPAC(EXAMPLE2, "http://foo.mozilla.org/", "DIRECT");
testPAC(EXAMPLE2, "http://localhost/", "DIRECT");
String EXAMPLE3A =
"function FindProxyForURL(url, host) {\n" +
" if (isResolvable(host)) return 'DIRECT';\n" +
" else return 'PROXY proxy.mydomain.com:8080';\n" +
"}";
testPAC(EXAMPLE3A, "http://www.mozilla.org/", "DIRECT");
testPAC(EXAMPLE3A, "http://doesnotexist.mozilla.org/", "PROXY proxy.mydomain.com:8080");
String EXAMPLE3B =
"function FindProxyForURL(url, host) {\n" +
" if (isPlainHostName(host) ||\n" +
" dnsDomainIs(host, '.mydomain.com') ||\n" +
" isResolvable(host)) {\n" +
" return 'DIRECT';\n" +
" } else {\n" +
" return 'PROXY proxy.mydomain.com:8080';\n" +
" }\n" +
"}";
testPAC(EXAMPLE3B, "http://plain/", "DIRECT");
testPAC(EXAMPLE3B, "http://foo.mydomain.com/", "DIRECT");
testPAC(EXAMPLE3B, "http://www.mozilla.org/", "DIRECT");
testPAC(EXAMPLE3B, "http://doesnotexist.mozilla.org/", "PROXY proxy.mydomain.com:8080");
// example 4
// function FindProxyForURL(url, host) {
// if (isInNet(host, '198.95.0.0', '255.255.0.0')) return 'DIRECT';
// else return 'PROXY proxy.mydomain.com:8080';
// }
// function FindProxyForURL(url, host) {
// if (isPlainHostName(host) ||
// dnsDomainIs(host, '.mydomain.com') ||
// isInNet(host, '198.95.0.0', '255.255.0.0')) {
// return 'DIRECT';
// } else {
// return 'PROXY proxy.mydomain.com:8080';
// }
// }
// example 5
// function FindProxyForURL(url, host) {
// if (isPlainHostName(host) || dnsDomainIs(host, '.mydomain.com')) return 'DIRECT';
// else if (shExpMatch(host, '*.com')) return 'PROXY proxy1.mydomain.com:8080; ' +
// 'PROXY proxy4.mydomain.com:8080';
// else if (shExpMatch(host, '*.edu')) return 'PROXY proxy2.mydomain.com:8080; ' +
// 'PROXY proxy4.mydomain.com:8080';
// else return 'PROXY proxy3.mydomain.com:8080; ' +
// 'PROXY proxy4.mydomain.com:8080';
// }
// example 6
// function FindProxyForURL(url, host) {
// if (url.substring(0, 5) == 'http:') {
// return 'PROXY http-proxy.mydomain.com:8080';
// }
// else if (url.substring(0, 4) == 'ftp:') {
// return 'PROXY ftp-proxy.mydomain.com:8080';
// }
// else if (url.substring(0, 7) == 'gopher:') {
// return 'PROXY gopher-proxy.mydomain.com:8080';
// }
// else if (url.substring(0, 6) == 'https:' ||
// url.substring(0, 6) == 'snews:') {
// return 'PROXY security-proxy.mydomain.com:8080';
// } else {
// return 'DIRECT';
// }
// }
String MYIP =
"function FindProxyForURL(url, host) {\n" +
" return 'PROXY ' + myIpAddress() + ':8080';\n" +
"}";
String myIp = InetAddress.getLocalHost().getHostAddress();
testPAC(MYIP, "http://testurl.com/", "PROXY " + myIp + ":8080");
}
}