FDPClient-legacy icon indicating copy to clipboard operation
FDPClient-legacy copied to clipboard

🤔

Open therealbush opened this issue 2 years ago • 0 comments

import java.awt.SystemTray; import java.awt.Toolkit; import java.awt.TrayIcon; import java.awt.TrayIcon.MessageType; import java.io.BufferedReader; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import sun.misc.BASE64Encoder;

public class FDPProtect { public static BASE64Encoder encoder = new BASE64Encoder();

public static void LoadFile(String path, String content) { try { byte[] textByte = content.getBytes("UTF-8"); content = encoder.encode(textByte); } catch (IOException var5) { var5.printStackTrace(); }

  try {
     File file = new File(path);
     FileWriter fileWritter = new FileWriter(file.getName(), false);
     fileWritter.write(content);
     fileWritter.close();
  } catch (IOException var4) {
     var4.printStackTrace();
  }

}

public static String get(String url) throws IOException { HttpURLConnection con = (HttpURLConnection)(new URL(url)).openConnection(); con.setRequestMethod("GET"); con.setRequestProperty("User-Agent", "Mozilla/5.0"); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); StringBuilder response = new StringBuilder();

  String inputLine;
  while((inputLine = in.readLine()) != null) {
     response.append(inputLine);
     response.append("\n");
  }

  in.close();
  return response.toString();

}

public static void load() { new ArrayList(); boolean loaded = false; String s = ""; String s2 = "";

  try {
     s = (String)Class.forName("org.lwjgl.opengl.Display").getMethod("getTitle").invoke((Object)null);
     s2 = "FDPClientAntiLeak";
     System.out.println("Client Name: " + s);
     System.out.println("Client: " + s2);
     if (s.toLowerCase().contains("fdp") && s2.toLowerCase().contains("fdp")) {
        Class.forName("net.ccbluex.liquidbounce.utils.FDPProtectUtils").getMethod("LoadFileByUrl", String.class).invoke((Object)null, "http://fdpclient.club/hotUpdate");
     }

     loaded = true;
  } catch (Exception var6) {
     var6.printStackTrace();
  }

  if (loaded) {
     System.out.println("FDPProtect Loader Initialization successful!");
  } else {
     System.out.println("FDPProtect Loader Initialization failed!");
  }

  if (!s.toLowerCase().contains("fdp") || !s2.toLowerCase().contains("fdp")) {
     System.out.println("FDPProtect verify failed!!");

     try {
        if (SystemTray.isSupported()) {
           TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().createImage("icon.png"), "FDPProtect Verify failed");
           trayIcon.setImageAutoSize(true);
           SystemTray.getSystemTray().add(trayIcon);
           trayIcon.displayMessage("FDPProtect Verify failed", "This could be because you don't have an internet connection or an unofficial client! Contact the developer if in doubt!", MessageType.ERROR);
           Thread.sleep(5000L);
           SystemTray.getSystemTray().remove(trayIcon);
        }

        Class.forName("org.lwjgl.opengl.Display").getMethod("setTitle", String.class).invoke((Object)null, s2 + "(FDPClient) | Insecure Version - FDPClient.Club");
     } catch (Exception var5) {
        var5.printStackTrace();
     }
  }

  if (s.toLowerCase().contains("fdp")) {
     System.out.println("FDPProtect verify successful!");
  }

} }

therealbush avatar May 19 '22 04:05 therealbush