Main -> GEarth

This commit is contained in:
sirjonasxx 2022-02-12 04:01:18 +01:00
parent 34889f88f1
commit 4a7c256d70
24 changed files with 64 additions and 63 deletions

View File

@ -8,8 +8,6 @@
<packaging>jar</packaging>
<version>1.5.1</version>
<properties>
<javafx.version>1.8</javafx.version>
<jettyVersion>9.4.41.v20210516</jettyVersion>
@ -55,7 +53,9 @@
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>Dependencies/</classpathPrefix>
<mainClass>gearth.Main</mainClass>
<mainClass>gearth.GEarth</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>

View File

@ -1,3 +1,3 @@
Manifest-Version: 1.0
Main-Class: gearth.Main
Main-Class: gearth.GEarth

View File

@ -12,7 +12,7 @@ import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
public class Main extends Application {
public class GEarth extends Application {
public static Application main;
public static String version = "1.5.1";
@ -62,7 +62,7 @@ public class Main extends Application {
public static String[] args;
public static void main(String[] args) {
Main.args = args;
GEarth.args = args;
launch(args);
}

View File

@ -1,6 +1,6 @@
package gearth.extensions;
import gearth.Main;
import gearth.GEarth;
import gearth.protocol.HPacket;
@ -32,7 +32,7 @@ public class InternalExtension extends ExtensionBase {
@Override
public boolean requestFlags(FlagsCheckListener flagRequestCallback) {
flagRequestCallback.act(Main.args);
flagRequestCallback.act(GEarth.args);
return true;
}

View File

@ -1,6 +1,6 @@
package gearth.extensions;
import gearth.Main;
import gearth.GEarth;
import gearth.services.extension_handler.extensions.GEarthExtension;
import gearth.services.extension_handler.extensions.extensionproducers.ExtensionProducerObserver;
import javafx.application.Platform;
@ -51,7 +51,7 @@ public class InternalExtensionFormBuilder<L extends InternalExtensionFormLaunche
return extensionForm.canDelete();
}
};
extensionForm.hostServices = Main.main.getHostServices();
extensionForm.hostServices = GEarth.main.getHostServices();
extensionForm.extension = internalExtension;
extensionForm.primaryStage = stage;

View File

@ -1,6 +1,6 @@
package gearth.misc;
import gearth.Main;
import gearth.GEarth;
import org.json.JSONArray;
import org.json.JSONObject;
@ -22,7 +22,7 @@ public class Cacher {
static {
File GEarthDir = null;
try {
GEarthDir = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile();
GEarthDir = new File(GEarth.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile();
if (GEarthDir.getName().equals("Extensions")) {
GEarthDir = GEarthDir.getParentFile();
}

View File

@ -1,6 +1,6 @@
package gearth.misc;
import gearth.Main;
import gearth.GEarth;
import javafx.application.Platform;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
@ -17,8 +17,8 @@ import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import static gearth.Main.gitApi;
import static gearth.Main.version;
import static gearth.GEarth.gitApi;
import static gearth.GEarth.version;
public class UpdateChecker {
@ -41,7 +41,7 @@ public class UpdateChecker {
Hyperlink link = new Hyperlink("https://github.com/sirjonasxx/G-Earth/releases");
fp.getChildren().addAll( lbl, link);
link.setOnAction(event -> {
Main.main.getHostServices().showDocument(link.getText());
GEarth.main.getHostServices().showDocument(link.getText());
event.consume();
});

View File

@ -1,6 +1,6 @@
package gearth.protocol.memory;
import gearth.Main;
import gearth.GEarth;
import gearth.protocol.HConnection;
import gearth.protocol.HMessage;
import gearth.protocol.HPacket;
@ -86,7 +86,7 @@ public class Rc4Obtainer {
Hyperlink link = new Hyperlink("https://github.com/sirjonasxx/G-Earth/wiki/Troubleshooting");
fp.getChildren().addAll( lbl, link);
link.setOnAction(event -> {
Main.main.getHostServices().showDocument(link.getText());
GEarth.main.getHostServices().showDocument(link.getText());
event.consume();
});
@ -96,7 +96,7 @@ public class Rc4Obtainer {
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.getDialogPane().setContent(fp);
alert.setOnCloseRequest(event -> {
Main.main.getHostServices().showDocument(link.getText());
GEarth.main.getHostServices().showDocument(link.getText());
});
alert.show();

View File

@ -1,6 +1,6 @@
package gearth.services.extension_handler;
import gearth.Main;
import gearth.GEarth;
import gearth.misc.listenerpattern.Observable;
import gearth.protocol.HConnection;
import gearth.protocol.HMessage;
@ -184,7 +184,7 @@ public class ExtensionHandler {
ExtensionListener listener = new ExtensionListener() {
@Override
public void flagsRequest() {
extension.provideFlags(Main.args);
extension.provideFlags(GEarth.args);
}
@Override

View File

@ -1,6 +1,6 @@
package gearth.services.extension_handler.extensions.implementations.network.executer;
import gearth.Main;
import gearth.GEarth;
import gearth.services.extension_handler.extensions.implementations.network.authentication.Authenticator;
import gearth.services.internal_extensions.extensionstore.tools.StoreExtensionTools;
@ -23,9 +23,9 @@ public class NormalExtensionRunner implements ExtensionRunner {
static {
String value;
try {
value = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent();
value = new File(GEarth.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent();
} catch (URISyntaxException e) {
value = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParent();
value = new File(GEarth.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParent();
e.printStackTrace();
}
JARPATH = value;
@ -115,7 +115,7 @@ public class NormalExtensionRunner implements ExtensionRunner {
}
public static void maybeLogExtension(String path, Process proc) {
if (Main.hasFlag(ExtensionRunner.SHOW_EXTENSIONS_LOG)) {
if (GEarth.hasFlag(ExtensionRunner.SHOW_EXTENSIONS_LOG)) {
String sep = "" + System.lineSeparator();
synchronized (System.out) {
System.out.println(path + sep + "Launching" + sep + "----------" + sep);

View File

@ -1,6 +1,6 @@
package gearth.services.g_python;
import gearth.Main;
import gearth.GEarth;
import gearth.ui.extra.ExtraController;
import javafx.application.Platform;
import javafx.scene.control.Alert;
@ -177,7 +177,7 @@ public class GPythonShell {
Hyperlink link = new Hyperlink(ExtraController.INFO_URL_GPYTHON);
fp.getChildren().addAll(lbl, link);
link.setOnAction(event -> {
Main.main.getHostServices().showDocument(link.getText());
GEarth.main.getHostServices().showDocument(link.getText());
event.consume();
});

View File

@ -1,6 +1,6 @@
package gearth.services.internal_extensions.extensionstore;
import gearth.Main;
import gearth.GEarth;
import gearth.extensions.InternalExtensionFormLauncher;
import gearth.services.internal_extensions.extensionstore.application.GExtensionStoreController;
import gearth.ui.GEarthController;
@ -26,8 +26,8 @@ public class GExtensionStoreLauncher extends InternalExtensionFormLauncher<GExte
stage.setHeight(530);
stage.setScene(new Scene(root));
stage.getScene().getStylesheets().add(GEarthController.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(GEarthController.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
GExtensionStore gExtensionStore = new GExtensionStore();

View File

@ -1,6 +1,6 @@
package gearth.services.internal_extensions.extensionstore.repository;
import gearth.Main;
import gearth.GEarth;
import gearth.services.internal_extensions.extensionstore.repository.models.StoreData;
import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
@ -19,7 +19,7 @@ public class StoreFetch {
}
public static void fetch(StoreFetchListener storeFetchListener) {
fetch(Main.version, storeFetchListener, "sirjonasxx/G-ExtensionStore");
fetch(GEarth.version, storeFetchListener, "sirjonasxx/G-ExtensionStore");
}
public static void fetch(String version, StoreFetchListener storeFetchListener) {

View File

@ -1,6 +1,6 @@
package gearth.services.internal_extensions.extensionstore.tools;
import gearth.Main;
import gearth.GEarth;
import gearth.misc.OSValidator;
import gearth.services.extension_handler.extensions.implementations.network.authentication.Authenticator;
import gearth.services.extension_handler.extensions.implementations.network.executer.ExecutionInfo;
@ -242,7 +242,7 @@ public class StoreExtensionTools {
}
public static void main(String[] args) {
StoreFetch.fetch(Main.version, new StoreFetch.StoreFetchListener() {
StoreFetch.fetch(GEarth.version, new StoreFetch.StoreFetchListener() {
@Override
public void success(StoreRepository storeRepository) {
installExtension("G-BuildTools", storeRepository, new InstallExtListener() {

View File

@ -1,6 +1,6 @@
package gearth.services.internal_extensions.uilogger;
import gearth.Main;
import gearth.GEarth;
import gearth.extensions.InternalExtensionFormLauncher;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -17,12 +17,12 @@ public class UiLoggerLauncher extends InternalExtensionFormLauncher<UiLogger> {
FXMLLoader loader = new FXMLLoader(UiLogger.class.getResource("UiLogger.fxml"));
Parent root = loader.load();
stage.setTitle(String.format("%s | Packet Logger", Main.theme));
stage.setTitle(String.format("%s | Packet Logger", GEarth.theme));
stage.initModality(Modality.NONE);
stage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
Scene scene = new Scene(root);
scene.getStylesheets().add(String.format("/gearth/themes/%s/styling.css", Main.theme));
scene.getStylesheets().add(String.format("/gearth/themes/%s/styling.css", GEarth.theme));
scene.getStylesheets().add("/gearth/services/internal_extensions/uilogger/logger.css");
UiLoggerController controller = loader.getController();

View File

@ -1,6 +1,6 @@
package gearth.services.packet_info.providers.implementations;
import gearth.Main;
import gearth.GEarth;
import gearth.services.packet_info.PacketInfo;
import gearth.services.packet_info.providers.PacketInfoProvider;
import gearth.protocol.HMessage;
@ -21,7 +21,7 @@ public class GEarthUnityPacketInfoProvider extends PacketInfoProvider {
@Override
protected File getFile() {
try {
return new File(new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI())
return new File(new File(GEarth.class.getProtectionDomain().getCodeSource().getLocation().toURI())
.getParentFile(), "messages.json");
} catch (URISyntaxException e) {
e.printStackTrace();

View File

@ -1,6 +1,6 @@
package gearth.services.unity_tools;
import gearth.Main;
import gearth.GEarth;
import gearth.misc.Cacher;
import javax.servlet.ServletOutputStream;
@ -135,7 +135,7 @@ public class GUnityFileServer extends HttpServlet
private void getLogo(HttpServletResponse response) throws IOException {
OutputStream out = response.getOutputStream();
InputStream in = Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logo.png", Main.theme));
InputStream in = GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logo.png", GEarth.theme));
byte[] bytes = new byte[4096];
int bytesRead;

View File

@ -1,6 +1,6 @@
package gearth.ui.connection;
import gearth.Main;
import gearth.GEarth;
import gearth.misc.Cacher;
import gearth.protocol.connection.HClient;
import gearth.protocol.connection.HState;
@ -221,12 +221,12 @@ public class ConnectionController extends SubForm {
}
private void maybeConnectOnInit() {
String connectMode = Main.getArgument("--connect", "-c");
String connectMode = GEarth.getArgument("--connect", "-c");
if (connectMode != null) {
if (connectMode.equals("flash")) {
Platform.runLater(() -> rd_flash.setSelected(true));
String host = Main.getArgument("--host");
String port = Main.getArgument("--port");
String host = GEarth.getArgument("--host");
String port = GEarth.getArgument("--port");
if (host != null && port != null) {
Platform.runLater(() -> {
if (!inpHost.getItems().contains(host)) inpHost.getItems().add(host);

View File

@ -1,6 +1,6 @@
package gearth.ui.extensions.logger;
import gearth.Main;
import gearth.GEarth;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
@ -35,15 +35,15 @@ public class ExtensionLogger {
stage = new Stage();
stage.setTitle(String.format("%s | Extension Console", Main.theme));
stage.setTitle(String.format("%s | Extension Console", GEarth.theme));
stage.initModality(Modality.NONE);
stage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
stage.setAlwaysOnTop(true);
stage.setMinHeight(235);
stage.setMinWidth(370);
Scene scene = new Scene(root);
scene.getStylesheets().add(String.format("/gearth/themes/%s/styling.css", Main.theme));
scene.getStylesheets().add(String.format("/gearth/themes/%s/styling.css", GEarth.theme));
scene.getStylesheets().add("/gearth/ui/extensions/logger/logger.css");
ExtensionLoggerController controller = loader.getController();
controller.setStage(stage);

View File

@ -1,10 +1,8 @@
package gearth.ui.extra;
import gearth.Main;
import gearth.GEarth;
import gearth.misc.Cacher;
import gearth.protocol.HConnection;
import gearth.protocol.HMessage;
import gearth.protocol.TrafficListener;
import gearth.protocol.connection.HState;
import gearth.protocol.connection.proxy.ProxyProviderFactory;
import gearth.protocol.connection.proxy.SocksConfiguration;
@ -183,7 +181,7 @@ public class ExtraController extends SubForm implements SocksConfiguration {
Hyperlink link = new Hyperlink(INFO_URL_GPYTHON);
fp.getChildren().addAll( lbl, link);
link.setOnAction(event -> {
Main.main.getHostServices().showDocument(link.getText());
GEarth.main.getHostServices().showDocument(link.getText());
event.consume();
});

View File

@ -1,6 +1,6 @@
package gearth.ui.info;
import gearth.Main;
import gearth.GEarth;
import javafx.event.ActionEvent;
import javafx.scene.control.*;
import gearth.ui.SubForm;
@ -27,16 +27,16 @@ public class InfoController extends SubForm {
link.setOnAction((ActionEvent event) -> {
Hyperlink h = (Hyperlink) event.getTarget();
String s = h.getTooltip().getText();
Main.main.getHostServices().showDocument(s);
GEarth.main.getHostServices().showDocument(s);
event.consume();
});
}
public void initialize() {
version.setText(version.getText().replace("$theme", Main.theme));
version.setText(version.getText().replace("$version", Main.version));
version.setText(version.getText().replace("$theme", GEarth.theme));
version.setText(version.getText().replace("$version", GEarth.version));
img_logo.setImage(new Image(String.format("/gearth/themes/%s/logo.png", Main.theme)));
img_logo.setImage(new Image(String.format("/gearth/themes/%s/logo.png", GEarth.theme)));
link_darkbox.setTooltip(new Tooltip("https://darkbox.nl"));
link_d_gearth.setTooltip(new Tooltip("https://discord.gg/AVkcF8y"));

View File

@ -1,6 +1,6 @@
package gearth.ui.logger.loggerdisplays;
import gearth.Main;
import gearth.GEarth;
import gearth.extensions.InternalExtensionFormBuilder;
import gearth.misc.OSValidator;
import gearth.services.extension_handler.ExtensionHandler;
@ -17,7 +17,7 @@ public class PacketLoggerFactory implements ExtensionProducer {
private UiLogger uiLogger;
public static boolean usesUIlogger() {
return (!Main.hasFlag("-t"));
return (!GEarth.hasFlag("-t"));
}
public PacketLoggerFactory(ExtensionHandler handler) {

View File

@ -6,7 +6,7 @@ If you're using a mac; make sure you have completed the mac-installation wiki pa
## Problem 1: G-Earth doesn't open
* It's recommended to use Java 8, some problems have occurred with people using Java 11 or other versions. It shouldn't be hard to fix this with a simple google search.
* On Linux, if you get a "Invalid MIT-MAGIC-COOKIE-1" exception, execute "xhost +local:" in a terminal
* On Linux, if you get a "could not find or load main class gearth.Main", javafx might not be installed. Execute "apt install openjfx" to install javafx
* On Linux, if you get a "could not find or load main class gearth.GEarth", javafx might not be installed. Execute "apt install openjfx" to install javafx
* It will almost always be an issue with Java, so try reinstalling
## Problem 2: Stuck at 76% or 57%

View File

@ -7,12 +7,15 @@
<groupId>G-Earth</groupId>
<artifactId>G-Earth-Parent</artifactId>
<packaging>pom</packaging>
<version>1.5.1</version>
<version>${revision}</version>
<name>G-Earth-Parent</name>
<url>https://github.com/sirjonasxx/G-Earth</url>
<description>Cross Platform Habbo packetlogger/manipulator</description>
<properties>
<revision>1.5.1</revision>
</properties>
<modules>
<module>G-Earth</module>
</modules>