package ml.aerialline.Lens; import ml.aerialline.Lens.antivpn.AntiVpn; import ml.aerialline.Lens.antivpn.Protector; import ml.aerialline.Lens.antivpn.Result; import ml.aerialline.Lens.antivpn.api.Getipintel; import ml.aerialline.Lens.antivpn.api.LensWEBAPI; import ml.aerialline.Lens.antivpn.api.Proxycheck; import ml.aerialline.Lens.antivpn.bulid_in.Dns; import java.io.IOException; import java.util.Scaner; /** @see https://github.com/AerialLine/Lens not debuged */ public class Example { public void main(String[] args) { ExampleAntiVpn api = new ExampleAntiVpn(); System.out.print("Please type a IP Address >>"); Scaner scaner = new Scaner(System.in); ip = scaner.nextLine(); Result res = api.check(ip, Protect[0].toarrys()); if (res.isVPN()) { System.out.print("Is VPN!"); System.out.print("Result: "+res.getRes()); System.out.print("Info: "+res.getInfo()); }else { System.out.print("Is not VPN!"); System.out.print("Result: "+res.getRes()); System.out.print("Info: "+res.getInfo()); } } class ExampleAntiVpn { String[] info = {"", "", "", ""}; AntiVpn[] lst; boolean[] res = {false, false, false, false, false}; // Protect Link sort oder public AntiVPN() { lst = new AntiVpn[]{ new Dns(), new LensWEBAPI(), new Getipintel(), new Proxycheck() }; } public Result check(Protector[] types, String ip) throws IOException { if (types.length > Protector.values().length) { throw new IllegalArgumentException("Illegal Argument Error. Please report form."); } Result ret = new Result(); for (Protector s: types) { res[s.get()] = lst[s.get()].check(ip); if (res[s.get()]) { ret.setVPN(true); info[s.get()] = lst[s.get()].info(ip); break; } return ret; } } }