Fixed dex2jar error on Minecraft 1.17

Removed the built-in Apache Commons library which was not fully
converted from dex to classes.
This commit is contained in:
Duy Tran Khanh committed 2021-06-04 10:46:52 +07:00
1 parent 4c12ce9608
commit f4503692fe
5 files changed
+12 -11

No files matched your search

@@ -12,8 +12,10 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
@@ -589,6 +591,14 @@ public final class Tools
return out;
}
public static void copy(final InputStream input, final OutputStream output) throws IOException {
final byte[] buffer = new byte[8192];
int n = 0;
while ((n = input.read(buffer)) != -1) {
output.write(buffer, 0, n);
}
}
public static File lastFileModified(String dir) {
File fl = new File(dir);
@@ -610,7 +620,6 @@ public final class Tools
return choice;
}
public static String read(InputStream is) throws IOException {
String out = "";
int len;
@@ -5,7 +5,6 @@ import java.net.*;
import java.nio.charset.*;
import java.util.*;
import net.kdt.pojavlaunch.*;
import org.apache.commons.io.*;
public class YggdrasilAuthenticator {
private static final String API_URL = "https://authserver.mojang.com/";
@@ -46,7 +45,7 @@ public class YggdrasilAuthenticator {
}
if (is != null) {
IOUtils.copy(is, bos);
Tools.copy(is, bos);
try {
is.close();
} catch (Exception e) {
@@ -6,8 +6,6 @@ import java.nio.charset.*;
import net.kdt.pojavlaunch.*;
import org.apache.commons.io.*;
public class DownloadUtils {
public static final String USER_AGENT = Tools.APP_NAME;
public static final Charset utf8 = Charset.forName("UTF-8");
@@ -30,7 +28,7 @@ public class DownloadUtils {
+ ": " + conn.getResponseMessage());
}
is = conn.getInputStream();
IOUtils.copy(is, os);
Tools.copy(is, os);
} catch (IOException e) {
throw new IOException("Unable to download from " + url.toString(), e);
} finally {
@@ -1,5 +0,0 @@
package net.kdt.pojavlaunch.utils;
public class FileUtils
{
}