mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-06-02 09:52:19 +00:00
Adding mongo support and /antivpn clearcache command
This commit is contained in:
@@ -41,33 +41,4 @@ public class MiscUtils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Borrowed from FireFlyx ngxdev */
|
||||
public static void download(File file, String from) throws Exception {
|
||||
URL url = new URL(from);
|
||||
InputStream stream = url.openStream();
|
||||
ReadableByteChannel channel = Channels.newChannel(stream);
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
out.getChannel().transferFrom(channel, 0L, Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
/* Borrowed from FireFlyx ngxdev */
|
||||
public static ClassLoader injectorClassLoader = MiscUtils.class.getClassLoader();
|
||||
|
||||
/* Borrowed from FireFlyx ngxdev */
|
||||
public static void injectURL(URL url) {
|
||||
try {
|
||||
URLClassLoader systemClassLoader = (URLClassLoader) injectorClassLoader;
|
||||
Class<URLClassLoader> classLoaderClass = URLClassLoader.class;
|
||||
|
||||
try {
|
||||
Method method = classLoaderClass.getDeclaredMethod("addURL", URL.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(systemClassLoader, url);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user