package com.baidu.location; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import cn.beekee.zhongtong.util.net.JsonOperate; import java.io.PrintWriter; import java.io.StringWriter; import org.json.JSONObject; public final class BDLocation implements m, Parcelable { public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { /* class com.baidu.location.BDLocation.AnonymousClass1 */ /* renamed from: a */ public BDLocation createFromParcel(Parcel parcel) { return new BDLocation(parcel); } /* renamed from: a */ public BDLocation[] newArray(int i) { return new BDLocation[i]; } }; public static final int LOCATION_WHERE_IN_CN = 1; public static final int LOCATION_WHERE_OUT_CN = 0; public static final int LOCATION_WHERE_UNKNOW = 2; public static final int OPERATORS_TYPE_MOBILE = 1; public static final int OPERATORS_TYPE_TELECOMU = 3; public static final int OPERATORS_TYPE_UNICOM = 2; public static final int OPERATORS_TYPE_UNKONW = 0; public static final int TypeCacheLocation = 65; public static final int TypeCriteriaException = 62; public static final int TypeGpsLocation = 61; public static final int TypeNetWorkException = 63; public static final int TypeNetWorkLocation = 161; public static final int TypeNone = 0; public static final int TypeOffLineLocation = 66; public static final int TypeOffLineLocationFail = 67; public static final int TypeOffLineLocationNetworkFail = 68; public static final int TypeServerError = 167; private String kA; private int kB; private float kC; private boolean kD; private int kE; private double kF; private boolean kG; private float kH; private String kI; private String kJ; private int kK; private String ko; private int kp; private double kq; private String kr; private boolean ks; private boolean kt; private String ku; private float kv; private double kw; private boolean kx; private a ky; private boolean kz; public class a { /* renamed from: byte reason: not valid java name */ public String f6byte = null; /* renamed from: do reason: not valid java name */ public String f7do = null; /* renamed from: for reason: not valid java name */ public String f8for = null; /* renamed from: if reason: not valid java name */ public String f9if = null; /* renamed from: int reason: not valid java name */ public String f10int = null; /* renamed from: new reason: not valid java name */ public String f11new = null; /* renamed from: try reason: not valid java name */ public String f12try = null; public a() { } } public BDLocation() { this.kE = 0; this.kI = null; this.kq = Double.MIN_VALUE; this.kF = Double.MIN_VALUE; this.ks = false; this.kw = Double.MIN_VALUE; this.kt = false; this.kH = 0.0f; this.kz = false; this.kC = 0.0f; this.kG = false; this.kp = -1; this.kv = -1.0f; this.kJ = null; this.kD = false; this.ko = null; this.kx = false; this.ky = new a(); this.kr = null; this.kB = 2; this.kA = null; this.ku = ""; } private BDLocation(Parcel parcel) { this.kE = 0; this.kI = null; this.kq = Double.MIN_VALUE; this.kF = Double.MIN_VALUE; this.ks = false; this.kw = Double.MIN_VALUE; this.kt = false; this.kH = 0.0f; this.kz = false; this.kC = 0.0f; this.kG = false; this.kp = -1; this.kv = -1.0f; this.kJ = null; this.kD = false; this.ko = null; this.kx = false; this.ky = new a(); this.kr = null; this.kB = 2; this.kA = null; this.ku = ""; this.kE = parcel.readInt(); this.kI = parcel.readString(); this.kq = parcel.readDouble(); this.kF = parcel.readDouble(); this.kw = parcel.readDouble(); this.kH = parcel.readFloat(); this.kC = parcel.readFloat(); this.kp = parcel.readInt(); this.kv = parcel.readFloat(); this.kr = parcel.readString(); this.kA = parcel.readString(); this.ky.f9if = parcel.readString(); this.ky.f11new = parcel.readString(); this.ky.f10int = parcel.readString(); this.ky.f6byte = parcel.readString(); this.ky.f7do = parcel.readString(); this.ky.f8for = parcel.readString(); this.ky.f12try = parcel.readString(); this.kK = parcel.readInt(); this.ku = parcel.readString(); this.kB = parcel.readInt(); boolean[] zArr = new boolean[6]; try { parcel.readBooleanArray(zArr); this.ks = zArr[0]; this.kt = zArr[1]; this.kz = zArr[2]; this.kG = zArr[3]; this.kD = zArr[4]; this.kx = zArr[5]; } catch (Exception e) { } } public BDLocation(BDLocation bDLocation) { this.kE = 0; this.kI = null; this.kq = Double.MIN_VALUE; this.kF = Double.MIN_VALUE; this.ks = false; this.kw = Double.MIN_VALUE; this.kt = false; this.kH = 0.0f; this.kz = false; this.kC = 0.0f; this.kG = false; this.kp = -1; this.kv = -1.0f; this.kJ = null; this.kD = false; this.ko = null; this.kx = false; this.ky = new a(); this.kr = null; this.kB = 2; this.kA = null; this.ku = ""; this.kE = bDLocation.kE; this.kI = bDLocation.kI; this.kq = bDLocation.kq; this.kF = bDLocation.kF; this.ks = bDLocation.ks; this.kw = bDLocation.kw; this.kt = bDLocation.kt; this.kH = bDLocation.kH; this.kz = bDLocation.kz; this.kC = bDLocation.kC; this.kG = bDLocation.kG; this.kp = bDLocation.kp; this.kv = bDLocation.kv; this.kJ = bDLocation.kJ; this.kD = bDLocation.kD; this.ko = bDLocation.ko; this.kB = bDLocation.kB; this.kx = bDLocation.kx; this.ky = new a(); this.ky.f9if = bDLocation.ky.f9if; this.ky.f11new = bDLocation.ky.f11new; this.ky.f10int = bDLocation.ky.f10int; this.ky.f6byte = bDLocation.ky.f6byte; this.ky.f7do = bDLocation.ky.f7do; this.ky.f8for = bDLocation.ky.f8for; this.ky.f12try = bDLocation.ky.f12try; this.kr = bDLocation.kr; this.kA = bDLocation.kA; this.kK = bDLocation.kK; this.ku = bDLocation.ku; } protected BDLocation(String str) { this.kE = 0; this.kI = null; this.kq = Double.MIN_VALUE; this.kF = Double.MIN_VALUE; this.ks = false; this.kw = Double.MIN_VALUE; this.kt = false; this.kH = 0.0f; this.kz = false; this.kC = 0.0f; this.kG = false; this.kp = -1; this.kv = -1.0f; this.kJ = null; this.kD = false; this.ko = null; this.kx = false; this.ky = new a(); this.kr = null; this.kB = 2; this.kA = null; this.ku = ""; if (str != null && !str.equals("")) { try { JSONObject jSONObject = new JSONObject(str); JSONObject jSONObject2 = jSONObject.getJSONObject(JsonOperate.ORDER_RESULT); int parseInt = Integer.parseInt(jSONObject2.getString("error")); setLocType(parseInt); setTime(jSONObject2.getString("time")); if (parseInt == 61) { JSONObject jSONObject3 = jSONObject.getJSONObject("content"); JSONObject jSONObject4 = jSONObject3.getJSONObject("point"); setLatitude(Double.parseDouble(jSONObject4.getString("y"))); setLongitude(Double.parseDouble(jSONObject4.getString("x"))); setRadius(Float.parseFloat(jSONObject3.getString(com.baidu.location.a.a.f30else))); setSpeed(Float.parseFloat(jSONObject3.getString("s"))); setDirection(Float.parseFloat(jSONObject3.getString("d"))); setSatelliteNumber(Integer.parseInt(jSONObject3.getString("n"))); if (jSONObject3.has("h")) { try { setAltitude(jSONObject3.getDouble("h")); } catch (Exception e) { } } } else if (parseInt == 161) { JSONObject jSONObject5 = jSONObject.getJSONObject("content"); JSONObject jSONObject6 = jSONObject5.getJSONObject("point"); setLatitude(Double.parseDouble(jSONObject6.getString("y"))); setLongitude(Double.parseDouble(jSONObject6.getString("x"))); setRadius(Float.parseFloat(jSONObject5.getString(com.baidu.location.a.a.f30else))); if (jSONObject5.has("addr")) { String string = jSONObject5.getString("addr"); this.ky.f12try = string; String[] split = string.split(","); int length = split.length; if (length > 0) { this.ky.f9if = split[0]; } if (length > 1) { this.ky.f11new = split[1]; } if (length > 2) { this.ky.f10int = split[2]; } if (length > 3) { this.ky.f6byte = split[3]; } if (length > 4) { this.ky.f7do = split[4]; } if (length > 5) { this.ky.f8for = split[5]; } String str2 = ((!this.ky.f9if.contains("北京") || !this.ky.f11new.contains("北京")) && (!this.ky.f9if.contains("上海") || !this.ky.f11new.contains("上海")) && ((!this.ky.f9if.contains("天津") || !this.ky.f11new.contains("天津")) && (!this.ky.f9if.contains("重庆") || !this.ky.f11new.contains("重庆")))) ? this.ky.f9if + this.ky.f11new : this.ky.f9if; this.ky.f12try = this.ky.f7do != null ? str2 + this.ky.f10int + this.ky.f6byte + this.ky.f7do : str2 + this.ky.f10int + this.ky.f6byte; this.kD = true; } else { this.kD = false; setAddrStr(null); } if (jSONObject5.has("floor")) { this.kr = jSONObject5.getString("floor"); if (TextUtils.isEmpty(this.kr)) { this.kr = null; } } if (jSONObject5.has("loctp")) { this.kA = jSONObject5.getString("loctp"); if (TextUtils.isEmpty(this.kA)) { this.kA = null; } } try { if (jSONObject5.has("in_cn")) { i(Integer.parseInt(jSONObject5.getString("in_cn"))); } else { i(1); } } catch (Exception e2) { } } else if (parseInt == 66 || parseInt == 68) { JSONObject jSONObject7 = jSONObject.getJSONObject("content"); JSONObject jSONObject8 = jSONObject7.getJSONObject("point"); setLatitude(Double.parseDouble(jSONObject8.getString("y"))); setLongitude(Double.parseDouble(jSONObject8.getString("x"))); setRadius(Float.parseFloat(jSONObject7.getString(com.baidu.location.a.a.f30else))); m1if(Boolean.valueOf(Boolean.parseBoolean(jSONObject7.getString("isCellChanged")))); } } catch (Exception e3) { e3.printStackTrace(); this.kE = 0; this.kD = false; } } } private String c6() { return this.ku; } private static String c8() { return Build.MODEL; } /* renamed from: do reason: not valid java name */ private String m0do(Throwable th) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); th.printStackTrace(printWriter); printWriter.close(); return stringWriter.toString(); } /* renamed from: if reason: not valid java name */ private void m1if(Boolean bool) { this.kx = bool.booleanValue(); } /* access modifiers changed from: protected */ public String c4() { return null; } /* access modifiers changed from: package-private */ public int c5() { return this.kB; } /* access modifiers changed from: package-private */ public a c7() { return this.ky; } public int describeContents() { return 0; } public String getAdUrl(String str) { String valueOf = String.valueOf(this.kq); String valueOf2 = String.valueOf(this.kF); String c6 = c6(); return "http://lba.baidu.com/" + "?a=" + CommonEncrypt.a("ak=" + str + "&" + "lat=" + valueOf + "&" + "lng=" + valueOf2 + "&" + "cu=" + c6 + "&" + "mb=" + c8()); } public String getAddrStr() { return this.ky.f12try; } public double getAltitude() { return this.kw; } public String getCity() { return this.ky.f11new; } public String getCityCode() { return this.ky.f8for; } public String getCoorType() { return this.kJ; } public float getDirection() { return this.kv; } public String getDistrict() { return this.ky.f10int; } public String getFloor() { return this.kr; } public double getLatitude() { return this.kq; } public int getLocType() { return this.kE; } public double getLongitude() { return this.kF; } public String getNetworkLocationType() { return this.kA; } public int getOperators() { return this.kK; } public String getProvince() { return this.ky.f9if; } public float getRadius() { return this.kC; } public int getSatelliteNumber() { this.kG = true; return this.kp; } public float getSpeed() { return this.kH; } public String getStreet() { return this.ky.f6byte; } public String getStreetNumber() { return this.ky.f7do; } public String getTime() { return this.kI; } /* access modifiers changed from: protected */ public void h(int i) { this.kK = i; } public boolean hasAddr() { return this.kD; } public boolean hasAltitude() { return this.ks; } public boolean hasRadius() { return this.kz; } public boolean hasSateNumber() { return this.kG; } public boolean hasSpeed() { return this.kt; } /* access modifiers changed from: protected */ public void i(int i) { this.kB = i; } /* access modifiers changed from: package-private */ /* renamed from: if reason: not valid java name */ public void m2if(a aVar) { if (aVar != null) { this.ky.f12try = aVar.f12try; this.ky.f11new = aVar.f11new; this.ky.f8for = aVar.f8for; this.ky.f10int = aVar.f10int; this.ky.f9if = aVar.f9if; this.ky.f6byte = aVar.f6byte; this.ky.f7do = aVar.f7do; this.kD = true; } } public void internalSet(int i, String str) { if (str != null && i == 0) { this.ku = str; } } public boolean isCellChangeFlag() { return this.kx; } public void setAddrStr(String str) { this.ko = str; if (str == null) { this.kD = false; } else { this.kD = true; } } public void setAltitude(double d) { this.kw = d; this.ks = true; } public void setCoorType(String str) { this.kJ = str; } public void setDirection(float f) { this.kv = f; } public void setLatitude(double d) { this.kq = d; } public void setLocType(int i) { this.kE = i; } public void setLongitude(double d) { this.kF = d; } public void setNetworkLocationType(String str) { this.kA = str; } public void setRadius(float f) { this.kC = f; this.kz = true; } public void setSatelliteNumber(int i) { this.kp = i; } public void setSpeed(float f) { this.kH = f; this.kt = true; } public void setTime(String str) { this.kI = str; } /* access modifiers changed from: protected */ public BDLocation v(String str) { return null; } public void writeToParcel(Parcel parcel, int i) { parcel.writeInt(this.kE); parcel.writeString(this.kI); parcel.writeDouble(this.kq); parcel.writeDouble(this.kF); parcel.writeDouble(this.kw); parcel.writeFloat(this.kH); parcel.writeFloat(this.kC); parcel.writeInt(this.kp); parcel.writeFloat(this.kv); parcel.writeString(this.kr); parcel.writeString(this.kA); parcel.writeString(this.ky.f9if); parcel.writeString(this.ky.f11new); parcel.writeString(this.ky.f10int); parcel.writeString(this.ky.f6byte); parcel.writeString(this.ky.f7do); parcel.writeString(this.ky.f8for); parcel.writeString(this.ky.f12try); parcel.writeInt(this.kK); parcel.writeString(this.ku); parcel.writeInt(this.kB); parcel.writeBooleanArray(new boolean[]{this.ks, this.kt, this.kz, this.kG, this.kD, this.kx}); } }