Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Decompiled with CFR 0_118.
- *
- * Could not load the following classes:
- * POGOProtos.Data.PlayerDataOuterClass
- * POGOProtos.Data.PlayerDataOuterClass$PlayerData
- * POGOProtos.Data.PokemonDataOuterClass
- * POGOProtos.Data.PokemonDataOuterClass$PokemonData
- * POGOProtos.Enums.PokemonIdOuterClass
- * POGOProtos.Enums.PokemonIdOuterClass$PokemonId
- * POGOProtos.Enums.PokemonMoveOuterClass
- * POGOProtos.Enums.PokemonMoveOuterClass$PokemonMove
- * POGOProtos.Enums.QuestTypeOuterClass
- * POGOProtos.Enums.QuestTypeOuterClass$QuestType
- * com.google.gson.Gson
- * com.google.gson.GsonBuilder
- * com.google.protobuf.ProtocolStringList
- * com.pokegoapi.api.PokemonGo
- * com.pokegoapi.api.device.DeviceInfo
- * com.pokegoapi.api.gym.Gym
- * com.pokegoapi.api.inventory.Stats
- * com.pokegoapi.api.map.pokemon.CatchablePokemon
- * com.pokegoapi.api.player.PlayerProfile
- * com.pokegoapi.api.pokemon.Pokemon
- * com.pokegoapi.api.pokemon.PokemonCpUtils
- * com.pokegoapi.google.common.geometry.S2Cell
- * com.pokegoapi.google.common.geometry.S2CellId
- * com.pokegoapi.google.common.geometry.S2LatLng
- * com.pokegoapi.google.common.geometry.S2Point
- * ninja.pokebot.gson.ProxyGson
- * ninja.pokebot.gson.SettingsGson
- * ninja.pokebot.o.EU
- * ninja.pokebot.o.Eq
- * ninja.pokebot.o.FG
- * ninja.pokebot.o.FI
- * ninja.pokebot.o.Gp
- * ninja.pokebot.o.SA
- * ninja.pokebot.o.aI
- * ninja.pokebot.o.by
- * ninja.pokebot.o.eB
- * ninja.pokebot.o.fq
- * ninja.pokebot.o.iT
- * ninja.pokebot.o.ie
- * ninja.pokebot.o.jZ
- * ninja.pokebot.o.jf
- * ninja.pokebot.o.jq
- * ninja.pokebot.o.kV
- * ninja.pokebot.o.l
- * ninja.pokebot.o.lQ
- * ninja.pokebot.o.mQ
- * ninja.pokebot.o.oA
- * ninja.pokebot.o.rU
- * ninja.pokebot.o.tC
- * ninja.pokebot.o.tp
- * ninja.pokebot.o.ue
- * ninja.pokebot.o.um
- * ninja.pokebot.o.xl
- * ninja.pokebot.o.yl
- * okhttp3.Authenticator
- * okhttp3.Call
- * okhttp3.Callback
- * okhttp3.Interceptor
- * okhttp3.OkHttpClient
- * okhttp3.OkHttpClient$Builder
- * okhttp3.Request
- * okhttp3.Request$Builder
- * okhttp3.Response
- * okhttp3.ResponseBody
- * okhttp3.internal.Version
- */
- package ninja.pokebot.o;
- import POGOProtos.Data.PlayerDataOuterClass;
- import POGOProtos.Data.PokemonDataOuterClass;
- import POGOProtos.Enums.PokemonIdOuterClass;
- import POGOProtos.Enums.PokemonMoveOuterClass;
- import POGOProtos.Enums.QuestTypeOuterClass;
- import com.google.gson.Gson;
- import com.google.gson.GsonBuilder;
- import com.google.protobuf.ProtocolStringList;
- import com.pokegoapi.api.PokemonGo;
- import com.pokegoapi.api.device.DeviceInfo;
- import com.pokegoapi.api.gym.Gym;
- import com.pokegoapi.api.inventory.Stats;
- import com.pokegoapi.api.map.pokemon.CatchablePokemon;
- import com.pokegoapi.api.player.PlayerProfile;
- import com.pokegoapi.api.pokemon.Pokemon;
- import com.pokegoapi.api.pokemon.PokemonCpUtils;
- import com.pokegoapi.google.common.geometry.S2Cell;
- import com.pokegoapi.google.common.geometry.S2CellId;
- import com.pokegoapi.google.common.geometry.S2LatLng;
- import com.pokegoapi.google.common.geometry.S2Point;
- import java.awt.AWTException;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Cursor;
- import java.awt.Desktop;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Frame;
- import java.awt.Image;
- import java.awt.MenuItem;
- import java.awt.PopupMenu;
- import java.awt.SystemTray;
- import java.awt.TrayIcon;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseListener;
- import java.awt.font.TextAttribute;
- import java.io.File;
- import java.io.IOException;
- import java.io.PrintStream;
- import java.io.PrintWriter;
- import java.io.Serializable;
- import java.io.StringWriter;
- import java.io.Writer;
- import java.net.Authenticator;
- import java.net.DatagramPacket;
- import java.net.DatagramSocket;
- import java.net.InetAddress;
- import java.net.InetSocketAddress;
- import java.net.Proxy;
- import java.net.SocketAddress;
- import java.net.SocketTimeoutException;
- import java.net.URI;
- import java.net.URISyntaxException;
- import java.net.URL;
- import java.nio.file.Files;
- import java.nio.file.OpenOption;
- import java.nio.file.Path;
- import java.nio.file.Paths;
- import java.security.CodeSource;
- import java.security.Key;
- import java.security.KeyFactory;
- import java.security.ProtectionDomain;
- import java.security.PublicKey;
- import java.security.SecureRandom;
- import java.security.Signature;
- import java.security.interfaces.RSAPublicKey;
- import java.security.spec.KeySpec;
- import java.security.spec.X509EncodedKeySpec;
- import java.text.AttributedCharacterIterator;
- import java.text.DecimalFormat;
- import java.text.DecimalFormatSymbols;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.GregorianCalendar;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Locale;
- import java.util.Map;
- import java.util.Set;
- import java.util.concurrent.TimeUnit;
- import javax.crypto.Cipher;
- import javax.net.ssl.HostnameVerifier;
- import javax.net.ssl.HttpsURLConnection;
- import javax.net.ssl.KeyManager;
- import javax.net.ssl.SSLContext;
- import javax.net.ssl.SSLSocketFactory;
- import javax.net.ssl.TrustManager;
- import javax.net.ssl.X509TrustManager;
- import javax.swing.Action;
- import javax.swing.JDialog;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JMenuItem;
- import javax.swing.JOptionPane;
- import javax.swing.JPopupMenu;
- import javax.swing.Timer;
- import javax.swing.text.DefaultEditorKit;
- import javax.swing.text.JTextComponent;
- import ninja.pokebot.gson.ProxyGson;
- import ninja.pokebot.gson.SettingsGson;
- import ninja.pokebot.o.EU;
- import ninja.pokebot.o.Eq;
- import ninja.pokebot.o.FG;
- import ninja.pokebot.o.FI;
- import ninja.pokebot.o.Gp;
- import ninja.pokebot.o.SA;
- import ninja.pokebot.o.aI;
- import ninja.pokebot.o.by;
- import ninja.pokebot.o.eB;
- import ninja.pokebot.o.fq;
- import ninja.pokebot.o.iT;
- import ninja.pokebot.o.ie;
- import ninja.pokebot.o.jZ;
- import ninja.pokebot.o.jf;
- import ninja.pokebot.o.jq;
- import ninja.pokebot.o.kV;
- import ninja.pokebot.o.l;
- import ninja.pokebot.o.lQ;
- import ninja.pokebot.o.mQ;
- import ninja.pokebot.o.oA;
- import ninja.pokebot.o.rU;
- import ninja.pokebot.o.tC;
- import ninja.pokebot.o.tp;
- import ninja.pokebot.o.ue;
- import ninja.pokebot.o.um;
- import ninja.pokebot.o.xl;
- import ninja.pokebot.o.yl;
- import okhttp3.Call;
- import okhttp3.Callback;
- import okhttp3.Interceptor;
- import okhttp3.OkHttpClient;
- import okhttp3.Request;
- import okhttp3.Response;
- import okhttp3.ResponseBody;
- import okhttp3.internal.Version;
- /*
- * Duplicate member names - consider using --renamedupmembers true
- */
- public class ji {
- private static DecimalFormat a;
- private static DecimalFormat b;
- private static DecimalFormat c;
- private static OkHttpClient a;
- private static boolean a;
- private static int a;
- private static boolean b;
- private static String a;
- private static final byte[] a;
- private static TrayIcon a;
- private static final HashMap<Integer, Integer> a;
- public static void a(String object) {
- Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
- if (desktop == null || !desktop.isSupported(Desktop.Action.BROWSE)) {
- EU.e((String)("Cannot open URL with browser: " + (String)object));
- return;
- }
- try {
- object = new URI((String)object);
- desktop.browse((URI)object);
- return;
- }
- catch (IOException | URISyntaxException v0) {
- v0.printStackTrace(System.out);
- return;
- }
- }
- public static boolean a(long l) {
- return ji.a(l, l, l);
- }
- public static boolean a(long l, long l2) {
- return ji.a(l, l2, l2);
- }
- public static boolean a(long l, long l2, long l3) {
- if (l2 <= 0) {
- return true;
- }
- if (l < 0) {
- l = 0;
- }
- if (l2 < l) {
- l ^= (l2 ^= (l ^= l2));
- }
- long l4 = Math.round(Math.random() * (double)(l2 - l)) + l;
- if (l3 > l2 && Math.round(Math.random() * 100.0) < 5) {
- l4 += Math.round(Math.random() * (double)(l3 - l2));
- }
- try {
- Thread.sleep(l4);
- }
- catch (InterruptedException var0_1) {
- System.err.println(var0_1.getMessage());
- return false;
- }
- return true;
- }
- public static boolean a(Component component, String string) {
- if (JOptionPane.showConfirmDialog(component, string, um.a().getString("Are you sure?"), 2, 3) == 0) {
- return true;
- }
- return false;
- }
- public static boolean a(Component component, String string, String string2, boolean bl) {
- if (JOptionPane.showConfirmDialog(component, string2, string, 0, bl ? 2 : 3) == 0) {
- return true;
- }
- return false;
- }
- public static Boolean a(Component component, String string) {
- int n = JOptionPane.showConfirmDialog(component, string, um.a().getString("Are you sure?"), 1, 2);
- if (n == 0) {
- return true;
- }
- if (n == 1) {
- return false;
- }
- return null;
- }
- public static int a(Component component, String string) {
- return ji.a(JOptionPane.showInputDialog(component, string, "4"), 0);
- }
- public static String a(Component component, String string, String string2) {
- return JOptionPane.showInputDialog(component, string, string2);
- }
- public static void a(Component component, String string) {
- JOptionPane.showMessageDialog(component, string, um.a().getString("Warning"), 2);
- }
- public static void b(Component component, String string) {
- JOptionPane.showMessageDialog(component, string, um.a().getString("Success"), -1);
- }
- public static double a(aI aI2, aI aI3) {
- return ji.a(aI2.a, aI2.b, aI3.a, aI3.b);
- }
- public static double b(aI aI2, aI aI3) {
- double d = aI2.b;
- double d2 = aI3.b;
- double d3 = Math.toRadians(aI2.a);
- double d4 = Math.toRadians(aI3.a);
- double d5 = Math.toRadians(d2 - d);
- double d6 = Math.sin(d5) * Math.cos(d4);
- double d7 = Math.cos(d3) * Math.sin(d4) - Math.sin(d3) * Math.cos(d4) * Math.cos(d5);
- return (Math.toDegrees(Math.atan2(d6, d7)) + 360.0) % 360.0;
- }
- public static double a(double d, double d2, double d3, double d4) {
- double d5;
- double d6 = Math.toRadians(d);
- double d7 = Math.toRadians(d3);
- double d8 = Math.toRadians(d2);
- double d9 = Math.toRadians(d4);
- double d10 = Math.sin(0.5 * (d7 - d6));
- double d11 = d10 * d10 + (d5 = Math.sin(0.5 * (d9 - d8))) * d5 * Math.cos(d6) * Math.cos(d7);
- double d12 = 2.0 * Math.atan2(Math.sqrt(d11), Math.sqrt(Math.max(0.0, 1.0 - d11))) * 6367000.0;
- if (Double.isInfinite(d12) || Double.isNaN(d12)) {
- return 0.0;
- }
- return d12;
- }
- public static double a() {
- return (Math.random() - 0.5) * 5.0E-7;
- }
- public static String a(double d) {
- if (a == null) {
- a = new DecimalFormat("0.000");
- DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
- decimalFormatSymbols.setDecimalSeparator('.');
- decimalFormatSymbols.setGroupingSeparator(' ');
- a.setDecimalFormatSymbols(decimalFormatSymbols);
- }
- return a.format(d);
- }
- public static String b(double d) {
- if (b == null) {
- b = new DecimalFormat("0.0");
- DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
- decimalFormatSymbols.setDecimalSeparator('.');
- decimalFormatSymbols.setGroupingSeparator(' ');
- b.setDecimalFormatSymbols(decimalFormatSymbols);
- }
- return b.format(d);
- }
- public static String c(double d) {
- if (c == null) {
- c = new DecimalFormat("0.000000000");
- DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US);
- decimalFormatSymbols.setDecimalSeparator('.');
- decimalFormatSymbols.setGroupingSeparator(' ');
- c.setDecimalFormatSymbols(decimalFormatSymbols);
- }
- return c.format(d);
- }
- public static double a(String string) {
- double d;
- string = string.replace(',', '.').replaceAll("\\s+", "");
- d = 0.0;
- try {
- d = Double.parseDouble(string);
- }
- catch (NumberFormatException v0) {}
- if (Double.isInfinite(d) || Double.isNaN(d)) {
- d = 0.0;
- }
- return d;
- }
- public static Double a(String object, Double d) {
- object = object.replace(',', '.').replaceAll("\\s+", "");
- try {
- object = Double.parseDouble((String)object);
- }
- catch (NumberFormatException v0) {
- return d;
- }
- if (Double.isInfinite(object.doubleValue()) || Double.isNaN(object.doubleValue())) {
- object = d;
- }
- return object;
- }
- public static String a(long l) {
- String string = String.valueOf(l);
- while (string.length() < 2) {
- string = "0" + string;
- }
- return string;
- }
- public static String b(long l) {
- GregorianCalendar gregorianCalendar = new GregorianCalendar();
- gregorianCalendar.setTimeInMillis(l);
- return ji.a(gregorianCalendar.get(11)) + ":" + ji.a(gregorianCalendar.get(12)) + ":" + ji.a(gregorianCalendar.get(13));
- }
- public static String c(long l) {
- long l2 = l / 86400;
- long l3 = (l %= 86400) / 3600;
- long l4 = (l %= 3600) / 60;
- l %= 60;
- boolean bl = false;
- String string = "";
- if (l2 > 0) {
- string = string + " " + l2 + " days";
- bl = true;
- }
- if (l3 > 0 || bl) {
- string = string + " " + l3 + " hours";
- bl = true;
- }
- if (l4 > 0 || bl) {
- string = string + " " + l4 + " minutes";
- }
- return (string + " " + l + " seconds").substring(1);
- }
- public static String d(long l) {
- if (l <= 0) {
- return "-";
- }
- long l2 = l / 1000;
- long l3 = l2 % 60;
- long l4 = (l2 /= 60) % 60;
- long l5 = l2 / 60 % 60;
- return ji.a(l5) + ":" + ji.a(l4) + ":" + ji.a(l3);
- }
- public static void a(JLabel jLabel) {
- jLabel.setCursor(Cursor.getPredefinedCursor(12));
- Font font = jLabel.getFont();
- HashMap<TextAttribute, Integer> hashMap = new HashMap<TextAttribute, Integer>();
- hashMap.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
- jLabel.setFont(font.deriveFont(hashMap));
- }
- public static void b(JLabel jLabel) {
- jLabel.setCursor(Cursor.getPredefinedCursor(0));
- Font font = jLabel.getFont();
- HashMap<TextAttribute, Integer> hashMap = new HashMap<TextAttribute, Integer>();
- hashMap.put(TextAttribute.UNDERLINE, -1);
- jLabel.setFont(font.deriveFont(hashMap));
- }
- public static void a(JLabel jLabel, Object object) {
- ji.a(jLabel);
- jLabel.addMouseListener((MouseListener)new jZ(object));
- }
- public static OkHttpClient a(DeviceInfo deviceInfo) {
- return ji.a(by.a(), deviceInfo);
- }
- private static OkHttpClient.Builder a(OkHttpClient.Builder builder, boolean bl) {
- Object object;
- TrustManager[] arrtrustManager;
- arrtrustManager = new X509TrustManager[]{new l()};
- object = null;
- try {
- object = SSLContext.getInstance("SSL");
- object.init(null, arrtrustManager, new SecureRandom());
- }
- catch (Exception v0) {}
- object = object.getSocketFactory();
- builder.sslSocketFactory((SSLSocketFactory)object, (X509TrustManager)arrtrustManager[0]);
- if (bl) {
- HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory)object);
- }
- builder.hostnameVerifier((HostnameVerifier)new eB());
- return builder;
- }
- public static OkHttpClient a() {
- OkHttpClient.Builder builder = new OkHttpClient.Builder();
- builder.connectTimeout(20, TimeUnit.SECONDS);
- builder.readTimeout(20, TimeUnit.SECONDS);
- builder.writeTimeout(20, TimeUnit.SECONDS);
- ji.a(builder, false);
- return builder.build();
- }
- public static OkHttpClient a(ProxyGson proxyGson, DeviceInfo deviceInfo) {
- do {
- String string;
- Authenticator.setDefault(null);
- OkHttpClient.Builder builder = new OkHttpClient.Builder();
- builder.connectTimeout(20, TimeUnit.SECONDS);
- builder.readTimeout(20, TimeUnit.SECONDS);
- builder.writeTimeout(20, TimeUnit.SECONDS);
- if (deviceInfo != null) {
- builder.addNetworkInterceptor((Interceptor)new Gp(FI.a()));
- }
- if (by.b) {
- ji.a(builder, true);
- }
- if (proxyGson == null) {
- try {
- return builder.build();
- }
- catch (AssertionError var3_6) {
- if (by.b) {
- throw var3_6;
- }
- by.b = true;
- continue;
- }
- }
- builder.proxy(new Proxy(proxyGson.type, new InetSocketAddress(proxyGson.host, proxyGson.port)));
- String string2 = proxyGson.username == null ? "" : proxyGson.username;
- String string3 = string = proxyGson.password == null ? "" : proxyGson.password;
- if (string2.length() == 0 && string.length() == 0) {
- try {
- return builder.build();
- }
- catch (AssertionError var2_3) {
- if (by.b) {
- throw var2_3;
- }
- by.b = true;
- continue;
- }
- }
- if (proxyGson.type == Proxy.Type.HTTP) {
- builder.proxyAuthenticator((okhttp3.Authenticator)new yl(string2, string));
- } else {
- Authenticator.setDefault((Authenticator)new kV(string2, string));
- }
- try {
- return builder.build();
- }
- catch (AssertionError var2_4) {
- if (by.b) {
- throw var2_4;
- }
- by.b = true;
- continue;
- }
- break;
- } while (true);
- }
- public static String a(String string) {
- try {
- boolean bl;
- if (a == null) {
- a = ji.a();
- }
- boolean bl2 = bl = by.c() != null && by.c().length() > 0 && by.d() != null && by.d().length() > 0 && by.e() != null && by.e().length() > 0;
- 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();
- return a.newCall((Request)string).execute().body().string();
- }
- catch (Exception v1) {
- v1.printStackTrace(System.out);
- return null;
- }
- }
- public static void a(JFrame jFrame, boolean bl) {
- if (ji.b()) {
- return;
- }
- if (a && !bl) {
- return;
- }
- a = true;
- 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)) {
- ji.a("http://pokebot.ninja/donate.php");
- }
- }
- public static boolean a() {
- return true;
- }
- public static void a() {
- ji.a(true);
- Timer timer = new Timer(3600000, (ActionListener)new rU());
- timer.setInitialDelay(5);
- timer.start();
- }
- public static void a(String string, byte[] arrby) {
- ji.a(new File(string), arrby);
- }
- public static void a(File file, byte[] arrby) {
- Files.write(file.toPath(), arrby, new OpenOption[0]);
- }
- private static String b() {
- try {
- String string = new File(ji.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getAbsolutePath();
- if (string.endsWith(".jar")) {
- return string.replaceAll("PokeBotNinja.jar", "");
- }
- }
- catch (Exception v0) {}
- return Paths.get(".", new String[0]).toAbsolutePath().normalize().toString() + File.separator;
- }
- public static void a(String[] arrstring) {
- String string = null;
- for (int i = 0; i < arrstring.length; ++i) {
- if (!arrstring[i].equals("-config") && !arrstring[i].equals("/config") && !arrstring[i].equals("/conf") && !arrstring[i].equals("-conf")) continue;
- if (arrstring.length <= i + 1) break;
- string = arrstring[i + 1];
- arrstring[i] = null;
- arrstring[i + 1] = null;
- break;
- }
- if (string != null) {
- a = string;
- }
- }
- public static SettingsGson a() {
- SettingsGson settingsGson;
- File file = a == null ? new File(ji.b() + "ninja.json") : new File(a);
- if (!file.exists()) {
- System.out.println("Settings file does not exist, creating it to: " + file.getAbsolutePath());
- SettingsGson settingsGson2 = new SettingsGson();
- ji.a(settingsGson2);
- return settingsGson2;
- }
- System.out.println("Loading settings from: " + file.getAbsolutePath());
- try {
- settingsGson = Files.readAllBytes(file.toPath());
- settingsGson = (SettingsGson)new GsonBuilder().create().fromJson(new String((byte[])settingsGson), SettingsGson.class);
- if (settingsGson != null) {
- return settingsGson;
- }
- }
- catch (Exception var1_3) {
- System.out.println(var1_3.getMessage());
- }
- System.out.println("Failed to read configuration, recreating it to: " + file.getAbsolutePath());
- settingsGson = new SettingsGson();
- ji.a(settingsGson);
- return settingsGson;
- }
- public static void a(SettingsGson arrby) {
- if (arrby == null) {
- System.out.println("No settings to save!?");
- return;
- }
- File file = a == null ? new File(ji.b() + "ninja.json") : new File(a);
- arrby = new GsonBuilder().setPrettyPrinting().create().toJson((Object)arrby).getBytes();
- try {
- ji.a(file, arrby);
- return;
- }
- catch (IOException var0_1) {
- System.out.println(var0_1.getMessage());
- System.out.println("Failed to write 'ninja.json', settings will not be saved to: " + file.getAbsolutePath());
- return;
- }
- }
- public static String a(Enum arrstring) {
- CharSequence charSequence = arrstring.name();
- if (charSequence == null || "".equals(charSequence)) {
- return "";
- }
- charSequence = charSequence.replaceAll("ITEM_", "").replaceAll("BADGE_", "").replaceAll("ERROR_", "").replaceAll("BADGE_", "");
- if (arrstring instanceof PokemonMoveOuterClass.PokemonMove) {
- charSequence = charSequence.replaceAll("_FAST", "");
- }
- if (arrstring instanceof QuestTypeOuterClass.QuestType) {
- charSequence = charSequence.replaceAll("QUEST_", "");
- }
- arrstring = charSequence.split("_");
- charSequence = new StringBuilder(charSequence.length());
- for (int i = 0; i < arrstring.length; ++i) {
- if (i > 0) {
- charSequence.append(" ");
- }
- charSequence.append(ji.b(arrstring[i]));
- }
- return charSequence.toString();
- }
- public static String b(String string) {
- if (string == null || "".equals(string)) {
- return "";
- }
- String string2 = string.substring(0, 1).toUpperCase();
- if (string.length() == 1) {
- return string2;
- }
- string = string.substring(1, string.length()).toLowerCase();
- return string2 + string;
- }
- public static String d(double d) {
- if (Math.abs(d - Math.floor(d + 1.0E-4)) < 0.001) {
- return "" + (int)(Math.floor(d + 1.0E-4) + 1.0E-4);
- }
- return String.valueOf(d);
- }
- public static int a(String string, int n) {
- try {
- return Integer.parseInt(string.trim());
- }
- catch (Exception v0) {
- return n;
- }
- }
- public static Integer a(String string) {
- try {
- return Integer.parseInt(string.trim());
- }
- catch (Exception v0) {
- return null;
- }
- }
- public static String a() {
- if (!ji.b() || ji.a() < 0) {
- return "";
- }
- if (ji.a() == 0) {
- return " " + um.a().getString("Radioactive");
- }
- if (ji.a() == 1) {
- return " " + um.a().getString("Silver");
- }
- if (ji.a() == 2) {
- return " " + um.a().getString("Gold");
- }
- if (ji.a() == 3) {
- return " " + um.a().getString("Platinum");
- }
- if (ji.a() == 4) {
- return " " + um.a().getString("Radioactive");
- }
- return " " + um.a().getString("Radioactive") + "+";
- }
- public static void a(JFrame jFrame, FI object) {
- object = object != null && object.a.getPlayerProfile().getPlayerData().getUsername().length() > 0 ? " - " + object.a.getPlayerProfile().getPlayerData().getUsername() : "";
- jFrame.setTitle(jFrame.getTitle() + " - v98" + ji.a() + (String)object);
- }
- public static void a(JDialog jDialog, FI object) {
- object = object != null && object.a.getPlayerProfile().getPlayerData().getUsername().length() > 0 ? " - " + object.a.getPlayerProfile().getPlayerData().getUsername() : "";
- jDialog.setTitle(jDialog.getTitle() + " - v98" + ji.a() + (String)object);
- }
- public static String a(Pokemon pokemon) {
- if (pokemon == null) {
- return "Null!?";
- }
- return ji.a((Enum)pokemon.getPokemonId());
- }
- public static String b(Pokemon pokemon) {
- if (pokemon == null) {
- return "Null!?";
- }
- String string = mQ.b((Pokemon)pokemon) ? um.a((String)"Shiny") + " " : "";
- 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() + ")";
- }
- public static String a(PokemonDataOuterClass.PokemonData pokemonData) {
- float f = PokemonCpUtils.getLevelFromCpMultiplier((float)(pokemonData.getAdditionalCpMultiplier() + pokemonData.getCpMultiplier()));
- 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() + ")";
- }
- public static Color a(Color[] arrcolor, double d, double d2, double d3) {
- if (arrcolor.length == 1 || d3 <= 0.0) {
- return arrcolor[0];
- }
- if (d3 >= d2) {
- return arrcolor[arrcolor.length - 1];
- }
- double d4 = d2 / (double)(arrcolor.length - 1);
- int n = Math.max(0, Math.min(arrcolor.length - 2, (int)Math.floor(d3 / d4)));
- float[] arrf = arrcolor[n].getRGBColorComponents(null);
- arrcolor = arrcolor[n + 1].getRGBColorComponents(null);
- float[] arrf2 = new float[arrf.length];
- for (int i = 0; i < arrf.length; ++i) {
- arrf2[i] = (float)((double)arrf[i] + (Object)(arrcolor[i] - arrf[i]) * (d3 - (double)n * d4) / d4);
- }
- return new Color(arrf2[0], arrf2[1], arrf2[2]);
- }
- public static boolean a(boolean bl) {
- String[] arrstring = System.getProperty("java.version");
- if (bl) {
- System.out.println("You are using Java " + (String)arrstring);
- }
- if (arrstring.startsWith("1.7")) {
- if (bl) {
- System.out.println("Please update your java to at least version 1.8!");
- }
- return false;
- }
- if (arrstring.startsWith("1.8") && (arrstring = arrstring.split("_")).length > 1 && ji.a(arrstring[1], 0) < 60) {
- if (bl) {
- System.out.println("Starting from Java 1.8.0_60 the Map should work better, please upgrade if possible!");
- }
- return false;
- }
- return BADBOOL 4;
- }
- public static boolean b() {
- String string = by.c();
- String string2 = by.e();
- String string3 = by.d();
- return ji.a(string, string2, string3);
- }
- public static int a() {
- if (!ji.b()) {
- return 0;
- }
- String string = by.d();
- if (string == null || string.length() <= 0) {
- return 0;
- }
- return ji.a(string.substring(0, 1), 0);
- }
- public static boolean a(String string, String string2, String string3) {
- if (string == null || string2 == null) {
- return false;
- }
- try {
- RSAPublicKey rSAPublicKey = (RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(a));
- Signature signature = Signature.getInstance("SHA1withRSA");
- signature.initVerify(rSAPublicKey);
- signature.update((string + "|" + string3).getBytes("UTF-8"));
- return signature.verify(xl.a((byte[])string2.getBytes("UTF-8")));
- }
- catch (Exception v0) {
- v0.printStackTrace(System.out);
- return false;
- }
- }
- public static aI a(aI aI2, double d, double d2) {
- double d3 = Math.random();
- double d4 = Math.random();
- double d5 = d3 * d;
- double d6 = Math.toRadians(aI2.a);
- double d7 = Math.toRadians(aI2.b);
- double d8 = 1.5707963267948966 - d5 / 6367.0;
- double d9 = d4 * 2.0 * 3.141592653589793;
- double d10 = Math.cos(d8) * Math.sin(d9);
- double d11 = Math.cos(d8) * Math.cos(d9);
- double d12 = Math.sin(d8);
- double d13 = 1.5707963267948966 - d6;
- double d14 = d11 * Math.cos(d13) + d12 * Math.sin(d13);
- double d15 = (- d11) * Math.sin(d13) + d12 * Math.cos(d13);
- double d16 = d10 * Math.cos(d7) + d14 * Math.sin(d7);
- double d17 = (- d10) * Math.sin(d7) + d14 * Math.cos(d7);
- d9 = Math.atan2(d16, d17);
- d8 = Math.asin(d15);
- return new aI(Math.toDegrees(d8), Math.toDegrees(d9), aI2.c + (Math.random() - 0.5) * d2);
- }
- public static double a(PokemonDataOuterClass.PokemonData pokemonData) {
- return (double)(pokemonData.getIndividualAttack() + pokemonData.getIndividualDefense() + pokemonData.getIndividualStamina()) / 45.0;
- }
- public static void a(FI fI, ProtocolStringList protocolStringList) {
- for (int i = 0; i < protocolStringList.size(); ++i) {
- fI.a.newCall(new Request.Builder().url((String)protocolStringList.get(i)).build()).enqueue((Callback)new SA());
- }
- }
- public static byte[] a() {
- return a;
- }
- public static void b() {
- if (System.getProperty("java.net.preferIPv4Stack", null) != null) {
- return;
- }
- try {
- System.setProperty("java.net.preferIPv4Stack", "true");
- return;
- }
- catch (Exception v0) {
- return;
- }
- }
- public static void a(FI object) {
- if (a == null) {
- return;
- }
- Image image = lQ.a();
- if (a.getImage() != image) {
- a.setImage(image);
- }
- SystemTray.getSystemTray().getTrayIconSize();
- try {
- object = object.a.getPlayerProfile();
- object = "PokeBot.Ninja - " + object.getPlayerData().getUsername() + " level " + object.getStats().getLevel();
- if (!object.equals(a.getToolTip())) {
- a.setToolTip((String)object);
- }
- return;
- }
- catch (Exception v0) {
- return;
- }
- }
- public static void c() {
- Image image;
- if (!SystemTray.isSupported()) {
- return;
- }
- SystemTray.getSystemTray().getTrayIconSize();
- if (a != null) {
- SystemTray.getSystemTray().remove(a);
- a = null;
- }
- if ((image = lQ.a()) == null) {
- return;
- }
- PopupMenu popupMenu = new PopupMenu("Menu label");
- MenuItem menuItem = new MenuItem("Show PokeBot.Ninja");
- menuItem.setEnabled(false);
- MenuItem menuItem2 = new MenuItem("Hide PokeBot.Ninja");
- menuItem2.setEnabled(true);
- MenuItem menuItem3 = new MenuItem("Exit PokeBot.Ninja");
- popupMenu.add(menuItem);
- popupMenu.add(menuItem2);
- popupMenu.addSeparator();
- popupMenu.add(menuItem3);
- menuItem.addActionListener((ActionListener)new ie(menuItem, menuItem2));
- menuItem2.addActionListener((ActionListener)new tC(menuItem, menuItem2));
- menuItem3.addActionListener((ActionListener)new tp());
- a = new TrayIcon(image, "PokeBot.Ninja", popupMenu);
- a.addActionListener((ActionListener)new jf(menuItem, menuItem2));
- try {
- SystemTray.getSystemTray().add(a);
- return;
- }
- catch (AWTException v0) {
- System.out.println("Unable to install tray icon");
- return;
- }
- }
- public static void d() {
- ji.a("Bot is now running in background", false);
- }
- public static void a(String string, boolean bl) {
- if (a == null) {
- return;
- }
- if (!bl || EU.a != null && !EU.a.isVisible()) {
- a.displayMessage("PokeBot.Ninja", string, TrayIcon.MessageType.NONE);
- }
- }
- private static void a(ArrayList<String> arrayList, int n, String object2) {
- try {
- for (Map.Entry entry : FG.a((int)n, (String)object2).entrySet()) {
- arrayList.add((String)entry.getValue());
- }
- return;
- }
- catch (Exception v0) {
- return;
- }
- }
- private static boolean e() {
- Object object;
- String string = System.getProperty("os.name", "none").toLowerCase();
- string.contains("win");
- boolean bl = string.contains("mac");
- if (!FG.a) {
- if (bl) {
- return true;
- }
- return false;
- }
- object = new ArrayList<String>();
- try {
- ji.a(object, Integer.MIN_VALUE, "pokesniper2\\shell\\open\\command");
- ji.a(object, -2147483647, "Software\\Classes\\pokesniper2\\shell\\open\\command");
- ji.a(object, -2147483646, "Software\\Classes\\pokesniper2\\shell\\open\\command");
- ji.a(object, Integer.MIN_VALUE, "ninjasniper\\shell\\open\\command");
- ji.a(object, -2147483647, "Software\\Classes\\ninjasniper\\shell\\open\\command");
- ji.a(object, -2147483646, "Software\\Classes\\ninjasniper\\shell\\open\\command");
- }
- catch (Exception v0) {}
- object = object.iterator();
- while (object.hasNext()) {
- if (!((String)object.next()).contains("ninjasniper")) continue;
- return true;
- }
- return false;
- }
- private static String a(String[] object) {
- List list;
- boolean bl;
- Object object2;
- boolean bl2;
- String string = System.getProperty("os.name", "none").toLowerCase();
- boolean bl3 = string.contains("win");
- string.contains("mac");
- bl2 = false;
- bl = false;
- object2 = null;
- for (Object object3 : object) {
- if (object3 == null) continue;
- boolean bl4 = "/register".equalsIgnoreCase((String)object3) || "-register".equalsIgnoreCase((String)object3);
- boolean bl5 = "/unregister".equalsIgnoreCase((String)object3) || "-unregister".equalsIgnoreCase((String)object3);
- bl2 |= bl4;
- bl |= bl5;
- if (object3.startsWith("/snipe:") || object3.startsWith("-snipe:")) {
- object2 = object3.substring(7);
- continue;
- }
- if (bl4 || bl5) continue;
- object2 = object3;
- }
- if (bl) {
- bl2 = false;
- }
- if ((bl2 || bl) && !bl3) {
- System.out.println("pokesniper2 protocol automatic registration only available on Windows!");
- System.out.println("You have to manually register (use google to find examples) pokesniper2 protocol to: ninjasniper.sh -snipe:%u");
- System.out.println("After that contact MrNinja with details to be able to enable it in PokeBot.Ninja");
- by.a();
- System.exit(0);
- }
- if (bl2 && ji.a() < 3) {
- System.out.println("pokesniper2 protocol is only for Platinum and Radioactive donators!");
- System.exit(0);
- }
- object = null;
- list = null;
- try {
- object = FG.a((int)Integer.MIN_VALUE, (String)"pokesniper2");
- list = FG.a((int)Integer.MIN_VALUE, (String)"ninjasniper");
- }
- catch (Exception v0) {}
- if (!bl2 && !bl && object2 == null) {
- if (ji.e()) {
- System.out.println("pokesniper2 protocol is registered to PokeBot.Ninja :)");
- } else {
- System.out.println("pokesniper2 protocol is NOT registered to PokeBot.Ninja :(");
- System.out.println("Start ninjasniper_register as Administrator to register it!");
- }
- return null;
- }
- if (bl2) {
- if (ji.e()) {
- System.out.println("Reinstalling pokesniper2 link handler to PokeBot.Ninja");
- } else {
- System.out.println("Installing pokesniper2 link handler to PokeBot.Ninja");
- }
- String string = ji.b();
- try {
- FG.a((String)"pokesniper2");
- FG.a((String)"pokesniper2", (String)"", (String)"URL:Pokesniper2 Protocol");
- FG.a((String)"pokesniper2", (String)"URL Protocol", (String)"");
- FG.a((String)"pokesniper2\\shell\\open\\command");
- FG.a((String)"pokesniper2\\shell\\open\\command", (String)"", (String)("\"" + string + "ninjasniper.cmd\" \"/snipe:%1\""));
- FG.a((String)"ninjasniper");
- FG.a((String)"ninjasniper", (String)"", (String)"URL:NinjaSniper Protocol");
- FG.a((String)"ninjasniper", (String)"URL Protocol", (String)"");
- FG.a((String)"ninjasniper\\shell\\open\\command");
- FG.a((String)"ninjasniper\\shell\\open\\command", (String)"", (String)("\"" + string + "ninjasniper.cmd\" \"/snipe:%1\""));
- }
- catch (Exception v1) {
- Object object3;
- object3 = v1;
- if (v1.getMessage().contains("ACCESS_DENIED")) {
- System.out.println("Access denied, rerun with administrator privileges");
- }
- object3.printStackTrace(System.out);
- }
- System.exit(0);
- }
- if (bl) {
- if (object == null && list == null) {
- System.out.println("pokesniper2 link handler already uninstalled");
- } else {
- try {
- FG.a((int)Integer.MIN_VALUE, (String)"pokesniper2");
- FG.a((int)Integer.MIN_VALUE, (String)"ninjasniper");
- }
- catch (Exception v2) {
- Exception exception = v2;
- if (v2.getMessage().contains("ACCESS_DENIED")) {
- System.out.println("Access denied, rerun with administrator privileges");
- }
- exception.printStackTrace(System.out);
- }
- }
- System.exit(0);
- }
- if (object2 != null) {
- if (ji.a() >= 3) {
- return object2;
- }
- System.out.println("Platinum or Radioactive needed for protocol handler support!");
- }
- return null;
- }
- public static void a(JTextComponent jTextComponent) {
- JPopupMenu jPopupMenu = new JPopupMenu();
- Serializable serializable = new DefaultEditorKit.PasteAction();
- serializable = new fq(jTextComponent, serializable);
- serializable = new JMenuItem((Action)((Object)serializable));
- serializable.setText(um.a((String)"Paste"));
- jPopupMenu.add((JMenuItem)serializable);
- jTextComponent.setComponentPopupMenu(jPopupMenu);
- }
- public static String c(String string) {
- return ji.a(string.getBytes());
- }
- private static String a(byte[] arrby) {
- try {
- RSAPublicKey rSAPublicKey = (RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(a));
- Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
- cipher.init(1, rSAPublicKey);
- return xl.a((byte[])cipher.doFinal(arrby));
- }
- catch (Exception v0) {
- v0.printStackTrace(System.out);
- return "";
- }
- }
- public static String a(Throwable throwable) {
- StringWriter stringWriter = new StringWriter();
- PrintWriter printWriter = new PrintWriter(stringWriter);
- throwable.printStackTrace(printWriter);
- return stringWriter.toString();
- }
- public static void a(List<CatchablePokemon> list, aI aI2) {
- Collections.sort(list, new ue(aI2));
- }
- public static void b(List<Gym> list, aI aI2) {
- Collections.sort(list, new jq(aI2));
- }
- public static boolean a(JFrame jFrame, int n, FI fI) {
- if (ji.a() >= n) {
- return true;
- }
- Object object = (Integer)a.get(n);
- String string = "Radioactive";
- switch (n) {
- case 0: {
- string = "Radioactive";
- break;
- }
- case 1: {
- string = "Silver";
- break;
- }
- case 2: {
- string = "Gold";
- break;
- }
- case 3: {
- string = "Platinum";
- break;
- }
- case 4: {
- string = "Radioactive";
- }
- }
- Object[] arrobject = new String[]{um.a((String)"Yes"), um.a((String)"No"), um.a((String)"Confirm")};
- if (fI == null) {
- arrobject = new String[]{um.a((String)"Yes"), um.a((String)"No")};
- }
- String string2 = um.a((String)"Donator-only feature");
- 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?");
- int n2 = JOptionPane.showOptionDialog(jFrame, object, string2, -1, -1, lQ.c(), arrobject, arrobject[0]);
- if (n2 == 0) {
- ji.a("http://pokebot.ninja/donate.php");
- } else if (n2 == 2) {
- new Eq((Frame)jFrame, fI).setVisible(true);
- if (ji.a() >= n) {
- return true;
- }
- }
- return false;
- }
- public static boolean a(String[] object) {
- if ((object = ji.a((String[])object)) == null) {
- return false;
- }
- if (ji.a() < 3) {
- System.out.println("pokesniper2 link handling is only enabled for Platinum and Radioactive donators!");
- return true;
- }
- if (!object.startsWith("pokesniper2://") && object.startsWith("ninjasniper://")) {
- System.out.println("Invalid link provided: " + (String)object);
- return true;
- }
- ji.b(object.trim());
- return true;
- }
- public static void e() {
- if (ji.a() < 3) {
- return;
- }
- if (!ji.e()) {
- if (!FG.a) {
- System.out.println("pokesniper2:// link handler is currently only usable in Windows, skipping link listener");
- return;
- }
- System.out.println("pokesniper2:// link handler is not installed, skipping link listener");
- return;
- }
- new oA().start();
- }
- private static void b(String object) {
- InetAddress inetAddress;
- DatagramSocket datagramSocket = null;
- try {
- datagramSocket = new DatagramSocket();
- inetAddress = InetAddress.getByName("224.0.0.3");
- datagramSocket.setSoTimeout(500);
- }
- catch (Exception v0) {
- v0.printStackTrace(System.out);
- System.out.println("Unable to send pokesniper2 link!");
- if (datagramSocket != null) {
- datagramSocket.close();
- }
- return;
- }
- Object object2 = object.getBytes();
- byte[] arrby = new byte[1024];
- System.out.println("Sending: " + (String)object);
- object = new DatagramPacket((byte[])object2, object2.length, inetAddress, 28174);
- try {
- datagramSocket.send((DatagramPacket)object);
- }
- catch (Exception v1) {
- v1.printStackTrace(System.out);
- System.out.println("Unable to send pokesniper2 link!");
- return;
- }
- int n = 0;
- int n2 = 0;
- do {
- object2 = new DatagramPacket(arrby, 1024);
- try {
- datagramSocket.receive((DatagramPacket)object2);
- object2 = new String(object2.getData()).trim();
- if (object2.equals("OK")) {
- ++n2;
- }
- object2.equals("NO");
- ++n;
- continue;
- }
- catch (SocketTimeoutException v2) {
- break;
- }
- catch (IOException v3) {
- v3.printStackTrace(System.out);
- break;
- }
- } while (true);
- System.out.println("Sent pokesniper2 link to " + n + " PokeBot.Ninja instances, " + n2 + " started processing");
- datagramSocket.close();
- ji.a(1000, 1000, 1000);
- }
- public static aI a(PokemonDataOuterClass.PokemonData pokemonData) {
- pokemonData = new S2LatLng(new S2Cell(new S2CellId(pokemonData.getCapturedCellId())).getCenter());
- return new aI(pokemonData.latDegrees(), pokemonData.lngDegrees(), 0.0);
- }
- public static String a(aI aI2) {
- return "https://maps.google.com/?q=" + aI2.a + "," + aI2.b;
- }
- public static void f() {
- if (ji.b()) {
- new Timer(1080000, (ActionListener)new iT()).start();
- }
- }
- static /* synthetic */ boolean c() {
- return b;
- }
- static /* synthetic */ boolean d() {
- return true;
- }
- static /* synthetic */ int b() {
- return a++;
- }
- static /* synthetic */ boolean b(boolean bl) {
- b = bl;
- return b;
- }
- static /* synthetic */ int c() {
- return a;
- }
- static {
- a = false;
- a = 0;
- b = false;
- a = null;
- 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};
- a = new HashMap<Integer, Integer>();
- a.put(1, 1);
- a.put(2, 5);
- a.put(3, 10);
- a.put(4, 20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement