aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/customurl
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-13 22:05:09 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-13 22:05:09 +0900
commit84a71ed7bc03afbdfab00100b780117de354c83b (patch)
treeb74a005c5c3df99d3a23e70c9a1ed1159705dee4 /src/main/java/kr/syeyoung/dungeonsguide/customurl
parent2b869989ec69bfb0f5ca54409844ec5720b6a6fd (diff)
downloadSkyblock-Dungeons-Guide-84a71ed7bc03afbdfab00100b780117de354c83b.tar.gz
Skyblock-Dungeons-Guide-84a71ed7bc03afbdfab00100b780117de354c83b.tar.bz2
Skyblock-Dungeons-Guide-84a71ed7bc03afbdfab00100b780117de354c83b.zip
semi-obfuscate
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/customurl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java42
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java18
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java20
3 files changed, 0 insertions, 80 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
deleted file mode 100644
index 06aec0d8..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import kr.syeyoung.dungeonsguide.DungeonsGuideMain;
-import lombok.SneakyThrows;
-import net.minecraft.launchwrapper.LaunchClassLoader;
-
-import javax.crypto.Cipher;
-import javax.crypto.CipherInputStream;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
-public class DGURLConnection extends URLConnection {
- private Authenticator authenticator;
- protected DGURLConnection(URL url, Authenticator authenticator) {
- super(url);
- connected = false;
- this.authenticator = authenticator;
- }
-
- @Override
- public void connect() throws IOException {
- }
- @Override
- public InputStream getInputStream() throws IOException {
- if (authenticator != null) {
- String path = url.getPath().substring(1);
- if (!authenticator.getDynamicResources().containsKey(path)) throw new FileNotFoundException();
- return new ByteArrayInputStream(authenticator.getDynamicResources().get(path));
- } else {
- return DGURLConnection.class.getResourceAsStream(url.getPath());
- }
- }
-}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java
deleted file mode 100644
index b5d0f861..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import lombok.AllArgsConstructor;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-@AllArgsConstructor
-public class DGURLStreamHandler extends URLStreamHandler {
- private Authenticator authenticator;
- @Override
- protected URLConnection openConnection(URL url) throws IOException {
- return new DGURLConnection(url, authenticator);
- }
-}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java
deleted file mode 100644
index 418c55f0..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import lombok.AllArgsConstructor;
-
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
-
-@AllArgsConstructor
-public class DGURLStreamHandlerFactory implements URLStreamHandlerFactory {
- private Authenticator authenticator;
- @Override
- public URLStreamHandler createURLStreamHandler(String s) {
- if ("dungeonsguide".equals(s)) {
- return new DGURLStreamHandler(authenticator);
- }
-
- return null;
- }
-}