Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.skillclient.gui.accountManager;
- import com.skillclient.utils.FakePlayer.*;
- import net.minecraft.util.*;
- import com.mojang.authlib.*;
- import com.mojang.authlib.yggdrasil.*;
- import java.awt.*;
- import com.skillclient.gui.*;
- import com.mojang.authlib.exceptions.*;
- import java.net.*;
- import java.util.*;
- import com.skillclient.utils.exceptions.*;
- import com.skillclient.gui.accountManager.mcleaks.*;
- import com.skillclient.chat.*;
- import net.minecraft.client.gui.*;
- public class Account
- {
- public final AccountManager.AccountType type;
- public String username;
- public String uuid;
- public String token;
- public String line1;
- public String line2;
- protected EntityFakePlayer player;
- public EntityFakePlayer getPlayer() {
- if (this.player == null) {
- try {
- this.player = new EntityFakePlayer(this.username);
- }
- catch (Exception ex) {}
- }
- return this.player;
- }
- public Session getSession() {
- return new Session(this.username, this.uuid, this.token, "legacy");
- }
- public Account(final AccountManager.AccountType type) {
- this.token = "-";
- this.line1 = "";
- this.line2 = "";
- this.type = type;
- }
- public void relog() {
- }
- public String save() {
- return String.valueOf(this.type.toString()) + ";" + this.username + ";" + this.uuid + ";" + this.token + ";" + this.line1 + ";" + this.line2;
- }
- public static Account load(final String[] args) {
- final Account acc = base(args);
- acc.username = args[1];
- acc.uuid = args[2];
- acc.token = args[3];
- acc.line1 = args[4];
- acc.line2 = args[5];
- return acc;
- }
- public static Account base(final String[] s) {
- final AccountManager.AccountType type = AccountManager.AccountType.valueOf(s[0]);
- if (type.equals(AccountManager.AccountType.CRACKED)) {
- return new AccountCracked(AccountManager.AccountType.CRACKED);
- }
- if (type.equals(AccountManager.AccountType.MCLeaks)) {
- final AccountMCLeaks acc = new AccountMCLeaks(AccountManager.AccountType.MCLeaks);
- acc.session_mcleaks = s[s.length - 1];
- acc.token_mcleaks = s[s.length - 2];
- return acc;
- }
- if (type.equals(AccountManager.AccountType.MOJANG)) {
- final AccountMojang acc2 = new AccountMojang(type);
- acc2.email = s[s.length - 1];
- acc2.password = s[s.length - 2];
- return acc2;
- }
- return new Account(type);
- }
- @Override
- public boolean equals(final Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof Account)) {
- return false;
- }
- final Account other = (Account)o;
- if (!other.canEqual(this)) {
- return false;
- }
- final Object this$type = this.type;
- final Object other$type = other.type;
- Label_0065: {
- if (this$type == null) {
- if (other$type == null) {
- break Label_0065;
- }
- }
- else if (this$type.equals(other$type)) {
- break Label_0065;
- }
- return false;
- }
- final Object this$username = this.username;
- final Object other$username = other.username;
- Label_0102: {
- if (this$username == null) {
- if (other$username == null) {
- break Label_0102;
- }
- }
- else if (this$username.equals(other$username)) {
- break Label_0102;
- }
- return false;
- }
- final Object this$uuid = this.uuid;
- final Object other$uuid = other.uuid;
- Label_0139: {
- if (this$uuid == null) {
- if (other$uuid == null) {
- break Label_0139;
- }
- }
- else if (this$uuid.equals(other$uuid)) {
- break Label_0139;
- }
- return false;
- }
- final Object this$token = this.token;
- final Object other$token = other.token;
- Label_0176: {
- if (this$token == null) {
- if (other$token == null) {
- break Label_0176;
- }
- }
- else if (this$token.equals(other$token)) {
- break Label_0176;
- }
- return false;
- }
- final Object this$line1 = this.line1;
- final Object other$line1 = other.line1;
- Label_0213: {
- if (this$line1 == null) {
- if (other$line1 == null) {
- break Label_0213;
- }
- }
- else if (this$line1.equals(other$line1)) {
- break Label_0213;
- }
- return false;
- }
- final Object this$line2 = this.line2;
- final Object other$line2 = other.line2;
- Label_0250: {
- if (this$line2 == null) {
- if (other$line2 == null) {
- break Label_0250;
- }
- }
- else if (this$line2.equals(other$line2)) {
- break Label_0250;
- }
- return false;
- }
- final Object this$player = this.player;
- final Object other$player = other.player;
- if (this$player == null) {
- if (other$player == null) {
- return true;
- }
- }
- else if (this$player.equals(other$player)) {
- return true;
- }
- return false;
- }
- protected boolean canEqual(final Object other) {
- return other instanceof Account;
- }
- @Override
- public int hashCode() {
- final int PRIME = 59;
- int result = 1;
- final Object $type = this.type;
- result = result * 59 + (($type == null) ? 43 : $type.hashCode());
- final Object $username = this.username;
- result = result * 59 + (($username == null) ? 43 : $username.hashCode());
- final Object $uuid = this.uuid;
- result = result * 59 + (($uuid == null) ? 43 : $uuid.hashCode());
- final Object $token = this.token;
- result = result * 59 + (($token == null) ? 43 : $token.hashCode());
- final Object $line1 = this.line1;
- result = result * 59 + (($line1 == null) ? 43 : $line1.hashCode());
- final Object $line2 = this.line2;
- result = result * 59 + (($line2 == null) ? 43 : $line2.hashCode());
- final Object $player = this.player;
- result = result * 59 + (($player == null) ? 43 : $player.hashCode());
- return result;
- }
- public static class AccountMojang extends Account
- {
- public String email;
- public String password;
- public AccountMojang(final AccountManager.AccountType type) {
- super(type);
- }
- public AccountMojang(final String email, final String password) throws AuthenticationException {
- super(AccountManager.AccountType.MOJANG);
- this.email = email;
- this.password = password;
- final YggdrasilUserAuthentication loginService = new YggdrasilUserAuthentication(new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()), Agent.MINECRAFT);
- loginService.setUsername(email);
- loginService.setPassword(password);
- loginService.logIn();
- this.username = loginService.getSelectedProfile().getName();
- try {
- this.player = new EntityFakePlayer(this.username);
- }
- catch (Exception ex) {}
- this.uuid = loginService.getSelectedProfile().getId().toString();
- this.token = loginService.getAuthenticatedToken();
- this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
- this.line2 = String.valueOf(email) + ":" + password;
- GuiOverlay.notify("Added Account " + this.username, Color.ORANGE);
- }
- @Override
- public void relog() {
- try {
- final AccountMojang accountMojang = new AccountMojang(this.email, this.password);
- }
- catch (AuthenticationException e) {
- e.printStackTrace();
- }
- }
- @Override
- public String save() {
- return String.valueOf(super.save()) + ";" + this.email + ";" + this.password;
- }
- @Override
- public boolean equals(final Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof AccountMojang)) {
- return false;
- }
- final AccountMojang other = (AccountMojang)o;
- if (!other.canEqual(this)) {
- return false;
- }
- if (!super.equals(o)) {
- return false;
- }
- final Object this$email = this.email;
- final Object other$email = other.email;
- Label_0075: {
- if (this$email == null) {
- if (other$email == null) {
- break Label_0075;
- }
- }
- else if (this$email.equals(other$email)) {
- break Label_0075;
- }
- return false;
- }
- final Object this$password = this.password;
- final Object other$password = other.password;
- if (this$password == null) {
- if (other$password == null) {
- return true;
- }
- }
- else if (this$password.equals(other$password)) {
- return true;
- }
- return false;
- }
- @Override
- protected boolean canEqual(final Object other) {
- return other instanceof AccountMojang;
- }
- @Override
- public int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = result * 59 + super.hashCode();
- final Object $email = this.email;
- result = result * 59 + (($email == null) ? 43 : $email.hashCode());
- final Object $password = this.password;
- result = result * 59 + (($password == null) ? 43 : $password.hashCode());
- return result;
- }
- }
- public static class AccountCracked extends Account
- {
- public AccountCracked(final AccountManager.AccountType type) {
- super(type);
- }
- public AccountCracked(final String username, final boolean offlinePlayer) throws InvalidPlayerException {
- super(AccountManager.AccountType.CRACKED);
- if (offlinePlayer) {
- this.uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes()).toString().replace("-", "");
- }
- else {
- this.uuid = "";
- try {
- final URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + username);
- final Scanner scanner = new Scanner(url.openStream());
- final String line = scanner.nextLine();
- this.uuid = line.split("\"")[3];
- scanner.close();
- }
- catch (Exception e) {
- throw new InvalidPlayerException();
- }
- }
- this.username = username;
- try {
- this.player = new EntityFakePlayer(this.username);
- }
- catch (Exception ex) {}
- this.line1 = String.valueOf(this.type.toString()) + ": " + username;
- this.line2 = this.getSession().getPlayerID().replace("-", "");
- GuiOverlay.notify("Added Account " + username, Color.ORANGE);
- }
- @Override
- public boolean equals(final Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof AccountCracked)) {
- return false;
- }
- final AccountCracked other = (AccountCracked)o;
- return other.canEqual(this) && super.equals(o);
- }
- @Override
- protected boolean canEqual(final Object other) {
- return other instanceof AccountCracked;
- }
- @Override
- public int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = result * 59 + super.hashCode();
- return result;
- }
- }
- public static class AccountSession extends Account
- {
- public AccountSession(final AccountManager.AccountType type) {
- super(type);
- }
- public AccountSession(final Session session) {
- super(AccountManager.AccountType.SESSION);
- this.username = session.getUsername();
- this.uuid = session.getPlayerID();
- this.token = session.getToken();
- this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
- this.line2 = this.getSession().getPlayerID().replace("-", "");
- AccountManager.orig = this;
- }
- @Override
- public String save() {
- return super.save();
- }
- @Override
- public boolean equals(final Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof AccountSession)) {
- return false;
- }
- final AccountSession other = (AccountSession)o;
- return other.canEqual(this) && super.equals(o);
- }
- @Override
- protected boolean canEqual(final Object other) {
- return other instanceof AccountSession;
- }
- @Override
- public int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = result * 59 + super.hashCode();
- return result;
- }
- }
- public static class AccountMCLeaks extends Account
- {
- public String session_mcleaks;
- public String token_mcleaks;
- public AccountMCLeaks(final AccountManager.AccountType type) {
- super(type);
- }
- public AccountMCLeaks(final String token) throws InvalidTokenException {
- super(AccountManager.AccountType.MCLeaks);
- if (token.length() != 16) {
- throw new InvalidTokenException(ChatColor.RED + "The token has to be 16 characters long!");
- }
- this.token_mcleaks = token;
- this.username = "...";
- this.uuid = UUID.randomUUID().toString();
- try {
- this.player = new EntityFakePlayer("");
- }
- catch (Exception ex) {}
- RedeemResponse response;
- ModApi.redeem(this.token_mcleaks, o -> {
- try {
- if (o instanceof String) {
- this.line1 = (String)o;
- throw new InvalidTokenException((String)o);
- }
- else {
- response = o;
- this.session_mcleaks = response.getSession();
- this.username = response.getMcName();
- try {
- this.player = new EntityFakePlayer(this.username);
- }
- catch (Exception ex2) {}
- this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
- this.line2 = this.token_mcleaks;
- GuiOverlay.notify("Added Account " + this.username, Color.ORANGE);
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- });
- }
- public AccountMCLeaks(final String[] s) {
- super(AccountManager.AccountType.MCLeaks);
- this.username = s[0];
- try {
- this.player = new EntityFakePlayer(this.username);
- }
- catch (Exception ex) {}
- this.session_mcleaks = s[1];
- this.token_mcleaks = s[2];
- this.uuid = UUID.randomUUID().toString();
- this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
- this.line2 = this.token_mcleaks;
- }
- @Override
- public void relog() {
- Chat.openWebLink("https://mcleaks.net/renew");
- GuiScreen.setClipboardString("token");
- GuiOverlay.notify("Copied token to clipboard!", Color.BLUE);
- }
- @Override
- public String save() {
- return String.valueOf(super.save()) + ";" + this.session_mcleaks + ";" + this.token_mcleaks;
- }
- @Override
- public boolean equals(final Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof AccountMCLeaks)) {
- return false;
- }
- final AccountMCLeaks other = (AccountMCLeaks)o;
- if (!other.canEqual(this)) {
- return false;
- }
- if (!super.equals(o)) {
- return false;
- }
- final Object this$session_mcleaks = this.session_mcleaks;
- final Object other$session_mcleaks = other.session_mcleaks;
- Label_0075: {
- if (this$session_mcleaks == null) {
- if (other$session_mcleaks == null) {
- break Label_0075;
- }
- }
- else if (this$session_mcleaks.equals(other$session_mcleaks)) {
- break Label_0075;
- }
- return false;
- }
- final Object this$token_mcleaks = this.token_mcleaks;
- final Object other$token_mcleaks = other.token_mcleaks;
- if (this$token_mcleaks == null) {
- if (other$token_mcleaks == null) {
- return true;
- }
- }
- else if (this$token_mcleaks.equals(other$token_mcleaks)) {
- return true;
- }
- return false;
- }
- @Override
- protected boolean canEqual(final Object other) {
- return other instanceof AccountMCLeaks;
- }
- @Override
- public int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = result * 59 + super.hashCode();
- final Object $session_mcleaks = this.session_mcleaks;
- result = result * 59 + (($session_mcleaks == null) ? 43 : $session_mcleaks.hashCode());
- final Object $token_mcleaks = this.token_mcleaks;
- result = result * 59 + (($token_mcleaks == null) ? 43 : $token_mcleaks.hashCode());
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement