diff --git a/LaunchServer/resources/launchserver/defaults/profile1.10.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.10.2.cfg index 65f8519..3aa76eb 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.10.2.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.10.2.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.11.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.11.2.cfg index 6aa6c45..42f33b4 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.11.2.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.11.2.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.4.7.cfg b/LaunchServer/resources/launchserver/defaults/profile1.4.7.cfg index ebaf2e3..608311d 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.4.7.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.4.7.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg index 69d6f92..296d4c2 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg b/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg index 9f49f5c..51b1455 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.7.10.cfg b/LaunchServer/resources/launchserver/defaults/profile1.7.10.cfg index f7eabaa..ac3309b 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.7.10.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.7.10.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg index 55eca61..6811f57 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.8.9.cfg b/LaunchServer/resources/launchserver/defaults/profile1.8.9.cfg index e55ad25..2869cff 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.8.9.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.8.9.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.9.4.cfg b/LaunchServer/resources/launchserver/defaults/profile1.9.4.cfg index 076efcc..2653508 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.9.4.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.9.4.cfg @@ -12,6 +12,7 @@ serverPort: 25565; # Updater and client watch service +updateFastCheck: true; update: [ "servers\\.dat" ]; diff --git a/Launcher.pro b/Launcher.pro new file mode 100644 index 0000000..11b76aa --- /dev/null +++ b/Launcher.pro @@ -0,0 +1,53 @@ +-injars 'Launcher.jar' +-outjars 'Launcher-obf.jar' +-libraryjars 'build/libraries/jansi-1.11.jar' +-libraryjars '/lib/rt.jar' +-libraryjars '/lib/jce.jar' +-libraryjars '/lib/ext/jfxrt.jar' +-libraryjars '/lib/ext/nashorn.jar' + +-printmapping 'build/mapping.pro' +-keepattributes SourceFile,LineNumberTable +-renamesourcefileattribute Source + +-dontnote +-dontshrink +-dontoptimize +-target 8 +-forceprocessing + +-obfuscationdictionary 'build/dictionary.pro' +-classobfuscationdictionary 'build/dictionary.pro' +-overloadaggressively +-repackageclasses 'launcher' +-keepattributes SourceFile,LineNumberTable +-renamesourcefileattribute SourceFile +-adaptresourcefilecontents META-INF/MANIFEST.MF + +-keeppackagenames com.eclipsesource.json.** + +-keep class com.eclipsesource.json.** { + ; + ; +} + +-keepclassmembers @launcher.LauncherAPI class ** { + ; + ; +} + +-keepclassmembers class ** { + @launcher.LauncherAPI + ; + @launcher.LauncherAPI + ; +} + +-keepclassmembers public class ** { + public static void main(java.lang.String[]); +} + +-keepclassmembers enum ** { + public static **[] values(); + public static ** valueOf(java.lang.String); +} diff --git a/Launcher.stringer b/Launcher.stringer new file mode 100644 index 0000000..7fd8144 --- /dev/null +++ b/Launcher.stringer @@ -0,0 +1,18 @@ + + + true + none + build/dictionary.pro + + + glob:launcher/** + + + + + true + false + false + + + diff --git a/Launcher/TODO.txt b/Launcher/TODO.txt deleted file mode 100644 index 661a875..0000000 --- a/Launcher/TODO.txt +++ /dev/null @@ -1 +0,0 @@ -3) сделать 1.5.2 diff --git a/Launcher/source/client/ClientProfile.java b/Launcher/source/client/ClientProfile.java index 68b6100..3304b44 100644 --- a/Launcher/source/client/ClientProfile.java +++ b/Launcher/source/client/ClientProfile.java @@ -12,6 +12,7 @@ import launcher.serialize.HInput; import launcher.serialize.config.ConfigObject; import launcher.serialize.config.entry.BlockConfigEntry; +import launcher.serialize.config.entry.BooleanConfigEntry; import launcher.serialize.config.entry.ConfigEntry.Type; import launcher.serialize.config.entry.IntegerConfigEntry; import launcher.serialize.config.entry.ListConfigEntry; @@ -38,7 +39,7 @@ private final ListConfigEntry update; private final ListConfigEntry updateExclusions; private final ListConfigEntry updateVerify; - //private final BooleanConfigEntry updateFastCheck; + private final BooleanConfigEntry updateFastCheck; // Client launcher private final StringConfigEntry mainClass; @@ -64,7 +65,7 @@ update = block.getEntry("update", ListConfigEntry.class); updateVerify = block.getEntry("updateVerify", ListConfigEntry.class); updateExclusions = block.getEntry("updateExclusions", ListConfigEntry.class); - //updateFastCheck = block.getEntry("updateFastCheck", BooleanConfigEntry.class); + updateFastCheck = block.getEntry("updateFastCheck", BooleanConfigEntry.class); // Client launcher mainClass = block.getEntry("mainClass", StringConfigEntry.class); @@ -167,6 +168,11 @@ } @LauncherAPI + public boolean isUpdateFastCheck() { + return updateFastCheck.getValue(); + } + + @LauncherAPI public void verify() { // Version getVersion(); diff --git a/Launcher/source/helper/SecurityHelper.java b/Launcher/source/helper/SecurityHelper.java index 0c97793..ca66736 100644 --- a/Launcher/source/helper/SecurityHelper.java +++ b/Launcher/source/helper/SecurityHelper.java @@ -411,9 +411,12 @@ } private static Cipher newCipher(String algo) { + // IDK Why, but collapsing catch blocks makes ProGuard generate invalid stackmap try { return Cipher.getInstance(algo); - } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { + } catch (NoSuchAlgorithmException e) { + throw new InternalError(e); + } catch (NoSuchPaddingException e) { throw new InternalError(e); } } diff --git a/Launcher/source/request/update/LauncherRequest.java b/Launcher/source/request/update/LauncherRequest.java index cd9652f..0a88482 100644 --- a/Launcher/source/request/update/LauncherRequest.java +++ b/Launcher/source/request/update/LauncherRequest.java @@ -69,6 +69,8 @@ if (Config.ADDRESS_OVERRIDE != null) { args.add(ClientLauncher.jvmProperty(Config.ADDRESS_OVERRIDE_PROPERTY, Config.ADDRESS_OVERRIDE)); } + args.add("-jar"); + args.add(BINARY_PATH.toString()); ProcessBuilder builder = new ProcessBuilder(args.toArray(new String[args.size()])); builder.inheritIO(); diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..33ffc31 --- /dev/null +++ b/build.bat @@ -0,0 +1,24 @@ +@ECHO OFF + +REM Build Launcher.jar +echo Building Launcher.jar... +jar -uf Launcher.jar buildnumber +java -jar build/proguard.jar @Launcher.pro +del Launcher.jar +ren Launcher-obf.jar Launcher.jar +pack200 -E9 -Htrue -mlatest -Uerror -r Launcher.jar +java -jar build/stringer.jar -configFile Launcher.stringer Launcher.jar Launcher.jar +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER Launcher.jar sashok724 +pack200 Launcher.pack.gz Launcher.jar + +REM Build LauncherAuthlib.jar +echo Building LauncherAuthlib.jar... +pack200 -E9 -Htrue -mlatest -Uerror -r LauncherAuthlib.jar +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LauncherAuthlib.jar sashok724 + +REM Build LaunchServer.jar +echo Building LaunchServer.jar... +jar -uf LaunchServer.jar Launcher.pack.gz buildnumber +pack200 -E9 -Htrue -mlatest -Uerror -r LaunchServer.jar +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LaunchServer.jar sashok724 +del Launcher.pack.gz diff --git a/build.sh b/build.sh deleted file mode 100644 index 77c9bea..0000000 --- a/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -e - -# Increase build number -echo -n $(($(cat buildnumber | cut -d ',' -f 1)+1)), $(date +'%d.%m.%Y') > buildnumber - -# Build Launcher.jar -echo 'Packing Launcher.jar binary' -zip -9 Launcher.jar buildnumber -pack200 -E9 -Htrue -mlatest -Uerror -r Launcher.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER Launcher.jar sashok724 -pack200 Launcher.pack.gz Launcher.jar - -# Build LauncherAuthlib.jar -echo 'Packing LauncherAuthlib.jar binary' -pack200 -E9 -Htrue -mlatest -Uerror -r LauncherAuthlib.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LauncherAuthlib.jar sashok724 - -# Build LaunchServer.jar -echo 'Packing LaunchServer.jar binary' -zip -9 LaunchServer.jar Launcher.pack.gz buildnumber -pack200 -E9 -Htrue -mlatest -Uerror -r LaunchServer.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LaunchServer.jar sashok724 -rm Launcher.pack.gz diff --git a/compat/BungeeCord.patch b/compat/BungeeCord.patch index 80a425f..0a60ec5 100644 --- a/compat/BungeeCord.patch +++ b/compat/BungeeCord.patch @@ -1,7 +1,10 @@ -diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 5c42c6f..2f5ac13 100644 ---- a/bootstrap/pom.xml -+++ b/bootstrap/pom.xml +Index: bootstrap/pom.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- bootstrap/pom.xml (revision 53cc3242e1d2786c34b2e138d233c4eeca8e3b1d) ++++ bootstrap/pom.xml (revision ) @@ -57,7 +57,8 @@ @@ -12,88 +15,14 @@ ${describe} ${maven.build.timestamp} -diff --git a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -index b7cb81e..6be2273 100644 ---- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -+++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java -@@ -5,9 +5,9 @@ public class Bootstrap - - public static void main(String[] args) throws Exception - { -- if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) -+ if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 ) - { -- System.err.println( "*** ERROR *** BungeeCord requires Java 7 or above to function! Please download and install it!" ); -+ System.err.println( "*** ERROR *** BungeeCord requires Java 8 or above to function! Please download and install it!" ); - System.out.println( "You can check your Java version with the command: java -version" ); - return; - } -diff --git a/pom.xml b/pom.xml -index 7f9564c..1d04d57 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -67,8 +67,8 @@ - - unknown - 4.1.6.Final -- 1.7 -- 1.7 -+ 1.8 -+ 1.8 - UTF-8 - - -@@ -97,6 +97,13 @@ - 1.14.8 - provided - -+ -+ launcher -+ clientside -+ 12.0+ -+ system -+ /full/path/to/Launcher.jar -+ - - - -@@ -117,31 +124,6 @@ - - - -- -- org.codehaus.mojo -- animal-sniffer-maven-plugin -- 1.13 -- -- -- process-classes -- -- check -- -- -- -- -- -- java.lang.ClassLoader -- java.lang.Throwable -- java.util.Locale -- -- -- org.codehaus.mojo.signature -- java16 -- 1.1 -- -- -- - - - org.apache.maven.plugins -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -index d87b03c..08efeb4 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -@@ -63,6 +63,9 @@ import net.md_5.bungee.protocol.packet.StatusRequest; +Index: proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java (revision 53cc3242e1d2786c34b2e138d233c4eeca8e3b1d) ++++ proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java (revision ) +@@ -63,6 +63,9 @@ import net.md_5.bungee.protocol.packet.StatusResponse; import net.md_5.bungee.util.BoundedArrayList; @@ -103,7 +32,7 @@ @RequiredArgsConstructor public class InitialHandler extends PacketHandler implements PendingConnection { -@@ -262,7 +265,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -261,7 +264,7 @@ this.handshake = handshake; ch.setVersion( handshake.getProtocolVersion() ); @@ -112,12 +41,12 @@ // with Bungee's IP forwarding, so we detect it, and remove it from the host string, for now. // We know FML appends \00FML\00. However, we need to also consider that other systems might // add their own data to the end of the string. So, we just take everything from the \0 character -@@ -403,35 +406,25 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -402,35 +405,26 @@ { sha.update( bit ); } - String encodedHash = URLEncoder.encode( new BigInteger( sha.digest() ).toString( 16 ), "UTF-8" ); -- + - String authURL = "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=" + encName + "&serverId=" + encodedHash; - - Callback handler = new Callback() @@ -135,7 +64,7 @@ - finish(); - return; - } -- disconnect( "Not authenticated with Minecraft.net" ); +- disconnect( bungee.getTranslation( "offline_mode_player" ) ); - } else - { - disconnect( bungee.getTranslation( "mojang_fail" ) ); @@ -165,11 +94,33 @@ } private void finish() -diff --git a/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java b/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java -index 9311ef7..98bba42 100644 ---- a/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java -+++ b/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java -@@ -3,6 +3,17 @@ package net.md_5.bungee.connection; +Index: bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java (revision 53cc3242e1d2786c34b2e138d233c4eeca8e3b1d) ++++ bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java (revision ) +@@ -5,9 +5,9 @@ + + public static void main(String[] args) throws Exception + { +- if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) ++ if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 ) + { +- System.err.println( "*** ERROR *** BungeeCord requires Java 7 or above to function! Please download and install it!" ); ++ System.err.println( "*** ERROR *** BungeeCord requires Java 8 or above to function! Please download and install it!" ); + System.out.println( "You can check your Java version with the command: java -version" ); + return; + } +Index: proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java (revision 53cc3242e1d2786c34b2e138d233c4eeca8e3b1d) ++++ proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java (revision ) +@@ -3,6 +3,17 @@ import lombok.AllArgsConstructor; import lombok.Data; @@ -187,7 +138,7 @@ @Data @AllArgsConstructor public class LoginResult -@@ -11,6 +22,20 @@ public class LoginResult +@@ -11,6 +22,20 @@ private String id; private Property[] properties; @@ -208,3 +159,67 @@ @Data @AllArgsConstructor public static class Property +Index: pom.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- pom.xml (revision 53cc3242e1d2786c34b2e138d233c4eeca8e3b1d) ++++ pom.xml (revision ) +@@ -67,8 +67,8 @@ + + unknown + 4.1.9.Final +- 1.7 +- 1.7 ++ 1.8 ++ 1.8 + UTF-8 + + +@@ -97,6 +97,13 @@ + 1.16.12 + provided + ++ ++ launcher ++ clientside ++ 12.0+ ++ system ++ /full/path/to/Launcher.jar ++ + + + +@@ -116,31 +123,6 @@ + + + +- +- +- org.codehaus.mojo +- animal-sniffer-maven-plugin +- 1.13 +- +- +- process-classes +- +- check +- +- +- +- +- +- java.lang.ClassLoader +- java.lang.Throwable +- java.util.Locale +- +- +- org.codehaus.mojo.signature +- java16 +- 1.1 +- +- + + +