Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Move rewrite to master
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed Sep 21, 2024
1 parent 03bcc06 commit 148826a
Show file tree
Hide file tree
Showing 1,846 changed files with 9,445 additions and 20,881 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Zyneon Application ```2024.8.1f (Neo Primalia)``` [Download latest version](https://github.com/danieldieeins/Zyneon-Application/releases/latest)
<br>`Contributions are welcome!` [Visit the rewrite branch to contribute](https://github.com/danieldieeins/Zyneon-Application/tree/shervann)
Zyneon Application ```2024.9-prerelease.1 (Praeparatio)``` [Download latest version](https://github.com/danieldieeins/Zyneon-Application/releases/latest)
<br>`Contributions are welcome!`

Download the Zyneon Application from https://github.com/danieldieeins/Zyneon-Application/releases and https://nexus.zyneonstudios.com/application only! All other sources are not verified and we assume no liability!

Expand Down
53 changes: 0 additions & 53 deletions application-main/TODO.md

This file was deleted.

71 changes: 12 additions & 59 deletions application-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,36 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.zyneonstudios</groupId>
<artifactId>application-parent</artifactId>
<version>2024.8</version>
<groupId>com.zyneonstudios.nexus</groupId>
<artifactId>application</artifactId>
<version>2024.9</version>
</parent>

<artifactId>application-main</artifactId>
<version>2024.8.1f</version>
<version>2024.9-prerelease.1</version>
<name>Praeparatio (2.0.0-build377)</name>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>zyneonstudios-repo-releases</id>
<name>Zyneon Studios Repository</name>
<url>https://maven.zyneonstudios.com/releases</url>
</repository>
<repository>
<id>zyneonstudios-repo-private</id>
<name>Zyneon Studios Repository</name>
<url>https://maven.zyneonstudios.com/private</url>
</repository>
</repositories>

<dependencies>
<!--Dependencies by Zyneon Studios' NEXUS Team-->
<dependency>
<groupId>com.zyneonstudios</groupId>
<artifactId>nexus-zyndex</artifactId>
<version>2024.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.zyneonstudios</groupId>
<artifactId>nexus-auth</artifactId>
<version>2024.8</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.zyneonstudios</groupId>
<artifactId>verget-all</artifactId>
<version>2024.8</version>
<groupId>com.zyneonstudios.nexus</groupId>
<artifactId>zyndex-java</artifactId>
<version>2024.9</version>
<scope>compile</scope>
</dependency>

<!--Dependencies by FlowArg-->
<dependency>
<groupId>fr.flowarg</groupId>
<artifactId>flowupdater</artifactId>
<version>1.8.5</version>
<groupId>com.zyneonstudios.nexus</groupId>
<artifactId>base-desktop</artifactId>
<version>2024.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>fr.flowarg</groupId>
<artifactId>openlauncherlib</artifactId>
<version>3.2.11</version>
<scope>compile</scope>
</dependency>

<!--Something... that is used?.... in the code?-->
<dependency>
<groupId>com.moandjiezana.toml</groupId>
<artifactId>toml4j</artifactId>
<version>LATEST</version>
</dependency>

<!--Fix vulnerabilities from dependencies with newer versions of their dependencies-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -108,7 +62,6 @@
<version>3.8.1</version>
<configuration>
<source>21</source>
<target>21</target>
<release>21</release>
</configuration>
</plugin>
Expand Down
Binary file modified application-main/src/deb/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified application-main/src/deb/updater.jar
Binary file not shown.
130 changes: 7 additions & 123 deletions application-main/src/main/java/com/zyneonstudios/Main.java
Original file line number Diff line number Diff line change
@@ -1,134 +1,18 @@
package com.zyneonstudios;

import com.zyneonstudios.application.Application;
import com.zyneonstudios.application.installer.java.Architecture;
import com.zyneonstudios.application.installer.java.OperatingSystem;
import com.zyneonstudios.application.utils.ZLogger;
import com.zyneonstudios.application.utils.frame.ZyneonSplash;
import live.nerotv.shademebaby.ShadeMeBaby;
import live.nerotv.shademebaby.utils.FileUtil;

import java.io.File;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import com.zyneonstudios.application.frame.ZyneonSplash;
import com.zyneonstudios.application.main.NexusApplication;
import com.zyneonstudios.nexus.desktop.NexusDesktop;

public class Main {

private static String applicationPath;
public static ZyneonSplash splash;
private static ZLogger logger;
public static String version;
public static OperatingSystem operatingSystem;
public static Architecture architecture;
private static boolean test = false;
public static ZyneonSplash splash = null;

public static void main(String[] args) {
splash = new ZyneonSplash();
splash.setVisible(true);
FileUtil.deleteFolder(new File(getDirectoryPath()+"temp/"));
version = "2024.8.1f";
ArrayList<String> arguments = new ArrayList<>();
String name = "Neo Primalia";
architecture = getArchitecture();
logger = new ZLogger("ZYNEON");
String fullVersion = version+" ▪ "+name;
logger.log("[MAIN] Updated user interface: "+update());
boolean online = false;
for(String arg:args) {
arg = arg.toLowerCase();
switch (arg) {
case "--test" -> {
test = true;
version = new SimpleDateFormat("yyyy.M.d-HHmmss").format(Calendar.getInstance().getTime());
name = "Test";
fullVersion = version+" ▪ "+name;
}
case "--debug" -> {
logger.setDebugEnabled(true);
ShadeMeBaby.getLogger().setDebugEnabled(true);
}
case "--online" -> online = true;
}
}
arguments.add(fullVersion);
System.gc();
logger.log("[MAIN] Launching Zyneon Application version "+fullVersion+"...");
Application application = new Application(arguments);
application.start(online);
}

public static ZLogger getLogger() {
return logger;
}

private static boolean update() {
boolean updated;
try {
new File(getDirectoryPath() + "libs/zyneon/instances.json").delete();
logger.log("[MAIN] Deleted old user interface files: " + new File(getDirectoryPath() + "libs/zyneon/").mkdirs());
logger.log("[MAIN] Created new user interface extraction folder: " + new File(getDirectoryPath() + "temp/ui/").mkdirs());
FileUtil.extractResourceFile("content.zip",getDirectoryPath()+"temp/content.zip",Main.class);
FileUtil.unzipFile(getDirectoryPath()+"temp/content.zip", getDirectoryPath() + "temp/ui");
logger.log("[MAIN] Deleted user interface archive: " + new File(getDirectoryPath()+"temp/content.zip").delete());
updated = true;
} catch (Exception e) {
logger.error("[MAIN] Couldn't update application user interface: "+e.getMessage());
updated = false;
}
logger.log("[MAIN] Deleted old updater json: " + new File(getDirectoryPath() + "updater.json").delete());
logger.log("[MAIN] Deleted old version json: " + new File(getDirectoryPath() + "version.json").delete());
return updated;
}

public static String getDirectoryPath() {
if (applicationPath == null) {
String folderName = "Zyneon/Application";
String appData;
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("win")) {
operatingSystem = OperatingSystem.Windows;
appData = System.getenv("LOCALAPPDATA");
} else if (os.contains("mac")) {
operatingSystem = OperatingSystem.macOS;
appData = System.getProperty("user.home") + "/Library/Application Support";
} else {
operatingSystem = OperatingSystem.Linux;
appData = System.getProperty("user.home") + "/.local/share";
}
Path folderPath = Paths.get(appData, folderName);
try {
Files.createDirectories(folderPath);
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
applicationPath = folderPath + "/";
}
return URLDecoder.decode(applicationPath, StandardCharsets.UTF_8);
}

private static Architecture getArchitecture() {
String os = System.getProperty("os.arch");
ArrayList<String> aarch = new ArrayList<>();
aarch.add("ARM");
aarch.add("ARM64");
aarch.add("aarch64");
aarch.add("armv6l");
aarch.add("armv7l");
for(String arch_os:aarch) {
if(arch_os.equalsIgnoreCase(os)) {
return Architecture.aarch64;
}
}
return Architecture.x64;
}

public static boolean isTest() {
return test;
NexusDesktop.getLogger().setName("APP",true);
NexusDesktop.init();
new NexusApplication(args).launch();
}
}
Loading

0 comments on commit 148826a

Please sign in to comment.