Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
2,381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.41 KB | None | 0 0
  1. package com.skillclient.gui.accountManager;
  2.  
  3. import com.skillclient.utils.FakePlayer.*;
  4. import net.minecraft.util.*;
  5. import com.mojang.authlib.*;
  6. import com.mojang.authlib.yggdrasil.*;
  7. import java.awt.*;
  8. import com.skillclient.gui.*;
  9. import com.mojang.authlib.exceptions.*;
  10. import java.net.*;
  11. import java.util.*;
  12. import com.skillclient.utils.exceptions.*;
  13. import com.skillclient.gui.accountManager.mcleaks.*;
  14. import com.skillclient.chat.*;
  15. import net.minecraft.client.gui.*;
  16.  
  17. public class Account
  18. {
  19. public final AccountManager.AccountType type;
  20. public String username;
  21. public String uuid;
  22. public String token;
  23. public String line1;
  24. public String line2;
  25. protected EntityFakePlayer player;
  26.  
  27. public EntityFakePlayer getPlayer() {
  28. if (this.player == null) {
  29. try {
  30. this.player = new EntityFakePlayer(this.username);
  31. }
  32. catch (Exception ex) {}
  33. }
  34. return this.player;
  35. }
  36.  
  37. public Session getSession() {
  38. return new Session(this.username, this.uuid, this.token, "legacy");
  39. }
  40.  
  41. public Account(final AccountManager.AccountType type) {
  42. this.token = "-";
  43. this.line1 = "";
  44. this.line2 = "";
  45. this.type = type;
  46. }
  47.  
  48. public void relog() {
  49. }
  50.  
  51. public String save() {
  52. return String.valueOf(this.type.toString()) + ";" + this.username + ";" + this.uuid + ";" + this.token + ";" + this.line1 + ";" + this.line2;
  53. }
  54.  
  55. public static Account load(final String[] args) {
  56. final Account acc = base(args);
  57. acc.username = args[1];
  58. acc.uuid = args[2];
  59. acc.token = args[3];
  60. acc.line1 = args[4];
  61. acc.line2 = args[5];
  62. return acc;
  63. }
  64.  
  65. public static Account base(final String[] s) {
  66. final AccountManager.AccountType type = AccountManager.AccountType.valueOf(s[0]);
  67. if (type.equals(AccountManager.AccountType.CRACKED)) {
  68. return new AccountCracked(AccountManager.AccountType.CRACKED);
  69. }
  70. if (type.equals(AccountManager.AccountType.MCLeaks)) {
  71. final AccountMCLeaks acc = new AccountMCLeaks(AccountManager.AccountType.MCLeaks);
  72. acc.session_mcleaks = s[s.length - 1];
  73. acc.token_mcleaks = s[s.length - 2];
  74. return acc;
  75. }
  76. if (type.equals(AccountManager.AccountType.MOJANG)) {
  77. final AccountMojang acc2 = new AccountMojang(type);
  78. acc2.email = s[s.length - 1];
  79. acc2.password = s[s.length - 2];
  80. return acc2;
  81. }
  82. return new Account(type);
  83. }
  84.  
  85. @Override
  86. public boolean equals(final Object o) {
  87. if (o == this) {
  88. return true;
  89. }
  90. if (!(o instanceof Account)) {
  91. return false;
  92. }
  93. final Account other = (Account)o;
  94. if (!other.canEqual(this)) {
  95. return false;
  96. }
  97. final Object this$type = this.type;
  98. final Object other$type = other.type;
  99. Label_0065: {
  100. if (this$type == null) {
  101. if (other$type == null) {
  102. break Label_0065;
  103. }
  104. }
  105. else if (this$type.equals(other$type)) {
  106. break Label_0065;
  107. }
  108. return false;
  109. }
  110. final Object this$username = this.username;
  111. final Object other$username = other.username;
  112. Label_0102: {
  113. if (this$username == null) {
  114. if (other$username == null) {
  115. break Label_0102;
  116. }
  117. }
  118. else if (this$username.equals(other$username)) {
  119. break Label_0102;
  120. }
  121. return false;
  122. }
  123. final Object this$uuid = this.uuid;
  124. final Object other$uuid = other.uuid;
  125. Label_0139: {
  126. if (this$uuid == null) {
  127. if (other$uuid == null) {
  128. break Label_0139;
  129. }
  130. }
  131. else if (this$uuid.equals(other$uuid)) {
  132. break Label_0139;
  133. }
  134. return false;
  135. }
  136. final Object this$token = this.token;
  137. final Object other$token = other.token;
  138. Label_0176: {
  139. if (this$token == null) {
  140. if (other$token == null) {
  141. break Label_0176;
  142. }
  143. }
  144. else if (this$token.equals(other$token)) {
  145. break Label_0176;
  146. }
  147. return false;
  148. }
  149. final Object this$line1 = this.line1;
  150. final Object other$line1 = other.line1;
  151. Label_0213: {
  152. if (this$line1 == null) {
  153. if (other$line1 == null) {
  154. break Label_0213;
  155. }
  156. }
  157. else if (this$line1.equals(other$line1)) {
  158. break Label_0213;
  159. }
  160. return false;
  161. }
  162. final Object this$line2 = this.line2;
  163. final Object other$line2 = other.line2;
  164. Label_0250: {
  165. if (this$line2 == null) {
  166. if (other$line2 == null) {
  167. break Label_0250;
  168. }
  169. }
  170. else if (this$line2.equals(other$line2)) {
  171. break Label_0250;
  172. }
  173. return false;
  174. }
  175. final Object this$player = this.player;
  176. final Object other$player = other.player;
  177. if (this$player == null) {
  178. if (other$player == null) {
  179. return true;
  180. }
  181. }
  182. else if (this$player.equals(other$player)) {
  183. return true;
  184. }
  185. return false;
  186. }
  187.  
  188. protected boolean canEqual(final Object other) {
  189. return other instanceof Account;
  190. }
  191.  
  192. @Override
  193. public int hashCode() {
  194. final int PRIME = 59;
  195. int result = 1;
  196. final Object $type = this.type;
  197. result = result * 59 + (($type == null) ? 43 : $type.hashCode());
  198. final Object $username = this.username;
  199. result = result * 59 + (($username == null) ? 43 : $username.hashCode());
  200. final Object $uuid = this.uuid;
  201. result = result * 59 + (($uuid == null) ? 43 : $uuid.hashCode());
  202. final Object $token = this.token;
  203. result = result * 59 + (($token == null) ? 43 : $token.hashCode());
  204. final Object $line1 = this.line1;
  205. result = result * 59 + (($line1 == null) ? 43 : $line1.hashCode());
  206. final Object $line2 = this.line2;
  207. result = result * 59 + (($line2 == null) ? 43 : $line2.hashCode());
  208. final Object $player = this.player;
  209. result = result * 59 + (($player == null) ? 43 : $player.hashCode());
  210. return result;
  211. }
  212.  
  213. public static class AccountMojang extends Account
  214. {
  215. public String email;
  216. public String password;
  217.  
  218. public AccountMojang(final AccountManager.AccountType type) {
  219. super(type);
  220. }
  221.  
  222. public AccountMojang(final String email, final String password) throws AuthenticationException {
  223. super(AccountManager.AccountType.MOJANG);
  224. this.email = email;
  225. this.password = password;
  226. final YggdrasilUserAuthentication loginService = new YggdrasilUserAuthentication(new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()), Agent.MINECRAFT);
  227. loginService.setUsername(email);
  228. loginService.setPassword(password);
  229. loginService.logIn();
  230. this.username = loginService.getSelectedProfile().getName();
  231. try {
  232. this.player = new EntityFakePlayer(this.username);
  233. }
  234. catch (Exception ex) {}
  235. this.uuid = loginService.getSelectedProfile().getId().toString();
  236. this.token = loginService.getAuthenticatedToken();
  237. this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
  238. this.line2 = String.valueOf(email) + ":" + password;
  239. GuiOverlay.notify("Added Account " + this.username, Color.ORANGE);
  240. }
  241.  
  242. @Override
  243. public void relog() {
  244. try {
  245. final AccountMojang accountMojang = new AccountMojang(this.email, this.password);
  246. }
  247. catch (AuthenticationException e) {
  248. e.printStackTrace();
  249. }
  250. }
  251.  
  252. @Override
  253. public String save() {
  254. return String.valueOf(super.save()) + ";" + this.email + ";" + this.password;
  255. }
  256.  
  257. @Override
  258. public boolean equals(final Object o) {
  259. if (o == this) {
  260. return true;
  261. }
  262. if (!(o instanceof AccountMojang)) {
  263. return false;
  264. }
  265. final AccountMojang other = (AccountMojang)o;
  266. if (!other.canEqual(this)) {
  267. return false;
  268. }
  269. if (!super.equals(o)) {
  270. return false;
  271. }
  272. final Object this$email = this.email;
  273. final Object other$email = other.email;
  274. Label_0075: {
  275. if (this$email == null) {
  276. if (other$email == null) {
  277. break Label_0075;
  278. }
  279. }
  280. else if (this$email.equals(other$email)) {
  281. break Label_0075;
  282. }
  283. return false;
  284. }
  285. final Object this$password = this.password;
  286. final Object other$password = other.password;
  287. if (this$password == null) {
  288. if (other$password == null) {
  289. return true;
  290. }
  291. }
  292. else if (this$password.equals(other$password)) {
  293. return true;
  294. }
  295. return false;
  296. }
  297.  
  298. @Override
  299. protected boolean canEqual(final Object other) {
  300. return other instanceof AccountMojang;
  301. }
  302.  
  303. @Override
  304. public int hashCode() {
  305. final int PRIME = 59;
  306. int result = 1;
  307. result = result * 59 + super.hashCode();
  308. final Object $email = this.email;
  309. result = result * 59 + (($email == null) ? 43 : $email.hashCode());
  310. final Object $password = this.password;
  311. result = result * 59 + (($password == null) ? 43 : $password.hashCode());
  312. return result;
  313. }
  314. }
  315.  
  316. public static class AccountCracked extends Account
  317. {
  318. public AccountCracked(final AccountManager.AccountType type) {
  319. super(type);
  320. }
  321.  
  322. public AccountCracked(final String username, final boolean offlinePlayer) throws InvalidPlayerException {
  323. super(AccountManager.AccountType.CRACKED);
  324. if (offlinePlayer) {
  325. this.uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes()).toString().replace("-", "");
  326. }
  327. else {
  328. this.uuid = "";
  329. try {
  330. final URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + username);
  331. final Scanner scanner = new Scanner(url.openStream());
  332. final String line = scanner.nextLine();
  333. this.uuid = line.split("\"")[3];
  334. scanner.close();
  335. }
  336. catch (Exception e) {
  337. throw new InvalidPlayerException();
  338. }
  339. }
  340. this.username = username;
  341. try {
  342. this.player = new EntityFakePlayer(this.username);
  343. }
  344. catch (Exception ex) {}
  345. this.line1 = String.valueOf(this.type.toString()) + ": " + username;
  346. this.line2 = this.getSession().getPlayerID().replace("-", "");
  347. GuiOverlay.notify("Added Account " + username, Color.ORANGE);
  348. }
  349.  
  350. @Override
  351. public boolean equals(final Object o) {
  352. if (o == this) {
  353. return true;
  354. }
  355. if (!(o instanceof AccountCracked)) {
  356. return false;
  357. }
  358. final AccountCracked other = (AccountCracked)o;
  359. return other.canEqual(this) && super.equals(o);
  360. }
  361.  
  362. @Override
  363. protected boolean canEqual(final Object other) {
  364. return other instanceof AccountCracked;
  365. }
  366.  
  367. @Override
  368. public int hashCode() {
  369. final int PRIME = 59;
  370. int result = 1;
  371. result = result * 59 + super.hashCode();
  372. return result;
  373. }
  374. }
  375.  
  376. public static class AccountSession extends Account
  377. {
  378. public AccountSession(final AccountManager.AccountType type) {
  379. super(type);
  380. }
  381.  
  382. public AccountSession(final Session session) {
  383. super(AccountManager.AccountType.SESSION);
  384. this.username = session.getUsername();
  385. this.uuid = session.getPlayerID();
  386. this.token = session.getToken();
  387. this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
  388. this.line2 = this.getSession().getPlayerID().replace("-", "");
  389. AccountManager.orig = this;
  390. }
  391.  
  392. @Override
  393. public String save() {
  394. return super.save();
  395. }
  396.  
  397. @Override
  398. public boolean equals(final Object o) {
  399. if (o == this) {
  400. return true;
  401. }
  402. if (!(o instanceof AccountSession)) {
  403. return false;
  404. }
  405. final AccountSession other = (AccountSession)o;
  406. return other.canEqual(this) && super.equals(o);
  407. }
  408.  
  409. @Override
  410. protected boolean canEqual(final Object other) {
  411. return other instanceof AccountSession;
  412. }
  413.  
  414. @Override
  415. public int hashCode() {
  416. final int PRIME = 59;
  417. int result = 1;
  418. result = result * 59 + super.hashCode();
  419. return result;
  420. }
  421. }
  422.  
  423. public static class AccountMCLeaks extends Account
  424. {
  425. public String session_mcleaks;
  426. public String token_mcleaks;
  427.  
  428. public AccountMCLeaks(final AccountManager.AccountType type) {
  429. super(type);
  430. }
  431.  
  432. public AccountMCLeaks(final String token) throws InvalidTokenException {
  433. super(AccountManager.AccountType.MCLeaks);
  434. if (token.length() != 16) {
  435. throw new InvalidTokenException(ChatColor.RED + "The token has to be 16 characters long!");
  436. }
  437. this.token_mcleaks = token;
  438. this.username = "...";
  439. this.uuid = UUID.randomUUID().toString();
  440. try {
  441. this.player = new EntityFakePlayer("");
  442. }
  443. catch (Exception ex) {}
  444. RedeemResponse response;
  445. ModApi.redeem(this.token_mcleaks, o -> {
  446. try {
  447. if (o instanceof String) {
  448. this.line1 = (String)o;
  449. throw new InvalidTokenException((String)o);
  450. }
  451. else {
  452. response = o;
  453. this.session_mcleaks = response.getSession();
  454. this.username = response.getMcName();
  455. try {
  456. this.player = new EntityFakePlayer(this.username);
  457. }
  458. catch (Exception ex2) {}
  459. this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
  460. this.line2 = this.token_mcleaks;
  461. GuiOverlay.notify("Added Account " + this.username, Color.ORANGE);
  462. }
  463. }
  464. catch (Exception e) {
  465. e.printStackTrace();
  466. }
  467. });
  468. }
  469.  
  470. public AccountMCLeaks(final String[] s) {
  471. super(AccountManager.AccountType.MCLeaks);
  472. this.username = s[0];
  473. try {
  474. this.player = new EntityFakePlayer(this.username);
  475. }
  476. catch (Exception ex) {}
  477. this.session_mcleaks = s[1];
  478. this.token_mcleaks = s[2];
  479. this.uuid = UUID.randomUUID().toString();
  480. this.line1 = String.valueOf(this.type.toString()) + ": " + this.username;
  481. this.line2 = this.token_mcleaks;
  482. }
  483.  
  484. @Override
  485. public void relog() {
  486. Chat.openWebLink("https://mcleaks.net/renew");
  487. GuiScreen.setClipboardString("token");
  488. GuiOverlay.notify("Copied token to clipboard!", Color.BLUE);
  489. }
  490.  
  491. @Override
  492. public String save() {
  493. return String.valueOf(super.save()) + ";" + this.session_mcleaks + ";" + this.token_mcleaks;
  494. }
  495.  
  496. @Override
  497. public boolean equals(final Object o) {
  498. if (o == this) {
  499. return true;
  500. }
  501. if (!(o instanceof AccountMCLeaks)) {
  502. return false;
  503. }
  504. final AccountMCLeaks other = (AccountMCLeaks)o;
  505. if (!other.canEqual(this)) {
  506. return false;
  507. }
  508. if (!super.equals(o)) {
  509. return false;
  510. }
  511. final Object this$session_mcleaks = this.session_mcleaks;
  512. final Object other$session_mcleaks = other.session_mcleaks;
  513. Label_0075: {
  514. if (this$session_mcleaks == null) {
  515. if (other$session_mcleaks == null) {
  516. break Label_0075;
  517. }
  518. }
  519. else if (this$session_mcleaks.equals(other$session_mcleaks)) {
  520. break Label_0075;
  521. }
  522. return false;
  523. }
  524. final Object this$token_mcleaks = this.token_mcleaks;
  525. final Object other$token_mcleaks = other.token_mcleaks;
  526. if (this$token_mcleaks == null) {
  527. if (other$token_mcleaks == null) {
  528. return true;
  529. }
  530. }
  531. else if (this$token_mcleaks.equals(other$token_mcleaks)) {
  532. return true;
  533. }
  534. return false;
  535. }
  536.  
  537. @Override
  538. protected boolean canEqual(final Object other) {
  539. return other instanceof AccountMCLeaks;
  540. }
  541.  
  542. @Override
  543. public int hashCode() {
  544. final int PRIME = 59;
  545. int result = 1;
  546. result = result * 59 + super.hashCode();
  547. final Object $session_mcleaks = this.session_mcleaks;
  548. result = result * 59 + (($session_mcleaks == null) ? 43 : $session_mcleaks.hashCode());
  549. final Object $token_mcleaks = this.token_mcleaks;
  550. result = result * 59 + (($token_mcleaks == null) ? 43 : $token_mcleaks.hashCode());
  551. return result;
  552. }
  553. }
  554. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement