-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.dart
43 lines (37 loc) · 1.06 KB
/
main.dart
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
// MinecraftChecker - @IndianBots - V0.0.1+a
import 'package:http/http.dart';
import 'package:uuid/uuid.dart';
class MinecraftChecker {
String user = '';
String password = '';
MinecraftChecker(this.user, this.password) : assert(
user != '',
password != '',
);
Future<bool> check() async {
if (user != null && password != null) {
var randomGuid = Uuid().v4();
var req = await post(
Uri.parse('https://authserver.mojang.com/authenticate'),
body: {
'agent': "{'name': 'Minecraft','version': 1}",
'username': user,
'password': password,
'clientToken': randomGuid,
},
headers: {
'Cache-Control': 'no-cache',
'Pragma': 'no-cache',
'User-Agent': 'Java/1.8.0_281',
'Host': 'authserver.mojang.com',
'Accept': 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2',
'Connection': 'keep-alive',
}
);
if (req.body.contains('accessToken')) {
return true;
}
}
return false;
}
}