MD5 校验值:576c0e120baeb324e9c5a56152387c2b
e.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package de.mdiener.rain.usa; import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.hardware.GeomagneticField; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.util.Log; import android.view.View; import android.widget.TextView; import androidx.work.PeriodicWorkRequest; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.Circle; import com.google.android.gms.maps.model.CircleOptions; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polygon; import com.google.android.gms.maps.model.PolygonOptions; import com.google.android.gms.maps.model.Tile; import com.google.android.gms.maps.model.TileOverlay; import com.google.android.gms.maps.model.TileOverlayOptions; import com.google.android.gms.maps.model.TileProvider; import de.mdiener.android.core.util.t; import de.mdiener.android.core.util.u; import de.mdiener.rain.core.ICore; import de.mdiener.rain.core.util.d; import de.mdiener.rain.core.v; import de.mdiener.rain.core.w; import de.mdiener.rain.core.z; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.Array; import java.net.URL; import java.text.DateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @SuppressLint({"ViewConstructor"}) public class e implements z, de.mdiener.rain.usa.c { public static final AtomicInteger V0 = new AtomicInteger(0); public Handler A0; public int B; public Handler B0; public n C; public ArrayList<q> C0; public ArrayList<j> D; public Thread D0; public ArrayList<k> E; public de.mdiener.rain.core.util.d E0; public float F; public Object F0; public Object G; public int G0; public SensorManager H; public double[][] H0; public int I; public double[][] I0; public float J; public Marker[] J0; public Sensor K; public boolean K0; public SensorEventListener L; public float L0; public String M; public Circle[] M0; public String N; public Polygon[] N0; public boolean O; public float[] O0; public int P; public int[] P0; public Calendar Q; public int[] Q0; public Object R; public int R0; public double S; public boolean S0; public View T; public boolean T0; public GoogleMap U; public Marker U0; public Context V; public TileOverlay[] W; public m[] X; public Handler Y; public DateFormat Z; public float f1800a0; public boolean f1801b0; public HashMap<v.d, l>[] f1802c; public boolean f1803c0; public Handler f1804d; public AtomicBoolean f1805d0; public int f1806e0; public volatile int f1807f; public int f1808f0; public volatile int f1809g; public int f1810g0; public int f1811h0; public Object f1812i; public boolean f1813i0; public h f1814j; public o f1815j0; public String f1816k0; public String f1817l0; public String f1818m0; public String f1819n0; public Object f1820o; public String f1821o0; public int f1822p; public i f1823p0; public TextView f1824q0; public GoogleMap.OnCameraChangeListener f1825r0; public GoogleMap.OnMarkerDragListener f1826s0; public int f1827t0; public GoogleMap.OnCameraChangeListener f1828u0; public Object f1829v0; public Handler f1830w0; public int f1831x; public boolean f1832x0; public boolean f1833y; public boolean f1834y0; public Handler f1835z0; public class a implements SensorEventListener { public boolean f1836a = true; public float[] f1837b = new float[3]; public float[] f1838c = new float[9]; public a() { } @Override public void onAccuracyChanged(Sensor sensor, int i2) { } @Override public void onSensorChanged(SensorEvent sensorEvent) { if (sensorEvent.sensor.getType() == 11) { SensorManager.getRotationMatrixFromVector(this.f1838c, sensorEvent.values); float degrees = ((float) (Math.toDegrees(SensorManager.getOrientation(this.f1838c, this.f1837b)[0]) + 360.0d)) % 360.0f; e eVar = e.this; float f2 = (degrees + eVar.I) - eVar.L0; if (this.f1836a || Math.abs(f2 - eVar.J) >= 1.0f) { this.f1836a = false; e eVar2 = e.this; eVar2.J = f2; eVar2.R(); } } } } public class b implements GoogleMap.OnMarkerClickListener { public final ICore f1840a; public b(ICore iCore) { this.f1840a = iCore; } @Override public boolean onMarkerClick(Marker marker) { Object tag = marker.getTag(); if (tag != null) { int intValue = ((Integer) tag).intValue(); e.this.f(intValue); ICore iCore = this.f1840a; if (iCore != null) { iCore.removePoi(); this.f1840a.setLocationIdIndex(intValue); this.f1840a.setCentered(false); if (!this.f1840a.center(true)) { this.f1840a.onSingleTapConfirmed(false); } } } return true; } } public class c implements GoogleMap.OnCameraChangeListener { public c() { } @Override public void onCameraChange(CameraPosition cameraPosition) { e.this.S((int) cameraPosition.zoom); GoogleMap.OnCameraChangeListener onCameraChangeListener = e.this.f1825r0; if (onCameraChangeListener != null) { onCameraChangeListener.onCameraChange(cameraPosition); } LatLngBounds latLngBounds = e.this.U.getProjection().getVisibleRegion().latLngBounds; LatLng latLng = latLngBounds.southwest; double d2 = latLng.longitude; LatLng latLng2 = latLngBounds.northeast; double[] dArr = {d2, latLng2.latitude}; double[] dArr2 = {latLng2.longitude, latLng.latitude}; e eVar = e.this; eVar.f1816k0 = s.a.c(s.a.a(eVar.V, dArr, dArr2, v.providers), e.this.f1821o0); e.this.K(); } } public class d implements Handler.Callback { public d() { } @Override public boolean handleMessage(Message message) { Marker[] markerArr; Marker marker; e eVar = e.this; int i2 = eVar.G0; if (i2 != eVar.H0.length && (markerArr = eVar.J0) != null && (marker = markerArr[i2]) != null) { if (!eVar.K0) { marker.setAnchor(0.5f, 0.76106197f); try { e eVar2 = e.this; eVar2.J0[eVar2.G0].setIcon(BitmapDescriptorFactory.fromResource(eVar2.S0 ? de.mdiener.rain.core.r.location_direction_black : de.mdiener.rain.core.r.location_direction_white)); } catch (IllegalArgumentException unused) { } e.this.K0 = true; } e eVar3 = e.this; eVar3.J0[eVar3.G0].setRotation(eVar3.J); } return true; } } public class HandlerC0084e extends Handler { public HandlerC0084e() { } @Override public void handleMessage(Message message) { e.this.H(message.what); } } public class f extends Handler { public f() { } @Override public void handleMessage(Message message) { e.this.L(message.what); } } public class g extends Handler { public g() { } @Override public void handleMessage(Message message) { int i2 = 1; while (true) { TileOverlay[] tileOverlayArr = e.this.W; if (i2 >= tileOverlayArr.length) { return; } TileOverlay tileOverlay = tileOverlayArr[i2]; if (tileOverlay != null) { tileOverlay.clearTileCache(); } i2++; } } } public class h extends Thread { public boolean f1847c; public h(boolean z2) { super("RainOverlay$AnimationThread"); this.f1847c = z2; } @Override public void run() { boolean z2 = true; while (!isInterrupted()) { try { e eVar = e.this; long j2 = eVar.f1806e0; if (z2) { j2 = 0; z2 = false; } else if (eVar.f1807f == 1) { j2 = e.this.f1808f0; } Thread.sleep(j2); while (true) { e eVar2 = e.this; if (!eVar2.I(eVar2.f1807f)) { break; } try { Thread.sleep(e.this.f1806e0); } catch (InterruptedException unused) { synchronized (e.this.f1820o) { e.this.f1814j = null; return; } } } if (this.f1847c) { this.f1847c = false; try { Thread.sleep(e.this.f1810g0); } catch (InterruptedException unused2) { synchronized (e.this.f1820o) { e.this.f1814j = null; return; } } } synchronized (e.this.f1812i) { try { e eVar3 = e.this; eVar3.f1809g = eVar3.f1807f; if (e.this.f1807f == 1) { e eVar4 = e.this; eVar4.f1807f = eVar4.f1822p; } else { e.this.f1807f--; } } finally { } } e eVar5 = e.this; eVar5.Q(eVar5.f1827t0); e eVar6 = e.this; eVar6.H(eVar6.f1807f); } catch (InterruptedException unused3) { synchronized (e.this.f1820o) { e.this.f1814j = null; return; } } } synchronized (e.this.f1820o) { e.this.f1814j = null; } } } public class i implements Runnable { public String f1849c; public i() { } public synchronized void a(String str) { this.f1849c = str; } @Override public void run() { String str; synchronized (this) { str = this.f1849c; } TextView textView = e.this.f1824q0; if (textView != null) { textView.setText(str); } } } public static class j { public int f1851a; public int f1852b; public int f1853c; public int f1854d; public j(int i2, int i3, int i4, int i5) { this.f1851a = i2; this.f1852b = i3; this.f1853c = i4; this.f1854d = i5; } public boolean equals(Object obj) { if (obj == null || !(obj instanceof j)) { return false; } j jVar = (j) obj; return this.f1851a == jVar.f1851a && this.f1852b == jVar.f1852b && this.f1853c == jVar.f1853c && this.f1854d == jVar.f1854d; } } public class k extends Thread { public boolean f1855c; public boolean f1856d; public k(int i2, boolean z2) { super("RainOverlay$LoadThread" + i2); this.f1855c = false; this.f1856d = z2; int B = t.B(); if (B == 1) { setPriority(5); } else if (B == 2 && z2) { setPriority(4); } else if (B == 2) { setPriority(3); } else if (z2) { setPriority(3); } else { setPriority(2); } e.V0.incrementAndGet(); } @Override public void interrupt() { super.interrupt(); this.f1855c = true; } @Override public boolean isInterrupted() { return this.f1855c || super.isInterrupted(); } @Override public void run() { e eVar; int i2; boolean z2; boolean z3; Exception exc; d.c cVar; IOException iOException; Throwable th; Throwable th2; boolean z4; int i3; URL url; URL url2; Throwable th3; Calendar calendar; try { de.mdiener.rain.core.util.d G = e.this.G(); DateFormat x02 = de.mdiener.rain.core.util.q.x0(); while (!isInterrupted()) { synchronized (e.this.D) { do { try { if (e.this.D.size() != 0 && (!this.f1856d || e.this.D.get(0).f1853c == 0)) { j remove = e.this.D.remove(0); e.this.D.notifyAll(); l D = e.this.D(new q(remove.f1851a, remove.f1852b, remove.f1854d, remove.f1853c)); if (D == null) { e.this.O(-1, 0); } else { synchronized (D) { try { i2 = D.f1859b; z2 = D.f1862e; if (z2) { D.f1862e = false; } } finally { } } if (i2 > 0) { try { Thread.sleep(500L); } catch (InterruptedException unused) { synchronized (D) { D.f1858a = null; D.f1860c = false; D.f1861d = false; D.f1863f = -1L; e.this.O(-1, i2); e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); return; } } } } int F = e.this.F(remove.f1854d); try { i3 = remove.f1853c; } catch (IOException e2) { e = e2; z3 = true; } catch (Exception e3) { e = e3; z3 = true; } if (i3 == 0) { try { url = new URL("https://images.rain-alarm.com/rain/" + e.this.M + remove.f1854d + "/" + remove.f1851a + "/" + remove.f1852b + ".png"); } catch (IOException e4) { iOException = e4; z3 = true; cVar = null; th2 = iOException; while (true) { if (th2.getCause() != null) { } } if (de.mdiener.android.core.util.p.m(iOException)) { } synchronized (D) { } } catch (Exception e5) { exc = e5; z3 = true; cVar = null; th = exc; while (true) { th = th.getCause(); if (th == null) { } } Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, exc); i2++; de.mdiener.android.core.util.m.a().c(exc); synchronized (D) { } } } else if (i3 == 1) { url = new URL(e.this.N + "z" + remove.f1854d + "/" + (remove.f1851a / 8) + "_" + (remove.f1852b / 8) + "/" + remove.f1851a + "_" + remove.f1852b + ".png"); } else { try { } catch (IOException e6) { e = e6; z3 = true; iOException = e; cVar = null; th2 = iOException; while (true) { if (th2.getCause() != null) { } } if (de.mdiener.android.core.util.p.m(iOException)) { } synchronized (D) { } } catch (Exception e7) { e = e7; z3 = true; exc = e; cVar = null; th = exc; while (true) { th = th.getCause(); if (th == null) { } } Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, exc); i2++; de.mdiener.android.core.util.m.a().c(exc); synchronized (D) { } } synchronized (e.this.R) { try { Calendar calendar2 = e.this.Q; if (calendar2 != null) { try { calendar = (Calendar) calendar2.clone(); } catch (Throwable th4) { th3 = th4; z3 = true; while (true) { try { try { break; } catch (IOException e8) { e = e8; iOException = e; cVar = null; th2 = iOException; while (true) { if (th2.getCause() != null) { th2 = th2.getCause(); if (th2 != null && (th2 instanceof OutOfMemoryError)) { e.this.P(); break; } } else { break; } } if (de.mdiener.android.core.util.p.m(iOException)) { String message = iOException.getMessage(); Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, iOException); i2++; SharedPreferences.Editor edit = r.a.getPreferences(e.this.V, null).edit(); StringBuilder sb = new StringBuilder(); sb.append(new Date().toString()); sb.append(" "); sb.append(message); edit.putString("errorHttpImage", sb.toString()); edit.apply(); de.mdiener.android.core.util.m.a().c(iOException); } synchronized (D) { } } catch (Exception e9) { e = e9; exc = e; cVar = null; th = exc; while (true) { th = th.getCause(); if (th == null) { break; } else if (th instanceof OutOfMemoryError) { e.this.P(); break; } } Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, exc); i2++; de.mdiener.android.core.util.m.a().c(exc); synchronized (D) { } } } catch (Throwable th5) { th3 = th5; } th3 = th5; } throw th3; break; } } else { calendar = null; } if (calendar == null) { synchronized (e.this.D) { e.this.D.add(remove); e.this.D.notifyAll(); } try { Thread.sleep(250L); } catch (InterruptedException unused2) { synchronized (D) { D.f1858a = null; D.f1860c = false; D.f1861d = false; e.this.O(-1, i2); e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); return; } } } } else { calendar.add(12, (-e.this.B) * (remove.f1853c - 1) * F); url2 = new URL(e.this.N + "z" + remove.f1854d + "/" + (remove.f1851a / 8) + "_" + (remove.f1852b / 8) + "/" + remove.f1851a + "_" + remove.f1852b + "_" + x02.format(calendar.getTime()) + ".png"); z3 = true; cVar = G.l(url2, remove.f1854d, remove.f1853c, z2, e.this.O); if (remove.f1853c == 1) { try { Calendar calendar3 = cVar.f1491b; if (calendar3 != null) { int i4 = calendar3.get(12); int i5 = e.this.B; if (i4 % i5 != 0) { cVar.f1491b.add(12, -(i4 % i5)); } synchronized (e.this.R) { try { Calendar calendar4 = e.this.Q; if (calendar4 != null) { if (cVar.f1491b.after(calendar4)) { } } e eVar2 = e.this; eVar2.Q = cVar.f1491b; eVar2.Q(remove.f1854d); } catch (Throwable th6) { throw th6; break; } } } } catch (IOException e10) { iOException = e10; th2 = iOException; while (true) { if (th2.getCause() != null) { } } if (de.mdiener.android.core.util.p.m(iOException)) { } synchronized (D) { } } catch (Exception e11) { exc = e11; th = exc; while (true) { th = th.getCause(); if (th == null) { } } Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, exc); i2++; de.mdiener.android.core.util.m.a().c(exc); synchronized (D) { } } } cVar.f1491b = null; if (isInterrupted()) { try { try { synchronized (D) { try { D.f1858a = null; D.f1860c = false; D.f1861d = false; D.f1863f = -1L; e.this.O(-1, i2); e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); } return; } catch (Throwable th7) { th = th7; throw th; } } } catch (Throwable th8) { th = th8; } } catch (IOException e12) { e = e12; iOException = e; th2 = iOException; while (true) { if (th2.getCause() != null) { } } if (de.mdiener.android.core.util.p.m(iOException)) { } synchronized (D) { } } catch (Exception e13) { e = e13; exc = e; th = exc; while (true) { th = th.getCause(); if (th == null) { } } Log.w("RainAlarm", "x " + remove.f1851a + " y " + remove.f1852b + " z " + remove.f1853c, exc); i2++; de.mdiener.android.core.util.m.a().c(exc); synchronized (D) { } } if (e.this.D(new q(remove.f1851a, remove.f1852b, remove.f1854d, remove.f1853c)) != null && !z4) { boolean z5 = D.f1859b >= i2 ? z3 : false; synchronized (D) { try { D.f1860c = false; if (cVar != null && cVar.f1490a != null) { D.f1858a = cVar; } D.f1859b = i2; D.f1863f = System.currentTimeMillis(); } finally { } } if (!z5) { continue; } else if (i2 < 4) { synchronized (D) { D.f1860c = z3; D.f1863f = -1L; } synchronized (e.this.D) { e.this.D.add(0, remove); e.this.D.notifyAll(); } e.this.O(0, i2); } else { e.this.O(-1, i2); } } synchronized (D) { D.f1858a = null; D.f1860c = false; D.f1861d = false; D.f1863f = -1L; } e.this.O(-1, i2); } synchronized (D) { z4 = D.f1860c ^ z3; if (e.this.D(new q(remove.f1851a, remove.f1852b, remove.f1854d, remove.f1853c)) != null) { if (D.f1859b >= i2) { } synchronized (D) { } } synchronized (D) { } } } } catch (Throwable th9) { z3 = true; th3 = th9; } } } url2 = url; z3 = true; cVar = G.l(url2, remove.f1854d, remove.f1853c, z2, e.this.O); if (remove.f1853c == 1) { } cVar.f1491b = null; if (isInterrupted()) { } synchronized (D) { } } } try { e.this.D.wait(2000L); eVar = e.this; } catch (InterruptedException unused3) { e.this.D.notifyAll(); e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); return; } } } catch (Throwable th10) { e.this.D.notifyAll(); throw th10; } } while (!eVar.f1834y0); eVar.D.notifyAll(); e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); } return; } } e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); } } catch (Throwable th11) { e.V0.decrementAndGet(); synchronized (e.this.E) { e.this.E.remove(this); throw th11; } } } } public static class l { public d.c f1858a; public int f1859b = 0; public boolean f1860c = false; public boolean f1861d = false; public boolean f1862e = false; public long f1863f = 0; public q f1864g; public l(q qVar) { this.f1864g = qVar; } } public class m implements TileProvider { public int f1865a; public AtomicInteger f1866b = new AtomicInteger(0); public int f1867c; public m(int i2) { this.f1865a = -1; this.f1865a = i2; this.f1867c = i2 == 0 ? 13 : 9; } public boolean a() { return this.f1866b.get() > 0; } @Override public Tile getTile(int i2, int i3, int i4) { int i5; int i6; int i7; boolean z2; byte[] bArr; Tile tile; d.c cVar; boolean z3; e eVar = e.this; if (eVar.U == null) { return null; } synchronized (eVar.D) { e eVar2 = e.this; if (!eVar2.f1832x0 && !eVar2.f1834y0) { int i8 = this.f1867c; if (i4 > i8) { i7 = (int) Math.pow(2.0d, i4 - i8); i5 = i2 / i7; i6 = i3 / i7; } else { i5 = i2; i6 = i3; i8 = i4; i7 = 1; } q qVar = new q(i5, i6, i8, this.f1865a); l E = e.this.E(qVar); if (E == null) { return null; } synchronized (e.this.f1802c) { z2 = e.this.f1801b0; } synchronized (E) { try { boolean z4 = E.f1860c; if (z4 || ((cVar = E.f1858a) != null && cVar.f1490a != null)) { d.c cVar2 = E.f1858a; if (cVar2 == null || (bArr = cVar2.f1490a) == null) { if (E.f1859b < 4) { return null; } synchronized (e.this.C0) { e.this.C0.add(qVar); e.this.C0.notifyAll(); } return TileProvider.NO_TILE; } if (i4 > this.f1867c) { Bitmap decodeByteArray = BitmapFactory.decodeByteArray(bArr, 0, bArr.length); int i9 = e.this.P / i7; Bitmap createBitmap = Bitmap.createBitmap(decodeByteArray, (i2 - (i5 * i7)) * i9, (i3 - (i6 * i7)) * i9, i9, i9); decodeByteArray.recycle(); int i10 = e.this.P; Bitmap createScaledBitmap = Bitmap.createScaledBitmap(createBitmap, i10, i10, false); createBitmap.recycle(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); createScaledBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); bArr = byteArrayOutputStream.toByteArray(); createScaledBitmap.recycle(); } int i11 = e.this.P; tile = new Tile(i11, i11, bArr); E.f1861d = true; synchronized (e.this.f1802c) { try { if (z2 != e.this.f1801b0) { e.this.f1801b0 = z2; } } finally { } } if (tile == null) { if (z4) { return null; } synchronized (e.this.C0) { e.this.C0.add(qVar); e.this.C0.notifyAll(); } return TileProvider.NO_TILE; } synchronized (e.this.C0) { e.this.C0.add(qVar); e.this.C0.notifyAll(); } synchronized (e.this.f1802c[this.f1865a]) { e.this.f1802c[this.f1865a].remove(E.f1864g); } e.this.O(-1, E.f1859b); return tile; } if (z2 && this.f1865a > 1) { z3 = false; z4 = e.this.J(E, qVar.f2762c, qVar.f2763d, this.f1865a, qVar.f2765g); this.f1866b.incrementAndGet(); if (e.this.isRunning()) { int i12 = this.f1865a; int i13 = i12 <= 1 ? e.this.f1822p : i12 - 1; e eVar3 = e.this; int i14 = eVar3.f1822p; eVar3.L(i13); } z2 = z3; tile = null; synchronized (e.this.f1802c) { } } z3 = z2; z4 = e.this.J(E, qVar.f2762c, qVar.f2763d, this.f1865a, qVar.f2765g); this.f1866b.incrementAndGet(); if (e.this.isRunning()) { } z2 = z3; tile = null; synchronized (e.this.f1802c) { } } finally { } } } return TileProvider.NO_TILE; } } } public class n extends Thread { public boolean f1869c; public n() { super("RainOverlay$Recycler"); this.f1869c = false; setPriority(getThreadGroup().getMaxPriority()); } @Override public void interrupt() { super.interrupt(); this.f1869c = true; } @Override public boolean isInterrupted() { return this.f1869c || super.isInterrupted(); } @Override public void run() { q qVar; boolean remove; while (!isInterrupted()) { try { synchronized (e.this.C0) { try { if (e.this.C0.size() == 0) { e.this.C0.wait(); } qVar = (q) e.this.C0.remove(0); } finally { } } l N = e.this.N(qVar); if (N != null) { synchronized (N) { try { if (N.f1860c) { synchronized (e.this.D) { remove = e.this.D.remove(new j(qVar.f2762c, qVar.f2763d, qVar.f1876j, qVar.f2765g)); } if (remove) { e.this.O(-1, 0); } N.f1860c = false; } N.f1861d = false; N.f1858a = null; } finally { } } } } catch (InterruptedException unused) { return; } } } } public class o extends u<Object, Void, Void> { public o() { } public o(e eVar, a aVar) { this(); } @Override public Void doInBackground(Object... objArr) { synchronized (e.this.G) { try { e eVar = e.this; eVar.H.registerListener(eVar.L, eVar.K, 2); } catch (Throwable unused) { } } return null; } @Override public synchronized void onPostExecute(Void r1) { } @Override public void onPreExecute() { super.onPreExecute(); } } public class p extends Thread { public boolean f1872c; public class a implements Runnable { public a() { } @Override public void run() { e.this.recycle(); } } public p() { super("RainOverlay$Supervisor"); this.f1872c = false; } @Override public void interrupt() { super.interrupt(); this.f1872c = true; } @Override public boolean isInterrupted() { return this.f1872c || super.isInterrupted(); } @Override public void run() { long currentTimeMillis = System.currentTimeMillis(); int i2 = 0; while (!isInterrupted()) { e.this.f1805d0.set(e.this.f1803c0 || (t.V(e.this.V) && de.mdiener.rain.core.util.q.F0(e.this.V))); int p2 = de.mdiener.rain.core.util.d.p(e.this.V) - e.V0.get(); synchronized (e.this.E) { if (p2 > 0) { for (int i3 = 0; i3 < p2; i3++) { try { e eVar = e.this; k kVar = new k(eVar.E.size(), false); e.this.E.add(kVar); kVar.start(); } catch (Throwable th) { throw th; } } } else if (p2 < 0) { int i4 = -p2; int i5 = 0; for (int size = e.this.E.size() - 1; size >= 0 && i4 > i5; size--) { k kVar2 = e.this.E.get(size); if (!kVar2.f1856d && kVar2.isAlive()) { i5++; if (!kVar2.isInterrupted()) { kVar2.interrupt(); } } } } } long currentTimeMillis2 = System.currentTimeMillis(); long j2 = currentTimeMillis2 - currentTimeMillis; e eVar2 = e.this; if (j2 > eVar2.B * 60000) { eVar2.M(); currentTimeMillis = currentTimeMillis2; } try { Thread.sleep(2000L); View view = e.this.T; if (view == null || !view.isShown()) { i2++; } if (i2 > 10) { e.this.f1835z0.post(new a()); return; } } catch (InterruptedException unused) { return; } } } } public static class q extends v.e { public long f1875i; public int f1876j; public q(int i2, int i3, int i4, int i5) { this.f2762c = i2; this.f2763d = i3; this.f2765g = i4; this.f1876j = i5; long j2 = (i4 * 201326592) + (i2 * 98304) + (i3 * 48) + i5; this.f1875i = j2; this.f2764f = (int) j2; } @Override public int compareTo(v.d dVar) { return dVar instanceof q ? (int) (this.f1875i - ((q) dVar).f1875i) : super.compareTo(dVar); } @Override public boolean equals(Object obj) { if (obj instanceof q) { return obj == this || this.f1875i == ((q) obj).f1875i; } return false; } @Override public int hashCode() { long j2 = this.f1875i; return (int) (j2 ^ (j2 >>> 32)); } @Override public String toString() { return this.f2762c + "," + this.f2763d + "," + this.f2765g + "," + this.f1876j; } } public class r extends u<s, Void, Void> { public Sensor f1877c; public SensorEventListener f1878d; public r(Sensor sensor, SensorEventListener sensorEventListener) { this.f1877c = sensor; this.f1878d = sensorEventListener; } @Override public Void doInBackground(s... sVarArr) { try { Thread.sleep(1500L); sVarArr[0].cancel(true); } catch (InterruptedException unused) { } return null; } @Override public void onPostExecute(Void r4) { synchronized (e.this.G) { try { e.this.H.unregisterListener(this.f1878d, this.f1877c); } finally { } } } @Override public void onPreExecute() { super.onPreExecute(); } } public class s extends u<Object, Void, Void> { public s() { } public s(e eVar, a aVar) { this(); } @Override public Void doInBackground(Object... objArr) { synchronized (e.this.G) { try { AtomicBoolean atomicBoolean = de.mdiener.rain.core.util.n.f1536a; atomicBoolean.set(true); e.this.H.unregisterListener((SensorEventListener) objArr[0], (Sensor) objArr[1]); atomicBoolean.set(false); } finally { ((r) objArr[2]).cancel(true); return null; } } ((r) objArr[2]).cancel(true); return null; } @Override public synchronized void onPostExecute(Void r1) { } @Override public void onPreExecute() { super.onPreExecute(); } } public e(Context context, double[] dArr, Handler handler, float f2, int i2, View view, int i3, boolean z2, TextView textView, GoogleMap googleMap, boolean z3) { this(context, new double[][]{dArr}, 0, handler, 10, 1, true, 1, f2, i2, view, i3, null, false, z2, textView, googleMap, 400, 2, z3); } public e(Context context, double[][] dArr, int i2, Handler handler, int i3, int i4, boolean z2, int i5, float f2, int i6, View view, int i7, Handler handler2, boolean z3, boolean z4, TextView textView, GoogleMap googleMap, int i8, int i9, boolean z5) { this(context, dArr, i2, handler, i3, i4, z2, i5, f2, i6, view, i7, handler2, z3, z4, textView, googleMap, i8, i9, z5, null); } public e(Context context, double[][] dArr, int i2, Handler handler, int i3, int i4, boolean z2, int i5, float f2, int i6, View view, int i7, Handler handler2, boolean z3, boolean z4, TextView textView, GoogleMap googleMap, int i8, int i9, boolean z5, ICore iCore) { int i10; this.f1807f = 1; this.f1809g = 1; this.f1812i = new Object(); this.f1820o = new Object(); this.C = new n(); this.D = new ArrayList<>(16); this.E = new ArrayList<>(6); this.F = 1.0f; this.G = new Object(); this.J = Float.MAX_VALUE; this.O = false; this.R = new Object(); this.S = 0.8176460266113281d; this.f1800a0 = 0.3f; this.f1805d0 = new AtomicBoolean(false); this.f1806e0 = 400; this.f1808f0 = 400 * 4; this.f1810g0 = (int) (400 * 2.5d); this.f1811h0 = 0; this.f1813i0 = true; a aVar = null; this.f1815j0 = null; this.f1816k0 = ""; this.f1817l0 = ""; this.f1823p0 = new i(); this.f1827t0 = -1; this.f1828u0 = new c(); this.f1829v0 = new Object(); this.f1830w0 = new Handler(new d()); this.f1832x0 = false; this.f1834y0 = false; this.f1835z0 = new HandlerC0084e(); this.A0 = new f(); this.B0 = new g(); this.C0 = new ArrayList<>(16); this.D0 = new p(); this.F0 = new Object(); this.G0 = 0; this.I0 = null; this.K0 = false; this.R0 = -1; this.S0 = true; this.T0 = false; this.U0 = null; this.T = view; this.V = context; this.f1811h0 = i9; this.f1813i0 = z5; this.f1824q0 = textView; u(dArr, i2); this.f1804d = handler; if (i4 < 1) { i10 = 1; } else { i10 = 13; if (i4 <= 13) { i10 = i4; } } this.f1822p = i10; this.f1831x = i5; this.f1833y = z2; this.B = i3; this.f1806e0 = i8; this.f1808f0 = i8 * 4; this.f1810g0 = (int) (i8 * 2.5d); int i11 = i10 + 1; this.f1802c = new HashMap[i11]; for (int i12 = 0; i12 <= i10; i12++) { this.f1802c[i12] = new HashMap<>(); } this.F = f2; boolean z6 = f2 >= 2.0f; this.O = z6; this.M = z6 ? "g2hd/mz2/" : "g2/mz2/"; this.N = z6 ? "https://images.rain-alarm.com/rain/g2hd/" : "https://images.rain-alarm.com/rain/g2/"; this.P = z6 ? 512 : 256; this.Z = de.mdiener.rain.core.util.q.v0(context); this.f1800a0 = i7 / 100.0f; if (i6 == 0) { this.I = 0; } else if (i6 == 1) { this.I = 90; } else if (i6 == 2) { this.I = 180; } else if (i6 == 3) { this.I = 270; } if (i9 == 0) { synchronized (this.G) { try { SensorManager a2 = de.mdiener.rain.core.util.n.a(context); this.H = a2; if (a2 != null && this.L == null) { Sensor defaultSensor = a2.getDefaultSensor(11); this.K = defaultSensor; if (defaultSensor != null) { this.L = new a(); o oVar = new o(this, aVar); this.f1815j0 = oVar; oVar.a(new Object[0]); } } } finally { } } } this.Y = handler2; this.f1801b0 = z3; this.f1803c0 = z4; this.f1818m0 = context.getText(w.source_map).toString(); this.f1821o0 = context.getText(w.source_separator).toString(); k kVar = new k(0, z4); this.E.add(kVar); kVar.start(); k kVar2 = new k(1, z4); this.E.add(kVar2); kVar2.start(); k kVar3 = new k(2, false); this.E.add(kVar3); kVar3.start(); k kVar4 = new k(3, false); this.E.add(kVar4); kVar4.start(); this.D0.setPriority(2); this.D0.start(); this.C.start(); this.W = new TileOverlay[i11]; this.X = new m[i11]; r(googleMap, null, null, iCore); } private void U(ICore iCore) { Circle[] circleArr; Polygon[] polygonArr; if (this.f1803c0) { TileOverlayOptions tileOverlayOptions = new TileOverlayOptions(); this.X[0] = new m(0); tileOverlayOptions.tileProvider(this.X[0]); tileOverlayOptions.fadeIn(false); tileOverlayOptions.zIndex(0.0f); tileOverlayOptions.visible(true); tileOverlayOptions.transparency(0.0f); this.W[0] = this.U.addTileOverlay(tileOverlayOptions); } int i2 = 0; while (i2 < this.f1822p) { TileOverlayOptions tileOverlayOptions2 = new TileOverlayOptions(); int i3 = i2 + 1; this.X[i3] = new m(i3); tileOverlayOptions2.tileProvider(this.X[i3]); tileOverlayOptions2.fadeIn(false); tileOverlayOptions2.zIndex(this.f1822p - i2); if (i2 == 0) { tileOverlayOptions2.visible(true); tileOverlayOptions2.transparency(this.f1800a0); } else { tileOverlayOptions2.visible(false); tileOverlayOptions2.transparency(1.0f); } this.W[i3] = this.U.addTileOverlay(tileOverlayOptions2); i2 = i3; } Marker[] markerArr = this.J0; if (markerArr != null) { for (Marker marker : markerArr) { if (marker != null) { marker.remove(); } } } int i4 = 0; while (true) { double[][] dArr = this.H0; if (i4 >= dArr.length) { this.f1828u0.onCameraChange(this.U.getCameraPosition()); this.U.setOnCameraChangeListener(this.f1828u0); this.U.setOnMarkerClickListener(new b(iCore)); return; } double[] dArr2 = dArr[i4]; MarkerOptions markerOptions = new MarkerOptions(); int i5 = this.f1811h0; if (i5 == 2) { if (this.f1826s0 != null) { markerOptions.draggable(true); markerOptions.icon(BitmapDescriptorFactory.fromResource(this.S0 ? de.mdiener.rain.core.r.tmp_location_black : de.mdiener.rain.core.r.tmp_location_white)); this.U.setOnMarkerDragListener(this.f1826s0); } } else if (i5 == 1 || this.J == Float.MAX_VALUE || i4 != this.G0) { markerOptions.anchor(0.5f, 0.5f); markerOptions.icon(BitmapDescriptorFactory.fromResource(this.S0 ? de.mdiener.rain.core.r.location_black : de.mdiener.rain.core.r.location_white)); markerOptions.draggable(false); } else { markerOptions.anchor(0.5f, 0.76106197f); markerOptions.rotation(this.J); markerOptions.icon(BitmapDescriptorFactory.fromResource(this.S0 ? de.mdiener.rain.core.r.location_direction_black : de.mdiener.rain.core.r.location_direction_white)); this.K0 = true; markerOptions.draggable(false); } markerOptions.title(this.V.getString(w.main_my_location)); markerOptions.position(new LatLng(dArr2[1], dArr2[0])); this.J0[i4] = this.U.addMarker(markerOptions); this.J0[i4].setTag(Integer.valueOf(i4)); float[] fArr = this.O0; if (fArr != null) { float f2 = fArr[i4]; if (f2 != 0.0f && (circleArr = this.M0) != null && circleArr[i4] == null && (polygonArr = this.N0) != null && polygonArr[i4] == null) { g(f2, this.R0, this.P0[i4], this.Q0[i4], i4); } } i4++; } } public l D(q qVar) { l lVar; int i2 = qVar.f1876j; if (i2 < 0) { return null; } HashMap<v.d, l>[] hashMapArr = this.f1802c; if (i2 >= hashMapArr.length) { return null; } synchronized (hashMapArr[i2]) { lVar = this.f1802c[qVar.f1876j].get(qVar); } return lVar; } public final l E(q qVar) { l lVar; int i2 = qVar.f1876j; if (i2 < 0) { return null; } HashMap<v.d, l>[] hashMapArr = this.f1802c; if (i2 >= hashMapArr.length) { return null; } synchronized (hashMapArr[i2]) { try { lVar = this.f1802c[qVar.f1876j].get(qVar); if (lVar == null) { lVar = new l(qVar); this.f1802c[qVar.f1876j].put(qVar, lVar); } } catch (Throwable th) { throw th; } } return lVar; } public int F(int i2) { if (i2 < 1 || this.f1833y) { return this.f1831x; } if (i2 <= 2) { return 24; } if (i2 <= 3) { return 18; } if (i2 == 4) { return 12; } if (i2 == 5) { return 9; } if (i2 == 6) { return 6; } if (i2 == 7) { return 4; } if (i2 == 8) { return 2; } return i2 >= 9 ? 1 : 0; } public de.mdiener.rain.core.util.d G() { synchronized (this.F0) { try { if (this.E0 == null) { this.E0 = de.mdiener.rain.core.util.d.m(this.V); } } catch (Throwable th) { throw th; } } return this.E0; } public void H(int i2) { if (Looper.getMainLooper().getThread() != Thread.currentThread()) { for (int i3 = 1; i3 < this.f1822p + 1; i3++) { if (i3 != i2) { this.f1835z0.removeMessages(i3); } } this.f1835z0.sendEmptyMessage(i2); return; } if (this.W == null) { return; } for (int i4 = 1; i4 < this.f1822p + 1; i4++) { TileOverlay[] tileOverlayArr = this.W; TileOverlay tileOverlay = tileOverlayArr[i2]; if (tileOverlay != null) { if (i4 == i2) { tileOverlay.setTransparency(this.f1800a0); if (!this.W[i2].isVisible()) { this.W[i2].setVisible(true); } } else { tileOverlayArr[i4].setTransparency(1.0f); if (!isRunning() && this.W[i4].isVisible()) { this.W[i4].setVisible(false); } } } } } public boolean I(int i2) { m mVar = this.X[i2]; if (mVar == null || !mVar.a()) { return true; } synchronized (this.f1802c[i2]) { try { for (l lVar : this.f1802c[i2].values()) { if (!lVar.f1860c && lVar.f1861d) { } return true; } int i3 = i2 == 1 ? this.f1822p : i2 - 1; synchronized (this.f1802c[i3]) { try { for (l lVar2 : this.f1802c[i3].values()) { if (!lVar2.f1860c && lVar2.f1861d) { } return true; } return false; } finally { } } } finally { } } } public boolean J(l lVar, int i2, int i3, int i4, int i5) { if (!lVar.f1860c && lVar.f1859b < 4) { lVar.f1860c = true; lVar.f1861d = false; synchronized (this.D) { try { if (this.f1832x0) { lVar.f1860c = false; return false; } this.D.add(new j(i2, i3, i4, i5)); this.D.notifyAll(); O(1, 0); } catch (Throwable th) { throw th; } } } return lVar.f1860c && lVar.f1859b < 4; } public void K() { StringBuilder sb = new StringBuilder(); sb.append(this.f1803c0 ? this.f1818m0 : ""); sb.append(this.f1816k0); String sb2 = sb.toString(); if (sb2.length() >= 2 && !this.f1803c0) { sb2 = sb2.substring(this.f1821o0.length()); } if (this.f1819n0 != null) { if (sb2.length() > 0) { sb2 = sb2 + this.f1821o0 + this.f1819n0; } else { sb2 = this.f1819n0; } } if (this.f1817l0.equals(sb2)) { return; } this.f1823p0.a(sb2); this.f1804d.post(this.f1823p0); this.f1817l0 = sb2; } public void L(int i2) { if (i2 < 1) { return; } if (Looper.getMainLooper().getThread() != Thread.currentThread()) { for (int i3 = 1; i3 < this.f1822p + 1; i3++) { if (i3 != i2) { this.A0.removeMessages(i3); } } this.A0.sendEmptyMessage(i2); return; } if (this.W == null) { return; } for (int i4 = 1; i4 < this.f1822p + 1; i4++) { TileOverlay tileOverlay = this.W[i2]; if (tileOverlay != null && i4 == i2 && !tileOverlay.isVisible()) { this.W[i2].setVisible(true); } } } public void M() { int size; synchronized (this.R) { this.Q = null; } synchronized (this.D) { size = this.D.size(); this.D.clear(); } O(-size, 0); for (int i2 = 0; i2 <= this.f1822p; i2++) { synchronized (this.f1802c[i2]) { try { for (l lVar : this.f1802c[i2].values()) { synchronized (lVar) { lVar.f1860c = false; lVar.f1861d = false; } } } catch (Throwable th) { throw th; } } } this.B0.sendEmptyMessage(0); } public final l N(q qVar) { l remove; synchronized (this.f1802c[qVar.f1876j]) { remove = this.f1802c[qVar.f1876j].remove(qVar); } return remove; } public void O(int i2, int i3) { int i4; Message obtainMessage = this.f1804d.obtainMessage(i2, i3, 4); Bundle bundle = new Bundle(); int i5 = 0; int i6 = 0; while (true) { i4 = this.f1822p; if (i5 > i4) { break; } int size = this.f1802c[i5].size(); if (size > i6) { i6 = size; } i5++; } if (this.f1803c0) { i4++; } bundle.putInt("maxLoading", i6 * i4); obtainMessage.setData(bundle); this.f1804d.sendMessage(obtainMessage); } public void P() { Message obtainMessage = this.f1804d.obtainMessage(); Bundle bundle = new Bundle(); bundle.putBoolean("outOfMemory", true); obtainMessage.setData(bundle); this.f1804d.sendMessage(obtainMessage); } public void Q(int i2) { Calendar calendar; if (this.Y != null) { int F = F(i2); synchronized (this.R) { try { Calendar calendar2 = this.Q; if (calendar2 != null) { calendar = (Calendar) calendar2.clone(); Calendar calendar3 = Calendar.getInstance(); if (Math.abs(calendar.getTimeInMillis() - calendar3.getTimeInMillis()) > PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS) { calendar3.add(12, -(calendar3.get(12) % 5)); calendar = calendar3; } calendar.add(12, -this.B); } else { calendar = Calendar.getInstance(); int i3 = calendar.get(12); int i4 = this.B; calendar.add(12, (-(i3 % i4)) - i4); } } catch (Throwable th) { throw th; } } calendar.add(12, (-this.B) * F * (this.f1807f - 1)); this.Y.sendMessage(this.Y.obtainMessage(this.f1807f - 1, this.Z.format(calendar.getTime()))); } } public void R() { synchronized (this.f1829v0) { try { if (!this.f1830w0.hasMessages(0)) { this.f1830w0.sendEmptyMessageDelayed(0, 50L); } } catch (Throwable th) { throw th; } } } public void S(int i2) { if (i2 > 9) { i2 = 9; } this.f1827t0 = i2; Q(i2); } public void T(double[] dArr, int i2) { if (this.H0 == null) { double[][] dArr2 = new double[1]; this.H0 = dArr2; this.I0 = (double[][]) Array.newInstance((Class<?>) Double.TYPE, dArr2.length, 2); double[][] dArr3 = this.H0; this.J0 = new Marker[dArr3.length]; this.M0 = new Circle[dArr3.length]; this.N0 = new Polygon[dArr3.length]; } double[][] dArr4 = this.H0; double[] dArr5 = dArr4[i2]; if (dArr5 != null && dArr5[0] == dArr[0] && dArr5[1] == dArr[1]) { return; } double d2 = dArr[0]; double d3 = dArr[1]; double[] dArr6 = new double[2]; dArr6[0] = d2; dArr6[1] = d3; dArr4[i2] = dArr6; double[][] dArr7 = this.I0; dArr7[i2] = v.b.c(dArr6, dArr7[i2]); float f2 = this.L0; if (i2 == this.G0 && r.a.isValidLocation(this.H0[i2])) { double[] dArr8 = this.H0[i2]; this.L0 = new GeomagneticField((float) dArr8[1], (float) dArr8[0], 0.0f, System.currentTimeMillis()).getDeclination(); } double[] dArr9 = this.H0[i2]; LatLng latLng = new LatLng(dArr9[1], dArr9[0]); Marker marker = this.J0[i2]; if (marker != null) { marker.setPosition(latLng); if (i2 == this.G0 && this.L != null) { float f3 = this.J; if (f3 != Float.MAX_VALUE) { float f4 = this.L0; if (f2 != f4) { f3 = (f3 + f2) - f4; } this.J0[i2].setRotation(f3); } } } Circle circle = this.M0[i2]; if (circle != null) { circle.setCenter(latLng); } else if (this.N0[i2] != null) { g(this.O0[i2], this.R0, this.P0[i2], this.Q0[i2], i2); } } @Override public void a(int i2) { synchronized (this.f1812i) { try { if (i2 == this.f1807f) { return; } int i3 = this.f1822p; if (i2 <= i3) { i3 = 1; if (i2 < 1) { } this.f1809g = this.f1807f; this.f1807f = i2; Q(this.f1827t0); H(i2); } i2 = i3; this.f1809g = this.f1807f; this.f1807f = i2; Q(this.f1827t0); H(i2); } catch (Throwable th) { throw th; } } } @Override public double[] b(int i2) { int i3 = this.G0; double[][] dArr = this.H0; if (i3 == dArr.length) { Marker marker = this.U0; if (marker != null) { LatLng position = marker.getPosition(); return new double[]{position.longitude, position.latitude}; } if (i2 < dArr.length) { f(i2); } } double[] dArr2 = this.H0[this.G0]; return new double[]{dArr2[0], dArr2[1]}; } @Override public int c() { return F(this.f1827t0); } @Override public void d() { int size; synchronized (this.R) { this.Q = null; } synchronized (this.D) { size = this.D.size(); this.D.clear(); } O(-size, 0); for (int i2 = 0; i2 <= this.f1822p; i2++) { synchronized (this.f1802c[i2]) { try { for (l lVar : this.f1802c[i2].values()) { synchronized (lVar) { try { lVar.f1860c = false; lVar.f1861d = false; if (i2 == 1) { lVar.f1862e = true; } } finally { } } } } catch (Throwable th) { throw th; } } } this.B0.sendEmptyMessage(0); } @Override public float e() { return this.F; } @Override public void f(int i2) { double[][] dArr; if (i2 != this.G0) { this.G0 = i2; float f2 = this.L0; double[][] dArr2 = this.H0; int i3 = 0; if ((i2 < dArr2.length || this.U0 == null) && r.a.isValidLocation(dArr2[i2])) { double[] dArr3 = this.H0[i2]; this.L0 = new GeomagneticField((float) dArr3[1], (float) dArr3[0], 0.0f, System.currentTimeMillis()).getDeclination(); } while (true) { dArr = this.H0; if (i3 >= dArr.length) { break; } Marker marker = this.J0[i3]; if (marker != null) { if (this.K0 && i3 == i2) { if (this.S0) { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_direction_black)); } else { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_direction_white)); } this.J0[i3].setAnchor(0.5f, 0.76106197f); } else { if (this.S0) { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_black)); } else { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_white)); } this.J0[i3].setAnchor(0.5f, 0.5f); } } i3++; } if ((i2 < dArr.length || this.U0 == null) && this.L != null) { float f3 = this.J; if (f3 != Float.MAX_VALUE) { float f4 = this.L0; if (f2 != f4) { f3 = (f3 + f2) - f4; } Marker marker2 = this.J0[i2]; if (marker2 != null) { marker2.setRotation(f3); } } } } } @Override public void first() { a(this.f1822p); } @Override public void g(float f2, int i2, int i3, int i4, int i5) { int i6 = i4; this.O0[i5] = f2; this.R0 = i2; this.P0[i5] = i3; this.Q0[i5] = i6; if (this.U != null) { Circle circle = this.M0[i5]; if (circle != null) { circle.remove(); } Polygon polygon = this.N0[i5]; if (polygon != null) { polygon.remove(); } if (this.f1813i0) { if (i3 == i6) { CircleOptions circleOptions = new CircleOptions(); double[] dArr = this.H0[i5]; circleOptions.center(new LatLng(dArr[1], dArr[0])); circleOptions.radius(f2 * 1000.0f); circleOptions.zIndex(this.f1822p + 2); circleOptions.clickable(false); if (this.S0) { circleOptions.strokeColor(Color.argb(this.R0, 0, 0, 0)); } else { circleOptions.strokeColor(Color.argb(this.R0, 255, 255, 255)); } circleOptions.strokeWidth(this.F * 1.5f); this.M0[i5] = this.U.addCircle(circleOptions); return; } double[] dArr2 = new double[2]; if (i3 > i6) { i6 += 360; } PolygonOptions polygonOptions = new PolygonOptions(); double[] dArr3 = this.H0[i5]; polygonOptions.add(new LatLng(dArr3[1], dArr3[0])); double[] dArr4 = dArr2; for (int i7 = i3; i7 <= i6; i7 += 10) { dArr4 = v.b.g(this.H0[i5], f2, i7, dArr4); polygonOptions.add(new LatLng(dArr4[1], dArr4[0])); } if ((i6 - i3) % 10 != 0) { double[] g2 = v.b.g(this.H0[i5], f2, i6, dArr4); polygonOptions.add(new LatLng(g2[1], g2[0])); } double[] dArr5 = this.H0[i5]; polygonOptions.add(new LatLng(dArr5[1], dArr5[0])); polygonOptions.zIndex(this.f1822p + 2); polygonOptions.clickable(false); if (this.S0) { polygonOptions.strokeColor(Color.argb(this.R0, 0, 0, 0)); } else { polygonOptions.strokeColor(Color.argb(this.R0, 255, 255, 255)); } polygonOptions.strokeWidth(this.F * 1.5f); this.N0[i5] = this.U.addPolygon(polygonOptions); } } } @Override public void h(GoogleMap googleMap, GoogleMap.OnCameraChangeListener onCameraChangeListener, GoogleMap.OnMarkerDragListener onMarkerDragListener) { r(googleMap, onCameraChangeListener, onMarkerDragListener, null); } @Override public void i(int i2) { if (this.U != null) { Circle circle = this.M0[i2]; if (circle != null) { circle.remove(); } Polygon polygon = this.N0[i2]; if (polygon != null) { polygon.remove(); } } } @Override public int index() { int i2; synchronized (this.f1812i) { i2 = this.f1807f - 1; } return i2; } @Override public boolean isRunning() { boolean z2; synchronized (this.f1820o) { try { h hVar = this.f1814j; z2 = (hVar == null || !hVar.isAlive() || this.f1814j.isInterrupted()) ? false : true; } finally { } } return z2; } @Override public void j(boolean z2) { synchronized (this.f1820o) { try { h hVar = this.f1814j; if (hVar == null || !hVar.isAlive()) { h hVar2 = new h(z2); this.f1814j = hVar2; hVar2.start(); } } catch (Throwable th) { throw th; } } } @Override public int k() { return this.f1822p; } @Override public void l(boolean z2) { if (this.T0) { return; } this.T0 = z2; this.f1818m0 = this.V.getText(w.source_mapbox_static).toString(); K(); } @Override public void last() { a(1); } @Override public void m(boolean z2) { if (this.f1803c0 != z2) { this.f1803c0 = z2; if (z2) { TileOverlay tileOverlay = this.W[0]; if (tileOverlay == null) { TileOverlayOptions tileOverlayOptions = new TileOverlayOptions(); this.X[0] = new m(0); tileOverlayOptions.tileProvider(this.X[0]); tileOverlayOptions.fadeIn(false); tileOverlayOptions.zIndex(0.0f); tileOverlayOptions.visible(true); tileOverlayOptions.transparency(0.0f); this.W[0] = this.U.addTileOverlay(tileOverlayOptions); } else { tileOverlay.setVisible(true); } } else { TileOverlay tileOverlay2 = this.W[0]; if (tileOverlay2 != null) { tileOverlay2.setVisible(false); } } K(); } } @Override public void n(boolean z2) { if (z2 != this.S0) { this.S0 = z2; for (int i2 = 0; i2 < this.H0.length; i2++) { Circle circle = this.M0[i2]; if (circle != null) { if (this.S0) { circle.setStrokeColor(Color.argb(this.R0, 0, 0, 0)); } else { circle.setStrokeColor(Color.argb(this.R0, 255, 255, 255)); } } Polygon polygon = this.N0[i2]; if (polygon != null) { if (this.S0) { polygon.setStrokeColor(Color.argb(this.R0, 0, 0, 0)); } else { polygon.setStrokeColor(Color.argb(this.R0, 255, 255, 255)); } } Marker marker = this.J0[i2]; if (marker != null) { if (this.K0 && i2 == this.G0) { if (this.S0) { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_direction_black)); } else { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_direction_white)); } this.J0[i2].setAnchor(0.5f, 0.76106197f); } else { if (this.S0) { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_black)); } else { marker.setIcon(BitmapDescriptorFactory.fromResource(de.mdiener.rain.core.r.location_white)); } this.J0[i2].setAnchor(0.5f, 0.5f); } } } } } @Override public void o(GoogleMap googleMap, GoogleMap.OnCameraChangeListener onCameraChangeListener) { h(googleMap, onCameraChangeListener, null); } @Override public void p(String str, double[] dArr) { LatLng latLng = new LatLng(dArr[1], dArr[0]); Marker marker = this.U0; if (marker == null) { this.U0 = this.U.addMarker(new MarkerOptions().position(latLng).title(str).icon(BitmapDescriptorFactory.fromResource(this.S0 ? de.mdiener.rain.core.r.tmp_location_black : de.mdiener.rain.core.r.tmp_location_white))); } else { marker.setPosition(latLng); this.U0.setTitle(str); } } @Override public void pause() { int i2; synchronized (this.f1820o) { try { h hVar = this.f1814j; if (hVar != null && hVar.isAlive()) { this.f1814j.interrupt(); } } finally { } } Q(this.f1827t0); synchronized (this.f1812i) { i2 = this.f1807f; } H(i2); synchronized (this.D) { int i3 = 0; while (i3 < this.D.size()) { try { j jVar = this.D.get(i3); if (jVar.f1853c != i2) { this.D.remove(i3); i3--; O(-1, 0); l D = D(new q(jVar.f1851a, jVar.f1852b, jVar.f1854d, jVar.f1853c)); if (D != null) { D.f1860c = false; D.f1861d = false; } } i3++; } finally { } } } } @Override public void q() { int i2; synchronized (this.f1812i) { i2 = this.f1807f; } a(i2 != this.f1822p ? 1 + i2 : 1); } @Override public void r(GoogleMap googleMap, GoogleMap.OnCameraChangeListener onCameraChangeListener, GoogleMap.OnMarkerDragListener onMarkerDragListener, ICore iCore) { this.f1825r0 = onCameraChangeListener; this.f1826s0 = onMarkerDragListener; if (googleMap == null || this.U == googleMap) { return; } this.U = googleMap; U(iCore); S((int) googleMap.getCameraPosition().zoom); } @Override public void recycle() { synchronized (this.D) { try { if (this.f1834y0) { return; } try { o oVar = this.f1815j0; if (oVar != null && oVar.getStatus() != AsyncTask.Status.FINISHED) { this.f1815j0.cancel(true); } for (TileOverlay tileOverlay : this.W) { if (tileOverlay != null) { tileOverlay.remove(); } } Marker[] markerArr = this.J0; if (markerArr != null) { for (Marker marker : markerArr) { if (marker != null) { try { marker.remove(); } catch (IllegalArgumentException unused) { } } } } Circle[] circleArr = this.M0; if (circleArr != null) { for (Circle circle : circleArr) { if (circle != null) { try { circle.remove(); } catch (IllegalArgumentException unused2) { } } } } Polygon[] polygonArr = this.N0; if (polygonArr != null) { for (Polygon polygon : polygonArr) { if (polygon != null) { try { polygon.remove(); } catch (IllegalArgumentException unused3) { } } } } synchronized (this.D) { this.f1832x0 = true; } pause(); synchronized (this.G) { try { a aVar = null; if (this.L != null && this.H != null) { s sVar = new s(this, aVar); r rVar = new r(this.K, this.L); sVar.a(this.L, this.K, rVar); rVar.a(sVar); this.L = null; this.K = null; } } finally { } } synchronized (this.D) { this.D.clear(); } this.D0.interrupt(); synchronized (this.E) { try { Iterator<k> it = this.E.iterator(); while (it.hasNext()) { it.next().interrupt(); } } finally { } } this.C.interrupt(); for (int i2 = 0; i2 <= this.f1822p; i2++) { synchronized (this.f1802c[i2]) { try { for (l lVar : this.f1802c[i2].values()) { synchronized (lVar) { lVar.f1860c = false; lVar.f1861d = false; lVar.f1858a = null; } } this.f1802c[i2].clear(); } finally { } } } synchronized (this.D) { this.f1834y0 = true; } } catch (Throwable th) { synchronized (this.D) { this.f1834y0 = true; throw th; } } } finally { } } } @Override public void removePoi() { Marker marker = this.U0; if (marker != null) { marker.remove(); this.U0 = null; } } @Override public void reset() { for (int i2 = 0; i2 <= this.f1822p; i2++) { synchronized (this.f1802c[i2]) { try { for (l lVar : this.f1802c[i2].values()) { synchronized (lVar) { lVar.f1859b = 0; } } } catch (Throwable th) { throw th; } } } this.B0.sendEmptyMessage(0); } @Override public void s(String str) { this.f1819n0 = str; K(); } @Override public void t() { int i2; synchronized (this.f1812i) { i2 = this.f1807f; } a(i2 == 1 ? this.f1822p : i2 - 1); } @Override public void u(double[][] dArr, int i2) { double[][] dArr2 = this.H0; if (dArr2 == null || dArr2.length != dArr.length) { this.H0 = new double[dArr.length]; this.I0 = (double[][]) Array.newInstance((Class<?>) Double.TYPE, dArr.length, 2); Marker[] markerArr = this.J0; if (markerArr != null) { for (Marker marker : markerArr) { if (marker != null) { marker.remove(); } } } this.J0 = new Marker[dArr.length]; Circle[] circleArr = this.M0; if (circleArr != null) { for (Circle circle : circleArr) { if (circle != null) { circle.remove(); } } } this.M0 = new Circle[dArr.length]; Polygon[] polygonArr = this.N0; if (polygonArr != null) { for (Polygon polygon : polygonArr) { if (polygon != null) { polygon.remove(); } } } this.N0 = new Polygon[dArr.length]; this.O0 = new float[dArr.length]; this.P0 = new int[dArr.length]; this.Q0 = new int[dArr.length]; } this.G0 = i2; for (int i3 = 0; i3 < dArr.length; i3++) { T(dArr[i3], i3); } } }