Files
OpenOnyx/src/openonyx/utilities/FileUtils.java
T

106 lines
2.7 KiB
Java

package openonyx.utilities;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URI;
import java.nio.file.Path;
import openonyx.core.OnyxClient;
import org.apache.logging.log4j.Logger;
public final class FileUtils {
public static void L(Path path) {
Path path1 = path;
try {
Class class_xx;
Class class_x = class_xx = Class.forName("java.awt.Desktop");
Class[] class_xx = new Class[0];
boolean bl = true;
Method method = class_x.getMethod("getDesktop", class_xx);
Object[] objects = new Object[0];
bl = true;
Object object = method.invoke(null, objects);
objects = new Class[1];
bl = true;
objects[0] = File.class;
Method method1 = class_xx.getMethod("open", objects);
objects = new Object[1];
bl = true;
objects[0] = path1.toFile();
method1.invoke(object, objects);
} catch (Throwable throwable) {
L(path1.toUri());
}
}
public static void L(URI uRI) {
URI uRI1 = uRI;
try {
Class class_xx;
Class class_x = class_xx = Class.forName("java.awt.Desktop");
Class[] class_xx = new Class[0];
boolean bl = true;
Method method = class_x.getMethod("getDesktop", class_xx);
Object[] objects = new Object[0];
bl = true;
Object object = method.invoke(null, objects);
objects = new Class[1];
bl = true;
objects[0] = URI.class;
Method method1 = class_xx.getMethod("browse", objects);
objects = new Object[1];
bl = true;
objects[0] = uRI1;
method1.invoke(object, objects);
} catch (Throwable throwable) {
Logger logger = OnyxClient.LOGGER;
Object[] objects1 = new Object[2];
boolean bl1 = true;
objects1[0] = uRI1;
objects1[1] = throwable;
logger.error("Could not open {}", objects1);
}
}
public static String decrypt(String string) {
String string1 = string;
int p = --5 << 4 ^ 15;
int q = 4 << 4 ^ 12;
String string2;
int r = (string2 = string1).length();
char[] e = new char[r];
boolean bl = true;
int k;
int n = k = r - 1;
char[] c = e;
int j = q;
int o = 84;
int l = n;
int i = p;
while (l >= 0) {
int m = k;
char d = string2.charAt(k);
k--;
c[m] = (char)(d ^ i);
if (k < 0) {
break;
}
o = k--;
c[o] = (char)(string2.charAt(o) ^ j);
l = k;
}
return new String(c);
}
public static void L(String string) {
L(URI.create(string));
}
private FileUtils() {
}
}