コード例 #1
0
 static {
   List<String> spamlist = new ArrayList<String>();
   try {
     BufferedReader reader = new BufferedReader(new FileReader(new File("spamlist.txt")));
     String line;
     while ((line = reader.readLine()) != null) {
       if (line.trim().isEmpty()) continue;
       spamlist.add(line);
     }
     reader.close();
   } catch (Exception exception) {
     throw new RuntimeException(exception);
   }
   spamList = spamlist.toArray(new String[0]);
 }
コード例 #2
0
 private static List<String> loadLoginProxies(String fileName) {
   List<String> proxies = new ArrayList<String>();
   try {
     BufferedReader reader = new BufferedReader(new FileReader(new File(fileName)));
     String line;
     while ((line = reader.readLine()) != null) {
       if (line.trim().isEmpty()) continue;
       String[] parts = line.split(" ")[0].trim().split(":");
       proxies.add(parts[0].trim() + ":" + Integer.parseInt(parts[1].trim()));
     }
     reader.close();
   } catch (Exception exception) {
     throw new RuntimeException(exception);
   }
   System.out.println("Loaded " + proxies.size() + " login proxies.");
   return proxies;
 }
コード例 #3
0
 private static List<String> loadAccounts(String fileName) {
   List<String> accounts = new ArrayList<String>();
   try {
     Pattern pattern = Pattern.compile("[\\w]{1,16}");
     BufferedReader reader = new BufferedReader(new FileReader(new File(fileName)));
     String line;
     while ((line = reader.readLine()) != null) {
       Matcher matcher = pattern.matcher(line);
       if (!matcher.find()) continue;
       String username = matcher.group();
       if (!matcher.find()) continue;
       String password = matcher.group();
       accounts.add(username + ":" + password);
     }
     reader.close();
   } catch (Exception exception) {
     throw new RuntimeException(exception);
   }
   System.out.println("Loaded " + accounts.size() + " accounts.");
   return accounts;
 }