-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshid.js
30 lines (30 loc) · 1.01 KB
/
shid.js
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
let auth = require('prismarine-auth')
let flow = new auth.Authflow('calubjs','json/cache',{authTitle:auth.Titles.MinecraftJava,deviceType:"Win32",flow:"sisu"})
//let data;
flow.getMinecraftJavaToken({fetchProfile:true}).then(function(a){
let fs = require('fs')
if (fs.existsSync('auth/uuid.txt')){
fs.unlinkSync('auth/uuid.txt')
}
if (fs.existsSync('auth/expire.txt')){
fs.unlinkSync('auth/expire.txt')
}
if (fs.existsSync('auth/expired.txt')){
fs.unlinkSync('auth/expired.txt')
}
if (fs.existsSync('auth/username.txt')){
fs.unlinkSync('auth/username.txt')
}
if (fs.existsSync('auth/token.txt')){
fs.unlinkSync('auth/token.txt')
}
fs.writeFileSync('auth/uuid.txt'," --uuid "+a.profile.id)
fs.writeFileSync('auth/token.txt',a.token)
fs.writeFileSync('auth/username.txt',a.profile.name)
flow.getXboxToken().then(function(b){
let c = new Date(b.expiresOn)
c = c.getTime()
fs.writeFileSync('auth/expire.txt',String(c))
fs.writeFileSync('auth/expired.txt','false')
})
})