Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. LEAKED CODE ALERT!
  2.  
  3. package com.loudpacks.util;
  4.  
  5. import java.util.Locale;
  6.  
  7. public final class OSTools
  8. {
  9. public static enum OSType {
  10. Windows, MacOS, Linux;
  11. };
  12.  
  13. protected static OSType detectedOS;
  14.  
  15. public static OSType getOperatingSystemType() {
  16. if (detectedOS == null) {
  17. String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
  18. if ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0)) {
  19. detectedOS = OSType.MacOS;
  20. } else if (OS.indexOf("win") >= 0) {
  21. detectedOS = OSType.Windows;
  22. } else
  23. detectedOS = OSType.Linux;
  24. }
  25. return detectedOS;
  26. }
  27.  
  28. }
  29.  
  30. public static void launchClient(String path, String script, String clientUser, String clientPass, String botUser, String botPass, String world, String proxy, String params) {
  31. ProcessBuilder linuxBuilder = new ProcessBuilder("/bin/bash", "-c",
  32. "java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params);
  33.  
  34. ProcessBuilder windowsBuilder = new ProcessBuilder("cmd.exe", "/c",
  35. "java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params);
  36.  
  37. ProcessBuilder macBuilder = new ProcessBuilder("osascript", "-e",
  38. "tell application \"Terminal\" to do script \"java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params + "\"");
  39.  
  40. try {
  41. switch(OSTools.getOperatingSystemType()){
  42. case Windows:
  43. Process p1 = windowsBuilder.start();
  44. break;
  45. case MacOS:
  46. Process p2 = macBuilder.start();
  47.  
  48. break;
  49. case Linux:
  50. Process p3 = linuxBuilder.start();
  51. break;
  52. }
  53. } catch (IOException e1) {
  54. e1.printStackTrace();
  55. System.out.println(e1.getMessage());
  56. }
  57.  
  58. }
  59.  
  60. Your proxy string will have to include " -proxy ip:port", I did it like that so it can be optional.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement