Advertisement
Guest User

Untitled

a guest
Apr 16th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.94 KB | None | 0 0
  1. /*
  2. * Decompiled with CFR 0_118.
  3. *
  4. * Could not load the following classes:
  5. * POGOProtos.Data.PlayerDataOuterClass
  6. * POGOProtos.Data.PlayerDataOuterClass$PlayerData
  7. * POGOProtos.Data.PokemonDataOuterClass
  8. * POGOProtos.Data.PokemonDataOuterClass$PokemonData
  9. * POGOProtos.Enums.PokemonIdOuterClass
  10. * POGOProtos.Enums.PokemonIdOuterClass$PokemonId
  11. * POGOProtos.Enums.PokemonMoveOuterClass
  12. * POGOProtos.Enums.PokemonMoveOuterClass$PokemonMove
  13. * POGOProtos.Enums.QuestTypeOuterClass
  14. * POGOProtos.Enums.QuestTypeOuterClass$QuestType
  15. * com.google.gson.Gson
  16. * com.google.gson.GsonBuilder
  17. * com.google.protobuf.ProtocolStringList
  18. * com.pokegoapi.api.PokemonGo
  19. * com.pokegoapi.api.device.DeviceInfo
  20. * com.pokegoapi.api.gym.Gym
  21. * com.pokegoapi.api.inventory.Stats
  22. * com.pokegoapi.api.map.pokemon.CatchablePokemon
  23. * com.pokegoapi.api.player.PlayerProfile
  24. * com.pokegoapi.api.pokemon.Pokemon
  25. * com.pokegoapi.api.pokemon.PokemonCpUtils
  26. * com.pokegoapi.google.common.geometry.S2Cell
  27. * com.pokegoapi.google.common.geometry.S2CellId
  28. * com.pokegoapi.google.common.geometry.S2LatLng
  29. * com.pokegoapi.google.common.geometry.S2Point
  30. * ninja.pokebot.gson.ProxyGson
  31. * ninja.pokebot.gson.SettingsGson
  32. * ninja.pokebot.o.EU
  33. * ninja.pokebot.o.Eq
  34. * ninja.pokebot.o.FG
  35. * ninja.pokebot.o.FI
  36. * ninja.pokebot.o.Gp
  37. * ninja.pokebot.o.SA
  38. * ninja.pokebot.o.aI
  39. * ninja.pokebot.o.by
  40. * ninja.pokebot.o.eB
  41. * ninja.pokebot.o.fq
  42. * ninja.pokebot.o.iT
  43. * ninja.pokebot.o.ie
  44. * ninja.pokebot.o.jZ
  45. * ninja.pokebot.o.jf
  46. * ninja.pokebot.o.jq
  47. * ninja.pokebot.o.kV
  48. * ninja.pokebot.o.l
  49. * ninja.pokebot.o.lQ
  50. * ninja.pokebot.o.mQ
  51. * ninja.pokebot.o.oA
  52. * ninja.pokebot.o.rU
  53. * ninja.pokebot.o.tC
  54. * ninja.pokebot.o.tp
  55. * ninja.pokebot.o.ue
  56. * ninja.pokebot.o.um
  57. * ninja.pokebot.o.xl
  58. * ninja.pokebot.o.yl
  59. * okhttp3.Authenticator
  60. * okhttp3.Call
  61. * okhttp3.Callback
  62. * okhttp3.Interceptor
  63. * okhttp3.OkHttpClient
  64. * okhttp3.OkHttpClient$Builder
  65. * okhttp3.Request
  66. * okhttp3.Request$Builder
  67. * okhttp3.Response
  68. * okhttp3.ResponseBody
  69. * okhttp3.internal.Version
  70. */
  71. package ninja.pokebot.o;
  72.  
  73. import POGOProtos.Data.PlayerDataOuterClass;
  74. import POGOProtos.Data.PokemonDataOuterClass;
  75. import POGOProtos.Enums.PokemonIdOuterClass;
  76. import POGOProtos.Enums.PokemonMoveOuterClass;
  77. import POGOProtos.Enums.QuestTypeOuterClass;
  78. import com.google.gson.Gson;
  79. import com.google.gson.GsonBuilder;
  80. import com.google.protobuf.ProtocolStringList;
  81. import com.pokegoapi.api.PokemonGo;
  82. import com.pokegoapi.api.device.DeviceInfo;
  83. import com.pokegoapi.api.gym.Gym;
  84. import com.pokegoapi.api.inventory.Stats;
  85. import com.pokegoapi.api.map.pokemon.CatchablePokemon;
  86. import com.pokegoapi.api.player.PlayerProfile;
  87. import com.pokegoapi.api.pokemon.Pokemon;
  88. import com.pokegoapi.api.pokemon.PokemonCpUtils;
  89. import com.pokegoapi.google.common.geometry.S2Cell;
  90. import com.pokegoapi.google.common.geometry.S2CellId;
  91. import com.pokegoapi.google.common.geometry.S2LatLng;
  92. import com.pokegoapi.google.common.geometry.S2Point;
  93. import java.awt.AWTException;
  94. import java.awt.Color;
  95. import java.awt.Component;
  96. import java.awt.Cursor;
  97. import java.awt.Desktop;
  98. import java.awt.Dimension;
  99. import java.awt.Font;
  100. import java.awt.Frame;
  101. import java.awt.Image;
  102. import java.awt.MenuItem;
  103. import java.awt.PopupMenu;
  104. import java.awt.SystemTray;
  105. import java.awt.TrayIcon;
  106. import java.awt.event.ActionListener;
  107. import java.awt.event.MouseListener;
  108. import java.awt.font.TextAttribute;
  109. import java.io.File;
  110. import java.io.IOException;
  111. import java.io.PrintStream;
  112. import java.io.PrintWriter;
  113. import java.io.Serializable;
  114. import java.io.StringWriter;
  115. import java.io.Writer;
  116. import java.net.Authenticator;
  117. import java.net.DatagramPacket;
  118. import java.net.DatagramSocket;
  119. import java.net.InetAddress;
  120. import java.net.InetSocketAddress;
  121. import java.net.Proxy;
  122. import java.net.SocketAddress;
  123. import java.net.SocketTimeoutException;
  124. import java.net.URI;
  125. import java.net.URISyntaxException;
  126. import java.net.URL;
  127. import java.nio.file.Files;
  128. import java.nio.file.OpenOption;
  129. import java.nio.file.Path;
  130. import java.nio.file.Paths;
  131. import java.security.CodeSource;
  132. import java.security.Key;
  133. import java.security.KeyFactory;
  134. import java.security.ProtectionDomain;
  135. import java.security.PublicKey;
  136. import java.security.SecureRandom;
  137. import java.security.Signature;
  138. import java.security.interfaces.RSAPublicKey;
  139. import java.security.spec.KeySpec;
  140. import java.security.spec.X509EncodedKeySpec;
  141. import java.text.AttributedCharacterIterator;
  142. import java.text.DecimalFormat;
  143. import java.text.DecimalFormatSymbols;
  144. import java.util.ArrayList;
  145. import java.util.Collections;
  146. import java.util.GregorianCalendar;
  147. import java.util.HashMap;
  148. import java.util.Iterator;
  149. import java.util.List;
  150. import java.util.Locale;
  151. import java.util.Map;
  152. import java.util.Set;
  153. import java.util.concurrent.TimeUnit;
  154. import javax.crypto.Cipher;
  155. import javax.net.ssl.HostnameVerifier;
  156. import javax.net.ssl.HttpsURLConnection;
  157. import javax.net.ssl.KeyManager;
  158. import javax.net.ssl.SSLContext;
  159. import javax.net.ssl.SSLSocketFactory;
  160. import javax.net.ssl.TrustManager;
  161. import javax.net.ssl.X509TrustManager;
  162. import javax.swing.Action;
  163. import javax.swing.JDialog;
  164. import javax.swing.JFrame;
  165. import javax.swing.JLabel;
  166. import javax.swing.JMenuItem;
  167. import javax.swing.JOptionPane;
  168. import javax.swing.JPopupMenu;
  169. import javax.swing.Timer;
  170. import javax.swing.text.DefaultEditorKit;
  171. import javax.swing.text.JTextComponent;
  172. import ninja.pokebot.gson.ProxyGson;
  173. import ninja.pokebot.gson.SettingsGson;
  174. import ninja.pokebot.o.EU;
  175. import ninja.pokebot.o.Eq;
  176. import ninja.pokebot.o.FG;
  177. import ninja.pokebot.o.FI;
  178. import ninja.pokebot.o.Gp;
  179. import ninja.pokebot.o.SA;
  180. import ninja.pokebot.o.aI;
  181. import ninja.pokebot.o.by;
  182. import ninja.pokebot.o.eB;
  183. import ninja.pokebot.o.fq;
  184. import ninja.pokebot.o.iT;
  185. import ninja.pokebot.o.ie;
  186. import ninja.pokebot.o.jZ;
  187. import ninja.pokebot.o.jf;
  188. import ninja.pokebot.o.jq;
  189. import ninja.pokebot.o.kV;
  190. import ninja.pokebot.o.l;
  191. import ninja.pokebot.o.lQ;
  192. import ninja.pokebot.o.mQ;
  193. import ninja.pokebot.o.oA;
  194. import ninja.pokebot.o.rU;
  195. import ninja.pokebot.o.tC;
  196. import ninja.pokebot.o.tp;
  197. import ninja.pokebot.o.ue;
  198. import ninja.pokebot.o.um;
  199. import ninja.pokebot.o.xl;
  200. import ninja.pokebot.o.yl;
  201. import okhttp3.Call;
  202. import okhttp3.Callback;
  203. import okhttp3.Interceptor;
  204. import okhttp3.OkHttpClient;
  205. import okhttp3.Request;
  206. import okhttp3.Response;
  207. import okhttp3.ResponseBody;
  208. import okhttp3.internal.Version;
  209.  
  210. /*
  211. * Duplicate member names - consider using --renamedupmembers true
  212. */
  213. public class ji {
  214. private static DecimalFormat a;
  215. private static DecimalFormat b;
  216. private static DecimalFormat c;
  217. private static OkHttpClient a;
  218. private static boolean a;
  219. private static int a;
  220. private static boolean b;
  221. private static String a;
  222. private static final byte[] a;
  223. private static TrayIcon a;
  224. private static final HashMap<Integer, Integer> a;
  225.  
  226. public static void a(String object) {
  227. Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
  228. if (desktop == null || !desktop.isSupported(Desktop.Action.BROWSE)) {
  229. EU.e((String)("Cannot open URL with browser: " + (String)object));
  230. return;
  231. }
  232. try {
  233. object = new URI((String)object);
  234. desktop.browse((URI)object);
  235. return;
  236. }
  237. catch (IOException | URISyntaxException v0) {
  238. v0.printStackTrace(System.out);
  239. return;
  240. }
  241. }
  242.  
  243. public static boolean a(long l) {
  244. return ji.a(l, l, l);
  245. }
  246.  
  247. public static boolean a(long l, long l2) {
  248. return ji.a(l, l2, l2);
  249. }
  250.  
  251. public static boolean a(long l, long l2, long l3) {
  252. if (l2 <= 0) {
  253. return true;
  254. }
  255. if (l < 0) {
  256. l = 0;
  257. }
  258. if (l2 < l) {
  259. l ^= (l2 ^= (l ^= l2));
  260. }
  261. long l4 = Math.round(Math.random() * (double)(l2 - l)) + l;
  262. if (l3 > l2 && Math.round(Math.random() * 100.0) < 5) {
  263. l4 += Math.round(Math.random() * (double)(l3 - l2));
  264. }
  265. try {
  266. Thread.sleep(l4);
  267. }
  268. catch (InterruptedException var0_1) {
  269. System.err.println(var0_1.getMessage());
  270. return false;
  271. }
  272. return true;
  273. }
  274.  
  275. public static boolean a(Component component, String string) {
  276. if (JOptionPane.showConfirmDialog(component, string, um.a().getString("Are you sure?"), 2, 3) == 0) {
  277. return true;
  278. }
  279. return false;
  280. }
  281.  
  282. public static boolean a(Component component, String string, String string2, boolean bl) {
  283. if (JOptionPane.showConfirmDialog(component, string2, string, 0, bl ? 2 : 3) == 0) {
  284. return true;
  285. }
  286. return false;
  287. }
  288.  
  289. public static Boolean a(Component component, String string) {
  290. int n = JOptionPane.showConfirmDialog(component, string, um.a().getString("Are you sure?"), 1, 2);
  291. if (n == 0) {
  292. return true;
  293. }
  294. if (n == 1) {
  295. return false;
  296. }
  297. return null;
  298. }
  299.  
  300. public static int a(Component component, String string) {
  301. return ji.a(JOptionPane.showInputDialog(component, string, "4"), 0);
  302. }
  303.  
  304. public static String a(Component component, String string, String string2) {
  305. return JOptionPane.showInputDialog(component, string, string2);
  306. }
  307.  
  308. public static void a(Component component, String string) {
  309. JOptionPane.showMessageDialog(component, string, um.a().getString("Warning"), 2);
  310. }
  311.  
  312. public static void b(Component component, String string) {
  313. JOptionPane.showMessageDialog(component, string, um.a().getString("Success"), -1);
  314. }
  315.  
  316. public static double a(aI aI2, aI aI3) {
  317. return ji.a(aI2.a, aI2.b, aI3.a, aI3.b);
  318. }
  319.  
  320. public static double b(aI aI2, aI aI3) {
  321. double d = aI2.b;
  322. double d2 = aI3.b;
  323. double d3 = Math.toRadians(aI2.a);
  324. double d4 = Math.toRadians(aI3.a);
  325. double d5 = Math.toRadians(d2 - d);
  326. double d6 = Math.sin(d5) * Math.cos(d4);
  327. double d7 = Math.cos(d3) * Math.sin(d4) - Math.sin(d3) * Math.cos(d4) * Math.cos(d5);
  328. return (Math.toDegrees(Math.atan2(d6, d7)) + 360.0) % 360.0;
  329. }
  330.  
  331. public static double a(double d, double d2, double d3, double d4) {
  332. double d5;
  333. double d6 = Math.toRadians(d);
  334. double d7 = Math.toRadians(d3);
  335. double d8 = Math.toRadians(d2);
  336. double d9 = Math.toRadians(d4);
  337. double d10 = Math.sin(0.5 * (d7 - d6));
  338. double d11 = d10 * d10 + (d5 = Math.sin(0.5 * (d9 - d8))) * d5 * Math.cos(d6) * Math.cos(d7);
  339. double d12 = 2.0 * Math.atan2(Math.sqrt(d11), Math.sqrt(Math.max(0.0, 1.0 - d11))) * 6367000.0;
  340. if (Double.isInfinite(d12) || Double.isNaN(d12)) {
  341. return 0.0;
  342. }
  343. return d12;
  344. }
  345.  
  346. public static double a() {
  347. return (Math.random() - 0.5) * 5.0E-7;
  348. }
  349.  
  350. public static String a(double d) {
  351. if (a == null) {
  352. a = new DecimalFormat("0.000");
  353. DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
  354. decimalFormatSymbols.setDecimalSeparator('.');
  355. decimalFormatSymbols.setGroupingSeparator(' ');
  356. a.setDecimalFormatSymbols(decimalFormatSymbols);
  357. }
  358. return a.format(d);
  359. }
  360.  
  361. public static String b(double d) {
  362. if (b == null) {
  363. b = new DecimalFormat("0.0");
  364. DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
  365. decimalFormatSymbols.setDecimalSeparator('.');
  366. decimalFormatSymbols.setGroupingSeparator(' ');
  367. b.setDecimalFormatSymbols(decimalFormatSymbols);
  368. }
  369. return b.format(d);
  370. }
  371.  
  372. public static String c(double d) {
  373. if (c == null) {
  374. c = new DecimalFormat("0.000000000");
  375. DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
  376. decimalFormatSymbols.setDecimalSeparator('.');
  377. decimalFormatSymbols.setGroupingSeparator(' ');
  378. c.setDecimalFormatSymbols(decimalFormatSymbols);
  379. }
  380. return c.format(d);
  381. }
  382.  
  383. public static double a(String string) {
  384. double d;
  385. string = string.replace(',', '.').replaceAll("\\s+", "");
  386. d = 0.0;
  387. try {
  388. d = Double.parseDouble(string);
  389. }
  390. catch (NumberFormatException v0) {}
  391. if (Double.isInfinite(d) || Double.isNaN(d)) {
  392. d = 0.0;
  393. }
  394. return d;
  395. }
  396.  
  397. public static Double a(String object, Double d) {
  398. object = object.replace(',', '.').replaceAll("\\s+", "");
  399. try {
  400. object = Double.parseDouble((String)object);
  401. }
  402. catch (NumberFormatException v0) {
  403. return d;
  404. }
  405. if (Double.isInfinite(object.doubleValue()) || Double.isNaN(object.doubleValue())) {
  406. object = d;
  407. }
  408. return object;
  409. }
  410.  
  411. public static String a(long l) {
  412. String string = String.valueOf(l);
  413. while (string.length() < 2) {
  414. string = "0" + string;
  415. }
  416. return string;
  417. }
  418.  
  419. public static String b(long l) {
  420. GregorianCalendar gregorianCalendar = new GregorianCalendar();
  421. gregorianCalendar.setTimeInMillis(l);
  422. return ji.a(gregorianCalendar.get(11)) + ":" + ji.a(gregorianCalendar.get(12)) + ":" + ji.a(gregorianCalendar.get(13));
  423. }
  424.  
  425. public static String c(long l) {
  426. long l2 = l / 86400;
  427. long l3 = (l %= 86400) / 3600;
  428. long l4 = (l %= 3600) / 60;
  429. l %= 60;
  430. boolean bl = false;
  431. String string = "";
  432. if (l2 > 0) {
  433. string = string + " " + l2 + " days";
  434. bl = true;
  435. }
  436. if (l3 > 0 || bl) {
  437. string = string + " " + l3 + " hours";
  438. bl = true;
  439. }
  440. if (l4 > 0 || bl) {
  441. string = string + " " + l4 + " minutes";
  442. }
  443. return (string + " " + l + " seconds").substring(1);
  444. }
  445.  
  446. public static String d(long l) {
  447. if (l <= 0) {
  448. return "-";
  449. }
  450. long l2 = l / 1000;
  451. long l3 = l2 % 60;
  452. long l4 = (l2 /= 60) % 60;
  453. long l5 = l2 / 60 % 60;
  454. return ji.a(l5) + ":" + ji.a(l4) + ":" + ji.a(l3);
  455. }
  456.  
  457. public static void a(JLabel jLabel) {
  458. jLabel.setCursor(Cursor.getPredefinedCursor(12));
  459. Font font = jLabel.getFont();
  460. HashMap<TextAttribute, Integer> hashMap = new HashMap<TextAttribute, Integer>();
  461. hashMap.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
  462. jLabel.setFont(font.deriveFont(hashMap));
  463. }
  464.  
  465. public static void b(JLabel jLabel) {
  466. jLabel.setCursor(Cursor.getPredefinedCursor(0));
  467. Font font = jLabel.getFont();
  468. HashMap<TextAttribute, Integer> hashMap = new HashMap<TextAttribute, Integer>();
  469. hashMap.put(TextAttribute.UNDERLINE, -1);
  470. jLabel.setFont(font.deriveFont(hashMap));
  471. }
  472.  
  473. public static void a(JLabel jLabel, Object object) {
  474. ji.a(jLabel);
  475. jLabel.addMouseListener((MouseListener)new jZ(object));
  476. }
  477.  
  478. public static OkHttpClient a(DeviceInfo deviceInfo) {
  479. return ji.a(by.a(), deviceInfo);
  480. }
  481.  
  482. private static OkHttpClient.Builder a(OkHttpClient.Builder builder, boolean bl) {
  483. Object object;
  484. TrustManager[] arrtrustManager;
  485. arrtrustManager = new X509TrustManager[]{new l()};
  486. object = null;
  487. try {
  488. object = SSLContext.getInstance("SSL");
  489. object.init(null, arrtrustManager, new SecureRandom());
  490. }
  491. catch (Exception v0) {}
  492. object = object.getSocketFactory();
  493. builder.sslSocketFactory((SSLSocketFactory)object, (X509TrustManager)arrtrustManager[0]);
  494. if (bl) {
  495. HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory)object);
  496. }
  497. builder.hostnameVerifier((HostnameVerifier)new eB());
  498. return builder;
  499. }
  500.  
  501. public static OkHttpClient a() {
  502. OkHttpClient.Builder builder = new OkHttpClient.Builder();
  503. builder.connectTimeout(20, TimeUnit.SECONDS);
  504. builder.readTimeout(20, TimeUnit.SECONDS);
  505. builder.writeTimeout(20, TimeUnit.SECONDS);
  506. ji.a(builder, false);
  507. return builder.build();
  508. }
  509.  
  510. public static OkHttpClient a(ProxyGson proxyGson, DeviceInfo deviceInfo) {
  511. do {
  512. String string;
  513. Authenticator.setDefault(null);
  514. OkHttpClient.Builder builder = new OkHttpClient.Builder();
  515. builder.connectTimeout(20, TimeUnit.SECONDS);
  516. builder.readTimeout(20, TimeUnit.SECONDS);
  517. builder.writeTimeout(20, TimeUnit.SECONDS);
  518. if (deviceInfo != null) {
  519. builder.addNetworkInterceptor((Interceptor)new Gp(FI.a()));
  520. }
  521. if (by.b) {
  522. ji.a(builder, true);
  523. }
  524. if (proxyGson == null) {
  525. try {
  526. return builder.build();
  527. }
  528. catch (AssertionError var3_6) {
  529. if (by.b) {
  530. throw var3_6;
  531. }
  532. by.b = true;
  533. continue;
  534. }
  535. }
  536. builder.proxy(new Proxy(proxyGson.type, new InetSocketAddress(proxyGson.host, proxyGson.port)));
  537. String string2 = proxyGson.username == null ? "" : proxyGson.username;
  538. String string3 = string = proxyGson.password == null ? "" : proxyGson.password;
  539. if (string2.length() == 0 && string.length() == 0) {
  540. try {
  541. return builder.build();
  542. }
  543. catch (AssertionError var2_3) {
  544. if (by.b) {
  545. throw var2_3;
  546. }
  547. by.b = true;
  548. continue;
  549. }
  550. }
  551. if (proxyGson.type == Proxy.Type.HTTP) {
  552. builder.proxyAuthenticator((okhttp3.Authenticator)new yl(string2, string));
  553. } else {
  554. Authenticator.setDefault((Authenticator)new kV(string2, string));
  555. }
  556. try {
  557. return builder.build();
  558. }
  559. catch (AssertionError var2_4) {
  560. if (by.b) {
  561. throw var2_4;
  562. }
  563. by.b = true;
  564. continue;
  565. }
  566. break;
  567. } while (true);
  568. }
  569.  
  570. public static String a(String string) {
  571. try {
  572. boolean bl;
  573. if (a == null) {
  574. a = ji.a();
  575. }
  576. boolean bl2 = bl = by.c() != null && by.c().length() > 0 && by.d() != null && by.d().length() > 0 && by.e() != null && by.e().length() > 0;
  577. string = new Request.Builder().url(string).header("User-Agent", Version.userAgent() + "/98/" + (ji.b() && bl ? new StringBuilder("D").append(ji.a()).toString() : (ji.b() ? new StringBuilder("d").append(ji.a()).toString() : "-")) + "/" + by.g()).header("Cache-Key", xl.a((byte[])(bl ? by.d() + "|" + by.c() + "|" + by.e() : "" + ji.a()).getBytes())).build();
  578. return a.newCall((Request)string).execute().body().string();
  579. }
  580. catch (Exception v1) {
  581. v1.printStackTrace(System.out);
  582. return null;
  583. }
  584. }
  585.  
  586. public static void a(JFrame jFrame, boolean bl) {
  587. if (ji.b()) {
  588. return;
  589. }
  590. if (a && !bl) {
  591. return;
  592. }
  593. a = true;
  594. if (ji.a(jFrame, um.a().getString("Do you want to donate?"), um.a().getString("Would you like to donate to support the development of PokeBot.Ninja?"), false)) {
  595. ji.a("http://pokebot.ninja/donate.php");
  596. }
  597. }
  598.  
  599. public static boolean a() {
  600. return true;
  601. }
  602.  
  603. public static void a() {
  604. ji.a(true);
  605. Timer timer = new Timer(3600000, (ActionListener)new rU());
  606. timer.setInitialDelay(5);
  607. timer.start();
  608. }
  609.  
  610. public static void a(String string, byte[] arrby) {
  611. ji.a(new File(string), arrby);
  612. }
  613.  
  614. public static void a(File file, byte[] arrby) {
  615. Files.write(file.toPath(), arrby, new OpenOption[0]);
  616. }
  617.  
  618. private static String b() {
  619. try {
  620. String string = new File(ji.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getAbsolutePath();
  621. if (string.endsWith(".jar")) {
  622. return string.replaceAll("PokeBotNinja.jar", "");
  623. }
  624. }
  625. catch (Exception v0) {}
  626. return Paths.get(".", new String[0]).toAbsolutePath().normalize().toString() + File.separator;
  627. }
  628.  
  629. public static void a(String[] arrstring) {
  630. String string = null;
  631. for (int i = 0; i < arrstring.length; ++i) {
  632. if (!arrstring[i].equals("-config") && !arrstring[i].equals("/config") && !arrstring[i].equals("/conf") && !arrstring[i].equals("-conf")) continue;
  633. if (arrstring.length <= i + 1) break;
  634. string = arrstring[i + 1];
  635. arrstring[i] = null;
  636. arrstring[i + 1] = null;
  637. break;
  638. }
  639. if (string != null) {
  640. a = string;
  641. }
  642. }
  643.  
  644. public static SettingsGson a() {
  645. SettingsGson settingsGson;
  646. File file = a == null ? new File(ji.b() + "ninja.json") : new File(a);
  647. if (!file.exists()) {
  648. System.out.println("Settings file does not exist, creating it to: " + file.getAbsolutePath());
  649. SettingsGson settingsGson2 = new SettingsGson();
  650. ji.a(settingsGson2);
  651. return settingsGson2;
  652. }
  653. System.out.println("Loading settings from: " + file.getAbsolutePath());
  654. try {
  655. settingsGson = Files.readAllBytes(file.toPath());
  656. settingsGson = (SettingsGson)new GsonBuilder().create().fromJson(new String((byte[])settingsGson), SettingsGson.class);
  657. if (settingsGson != null) {
  658. return settingsGson;
  659. }
  660. }
  661. catch (Exception var1_3) {
  662. System.out.println(var1_3.getMessage());
  663. }
  664. System.out.println("Failed to read configuration, recreating it to: " + file.getAbsolutePath());
  665. settingsGson = new SettingsGson();
  666. ji.a(settingsGson);
  667. return settingsGson;
  668. }
  669.  
  670. public static void a(SettingsGson arrby) {
  671. if (arrby == null) {
  672. System.out.println("No settings to save!?");
  673. return;
  674. }
  675. File file = a == null ? new File(ji.b() + "ninja.json") : new File(a);
  676. arrby = new GsonBuilder().setPrettyPrinting().create().toJson((Object)arrby).getBytes();
  677. try {
  678. ji.a(file, arrby);
  679. return;
  680. }
  681. catch (IOException var0_1) {
  682. System.out.println(var0_1.getMessage());
  683. System.out.println("Failed to write 'ninja.json', settings will not be saved to: " + file.getAbsolutePath());
  684. return;
  685. }
  686. }
  687.  
  688. public static String a(Enum arrstring) {
  689. CharSequence charSequence = arrstring.name();
  690. if (charSequence == null || "".equals(charSequence)) {
  691. return "";
  692. }
  693. charSequence = charSequence.replaceAll("ITEM_", "").replaceAll("BADGE_", "").replaceAll("ERROR_", "").replaceAll("BADGE_", "");
  694. if (arrstring instanceof PokemonMoveOuterClass.PokemonMove) {
  695. charSequence = charSequence.replaceAll("_FAST", "");
  696. }
  697. if (arrstring instanceof QuestTypeOuterClass.QuestType) {
  698. charSequence = charSequence.replaceAll("QUEST_", "");
  699. }
  700. arrstring = charSequence.split("_");
  701. charSequence = new StringBuilder(charSequence.length());
  702. for (int i = 0; i < arrstring.length; ++i) {
  703. if (i > 0) {
  704. charSequence.append(" ");
  705. }
  706. charSequence.append(ji.b(arrstring[i]));
  707. }
  708. return charSequence.toString();
  709. }
  710.  
  711. public static String b(String string) {
  712. if (string == null || "".equals(string)) {
  713. return "";
  714. }
  715. String string2 = string.substring(0, 1).toUpperCase();
  716. if (string.length() == 1) {
  717. return string2;
  718. }
  719. string = string.substring(1, string.length()).toLowerCase();
  720. return string2 + string;
  721. }
  722.  
  723. public static String d(double d) {
  724. if (Math.abs(d - Math.floor(d + 1.0E-4)) < 0.001) {
  725. return "" + (int)(Math.floor(d + 1.0E-4) + 1.0E-4);
  726. }
  727. return String.valueOf(d);
  728. }
  729.  
  730. public static int a(String string, int n) {
  731. try {
  732. return Integer.parseInt(string.trim());
  733. }
  734. catch (Exception v0) {
  735. return n;
  736. }
  737. }
  738.  
  739. public static Integer a(String string) {
  740. try {
  741. return Integer.parseInt(string.trim());
  742. }
  743. catch (Exception v0) {
  744. return null;
  745. }
  746. }
  747.  
  748. public static String a() {
  749. if (!ji.b() || ji.a() < 0) {
  750. return "";
  751. }
  752. if (ji.a() == 0) {
  753. return " " + um.a().getString("Radioactive");
  754. }
  755. if (ji.a() == 1) {
  756. return " " + um.a().getString("Silver");
  757. }
  758. if (ji.a() == 2) {
  759. return " " + um.a().getString("Gold");
  760. }
  761. if (ji.a() == 3) {
  762. return " " + um.a().getString("Platinum");
  763. }
  764. if (ji.a() == 4) {
  765. return " " + um.a().getString("Radioactive");
  766. }
  767. return " " + um.a().getString("Radioactive") + "+";
  768. }
  769.  
  770. public static void a(JFrame jFrame, FI object) {
  771. object = object != null && object.a.getPlayerProfile().getPlayerData().getUsername().length() > 0 ? " - " + object.a.getPlayerProfile().getPlayerData().getUsername() : "";
  772. jFrame.setTitle(jFrame.getTitle() + " - v98" + ji.a() + (String)object);
  773. }
  774.  
  775. public static void a(JDialog jDialog, FI object) {
  776. object = object != null && object.a.getPlayerProfile().getPlayerData().getUsername().length() > 0 ? " - " + object.a.getPlayerProfile().getPlayerData().getUsername() : "";
  777. jDialog.setTitle(jDialog.getTitle() + " - v98" + ji.a() + (String)object);
  778. }
  779.  
  780. public static String a(Pokemon pokemon) {
  781. if (pokemon == null) {
  782. return "Null!?";
  783. }
  784. return ji.a((Enum)pokemon.getPokemonId());
  785. }
  786.  
  787. public static String b(Pokemon pokemon) {
  788. if (pokemon == null) {
  789. return "Null!?";
  790. }
  791. String string = mQ.b((Pokemon)pokemon) ? um.a((String)"Shiny") + " " : "";
  792. return string + ji.a((Enum)pokemon.getPokemonId()) + "(cp=" + pokemon.getCp() + ",iv=" + Math.round(pokemon.getIvRatio() * 100.0) + "%,lvl=" + pokemon.getLevel() + new StringBuilder(",").append(ji.a((Enum)pokemon.getMove1())).append(",").append(ji.a((Enum)pokemon.getMove2())).toString() + ")";
  793. }
  794.  
  795. public static String a(PokemonDataOuterClass.PokemonData pokemonData) {
  796. float f = PokemonCpUtils.getLevelFromCpMultiplier((float)(pokemonData.getAdditionalCpMultiplier() + pokemonData.getCpMultiplier()));
  797. return ji.a((Enum)pokemonData.getPokemonId()) + "(cp=" + pokemonData.getCp() + ",iv=" + Math.round(ji.a(pokemonData) * 100.0) + "%,lvl=" + f + new StringBuilder(",").append(ji.a((Enum)pokemonData.getMove1())).append(",").append(ji.a((Enum)pokemonData.getMove2())).toString() + ")";
  798. }
  799.  
  800. public static Color a(Color[] arrcolor, double d, double d2, double d3) {
  801. if (arrcolor.length == 1 || d3 <= 0.0) {
  802. return arrcolor[0];
  803. }
  804. if (d3 >= d2) {
  805. return arrcolor[arrcolor.length - 1];
  806. }
  807. double d4 = d2 / (double)(arrcolor.length - 1);
  808. int n = Math.max(0, Math.min(arrcolor.length - 2, (int)Math.floor(d3 / d4)));
  809. float[] arrf = arrcolor[n].getRGBColorComponents(null);
  810. arrcolor = arrcolor[n + 1].getRGBColorComponents(null);
  811. float[] arrf2 = new float[arrf.length];
  812. for (int i = 0; i < arrf.length; ++i) {
  813. arrf2[i] = (float)((double)arrf[i] + (Object)(arrcolor[i] - arrf[i]) * (d3 - (double)n * d4) / d4);
  814. }
  815. return new Color(arrf2[0], arrf2[1], arrf2[2]);
  816. }
  817.  
  818. public static boolean a(boolean bl) {
  819. String[] arrstring = System.getProperty("java.version");
  820. if (bl) {
  821. System.out.println("You are using Java " + (String)arrstring);
  822. }
  823. if (arrstring.startsWith("1.7")) {
  824. if (bl) {
  825. System.out.println("Please update your java to at least version 1.8!");
  826. }
  827. return false;
  828. }
  829. if (arrstring.startsWith("1.8") && (arrstring = arrstring.split("_")).length > 1 && ji.a(arrstring[1], 0) < 60) {
  830. if (bl) {
  831. System.out.println("Starting from Java 1.8.0_60 the Map should work better, please upgrade if possible!");
  832. }
  833. return false;
  834. }
  835. return BADBOOL 4;
  836. }
  837.  
  838. public static boolean b() {
  839. String string = by.c();
  840. String string2 = by.e();
  841. String string3 = by.d();
  842. return ji.a(string, string2, string3);
  843. }
  844.  
  845. public static int a() {
  846. if (!ji.b()) {
  847. return 0;
  848. }
  849. String string = by.d();
  850. if (string == null || string.length() <= 0) {
  851. return 0;
  852. }
  853. return ji.a(string.substring(0, 1), 0);
  854. }
  855.  
  856. public static boolean a(String string, String string2, String string3) {
  857. if (string == null || string2 == null) {
  858. return false;
  859. }
  860. try {
  861. RSAPublicKey rSAPublicKey = (RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(a));
  862. Signature signature = Signature.getInstance("SHA1withRSA");
  863. signature.initVerify(rSAPublicKey);
  864. signature.update((string + "|" + string3).getBytes("UTF-8"));
  865. return signature.verify(xl.a((byte[])string2.getBytes("UTF-8")));
  866. }
  867. catch (Exception v0) {
  868. v0.printStackTrace(System.out);
  869. return false;
  870. }
  871. }
  872.  
  873. public static aI a(aI aI2, double d, double d2) {
  874. double d3 = Math.random();
  875. double d4 = Math.random();
  876. double d5 = d3 * d;
  877. double d6 = Math.toRadians(aI2.a);
  878. double d7 = Math.toRadians(aI2.b);
  879. double d8 = 1.5707963267948966 - d5 / 6367.0;
  880. double d9 = d4 * 2.0 * 3.141592653589793;
  881. double d10 = Math.cos(d8) * Math.sin(d9);
  882. double d11 = Math.cos(d8) * Math.cos(d9);
  883. double d12 = Math.sin(d8);
  884. double d13 = 1.5707963267948966 - d6;
  885. double d14 = d11 * Math.cos(d13) + d12 * Math.sin(d13);
  886. double d15 = (- d11) * Math.sin(d13) + d12 * Math.cos(d13);
  887. double d16 = d10 * Math.cos(d7) + d14 * Math.sin(d7);
  888. double d17 = (- d10) * Math.sin(d7) + d14 * Math.cos(d7);
  889. d9 = Math.atan2(d16, d17);
  890. d8 = Math.asin(d15);
  891. return new aI(Math.toDegrees(d8), Math.toDegrees(d9), aI2.c + (Math.random() - 0.5) * d2);
  892. }
  893.  
  894. public static double a(PokemonDataOuterClass.PokemonData pokemonData) {
  895. return (double)(pokemonData.getIndividualAttack() + pokemonData.getIndividualDefense() + pokemonData.getIndividualStamina()) / 45.0;
  896. }
  897.  
  898. public static void a(FI fI, ProtocolStringList protocolStringList) {
  899. for (int i = 0; i < protocolStringList.size(); ++i) {
  900. fI.a.newCall(new Request.Builder().url((String)protocolStringList.get(i)).build()).enqueue((Callback)new SA());
  901. }
  902. }
  903.  
  904. public static byte[] a() {
  905. return a;
  906. }
  907.  
  908. public static void b() {
  909. if (System.getProperty("java.net.preferIPv4Stack", null) != null) {
  910. return;
  911. }
  912. try {
  913. System.setProperty("java.net.preferIPv4Stack", "true");
  914. return;
  915. }
  916. catch (Exception v0) {
  917. return;
  918. }
  919. }
  920.  
  921. public static void a(FI object) {
  922. if (a == null) {
  923. return;
  924. }
  925. Image image = lQ.a();
  926. if (a.getImage() != image) {
  927. a.setImage(image);
  928. }
  929. SystemTray.getSystemTray().getTrayIconSize();
  930. try {
  931. object = object.a.getPlayerProfile();
  932. object = "PokeBot.Ninja - " + object.getPlayerData().getUsername() + " level " + object.getStats().getLevel();
  933. if (!object.equals(a.getToolTip())) {
  934. a.setToolTip((String)object);
  935. }
  936. return;
  937. }
  938. catch (Exception v0) {
  939. return;
  940. }
  941. }
  942.  
  943. public static void c() {
  944. Image image;
  945. if (!SystemTray.isSupported()) {
  946. return;
  947. }
  948. SystemTray.getSystemTray().getTrayIconSize();
  949. if (a != null) {
  950. SystemTray.getSystemTray().remove(a);
  951. a = null;
  952. }
  953. if ((image = lQ.a()) == null) {
  954. return;
  955. }
  956. PopupMenu popupMenu = new PopupMenu("Menu label");
  957. MenuItem menuItem = new MenuItem("Show PokeBot.Ninja");
  958. menuItem.setEnabled(false);
  959. MenuItem menuItem2 = new MenuItem("Hide PokeBot.Ninja");
  960. menuItem2.setEnabled(true);
  961. MenuItem menuItem3 = new MenuItem("Exit PokeBot.Ninja");
  962. popupMenu.add(menuItem);
  963. popupMenu.add(menuItem2);
  964. popupMenu.addSeparator();
  965. popupMenu.add(menuItem3);
  966. menuItem.addActionListener((ActionListener)new ie(menuItem, menuItem2));
  967. menuItem2.addActionListener((ActionListener)new tC(menuItem, menuItem2));
  968. menuItem3.addActionListener((ActionListener)new tp());
  969. a = new TrayIcon(image, "PokeBot.Ninja", popupMenu);
  970. a.addActionListener((ActionListener)new jf(menuItem, menuItem2));
  971. try {
  972. SystemTray.getSystemTray().add(a);
  973. return;
  974. }
  975. catch (AWTException v0) {
  976. System.out.println("Unable to install tray icon");
  977. return;
  978. }
  979. }
  980.  
  981. public static void d() {
  982. ji.a("Bot is now running in background", false);
  983. }
  984.  
  985. public static void a(String string, boolean bl) {
  986. if (a == null) {
  987. return;
  988. }
  989. if (!bl || EU.a != null && !EU.a.isVisible()) {
  990. a.displayMessage("PokeBot.Ninja", string, TrayIcon.MessageType.NONE);
  991. }
  992. }
  993.  
  994. private static void a(ArrayList<String> arrayList, int n, String object2) {
  995. try {
  996. for (Map.Entry entry : FG.a((int)n, (String)object2).entrySet()) {
  997. arrayList.add((String)entry.getValue());
  998. }
  999. return;
  1000. }
  1001. catch (Exception v0) {
  1002. return;
  1003. }
  1004. }
  1005.  
  1006. private static boolean e() {
  1007. Object object;
  1008. String string = System.getProperty("os.name", "none").toLowerCase();
  1009. string.contains("win");
  1010. boolean bl = string.contains("mac");
  1011. if (!FG.a) {
  1012. if (bl) {
  1013. return true;
  1014. }
  1015. return false;
  1016. }
  1017. object = new ArrayList<String>();
  1018. try {
  1019. ji.a(object, Integer.MIN_VALUE, "pokesniper2\\shell\\open\\command");
  1020. ji.a(object, -2147483647, "Software\\Classes\\pokesniper2\\shell\\open\\command");
  1021. ji.a(object, -2147483646, "Software\\Classes\\pokesniper2\\shell\\open\\command");
  1022. ji.a(object, Integer.MIN_VALUE, "ninjasniper\\shell\\open\\command");
  1023. ji.a(object, -2147483647, "Software\\Classes\\ninjasniper\\shell\\open\\command");
  1024. ji.a(object, -2147483646, "Software\\Classes\\ninjasniper\\shell\\open\\command");
  1025. }
  1026. catch (Exception v0) {}
  1027. object = object.iterator();
  1028. while (object.hasNext()) {
  1029. if (!((String)object.next()).contains("ninjasniper")) continue;
  1030. return true;
  1031. }
  1032. return false;
  1033. }
  1034.  
  1035. private static String a(String[] object) {
  1036. List list;
  1037. boolean bl;
  1038. Object object2;
  1039. boolean bl2;
  1040. String string = System.getProperty("os.name", "none").toLowerCase();
  1041. boolean bl3 = string.contains("win");
  1042. string.contains("mac");
  1043. bl2 = false;
  1044. bl = false;
  1045. object2 = null;
  1046. for (Object object3 : object) {
  1047. if (object3 == null) continue;
  1048. boolean bl4 = "/register".equalsIgnoreCase((String)object3) || "-register".equalsIgnoreCase((String)object3);
  1049. boolean bl5 = "/unregister".equalsIgnoreCase((String)object3) || "-unregister".equalsIgnoreCase((String)object3);
  1050. bl2 |= bl4;
  1051. bl |= bl5;
  1052. if (object3.startsWith("/snipe:") || object3.startsWith("-snipe:")) {
  1053. object2 = object3.substring(7);
  1054. continue;
  1055. }
  1056. if (bl4 || bl5) continue;
  1057. object2 = object3;
  1058. }
  1059. if (bl) {
  1060. bl2 = false;
  1061. }
  1062. if ((bl2 || bl) && !bl3) {
  1063. System.out.println("pokesniper2 protocol automatic registration only available on Windows!");
  1064. System.out.println("You have to manually register (use google to find examples) pokesniper2 protocol to: ninjasniper.sh -snipe:%u");
  1065. System.out.println("After that contact MrNinja with details to be able to enable it in PokeBot.Ninja");
  1066. by.a();
  1067. System.exit(0);
  1068. }
  1069. if (bl2 && ji.a() < 3) {
  1070. System.out.println("pokesniper2 protocol is only for Platinum and Radioactive donators!");
  1071. System.exit(0);
  1072. }
  1073. object = null;
  1074. list = null;
  1075. try {
  1076. object = FG.a((int)Integer.MIN_VALUE, (String)"pokesniper2");
  1077. list = FG.a((int)Integer.MIN_VALUE, (String)"ninjasniper");
  1078. }
  1079. catch (Exception v0) {}
  1080. if (!bl2 && !bl && object2 == null) {
  1081. if (ji.e()) {
  1082. System.out.println("pokesniper2 protocol is registered to PokeBot.Ninja :)");
  1083. } else {
  1084. System.out.println("pokesniper2 protocol is NOT registered to PokeBot.Ninja :(");
  1085. System.out.println("Start ninjasniper_register as Administrator to register it!");
  1086. }
  1087. return null;
  1088. }
  1089. if (bl2) {
  1090. if (ji.e()) {
  1091. System.out.println("Reinstalling pokesniper2 link handler to PokeBot.Ninja");
  1092. } else {
  1093. System.out.println("Installing pokesniper2 link handler to PokeBot.Ninja");
  1094. }
  1095. String string = ji.b();
  1096. try {
  1097. FG.a((String)"pokesniper2");
  1098. FG.a((String)"pokesniper2", (String)"", (String)"URL:Pokesniper2 Protocol");
  1099. FG.a((String)"pokesniper2", (String)"URL Protocol", (String)"");
  1100. FG.a((String)"pokesniper2\\shell\\open\\command");
  1101. FG.a((String)"pokesniper2\\shell\\open\\command", (String)"", (String)("\"" + string + "ninjasniper.cmd\" \"/snipe:%1\""));
  1102. FG.a((String)"ninjasniper");
  1103. FG.a((String)"ninjasniper", (String)"", (String)"URL:NinjaSniper Protocol");
  1104. FG.a((String)"ninjasniper", (String)"URL Protocol", (String)"");
  1105. FG.a((String)"ninjasniper\\shell\\open\\command");
  1106. FG.a((String)"ninjasniper\\shell\\open\\command", (String)"", (String)("\"" + string + "ninjasniper.cmd\" \"/snipe:%1\""));
  1107. }
  1108. catch (Exception v1) {
  1109. Object object3;
  1110. object3 = v1;
  1111. if (v1.getMessage().contains("ACCESS_DENIED")) {
  1112. System.out.println("Access denied, rerun with administrator privileges");
  1113. }
  1114. object3.printStackTrace(System.out);
  1115. }
  1116. System.exit(0);
  1117. }
  1118. if (bl) {
  1119. if (object == null && list == null) {
  1120. System.out.println("pokesniper2 link handler already uninstalled");
  1121. } else {
  1122. try {
  1123. FG.a((int)Integer.MIN_VALUE, (String)"pokesniper2");
  1124. FG.a((int)Integer.MIN_VALUE, (String)"ninjasniper");
  1125. }
  1126. catch (Exception v2) {
  1127. Exception exception = v2;
  1128. if (v2.getMessage().contains("ACCESS_DENIED")) {
  1129. System.out.println("Access denied, rerun with administrator privileges");
  1130. }
  1131. exception.printStackTrace(System.out);
  1132. }
  1133. }
  1134. System.exit(0);
  1135. }
  1136. if (object2 != null) {
  1137. if (ji.a() >= 3) {
  1138. return object2;
  1139. }
  1140. System.out.println("Platinum or Radioactive needed for protocol handler support!");
  1141. }
  1142. return null;
  1143. }
  1144.  
  1145. public static void a(JTextComponent jTextComponent) {
  1146. JPopupMenu jPopupMenu = new JPopupMenu();
  1147. Serializable serializable = new DefaultEditorKit.PasteAction();
  1148. serializable = new fq(jTextComponent, serializable);
  1149. serializable = new JMenuItem((Action)((Object)serializable));
  1150. serializable.setText(um.a((String)"Paste"));
  1151. jPopupMenu.add((JMenuItem)serializable);
  1152. jTextComponent.setComponentPopupMenu(jPopupMenu);
  1153. }
  1154.  
  1155. public static String c(String string) {
  1156. return ji.a(string.getBytes());
  1157. }
  1158.  
  1159. private static String a(byte[] arrby) {
  1160. try {
  1161. RSAPublicKey rSAPublicKey = (RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(a));
  1162. Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
  1163. cipher.init(1, rSAPublicKey);
  1164. return xl.a((byte[])cipher.doFinal(arrby));
  1165. }
  1166. catch (Exception v0) {
  1167. v0.printStackTrace(System.out);
  1168. return "";
  1169. }
  1170. }
  1171.  
  1172. public static String a(Throwable throwable) {
  1173. StringWriter stringWriter = new StringWriter();
  1174. PrintWriter printWriter = new PrintWriter(stringWriter);
  1175. throwable.printStackTrace(printWriter);
  1176. return stringWriter.toString();
  1177. }
  1178.  
  1179. public static void a(List<CatchablePokemon> list, aI aI2) {
  1180. Collections.sort(list, new ue(aI2));
  1181. }
  1182.  
  1183. public static void b(List<Gym> list, aI aI2) {
  1184. Collections.sort(list, new jq(aI2));
  1185. }
  1186.  
  1187. public static boolean a(JFrame jFrame, int n, FI fI) {
  1188. if (ji.a() >= n) {
  1189. return true;
  1190. }
  1191. Object object = (Integer)a.get(n);
  1192. String string = "Radioactive";
  1193. switch (n) {
  1194. case 0: {
  1195. string = "Radioactive";
  1196. break;
  1197. }
  1198. case 1: {
  1199. string = "Silver";
  1200. break;
  1201. }
  1202. case 2: {
  1203. string = "Gold";
  1204. break;
  1205. }
  1206. case 3: {
  1207. string = "Platinum";
  1208. break;
  1209. }
  1210. case 4: {
  1211. string = "Radioactive";
  1212. }
  1213. }
  1214. Object[] arrobject = new String[]{um.a((String)"Yes"), um.a((String)"No"), um.a((String)"Confirm")};
  1215. if (fI == null) {
  1216. arrobject = new String[]{um.a((String)"Yes"), um.a((String)"No")};
  1217. }
  1218. String string2 = um.a((String)"Donator-only feature");
  1219. object = um.a((String)new StringBuilder().append(string).append(" level needed").toString()) + (object != null ? new StringBuilder(" ($").append(object).append(")").toString() : "") + "\n" + um.a((String)"Would you like to donate to support the development of PokeBot.Ninja?");
  1220. int n2 = JOptionPane.showOptionDialog(jFrame, object, string2, -1, -1, lQ.c(), arrobject, arrobject[0]);
  1221. if (n2 == 0) {
  1222. ji.a("http://pokebot.ninja/donate.php");
  1223. } else if (n2 == 2) {
  1224. new Eq((Frame)jFrame, fI).setVisible(true);
  1225. if (ji.a() >= n) {
  1226. return true;
  1227. }
  1228. }
  1229. return false;
  1230. }
  1231.  
  1232. public static boolean a(String[] object) {
  1233. if ((object = ji.a((String[])object)) == null) {
  1234. return false;
  1235. }
  1236. if (ji.a() < 3) {
  1237. System.out.println("pokesniper2 link handling is only enabled for Platinum and Radioactive donators!");
  1238. return true;
  1239. }
  1240. if (!object.startsWith("pokesniper2://") && object.startsWith("ninjasniper://")) {
  1241. System.out.println("Invalid link provided: " + (String)object);
  1242. return true;
  1243. }
  1244. ji.b(object.trim());
  1245. return true;
  1246. }
  1247.  
  1248. public static void e() {
  1249. if (ji.a() < 3) {
  1250. return;
  1251. }
  1252. if (!ji.e()) {
  1253. if (!FG.a) {
  1254. System.out.println("pokesniper2:// link handler is currently only usable in Windows, skipping link listener");
  1255. return;
  1256. }
  1257. System.out.println("pokesniper2:// link handler is not installed, skipping link listener");
  1258. return;
  1259. }
  1260. new oA().start();
  1261. }
  1262.  
  1263. private static void b(String object) {
  1264. InetAddress inetAddress;
  1265. DatagramSocket datagramSocket = null;
  1266. try {
  1267. datagramSocket = new DatagramSocket();
  1268. inetAddress = InetAddress.getByName("224.0.0.3");
  1269. datagramSocket.setSoTimeout(500);
  1270. }
  1271. catch (Exception v0) {
  1272. v0.printStackTrace(System.out);
  1273. System.out.println("Unable to send pokesniper2 link!");
  1274. if (datagramSocket != null) {
  1275. datagramSocket.close();
  1276. }
  1277. return;
  1278. }
  1279. Object object2 = object.getBytes();
  1280. byte[] arrby = new byte[1024];
  1281. System.out.println("Sending: " + (String)object);
  1282. object = new DatagramPacket((byte[])object2, object2.length, inetAddress, 28174);
  1283. try {
  1284. datagramSocket.send((DatagramPacket)object);
  1285. }
  1286. catch (Exception v1) {
  1287. v1.printStackTrace(System.out);
  1288. System.out.println("Unable to send pokesniper2 link!");
  1289. return;
  1290. }
  1291. int n = 0;
  1292. int n2 = 0;
  1293. do {
  1294. object2 = new DatagramPacket(arrby, 1024);
  1295. try {
  1296. datagramSocket.receive((DatagramPacket)object2);
  1297. object2 = new String(object2.getData()).trim();
  1298. if (object2.equals("OK")) {
  1299. ++n2;
  1300. }
  1301. object2.equals("NO");
  1302. ++n;
  1303. continue;
  1304. }
  1305. catch (SocketTimeoutException v2) {
  1306. break;
  1307. }
  1308. catch (IOException v3) {
  1309. v3.printStackTrace(System.out);
  1310. break;
  1311. }
  1312. } while (true);
  1313. System.out.println("Sent pokesniper2 link to " + n + " PokeBot.Ninja instances, " + n2 + " started processing");
  1314. datagramSocket.close();
  1315. ji.a(1000, 1000, 1000);
  1316. }
  1317.  
  1318. public static aI a(PokemonDataOuterClass.PokemonData pokemonData) {
  1319. pokemonData = new S2LatLng(new S2Cell(new S2CellId(pokemonData.getCapturedCellId())).getCenter());
  1320. return new aI(pokemonData.latDegrees(), pokemonData.lngDegrees(), 0.0);
  1321. }
  1322.  
  1323. public static String a(aI aI2) {
  1324. return "https://maps.google.com/?q=" + aI2.a + "," + aI2.b;
  1325. }
  1326.  
  1327. public static void f() {
  1328. if (ji.b()) {
  1329. new Timer(1080000, (ActionListener)new iT()).start();
  1330. }
  1331. }
  1332.  
  1333. static /* synthetic */ boolean c() {
  1334. return b;
  1335. }
  1336.  
  1337. static /* synthetic */ boolean d() {
  1338. return true;
  1339. }
  1340.  
  1341. static /* synthetic */ int b() {
  1342. return a++;
  1343. }
  1344.  
  1345. static /* synthetic */ boolean b(boolean bl) {
  1346. b = bl;
  1347. return b;
  1348. }
  1349.  
  1350. static /* synthetic */ int c() {
  1351. return a;
  1352. }
  1353.  
  1354. static {
  1355. a = false;
  1356. a = 0;
  1357. b = false;
  1358. a = null;
  1359. a = new byte[]{48, 92, 48, 13, 6, 9, 42, -122, 72, -122, -9, 13, 1, 1, 1, 5, 0, 3, 75, 0, 48, 72, 2, 65, 0, -97, -36, -115, -73, -111, -105, -72, -101, -58, -105, -77, 77, -63, 20, -61, 103, -98, -106, 32, -77, -90, 57, -73, 90, 95, 119, -106, 25, -44, -8, 104, 61, 33, 126, -82, 0, -118, 115, -63, 91, -64, -125, 19, 91, -4, -104, 98, -84, -102, 77, -87, 95, 126, -95, 10, -90, -66, 102, -113, 10, -67, 97, -59, -39, 2, 3, 1, 0, 1};
  1360. a = new HashMap<Integer, Integer>();
  1361. a.put(1, 1);
  1362. a.put(2, 5);
  1363. a.put(3, 10);
  1364. a.put(4, 20);
  1365. }
  1366. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement