diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index 548971fd..3b746f13 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -37,6 +37,7 @@ import pro.gravit.launcher.LauncherConfig; import pro.gravit.launcher.NeedGarbageCollection; import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.hwid.HWIDProvider; import pro.gravit.launcher.managers.ConfigManager; import pro.gravit.launcher.managers.GarbageManager; import pro.gravit.launcher.profiles.ClientProfile; @@ -495,6 +496,7 @@ public LaunchServer(Path dir, boolean testEnv, String[] args) throws IOException Component.registerComponents(); ProtectHandler.registerHandlers(); WebSocketService.registerResponses(); + HWIDProvider.registerHWIDs(); //LaunchServer.server = this; // Set command handler diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/AcceptHWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/AcceptHWIDHandler.java index b09ba0e7..16a36b0d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/AcceptHWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/AcceptHWIDHandler.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; public class AcceptHWIDHandler extends HWIDHandler { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/HWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/HWIDHandler.java index 51978a11..eadb4228 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/HWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/HWIDHandler.java @@ -2,7 +2,7 @@ import java.util.List; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.utils.ProviderMap; public abstract class HWIDHandler implements AutoCloseable { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java index 778c75f8..b181da50 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java @@ -12,7 +12,7 @@ import com.google.gson.reflect.TypeToken; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launcher.Launcher; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonHWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonHWIDHandler.java index bc605cca..8bbcb277 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonHWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/JsonHWIDHandler.java @@ -9,8 +9,8 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import pro.gravit.launcher.HWID; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.utils.HTTPRequest; import pro.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java index 1d221f37..21a719b7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Objects; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; public class MemoryHWIDHandler extends HWIDHandler { public class Entry { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MysqlHWIDHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MysqlHWIDHandler.java index 7bbe5b0e..2447034e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MysqlHWIDHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/hwid/MysqlHWIDHandler.java @@ -7,8 +7,8 @@ import java.util.ArrayList; import java.util.List; -import pro.gravit.launcher.HWID; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.launchserver.auth.MySQLSourceConfig; import pro.gravit.utils.helper.CommonHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/BanCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/BanCommand.java index e3b8b57b..89a5ce9b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/BanCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/BanCommand.java @@ -2,7 +2,7 @@ import java.util.List; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/GetHWIDCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/GetHWIDCommand.java index 1e82ec3a..3e7805a1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/GetHWIDCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/GetHWIDCommand.java @@ -2,7 +2,7 @@ import java.util.List; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/UnbanCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/UnbanCommand.java index 0effa030..f6897e8e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/UnbanCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/auth/UnbanCommand.java @@ -2,7 +2,7 @@ import java.util.List; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserDAO.java b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserDAO.java index 667ca4b0..b4769a3d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserDAO.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserDAO.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.dao; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.OshiHWID; import java.util.List; import java.util.UUID; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserHWID.java b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserHWID.java index 9d2b3f9a..106aab2a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserHWID.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/UserHWID.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.dao; -import pro.gravit.launcher.HWID; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.OshiHWID; import javax.persistence.*; import java.util.function.Supplier; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/DefaultUserDAOImpl.java b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/DefaultUserDAOImpl.java index 107e5686..49a24676 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/DefaultUserDAOImpl.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/DefaultUserDAOImpl.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.UUID; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.dao.User; import pro.gravit.launchserver.dao.UserDAO; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/HibernateUserDAOImpl.java b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/HibernateUserDAOImpl.java index 1c29dfc3..fc086c57 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/HibernateUserDAOImpl.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/dao/impl/HibernateUserDAOImpl.java @@ -12,7 +12,7 @@ import org.hibernate.SessionFactory; import org.hibernate.Transaction; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.launchserver.dao.User; import pro.gravit.launchserver.dao.UserDAO; import pro.gravit.launchserver.dao.UserHWID; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java index e6caf5ae..d636f6e0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java @@ -4,6 +4,8 @@ import pro.gravit.launcher.hasher.HashedEntry; import pro.gravit.launcher.hasher.HashedEntryAdapter; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.HWIDProvider; import pro.gravit.launcher.managers.GsonManager; import pro.gravit.launcher.request.JsonResultSerializeAdapter; import pro.gravit.launcher.request.WebSocketEvent; @@ -31,6 +33,7 @@ public void registerAdapters(GsonBuilder builder) { builder.registerTypeAdapter(Component.class, new UniversalJsonAdapter<>(Component.providers)); builder.registerTypeAdapter(ProtectHandler.class, new UniversalJsonAdapter<>(ProtectHandler.providers)); builder.registerTypeAdapter(DaoProvider.class, new UniversalJsonAdapter<>(DaoProvider.providers)); + builder.registerTypeAdapter(HWID.class, new UniversalJsonAdapter<>(HWIDProvider.hwids)); builder.registerTypeAdapter(WebSocketServerResponse.class, new UniversalJsonAdapter<>(WebSocketService.providers)); builder.registerTypeAdapter(HashedEntry.class, new HashedEntryAdapter()); builder.registerTypeAdapter(WebSocketEvent.class, new JsonResultSerializeAdapter()); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java index d732f2f3..0124074e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java @@ -9,7 +9,8 @@ import javax.crypto.IllegalBlockSizeException; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.OshiHWID; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launchserver.auth.AuthException; @@ -46,7 +47,7 @@ public AuthResponse(String login, String password, String auth_id, OshiHWID hwid public String auth_id; public boolean initProxy; public ConnectTypes authType; - public OshiHWID hwid; + public HWID hwid; public enum ConnectTypes { SERVER, CLIENT, BOT @@ -76,7 +77,7 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti AuthProviderPair pair; if (auth_id.isEmpty()) pair = server.config.getAuthProviderPair(); else pair = server.config.getAuthProviderPair(auth_id); - AuthContext context = new AuthContext(0, login, password.length(), customText, client, ip, null, authType); + AuthContext context = new AuthContext(0, login, password.length(), customText, client, null, ip, authType); AuthProvider provider = pair.provider; server.authHookManager.preHook.hook(context, clientData); provider.preAuth(login, password, customText, ip); diff --git a/Launcher/runtime/engine/api.js b/Launcher/runtime/engine/api.js index 0b07d4fb..4bae67fa 100644 --- a/Launcher/runtime/engine/api.js +++ b/Launcher/runtime/engine/api.js @@ -59,6 +59,9 @@ var VerifyHelper = VerifyHelperClass.static; var NewLauncherSettings = NewLauncherSettingsClass.static; var SettingsManager = SettingsManagerClass.static; +var NoHWID = NoHWIDClass.static; +var OshiHWID = OshiHWID.static; + // Helper JS class API imports var JSApplication = null; if (typeof JSApplicationClass !== 'undefined') { diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index c839dfd0..f2d84e0e 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -10,6 +10,7 @@ import pro.gravit.launcher.guard.LauncherGuardManager; import pro.gravit.launcher.gui.JSRuntimeProvider; import pro.gravit.launcher.gui.RuntimeProvider; +import pro.gravit.launcher.hwid.HWIDProvider; import pro.gravit.launcher.managers.ClientGsonManager; import pro.gravit.launcher.managers.ConsoleManager; import pro.gravit.launcher.request.Request; @@ -34,6 +35,7 @@ public static void main(String... args) throws Throwable { // Start Launcher initGson(); ConsoleManager.initConsole(); + HWIDProvider.registerHWIDs(); LauncherConfig config = Launcher.getConfig(); if (config.environment.equals(LauncherConfig.LauncherEnvironment.PROD)) { if (!LauncherAgent.isStarted()) throw new SecurityException("LauncherAgent must started"); diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index 5674255a..a4fe3cd0 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -32,6 +32,7 @@ import pro.gravit.launcher.gui.JSRuntimeProvider; import pro.gravit.launcher.hasher.FileNameMatcher; import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.hwid.HWIDProvider; import pro.gravit.launcher.managers.ClientGsonManager; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.PlayerProfile; @@ -427,6 +428,7 @@ public static void main(String... args) throws Throwable { if (engine.runtimeProvider == null) engine.runtimeProvider = new JSRuntimeProvider(); engine.runtimeProvider.init(true); engine.runtimeProvider.preLoad(); + HWIDProvider.registerHWIDs(); LauncherGuardManager.initGuard(true); LogHelper.debug("Reading ClientLauncher params"); Params params; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java b/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java index 28e77f81..ec1e5474 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/FunctionalBridge.java @@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launcher.LauncherAPI; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.guard.LauncherGuardManager; diff --git a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java index a502b137..97c09d85 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java @@ -25,6 +25,8 @@ import pro.gravit.launcher.hasher.HashedDir; import pro.gravit.launcher.hasher.HashedEntry; import pro.gravit.launcher.hasher.HashedFile; +import pro.gravit.launcher.hwid.NoHWID; +import pro.gravit.launcher.hwid.OshiHWID; import pro.gravit.launcher.managers.SettingsManager; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.PlayerProfile; @@ -130,6 +132,9 @@ public static void addLauncherClassBindings(Map bindings) { bindings.put("DirBridgeClass", DirBridge.class); bindings.put("FunctionalBridgeClass", FunctionalBridge.class); + bindings.put("NoHWIDClass", NoHWID.class); + bindings.put("OshiHWIDClass", OshiHWID.class); + // Load JS API if available try { Class.forName("javafx.application.Application"); diff --git a/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java index 67ad55c4..ccbdd898 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java @@ -10,9 +10,6 @@ import oshi.hardware.NetworkIF; import oshi.hardware.SoundCard; import oshi.hardware.UsbDevice; -import pro.gravit.launcher.HWID; -import pro.gravit.launcher.LauncherHWIDInterface; -import pro.gravit.launcher.OshiHWID; import pro.gravit.utils.helper.LogHelper; public class OshiHWIDProvider implements LauncherHWIDInterface { diff --git a/Launcher/src/main/java/pro/gravit/launcher/managers/ClientGsonManager.java b/Launcher/src/main/java/pro/gravit/launcher/managers/ClientGsonManager.java index 1f4d1539..bf2f2632 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/managers/ClientGsonManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/managers/ClientGsonManager.java @@ -3,6 +3,8 @@ import com.google.gson.GsonBuilder; import pro.gravit.launcher.client.UserSettings; +import pro.gravit.launcher.hwid.HWID; +import pro.gravit.launcher.hwid.HWIDProvider; import pro.gravit.utils.UniversalJsonAdapter; public class ClientGsonManager extends GsonManager { @@ -10,5 +12,6 @@ public class ClientGsonManager extends GsonManager { public void registerAdapters(GsonBuilder builder) { super.registerAdapters(builder); builder.registerTypeAdapter(UserSettings.class, new UniversalJsonAdapter<>(UserSettings.providers)); + builder.registerTypeAdapter(HWID.class, new UniversalJsonAdapter<>(HWIDProvider.hwids)); } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/HWID.java b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWID.java similarity index 86% rename from LauncherAPI/src/main/java/pro/gravit/launcher/HWID.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWID.java index 3cc02197..32616752 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/HWID.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWID.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.hwid; public interface HWID { String getSerializeString(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWIDProvider.java b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWIDProvider.java new file mode 100644 index 00000000..24deea4b --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/HWIDProvider.java @@ -0,0 +1,11 @@ +package pro.gravit.launcher.hwid; + +import pro.gravit.utils.ProviderMap; + +public class HWIDProvider { + public static ProviderMap hwids = new ProviderMap<>(); + public static void registerHWIDs() + { + hwids.register("oshi", OshiHWID.class); + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherHWIDInterface.java b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/LauncherHWIDInterface.java similarity index 53% rename from LauncherAPI/src/main/java/pro/gravit/launcher/LauncherHWIDInterface.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/hwid/LauncherHWIDInterface.java index 99edce7f..9c4c192b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherHWIDInterface.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/LauncherHWIDInterface.java @@ -1,4 +1,6 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.hwid; + +import pro.gravit.launcher.hwid.HWID; @FunctionalInterface public interface LauncherHWIDInterface { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/NoHWID.java b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/NoHWID.java new file mode 100644 index 00000000..d03c1d82 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/NoHWID.java @@ -0,0 +1,23 @@ +package pro.gravit.launcher.hwid; + +public class NoHWID implements HWID { + @Override + public String getSerializeString() { + return ""; + } + + @Override + public int getLevel() { + return 0; + } + + @Override + public int compare(HWID hwid) { + return 0; + } + + @Override + public boolean isNull() { + return true; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/OshiHWID.java b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/OshiHWID.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/OshiHWID.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/hwid/OshiHWID.java index 2c669470..68e8eff4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/OshiHWID.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/hwid/OshiHWID.java @@ -1,9 +1,10 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.hwid; import java.util.Objects; import java.util.StringJoiner; import com.google.gson.Gson; +import pro.gravit.launcher.LauncherAPI; public class OshiHWID implements HWID { public static Gson gson = new Gson(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java index 9c26720e..e3695bfb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth; -import pro.gravit.launcher.HWID; +import pro.gravit.launcher.hwid.HWID; import pro.gravit.launcher.LauncherAPI; import pro.gravit.launcher.LauncherNetworkAPI; import pro.gravit.launcher.events.request.AuthRequestEvent;