APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Rain Alarm
版本号:5.6.1
包名称:de.mdiener.rain.usa

MD5 校验值:576c0e120baeb324e9c5a56152387c2b

反编译源代码说明

b.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.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.hardware.GeomagneticField;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import androidx.core.content.ContextCompat;
import androidx.work.PeriodicWorkRequest;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.Projection;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import de.mdiener.android.core.util.m;
import de.mdiener.android.core.util.t;
import de.mdiener.rain.core.p;
import de.mdiener.rain.core.r;
import de.mdiener.rain.core.util.d;
import de.mdiener.rain.core.util.k;
import de.mdiener.rain.core.util.q;
import de.mdiener.rain.core.v;
import de.mdiener.rain.core.w;
import de.mdiener.rain.core.z;
import java.io.IOException;
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.AtomicInteger;

@SuppressLint({"ViewConstructor"})
public class b extends View implements z {
    public static int[] n1 = {-1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};
    public static final double o1;
    public static final double p1;
    public static final LatLng q1;
    public static final LatLng r1;
    public static final LatLng s1;
    public static final AtomicInteger t1;
    public Context A0;
    public String B;
    public String B0;
    public String C;
    public DateFormat C0;
    public double D;
    public int D0;
    public double E;
    public int E0;
    public int F;
    public int F0;
    public volatile int G;
    public int G0;
    public volatile int H;
    public float H0;
    public Object I;
    public double I0;
    public int J;
    public int J0;
    public int K;
    public int K0;
    public int L;
    public int L0;
    public g M;
    public int M0;
    public f N;
    public RectF N0;
    public double[] O;
    public String O0;
    public double[] P;
    public float P0;
    public double[] Q;
    public Rect Q0;
    public double[] R;
    public Object R0;
    public Rect S;
    public int S0;
    public Rect T;
    public boolean T0;
    public ArrayList<h> U;
    public boolean U0;
    public k<h> V;
    public double[] V0;
    public k<h> W;
    public double[] W0;
    public double[] X0;
    public float[] Y0;
    public double Z0;

    public ArrayList<c> f1597a0;

    public double f1598a1;

    public ArrayList<d> f1599b0;

    public double f1600b1;

    public HashMap<v.d, e>[] f1601c;

    public float f1602c0;
    public double c1;

    public Paint f1603d;

    public int f1604d0;
    public boolean d1;

    public int f1605e0;
    public boolean e1;

    public Paint f1606f;

    public int f1607f0;
    public Object f1;

    public Handler f1608g;

    public double f1609g0;
    public boolean g1;

    public double f1610h0;
    public Handler h1;

    public Bitmap f1611i;

    public double f1612i0;
    public ArrayList<h> i1;

    public Bitmap f1613j;

    public int f1614j0;
    public Thread j1;

    public ArrayList<h> f1615k0;
    public de.mdiener.rain.core.util.d k1;

    public String f1616l0;
    public Object l1;

    public String f1617m0;
    public boolean m1;

    public boolean f1618n0;

    public Bitmap f1619o;

    public Calendar f1620o0;

    public Drawable f1621p;

    public Object f1622p0;

    public double f1623q0;

    public double[] f1624r0;

    public double[] f1625s0;

    public int[] f1626t0;

    public int f1627u0;

    public float f1628v0;

    public ArrayList<String> f1629w0;

    public String f1630x;

    public String[] f1631x0;

    public String f1632y;

    public View f1633y0;

    public GoogleMap f1634z0;

    public class a implements Handler.Callback {
        public a() {
        }

        @Override
        public boolean handleMessage(Message message) {
            b.this.invalidate();
            return true;
        }
    }

    public class C0082b extends Thread {

        public boolean f1636c;

        public C0082b(String str) {
            super(str);
            this.f1636c = false;
        }

        @Override
        public void interrupt() {
            super.interrupt();
            this.f1636c = true;
        }

        @Override
        public boolean isInterrupted() {
            return this.f1636c || super.isInterrupted();
        }

        @Override
        public void run() {
            long currentTimeMillis = System.currentTimeMillis();
            int i2 = 0;
            while (!isInterrupted()) {
                int p2 = de.mdiener.rain.core.util.d.p(b.this.A0) - b.t1.get();
                synchronized (b.this.f1599b0) {
                    if (p2 > 0) {
                        for (int i3 = 0; i3 < p2; i3++) {
                            try {
                                b bVar = b.this;
                                d dVar = new d(bVar.f1599b0.size(), false);
                                b.this.f1599b0.add(dVar);
                                dVar.start();
                            } catch (Throwable th) {
                                throw th;
                            }
                        }
                    } else if (p2 < 0) {
                        int i4 = -p2;
                        int i5 = 0;
                        for (int size = b.this.f1599b0.size() - 1; size >= 0 && i4 > i5; size--) {
                            d dVar2 = b.this.f1599b0.get(size);
                            if (!dVar2.f1644d && dVar2.isAlive()) {
                                i5++;
                                if (!dVar2.isInterrupted()) {
                                    dVar2.interrupt();
                                }
                            }
                        }
                    }
                }
                long currentTimeMillis2 = System.currentTimeMillis();
                long j2 = currentTimeMillis2 - currentTimeMillis;
                b bVar2 = b.this;
                if (j2 > bVar2.L * 60000) {
                    bVar2.I();
                    currentTimeMillis = currentTimeMillis2;
                }
                try {
                    Thread.sleep(2000L);
                    View view = b.this.f1633y0;
                    if (view == null || !view.isShown()) {
                        i2++;
                    }
                    if (i2 > 10) {
                        b.this.H();
                        return;
                    }
                } catch (InterruptedException unused) {
                    return;
                }
            }
        }
    }

    public static class c {

        public int f1638a;

        public int f1639b;

        public int f1640c;

        public int f1641d;

        public int f1642e;

        public c(int i2, int i3, int i4, int i5, int i6) {
            this.f1638a = i2;
            this.f1639b = i3;
            this.f1640c = i4;
            this.f1641d = i5;
            this.f1642e = i6;
        }

        public boolean equals(Object obj) {
            if (obj == null || !(obj instanceof c)) {
                return false;
            }
            c cVar = (c) obj;
            return this.f1638a == cVar.f1638a && this.f1639b == cVar.f1639b && this.f1640c == cVar.f1640c && this.f1642e == cVar.f1642e;
        }
    }

    public class d extends Thread {

        public boolean f1643c;

        public boolean f1644d;

        public d(int i2, boolean z2) {
            super("MyOverlay$LoadThread" + i2);
            this.f1643c = false;
            this.f1644d = 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);
            }
            b.t1.incrementAndGet();
        }

        @Override
        public void interrupt() {
            super.interrupt();
            this.f1643c = true;
        }

        @Override
        public boolean isInterrupted() {
            return this.f1643c || super.isInterrupted();
        }

        @Override
        public void run() {
            b bVar;
            int i2;
            boolean z2;
            boolean z3;
            boolean z4;
            int i3;
            URL url;
            URL url2;
            Calendar calendar;
            int i4;
            int i5;
            Throwable th;
            Calendar calendar2;
            try {
                de.mdiener.rain.core.util.d cachedLoader = b.this.getCachedLoader();
                DateFormat x02 = q.x0();
                while (!isInterrupted()) {
                    synchronized (b.this.f1597a0) {
                        do {
                            try {
                                if (b.this.f1597a0.size() != 0 && (!this.f1644d || b.this.f1597a0.get(0).f1640c == 0)) {
                                    c remove = b.this.f1597a0.remove(0);
                                    b.this.f1597a0.notifyAll();
                                    e t2 = b.this.t(new v.d(remove.f1638a, remove.f1639b), remove.f1640c);
                                    if (t2 == null) {
                                        b.this.K(-1, 0);
                                    } else {
                                        synchronized (t2) {
                                            try {
                                                i2 = t2.f1647b;
                                                z2 = t2.f1649d;
                                                if (z2) {
                                                    t2.f1649d = false;
                                                }
                                            } finally {
                                            }
                                        }
                                        d.b bVar2 = null;
                                        if (i2 > 0) {
                                            try {
                                                Thread.sleep(500L);
                                            } catch (InterruptedException unused) {
                                                synchronized (t2) {
                                                    try {
                                                        if (t2.f1646a != null) {
                                                            t2.f1646a.b();
                                                            t2.f1646a = null;
                                                        }
                                                        t2.f1648c = false;
                                                        b.this.K(-1, i2);
                                                        b.t1.decrementAndGet();
                                                        synchronized (b.this.f1599b0) {
                                                            b.this.f1599b0.remove(this);
                                                            return;
                                                        }
                                                    } finally {
                                                    }
                                                }
                                            }
                                        }
                                        try {
                                            i3 = remove.f1640c;
                                        } 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/" + b.this.f1616l0 + remove.f1642e + "/" + remove.f1638a + "/" + remove.f1639b + ".png");
                                            } catch (IOException e4) {
                                                IOException iOException = e4;
                                                z3 = true;
                                                Throwable th2 = iOException;
                                                while (true) {
                                                    th2 = th2.getCause();
                                                    if (th2 == null) {
                                                    }
                                                }
                                                Log.w("RainAlarm", "x " + remove.f1638a + " y " + remove.f1639b + " z " + remove.f1640c, iOException);
                                                i2++;
                                                SharedPreferences.Editor edit = r.a.getPreferences(b.this.getContext(), null).edit();
                                                StringBuilder sb = new StringBuilder();
                                                sb.append(new Date().toString());
                                                sb.append(" ");
                                                sb.append(iOException.getMessage());
                                                edit.putString("errorHttpImage", sb.toString());
                                                edit.apply();
                                                synchronized (t2) {
                                                }
                                            } catch (Exception e5) {
                                                Exception exc = e5;
                                                z3 = true;
                                                Throwable th3 = exc;
                                                while (true) {
                                                    th3 = th3.getCause();
                                                    if (th3 == null) {
                                                    }
                                                }
                                                Log.w("RainAlarm", "x " + remove.f1638a + " y " + remove.f1639b + " z " + remove.f1640c, exc);
                                                i2++;
                                                synchronized (t2) {
                                                }
                                            }
                                        } else if (i3 == 1) {
                                            url = new URL(b.this.f1617m0 + "z" + remove.f1642e + "/" + (remove.f1638a / 8) + "_" + (remove.f1639b / 8) + "/" + remove.f1638a + "_" + remove.f1639b + ".png");
                                        } else {
                                            synchronized (b.this.f1622p0) {
                                                try {
                                                    Calendar calendar3 = b.this.f1620o0;
                                                    if (calendar3 != null) {
                                                        try {
                                                            calendar2 = (Calendar) calendar3.clone();
                                                        } catch (Throwable th4) {
                                                            th = th4;
                                                            z3 = true;
                                                            while (true) {
                                                                try {
                                                                    break;
                                                                } catch (Throwable th5) {
                                                                    th = th5;
                                                                }
                                                                th = th5;
                                                            }
                                                            throw th;
                                                            break;
                                                        }
                                                    } else {
                                                        calendar2 = null;
                                                    }
                                                    if (calendar2 == null) {
                                                        synchronized (b.this.f1597a0) {
                                                            b.this.f1597a0.add(remove);
                                                            b.this.f1597a0.notifyAll();
                                                        }
                                                        try {
                                                            Thread.sleep(250L);
                                                        } catch (InterruptedException unused2) {
                                                            synchronized (t2) {
                                                                try {
                                                                    if (t2.f1646a != null) {
                                                                        t2.f1646a.b();
                                                                        t2.f1646a = null;
                                                                    }
                                                                    t2.f1648c = false;
                                                                    b.this.K(-1, i2);
                                                                    b.t1.decrementAndGet();
                                                                    synchronized (b.this.f1599b0) {
                                                                        b.this.f1599b0.remove(this);
                                                                        return;
                                                                    }
                                                                } finally {
                                                                }
                                                            }
                                                        }
                                                    } else {
                                                        b bVar3 = b.this;
                                                        calendar2.add(12, (-bVar3.L) * (remove.f1640c - 1) * bVar3.K);
                                                        url2 = new URL(b.this.f1617m0 + "z" + b.this.f1605e0 + "/" + (remove.f1638a / 8) + "_" + (remove.f1639b / 8) + "/" + remove.f1638a + "_" + remove.f1639b + "_" + x02.format(calendar2.getTime()) + ".png");
                                                        int i6 = remove.f1641d;
                                                        b bVar4 = b.this;
                                                        z3 = true;
                                                        bVar2 = cachedLoader.k(url2, i6, bVar4.f1605e0, remove.f1640c, z2, bVar4.f1618n0);
                                                        if (remove.f1640c == 1 && (calendar = bVar2.f1487b) != null) {
                                                            i4 = calendar.get(12);
                                                            i5 = b.this.L;
                                                            if (i4 % i5 != 0) {
                                                                bVar2.f1487b.add(12, -(i4 % i5));
                                                            }
                                                            synchronized (b.this.f1622p0) {
                                                                try {
                                                                    Calendar calendar4 = b.this.f1620o0;
                                                                    if (calendar4 != null) {
                                                                        if (bVar2.f1487b.after(calendar4)) {
                                                                        }
                                                                    }
                                                                    b bVar5 = b.this;
                                                                    Calendar calendar5 = bVar2.f1487b;
                                                                    bVar5.f1620o0 = calendar5;
                                                                    Calendar calendar6 = (Calendar) calendar5.clone();
                                                                    Calendar calendar7 = Calendar.getInstance();
                                                                    if (Math.abs(calendar6.getTimeInMillis() - calendar7.getTimeInMillis()) > PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS) {
                                                                        calendar7.add(12, -(calendar7.get(12) % 5));
                                                                        calendar6 = calendar7;
                                                                    }
                                                                    calendar6.add(12, -b.this.L);
                                                                    int i7 = 0;
                                                                    while (true) {
                                                                        b bVar6 = b.this;
                                                                        if (i7 >= bVar6.J) {
                                                                            break;
                                                                        }
                                                                        bVar6.f1631x0[i7] = b.this.C0.format(calendar6.getTime());
                                                                        b bVar7 = b.this;
                                                                        calendar6.add(12, (-bVar7.L) * bVar7.K);
                                                                        i7++;
                                                                    }
                                                                } finally {
                                                                }
                                                            }
                                                        }
                                                        bVar2.f1487b = null;
                                                        if (isInterrupted()) {
                                                            bVar2.b();
                                                            synchronized (t2) {
                                                                try {
                                                                    d.b bVar8 = t2.f1646a;
                                                                    if (bVar8 != null) {
                                                                        bVar8.b();
                                                                        t2.f1646a = null;
                                                                    }
                                                                    t2.f1648c = false;
                                                                } finally {
                                                                }
                                                            }
                                                            b.this.K(-1, i2);
                                                            b.t1.decrementAndGet();
                                                            synchronized (b.this.f1599b0) {
                                                                b.this.f1599b0.remove(this);
                                                            }
                                                            return;
                                                        }
                                                        synchronized (t2) {
                                                            z4 = t2.f1648c ^ z3;
                                                        }
                                                        if (b.this.t(new v.d(remove.f1638a, remove.f1639b), remove.f1640c) != null && !z4) {
                                                            boolean z5 = t2.f1647b < i2 ? z3 : false;
                                                            synchronized (t2) {
                                                                try {
                                                                    t2.f1648c = false;
                                                                    d.b bVar9 = t2.f1646a;
                                                                    if (bVar9 != null && bVar2 != null && bVar2.f1486a != null) {
                                                                        bVar9.b();
                                                                    }
                                                                    if (bVar2 != null && bVar2.f1486a != null) {
                                                                        t2.f1646a = bVar2;
                                                                    }
                                                                    t2.f1647b = i2;
                                                                } finally {
                                                                }
                                                            }
                                                            if (z5) {
                                                                synchronized (t2) {
                                                                    t2.f1648c = z3;
                                                                }
                                                                synchronized (b.this.f1597a0) {
                                                                    b.this.f1597a0.add(remove);
                                                                    b.this.f1597a0.notifyAll();
                                                                }
                                                                b.this.K(0, i2);
                                                            } else {
                                                                synchronized (b.this.I) {
                                                                    if (bVar2 != null) {
                                                                        try {
                                                                            if (remove.f1640c != 0) {
                                                                                if (b.this.G == remove.f1640c) {
                                                                                }
                                                                            }
                                                                        } finally {
                                                                        }
                                                                    }
                                                                    z3 = false;
                                                                }
                                                                if (z3) {
                                                                    b.this.A();
                                                                }
                                                                b.this.K(-1, i2);
                                                            }
                                                        }
                                                        if (bVar2 != null) {
                                                            bVar2.b();
                                                        }
                                                        synchronized (t2) {
                                                            try {
                                                                d.b bVar10 = t2.f1646a;
                                                                if (bVar10 != null) {
                                                                    bVar10.b();
                                                                    t2.f1646a = null;
                                                                }
                                                                t2.f1648c = false;
                                                            } finally {
                                                            }
                                                        }
                                                        b.this.K(-1, i2);
                                                    }
                                                } catch (Throwable th6) {
                                                    z3 = true;
                                                    th = th6;
                                                }
                                            }
                                        }
                                        url2 = url;
                                        int i62 = remove.f1641d;
                                        b bVar42 = b.this;
                                        z3 = true;
                                        bVar2 = cachedLoader.k(url2, i62, bVar42.f1605e0, remove.f1640c, z2, bVar42.f1618n0);
                                        if (remove.f1640c == 1) {
                                            i4 = calendar.get(12);
                                            i5 = b.this.L;
                                            if (i4 % i5 != 0) {
                                            }
                                            synchronized (b.this.f1622p0) {
                                            }
                                        }
                                        bVar2.f1487b = null;
                                        if (isInterrupted()) {
                                        }
                                        synchronized (t2) {
                                        }
                                    }
                                }
                                try {
                                    b.this.f1597a0.wait(2000L);
                                    bVar = b.this;
                                } catch (InterruptedException unused3) {
                                    b.this.f1597a0.notifyAll();
                                    b.t1.decrementAndGet();
                                    synchronized (b.this.f1599b0) {
                                        b.this.f1599b0.remove(this);
                                        return;
                                    }
                                }
                            } finally {
                                b.this.f1597a0.notifyAll();
                            }
                        } while (!bVar.e1);
                        bVar.f1597a0.notifyAll();
                        b.t1.decrementAndGet();
                        synchronized (b.this.f1599b0) {
                            b.this.f1599b0.remove(this);
                        }
                        return;
                    }
                }
                b.t1.decrementAndGet();
                synchronized (b.this.f1599b0) {
                    b.this.f1599b0.remove(this);
                }
            } catch (Throwable th7) {
                b.t1.decrementAndGet();
                synchronized (b.this.f1599b0) {
                    b.this.f1599b0.remove(this);
                    throw th7;
                }
            }
        }
    }

    public static class e {

        public d.b f1646a;

        public int f1647b = 0;

        public boolean f1648c = false;

        public boolean f1649d = false;
    }

    public class f extends Thread {

        public Projection f1650c;

        public float f1651d;

        public Object f1652f;

        public boolean f1653g;

        public boolean f1654i;

        public f() {
            super("MyOverlay$ParallelDraw");
            this.f1650c = null;
            this.f1651d = -1.0f;
            this.f1652f = new Object();
            this.f1653g = false;
            this.f1654i = false;
        }

        public void a() {
            synchronized (this.f1652f) {
                do {
                    try {
                        if (this.f1650c == null || this.f1653g) {
                            this.f1652f.notify();
                            return;
                        } else {
                            try {
                                this.f1652f.wait(1000L);
                            } catch (InterruptedException unused) {
                                return;
                            }
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                } while (!this.f1653g);
            }
        }

        public boolean b() {
            boolean z2;
            synchronized (this.f1652f) {
                z2 = this.f1654i;
            }
            return z2;
        }

        public boolean c() {
            boolean z2;
            synchronized (this.f1652f) {
                z2 = this.f1650c != null;
            }
            return z2;
        }

        public void d() {
            synchronized (this.f1652f) {
                try {
                    this.f1653g = true;
                    this.f1652f.notify();
                    if (this.f1650c != null) {
                        interrupt();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        public void e(Projection projection, float f2) {
            synchronized (this.f1652f) {
                try {
                    boolean z2 = this.f1650c != null;
                    this.f1650c = projection;
                    this.f1651d = f2;
                    this.f1652f.notify();
                    if (z2) {
                        interrupt();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        @Override
        public void run() {
            boolean z2;
            Projection projection;
            ArrayList<String> a2;
            boolean z3;
            boolean z4;
            synchronized (this.f1652f) {
            }
            for (z2 = !this.f1653g; z2; z2 = z4) {
                try {
                    new Paint(b.this.f1603d);
                    try {
                        synchronized (this.f1652f) {
                            boolean z5 = false;
                            while (true) {
                                try {
                                    projection = this.f1650c;
                                    if (projection != null || this.f1653g) {
                                        break;
                                    }
                                    try {
                                        this.f1652f.wait(1000L);
                                    } catch (InterruptedException unused) {
                                        z5 = true;
                                    }
                                    if (this.f1653g) {
                                        z5 = true;
                                    }
                                } catch (Throwable th) {
                                    th = th;
                                    throw th;
                                }
                            }
                            if (!z5) {
                                try {
                                    Thread.interrupted();
                                } catch (Throwable th2) {
                                    th = th2;
                                    throw th;
                                }
                            }
                        }
                        if (projection == null) {
                            synchronized (this.f1652f) {
                                try {
                                    if (this.f1650c == projection) {
                                        this.f1650c = null;
                                        this.f1654i = true;
                                    }
                                    z4 = !this.f1653g;
                                    Thread.interrupted();
                                    this.f1652f.notify();
                                } finally {
                                }
                            }
                        } else {
                            try {
                                LatLngBounds latLngBounds = projection.getVisibleRegion().latLngBounds;
                                if (Thread.interrupted()) {
                                    synchronized (this.f1652f) {
                                        try {
                                            if (this.f1650c == projection) {
                                                this.f1650c = null;
                                                this.f1654i = true;
                                            }
                                            z4 = !this.f1653g;
                                            Thread.interrupted();
                                            this.f1652f.notify();
                                        } finally {
                                        }
                                    }
                                } else {
                                    Rect rect = b.this.T;
                                    b.this.f1633y0.getDrawingRect(rect);
                                    float f2 = rect.top;
                                    b bVar = b.this;
                                    int i2 = (int) (f2 + bVar.P0);
                                    rect.top = i2;
                                    int i3 = rect.bottom - i2;
                                    double[] dArr = bVar.O;
                                    dArr[0] = latLngBounds.southwest.longitude;
                                    double d2 = latLngBounds.northeast.latitude;
                                    dArr[1] = d2;
                                    double d3 = b.o1;
                                    if (d2 > d3) {
                                        rect.top = projection.toScreenLocation(b.q1).y;
                                        dArr[1] = d3;
                                    }
                                    double[] dArr2 = b.this.P;
                                    dArr2[0] = latLngBounds.northeast.longitude;
                                    double d4 = latLngBounds.southwest.latitude;
                                    dArr2[1] = d4;
                                    double d5 = b.p1;
                                    if (d4 == d5) {
                                        rect.bottom = projection.toScreenLocation(b.r1).y;
                                        dArr2[1] = d5;
                                    }
                                    Rect rect2 = b.this.S;
                                    if (dArr[0] == b.this.Q[0] && dArr[1] == b.this.Q[1] && dArr2[0] == b.this.R[0] && dArr2[1] == b.this.R[1] && rect.equals(rect2)) {
                                        z3 = false;
                                        if (Thread.interrupted()) {
                                            synchronized (this.f1652f) {
                                                try {
                                                    if (this.f1650c == projection) {
                                                        this.f1650c = null;
                                                        this.f1654i = true;
                                                    }
                                                    z4 = !this.f1653g;
                                                    Thread.interrupted();
                                                    this.f1652f.notify();
                                                } finally {
                                                }
                                            }
                                        } else {
                                            if (z3) {
                                                synchronized (b.this.I) {
                                                    synchronized (b.this.U) {
                                                        b.this.B();
                                                    }
                                                }
                                            }
                                            b.this.A();
                                            synchronized (this.f1652f) {
                                                try {
                                                    if (this.f1650c == projection) {
                                                        this.f1650c = null;
                                                        this.f1654i = true;
                                                    }
                                                    z4 = !this.f1653g;
                                                    Thread.interrupted();
                                                    this.f1652f.notify();
                                                } finally {
                                                }
                                            }
                                        }
                                    }
                                    int i4 = projection.toScreenLocation(b.s1).x;
                                    if (i4 >= rect.left && i4 <= rect.right) {
                                        double d6 = dArr[0];
                                        double d7 = dArr2[0];
                                        if (d6 < d7) {
                                            dArr2[0] = d6;
                                            dArr[0] = d7;
                                        }
                                        b.this.Q[0] = dArr[0];
                                        b.this.Q[1] = dArr[1];
                                        b.this.R[0] = dArr2[0];
                                        b.this.R[1] = dArr2[1];
                                        rect2.top = rect.top;
                                        rect2.bottom = rect.bottom;
                                        rect2.left = rect.left;
                                        rect2.right = rect.right;
                                        b.this.M(dArr, dArr2, this.f1651d);
                                        b bVar2 = b.this;
                                        bVar2.q(bVar2.Q, b.this.R, rect, projection, i3);
                                        if (b.this.f1627u0 <= rect2.right - rect2.left) {
                                            dArr[0] = -180.0d;
                                            dArr2[0] = 180.0d;
                                        }
                                        a2 = s.a.a(b.this.A0, dArr, dArr2, v.providers);
                                        if (a2.size() == b.this.f1629w0.size() || !a2.equals(b.this.f1629w0)) {
                                            b.this.f1629w0 = a2;
                                            b.this.F();
                                        }
                                        z3 = true;
                                        if (Thread.interrupted()) {
                                        }
                                    }
                                    double d8 = dArr[0];
                                    double d9 = dArr2[0];
                                    if (d8 > d9) {
                                        dArr2[0] = d8;
                                        dArr[0] = d9;
                                    }
                                    b.this.Q[0] = dArr[0];
                                    b.this.Q[1] = dArr[1];
                                    b.this.R[0] = dArr2[0];
                                    b.this.R[1] = dArr2[1];
                                    rect2.top = rect.top;
                                    rect2.bottom = rect.bottom;
                                    rect2.left = rect.left;
                                    rect2.right = rect.right;
                                    b.this.M(dArr, dArr2, this.f1651d);
                                    b bVar22 = b.this;
                                    bVar22.q(bVar22.Q, b.this.R, rect, projection, i3);
                                    if (b.this.f1627u0 <= rect2.right - rect2.left) {
                                    }
                                    a2 = s.a.a(b.this.A0, dArr, dArr2, v.providers);
                                    if (a2.size() == b.this.f1629w0.size()) {
                                    }
                                    b.this.f1629w0 = a2;
                                    b.this.F();
                                    z3 = true;
                                    if (Thread.interrupted()) {
                                    }
                                }
                            } catch (Throwable th3) {
                                th = th3;
                                synchronized (this.f1652f) {
                                    try {
                                        if (this.f1650c == projection) {
                                            this.f1650c = null;
                                            this.f1654i = true;
                                        }
                                        Thread.interrupted();
                                        this.f1652f.notify();
                                    } finally {
                                    }
                                }
                                throw th;
                            }
                        }
                    } catch (Throwable th4) {
                        th = th4;
                        projection = null;
                    }
                } catch (Exception e2) {
                    m.a().c(e2);
                    return;
                }
            }
        }
    }

    public class g extends Thread {

        public boolean f1656c;

        public g() {
            super("MyOverlay$Recycler");
            this.f1656c = false;
            setPriority(getThreadGroup().getMaxPriority());
        }

        @Override
        public void interrupt() {
            super.interrupt();
            this.f1656c = true;
        }

        @Override
        public boolean isInterrupted() {
            return this.f1656c || super.isInterrupted();
        }

        @Override
        public void run() {
            h hVar;
            boolean remove;
            boolean remove2;
            while (!isInterrupted()) {
                try {
                    synchronized (b.this.i1) {
                        try {
                            if (b.this.i1.size() == 0) {
                                b.this.i1.wait();
                            }
                            hVar = (h) b.this.i1.remove(0);
                        } finally {
                        }
                    }
                    if (hVar.f1658g) {
                        e J = b.this.J(hVar, 0);
                        if (J != null) {
                            synchronized (b.this.U) {
                                synchronized (J) {
                                    try {
                                        if (J.f1648c) {
                                            synchronized (b.this.f1597a0) {
                                                remove = b.this.f1597a0.remove(new c(hVar.f2762c, hVar.f2763d, 0, 1, hVar.f1659i));
                                            }
                                            if (remove) {
                                                b.this.K(-1, 0);
                                            }
                                            J.f1648c = false;
                                        }
                                        d.b bVar = J.f1646a;
                                        if (bVar != null) {
                                            bVar.b();
                                            J.f1646a = null;
                                        }
                                    } catch (Throwable th) {
                                        throw th;
                                    }
                                }
                            }
                        } else {
                            continue;
                        }
                    } else {
                        int i2 = 1;
                        while (true) {
                            b bVar2 = b.this;
                            if (i2 <= bVar2.J) {
                                e J2 = bVar2.J(hVar, i2);
                                if (J2 != null) {
                                    synchronized (b.this.U) {
                                        synchronized (J2) {
                                            try {
                                                if (J2.f1648c) {
                                                    synchronized (b.this.f1597a0) {
                                                        remove2 = b.this.f1597a0.remove(new c(hVar.f2762c, hVar.f2763d, i2, -1, hVar.f1659i));
                                                    }
                                                    if (remove2) {
                                                        b.this.K(-1, 0);
                                                    }
                                                    J2.f1648c = false;
                                                }
                                                d.b bVar3 = J2.f1646a;
                                                if (bVar3 != null) {
                                                    bVar3.b();
                                                    J2.f1646a = null;
                                                }
                                            } catch (Throwable th2) {
                                                throw th2;
                                            }
                                        }
                                    }
                                }
                                i2++;
                            }
                        }
                    }
                } catch (InterruptedException unused) {
                    return;
                }
            }
        }
    }

    public static class h extends v.d {

        public boolean f1658g;

        public int f1659i;

        public int f1660j;

        public int f1661o;

        public int f1662p;

        public int f1663x;

        public h(boolean z2, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
            super(i2, i3);
            this.f1658g = z2;
            this.f1659i = i4;
            this.f1660j = i5;
            this.f1661o = i6;
            this.f1662p = i7;
            this.f1663x = i8;
        }

        public h h() {
            return new h(true, this.f2762c, this.f2763d, this.f1659i, this.f1660j, this.f1661o, this.f1662p, this.f1663x);
        }
    }

    static {
        double d2 = v.b.f2760a[1];
        o1 = d2;
        double d3 = -d2;
        p1 = d3;
        q1 = new LatLng(d2, 0.0d);
        r1 = new LatLng(d3, 0.0d);
        s1 = new LatLng(0.0d, 180.0d);
        t1 = new AtomicInteger(0);
    }

    public b(Context context, double[] dArr, Handler handler, int i2, int i3, int i4, float f2, View view, int i5, float f3) {
        super(context);
        int i6;
        this.f1603d = new Paint();
        this.f1606f = new Paint();
        this.f1621p = null;
        this.D = 1.0d;
        this.E = 1.0d;
        this.F = 1;
        this.G = 1;
        this.H = 1;
        this.I = new Object();
        this.M = new g();
        this.N = new f();
        this.O = new double[]{360.0d, 360.0d};
        this.P = new double[]{360.0d, 360.0d};
        this.Q = new double[]{360.0d, 360.0d};
        this.R = new double[]{360.0d, 360.0d};
        this.S = new Rect(0, 0, 0, 0);
        this.T = new Rect(0, 0, 0, 0);
        this.U = new ArrayList<>(4);
        this.V = new k<>(4);
        this.W = new k<>(4);
        this.f1597a0 = new ArrayList<>(16);
        this.f1599b0 = new ArrayList<>(6);
        this.f1602c0 = 1.0f;
        this.f1604d0 = -1;
        this.f1605e0 = -1;
        this.f1607f0 = 7;
        this.f1609g0 = z.f1558l[7];
        this.f1610h0 = 1.0d;
        this.f1612i0 = 1.0d;
        this.f1614j0 = 1;
        this.f1615k0 = new ArrayList<>(4);
        this.f1618n0 = false;
        this.f1622p0 = new Object();
        this.f1623q0 = 0.8176460266113281d;
        this.f1625s0 = new double[2];
        this.f1626t0 = new int[]{-1, -1};
        this.f1628v0 = 0.0f;
        this.f1629w0 = new ArrayList<>(0);
        this.D0 = 100;
        this.E0 = 4;
        this.F0 = 4;
        this.G0 = 4;
        this.J0 = -1;
        this.K0 = -1;
        this.N0 = new RectF();
        this.Q0 = new Rect();
        this.R0 = new Object();
        this.S0 = -1;
        this.T0 = false;
        this.U0 = false;
        this.V0 = new double[2];
        this.W0 = new double[2];
        this.X0 = new double[2];
        this.Y0 = new float[2];
        this.d1 = false;
        this.e1 = false;
        this.f1 = new Object();
        this.g1 = false;
        this.h1 = new Handler(new a());
        this.i1 = new ArrayList<>(10);
        this.j1 = new C0082b("MyOverlay$Supervisor");
        this.l1 = new Object();
        this.m1 = false;
        this.f1611i = BitmapFactory.decodeResource(context.getResources(), r.location_black);
        this.f1613j = BitmapFactory.decodeResource(context.getResources(), r.strength_scale_global);
        this.f1619o = BitmapFactory.decodeResource(context.getResources(), r.arrow_white);
        boolean z2 = context.getResources().getConfiguration().getLayoutDirection() == 1;
        if (z2) {
            this.f1613j = q.M0(this.f1613j);
            this.f1619o = q.M0(this.f1619o);
        }
        this.f1621p = ContextCompat.getDrawable(context, r.ic_mapbox);
        this.f1630x = context.getString(w.help_strengthLight);
        this.f1632y = context.getString(w.help_strengthHeavy);
        this.B = context.getString(w.app_name);
        this.C = context.getString(w.main_share3);
        if (z2) {
            String str = this.f1630x;
            this.f1630x = this.f1632y;
            this.f1632y = str;
        }
        this.f1633y0 = view;
        this.A0 = context;
        this.f1624r0 = new double[]{dArr[0], dArr[1]};
        this.f1625s0 = v.b.c(dArr, this.f1625s0);
        if (r.a.isValidLocation(dArr)) {
            this.f1628v0 = new GeomagneticField((float) dArr[1], (float) dArr[0], 0.0f, System.currentTimeMillis()).getDeclination();
        }
        this.f1608g = handler;
        if (i3 < 1) {
            i6 = 1;
        } else {
            i6 = 13;
            if (i3 <= 13) {
                i6 = i3;
            }
        }
        this.J = i6;
        this.K = i4;
        this.L = i2;
        this.f1601c = new HashMap[i6 + 1];
        for (int i7 = 0; i7 <= i6; i7++) {
            this.f1601c[i7] = new HashMap<>();
        }
        this.f1602c0 = f2;
        boolean z3 = f2 >= 2.0f;
        this.f1618n0 = z3;
        this.f1616l0 = z3 ? "g2hd/mz2/" : "g2/mz2/";
        this.f1617m0 = z3 ? "https://images.rain-alarm.com/rain/g2hd/" : "https://images.rain-alarm.com/rain/g2/";
        Paint paint = this.f1603d;
        Typeface typeface = Typeface.DEFAULT;
        paint.setTypeface(typeface);
        this.f1603d.setColor(Color.argb(0, 0, 0, 0));
        this.f1606f.setTypeface(typeface);
        this.f1606f.setColor(Color.argb(0, 0, 0, 0));
        this.f1606f.setAntiAlias(true);
        this.f1606f.setAlpha(191);
        this.f1606f.setTextSize(f2 * 7.0f);
        this.f1631x0 = new String[i6];
        this.C0 = q.v0(context);
        Calendar calendar = Calendar.getInstance();
        calendar.add(12, (-(calendar.get(12) % i2)) - i2);
        for (int i8 = 0; i8 < i6; i8++) {
            this.f1631x0[i8] = this.C0.format(calendar.getTime());
            calendar.add(12, (-i2) * i4);
        }
        this.D0 = 255 - ((i5 * 255) / 100);
        this.P0 = f3;
        this.B0 = context.getText(w.source_separator).toString();
        this.O0 = getContext().getText(w.source_map).toString();
        d dVar = new d(0, true);
        this.f1599b0.add(dVar);
        dVar.start();
        d dVar2 = new d(1, true);
        this.f1599b0.add(dVar2);
        dVar2.start();
        d dVar3 = new d(2, false);
        this.f1599b0.add(dVar3);
        dVar3.start();
        d dVar4 = new d(3, false);
        this.f1599b0.add(dVar4);
        dVar4.start();
        this.j1.setPriority(2);
        this.j1.start();
        this.M.start();
        this.N.start();
    }

    public static boolean x(int i2) {
        return ((i2 + (-1)) & i2) == 0 && i2 > 0;
    }

    public void A() {
        synchronized (this.f1) {
            try {
                if (!this.g1 && !this.h1.hasMessages(0)) {
                    this.g1 = true;
                    this.h1.sendEmptyMessage(0);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void B() {
        Iterator<h> it;
        boolean z2;
        synchronized (this.U) {
            try {
                if (!this.U0) {
                    this.U0 = true;
                }
                it = this.f1615k0.iterator();
            } catch (Throwable th) {
                throw th;
            }
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                h next = it.next();
                e u2 = u(next, 0);
                if (u2 != null) {
                    synchronized (u2) {
                        try {
                            d.b bVar = u2.f1646a;
                            if (bVar != null) {
                                if (bVar.f1486a != null) {
                                    if (this.f1614j0 != bVar.f1488c) {
                                    }
                                }
                            }
                            C(u2, next.f2762c, next.f2763d, 0, this.f1614j0, next.f1659i);
                        } finally {
                        }
                    }
                }
                throw th;
            }
            if (this.G != 1) {
                synchronized (this.f1622p0) {
                    z2 = this.f1620o0 != null;
                }
                if (!z2 && this.U.size() > 0) {
                    Iterator<h> it2 = this.U.iterator();
                    while (it2.hasNext()) {
                        h next2 = it2.next();
                        e u3 = u(next2, 1);
                        if (u3 != null) {
                            synchronized (u3) {
                                try {
                                    d.b bVar2 = u3.f1646a;
                                    if (bVar2 != null) {
                                        if (bVar2.f1486a != null) {
                                            if (this.F != bVar2.f1488c) {
                                            }
                                        }
                                    }
                                    C(u3, next2.f2762c, next2.f2763d, 1, this.F, next2.f1659i);
                                } finally {
                                }
                            }
                        }
                    }
                }
            }
            Iterator<h> it3 = this.U.iterator();
            while (it3.hasNext()) {
                h next3 = it3.next();
                e u4 = u(next3, this.G);
                if (u4 != null) {
                    synchronized (u4) {
                        try {
                            d.b bVar3 = u4.f1646a;
                            if (bVar3 != null) {
                                if (bVar3.f1486a != null) {
                                    if (this.F != bVar3.f1488c) {
                                    }
                                }
                            }
                            C(u4, next3.f2762c, next3.f2763d, this.G, this.F, next3.f1659i);
                        } finally {
                        }
                    }
                }
            }
            if (y()) {
                int i2 = this.G;
                for (int i3 = i2; i3 >= 1; i3--) {
                    Iterator<h> it4 = this.U.iterator();
                    while (it4.hasNext()) {
                        h next4 = it4.next();
                        e u5 = u(next4, i3);
                        if (u5 != null) {
                            synchronized (u5) {
                                try {
                                    d.b bVar4 = u5.f1646a;
                                    if (bVar4 != null) {
                                        if (bVar4.f1486a != null) {
                                            if (this.F != bVar4.f1488c) {
                                            }
                                        }
                                    }
                                    C(u5, next4.f2762c, next4.f2763d, i3, this.F, next4.f1659i);
                                } finally {
                                }
                            }
                        }
                    }
                }
                for (int i4 = this.J; i4 > i2; i4--) {
                    Iterator<h> it5 = this.U.iterator();
                    while (it5.hasNext()) {
                        h next5 = it5.next();
                        e u6 = u(next5, i4);
                        if (u6 != null) {
                            synchronized (u6) {
                                try {
                                    d.b bVar5 = u6.f1646a;
                                    if (bVar5 != null) {
                                        if (bVar5.f1486a != null) {
                                            if (this.F != bVar5.f1488c) {
                                            }
                                        }
                                    }
                                    C(u6, next5.f2762c, next5.f2763d, i4, this.F, next5.f1659i);
                                } finally {
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public final void C(e eVar, int i2, int i3, int i4, int i5, int i6) {
        if (eVar.f1648c || eVar.f1647b >= 4) {
            return;
        }
        eVar.f1648c = true;
        synchronized (this.f1597a0) {
            try {
                if (this.d1) {
                    eVar.f1648c = false;
                    return;
                }
                if (i4 == 1) {
                    this.f1597a0.add(0, new c(i2, i3, i4, i5, i6));
                } else {
                    this.f1597a0.add(new c(i2, i3, i4, i5, i6));
                }
                this.f1597a0.notifyAll();
                K(1, 0);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void D() {
        boolean z2;
        h hVar;
        e u2;
        Iterator<h> it = this.f1615k0.iterator();
        while (it.hasNext()) {
            h next = it.next();
            e u3 = u(next, 0);
            if (u3 != null) {
                synchronized (u3) {
                    try {
                        d.b bVar = u3.f1646a;
                        if (bVar != null) {
                            if (bVar.f1486a != null) {
                                if (this.f1614j0 != bVar.f1488c) {
                                }
                            }
                        }
                        C(u3, next.f2762c, next.f2763d, 0, this.f1614j0, next.f1659i);
                    } finally {
                    }
                }
            }
        }
        if (this.G != 1) {
            synchronized (this.f1622p0) {
                z2 = this.f1620o0 != null;
            }
            if (!z2 && this.U.size() > 0 && (u2 = u((hVar = this.U.get(0)), 1)) != null) {
                synchronized (u2) {
                    try {
                        d.b bVar2 = u2.f1646a;
                        if (bVar2 != null) {
                            if (bVar2.f1486a != null) {
                                if (this.F != bVar2.f1488c) {
                                }
                            }
                        }
                        C(u2, hVar.f2762c, hVar.f2763d, 1, this.F, hVar.f1659i);
                    } finally {
                    }
                }
            }
        }
        Iterator<h> it2 = this.U.iterator();
        while (it2.hasNext()) {
            h next2 = it2.next();
            e u4 = u(next2, this.G);
            if (u4 != null) {
                synchronized (u4) {
                    try {
                        d.b bVar3 = u4.f1646a;
                        if (bVar3 != null) {
                            if (bVar3.f1486a != null) {
                                if (this.F != bVar3.f1488c) {
                                }
                            }
                        }
                        C(u4, next2.f2762c, next2.f2763d, this.G, this.F, next2.f1659i);
                    } finally {
                    }
                }
            }
        }
        int i2 = this.G;
        for (int i3 = i2; i3 >= 1; i3--) {
            Iterator<h> it3 = this.U.iterator();
            while (it3.hasNext()) {
                h next3 = it3.next();
                e u5 = u(next3, i3);
                if (u5 != null) {
                    synchronized (u5) {
                        try {
                            d.b bVar4 = u5.f1646a;
                            if (bVar4 != null) {
                                if (bVar4.f1486a != null) {
                                    if (this.F != bVar4.f1488c) {
                                    }
                                }
                            }
                            C(u5, next3.f2762c, next3.f2763d, i3, this.F, next3.f1659i);
                        } finally {
                        }
                    }
                }
            }
        }
        for (int i4 = this.J; i4 > i2; i4--) {
            Iterator<h> it4 = this.U.iterator();
            while (it4.hasNext()) {
                h next4 = it4.next();
                e u6 = u(next4, i4);
                if (u6 != null) {
                    synchronized (u6) {
                        try {
                            d.b bVar5 = u6.f1646a;
                            if (bVar5 != null) {
                                if (bVar5.f1486a != null) {
                                    if (this.F != bVar5.f1488c) {
                                    }
                                }
                            }
                            C(u6, next4.f2762c, next4.f2763d, i4, this.F, next4.f1659i);
                        } finally {
                        }
                    }
                }
            }
        }
    }

    public void E() {
        int i2;
        A();
        synchronized (this.I) {
            i2 = this.G;
        }
        synchronized (this.U) {
            synchronized (this.f1597a0) {
                int i3 = 0;
                while (i3 < this.f1597a0.size()) {
                    try {
                        c cVar = this.f1597a0.get(i3);
                        if (cVar.f1640c != i2) {
                            this.f1597a0.remove(i3);
                            i3--;
                            K(-1, 0);
                            e t2 = t(new v.d(cVar.f1638a, cVar.f1639b), cVar.f1640c);
                            if (t2 != null) {
                                t2.f1648c = false;
                            }
                        }
                        i3++;
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
        }
    }

    public void F() {
        String str = this.O0 + s.a.c(this.f1629w0, this.B0);
        synchronized (this.f1629w0) {
            this.f1629w0.clear();
            this.f1629w0.add(str);
        }
    }

    public final void G() {
        this.f1626t0 = new int[]{v.c.c((this.f1625s0[0] - this.W0[0]) * this.f1623q0 * this.D), v.c.c((this.f1625s0[1] - this.W0[1]) * this.f1623q0 * this.D)};
        this.f1627u0 = v.c.c(this.f1623q0 * 40003.200000000004d * this.D);
    }

    public void H() {
        try {
            synchronized (this.f1597a0) {
                this.d1 = true;
            }
            E();
            synchronized (this.f1597a0) {
                this.f1597a0.clear();
            }
            this.j1.interrupt();
            synchronized (this.f1599b0) {
                try {
                    Iterator<d> it = this.f1599b0.iterator();
                    while (it.hasNext()) {
                        it.next().interrupt();
                    }
                } finally {
                }
            }
            this.M.interrupt();
            f fVar = this.N;
            if (fVar != null) {
                fVar.d();
            }
            for (int i2 = 0; i2 <= this.J; i2++) {
                synchronized (this.f1601c[i2]) {
                    try {
                        for (e eVar : this.f1601c[i2].values()) {
                            synchronized (eVar) {
                                eVar.f1648c = false;
                                d.b bVar = eVar.f1646a;
                                if (bVar != null) {
                                    bVar.b();
                                    eVar.f1646a = null;
                                }
                            }
                        }
                        this.f1601c[i2].clear();
                    } finally {
                    }
                }
            }
            synchronized (this.f1597a0) {
                this.e1 = true;
            }
        } catch (Throwable th) {
            synchronized (this.f1597a0) {
                this.e1 = true;
                throw th;
            }
        }
    }

    public void I() {
        int size;
        synchronized (this.f1622p0) {
            this.f1620o0 = null;
        }
        synchronized (this.f1597a0) {
            size = this.f1597a0.size();
            this.f1597a0.clear();
        }
        K(-size, 0);
        synchronized (this.U) {
            try {
                Iterator<h> it = this.U.iterator();
                while (it.hasNext()) {
                    h next = it.next();
                    for (int i2 = 1; i2 <= this.J; i2++) {
                        e u2 = u(next, i2);
                        if (u2 != null) {
                            synchronized (u2) {
                                try {
                                    d.b bVar = u2.f1646a;
                                    if (bVar != null && bVar.f1486a != null) {
                                        bVar.f1488c = 0;
                                    }
                                    u2.f1648c = false;
                                } finally {
                                }
                            }
                        }
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        A();
    }

    public final e J(v.d dVar, int i2) {
        e remove;
        synchronized (this.f1601c[i2]) {
            remove = this.f1601c[i2].remove(dVar);
        }
        return remove;
    }

    public void K(int i2, int i3) {
        Handler handler = this.f1608g;
        if (handler == null) {
            return;
        }
        Message obtainMessage = handler.obtainMessage(i2, i3, 4);
        Bundle bundle = new Bundle();
        synchronized (this.U) {
            try {
                bundle.putInt("maxLoading", (y() ? this.U.size() * this.J : this.U.size()) + this.f1615k0.size());
            } catch (Throwable th) {
                throw th;
            }
        }
        obtainMessage.setData(bundle);
        this.f1608g.sendMessage(obtainMessage);
    }

    public void L() {
        Handler handler = this.f1608g;
        if (handler == null) {
            return;
        }
        Message obtainMessage = handler.obtainMessage();
        Bundle bundle = new Bundle();
        bundle.putBoolean("outOfMemory", true);
        obtainMessage.setData(bundle);
        this.f1608g.sendMessage(obtainMessage);
    }

    public final void M(double[] dArr, double[] dArr2, float f2) {
        double[] dArr3;
        double[] c2 = v.b.c(dArr, this.W0);
        double[] c3 = v.b.c(dArr2, this.X0);
        double d2 = c3[0];
        double d3 = c2[0];
        double d4 = d2 > d3 ? d2 - d3 : (v.b.b(new double[]{180.0d, c2[1]})[0] - c2[0]) + c3[0];
        Rect rect = this.S;
        double d5 = (rect.right - rect.left) / d4;
        double d6 = Double.MAX_VALUE;
        int i2 = 1;
        while (true) {
            dArr3 = z.f1558l;
            if (i2 >= dArr3.length) {
                break;
            }
            double abs = Math.abs(dArr3[i2] - d5);
            if (abs < d6) {
                d6 = abs;
            } else if (abs > d6) {
                break;
            }
            i2++;
        }
        int i3 = (int) f2;
        double d7 = dArr3[i3];
        double d8 = (((-(d7 - d5)) / (dArr3[1 + i3] - d7)) / 2.0d) + 0.5d;
        if (this.f1604d0 != i3) {
            this.f1604d0 = i3;
            if (i3 >= 14) {
                this.f1607f0 = 13;
                this.f1612i0 = Math.pow(2.0d, i3 - 13);
            } else {
                this.f1607f0 = i3;
                this.f1612i0 = 1.0d;
            }
            this.f1609g0 = dArr3[this.f1607f0];
            this.f1614j0 = v(this.f1610h0);
            if (i3 >= 10) {
                this.f1605e0 = 9;
                this.E = Math.pow(2.0d, i3 - 9);
            } else {
                this.f1605e0 = i3;
                this.E = 1.0d;
            }
            if (this.f1602c0 >= 2.0f) {
                this.E *= 2.0d;
                this.f1612i0 *= 2.0d;
            }
            this.f1623q0 = dArr3[this.f1605e0];
            this.F = v(this.D);
        }
        double d9 = this.E * d8;
        this.D = d9;
        double d10 = this.f1612i0 * d8;
        this.f1610h0 = d10;
        if (!this.f1618n0) {
            this.D = d9 * 2.0d;
            this.f1610h0 = d10 * 2.0d;
        }
        if (this.H0 > 0.0f) {
            this.J0 = v.c.c(this.I0 * this.f1623q0 * this.D);
        }
        double d11 = this.D;
        this.Z0 = d11 * 256.0d;
        this.f1598a1 = d11 * 256.0d;
        double d12 = this.f1610h0;
        this.f1600b1 = d12 * 256.0d;
        this.c1 = d12 * 256.0d;
    }

    public boolean N(int i2) {
        try {
            synchronized (this.R0) {
                while (i2 != this.S0) {
                    try {
                        this.R0.wait();
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
            return true;
        } catch (InterruptedException unused) {
            return false;
        }
    }

    public de.mdiener.rain.core.util.d getCachedLoader() {
        synchronized (this.l1) {
            try {
                if (this.k1 == null) {
                    this.k1 = de.mdiener.rain.core.util.d.m(getContext());
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return this.k1;
    }

    public String getCurrentTime() {
        synchronized (this.R0) {
            try {
                int i2 = this.S0;
                if (i2 == -1) {
                    return null;
                }
                return this.f1631x0[i2 - 1];
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public int getIndex() {
        return this.G;
    }

    public double[] getLocation() {
        double[] dArr = this.f1624r0;
        return new double[]{dArr[0], dArr[1]};
    }

    public void o() {
        GoogleMap googleMap = this.f1634z0;
        if (googleMap != null) {
            this.N.e(googleMap.getProjection(), this.f1634z0.getCameraPosition().zoom);
        }
    }

    @Override
    public void onDraw(Canvas canvas) {
        int i2;
        int height;
        int i3;
        boolean z2;
        String str;
        int i4;
        ArrayList arrayList;
        int i5;
        Paint.Style style;
        Bitmap bitmap;
        e u2;
        d.b bVar;
        Bitmap bitmap2;
        Bitmap bitmap3;
        Bitmap bitmap4;
        Bitmap bitmap5;
        synchronized (this.f1597a0) {
            if (!this.d1 && !this.e1 && this.f1634z0 != null) {
                synchronized (this.f1) {
                    this.g1 = false;
                }
                Paint paint = this.f1603d;
                if (!this.N.b()) {
                    this.N.e(this.f1634z0.getProjection(), this.f1634z0.getCameraPosition().zoom);
                    return;
                }
                if (this.N.c()) {
                    this.N.a();
                }
                synchronized (this.I) {
                    synchronized (this.U) {
                        try {
                            paint.setAlpha(255);
                            Iterator<h> it = this.f1615k0.iterator();
                            boolean z3 = true;
                            while (it.hasNext()) {
                                h next = it.next();
                                this.Q0.top = next.f1661o;
                                this.Q0.bottom = next.f1663x;
                                this.Q0.left = next.f1660j;
                                this.Q0.right = next.f1662p;
                                e u3 = u(next, 0);
                                if (u3 != null) {
                                    synchronized (u3) {
                                        d.b bVar2 = u3.f1646a;
                                        if (bVar2 != null && (bitmap5 = bVar2.f1486a) != null && this.f1614j0 == bVar2.f1488c) {
                                            if (bitmap5 != null) {
                                                canvas.drawBitmap(bitmap5, (Rect) null, this.Q0, paint);
                                            }
                                        }
                                        if (!u3.f1648c && u3.f1647b < 4) {
                                            B();
                                        }
                                        if (bVar2 != null && (bitmap4 = bVar2.f1486a) != null) {
                                            canvas.drawBitmap(bitmap4, (Rect) null, this.Q0, paint);
                                        }
                                        z3 = false;
                                    }
                                }
                            }
                            paint.setFilterBitmap(false);
                            paint.setAlpha(this.D0);
                            Iterator<h> it2 = this.U.iterator();
                            while (it2.hasNext()) {
                                h next2 = it2.next();
                                e u4 = u(next2, this.G);
                                if (u4 != null) {
                                    this.Q0.top = next2.f1661o;
                                    this.Q0.bottom = next2.f1663x;
                                    this.Q0.left = next2.f1660j;
                                    this.Q0.right = next2.f1662p;
                                    synchronized (u4) {
                                        d.b bVar3 = u4.f1646a;
                                        if (bVar3 != null) {
                                            try {
                                                bitmap = bVar3.f1486a;
                                            } catch (RuntimeException unused) {
                                            }
                                            if (bitmap != null && this.F == bVar3.f1488c) {
                                                if (bitmap != null) {
                                                    canvas.drawBitmap(bitmap, (Rect) null, this.Q0, paint);
                                                }
                                            }
                                        }
                                        if (!u4.f1648c && u4.f1647b < 4) {
                                            B();
                                        }
                                        if (bVar3 != null && (bitmap3 = bVar3.f1486a) != null) {
                                            canvas.drawBitmap(bitmap3, (Rect) null, this.Q0, paint);
                                        } else if (this.G != this.H && (u2 = u(next2, this.H)) != null && (bVar = u2.f1646a) != null && (bitmap2 = bVar.f1486a) != null) {
                                            try {
                                                canvas.drawBitmap(bitmap2, (Rect) null, this.Q0, paint);
                                            } catch (RuntimeException unused2) {
                                            }
                                        }
                                        z3 = false;
                                    }
                                }
                            }
                            i2 = z3 ? this.G : -1;
                        } catch (Throwable th) {
                            throw th;
                        } finally {
                        }
                    }
                    paint.setAlpha(255);
                }
                if (r.a.isValidLocation(this.f1624r0)) {
                    Rect rect = this.S;
                    int i6 = rect.left;
                    int[] iArr = this.f1626t0;
                    int i7 = i6 + iArr[0];
                    height = rect.top + iArr[1];
                    i3 = i7;
                    z2 = true;
                } else {
                    int width = this.S.width() / 2;
                    height = this.S.height() / 2;
                    i3 = width;
                    z2 = false;
                }
                int i8 = this.J0;
                if (i8 >= 0) {
                    float strokeWidth = paint.getStrokeWidth();
                    Paint.Style style2 = paint.getStyle();
                    paint.setAntiAlias(true);
                    paint.setStrokeWidth(this.f1602c0 * 1.5f);
                    paint.setStyle(Paint.Style.STROKE);
                    paint.setAlpha(this.K0);
                    int i9 = this.M0;
                    if (i9 == 0) {
                        canvas.drawCircle(i3, height, i8, paint);
                        style = style2;
                    } else {
                        RectF rectF = this.N0;
                        rectF.left = i3 - i8;
                        rectF.right = i3 + i8;
                        rectF.top = height - i8;
                        rectF.bottom = i8 + height;
                        style = style2;
                        canvas.drawArc(rectF, this.L0, i9, true, paint);
                    }
                    paint.setStyle(style);
                    paint.setStrokeWidth(strokeWidth);
                    paint.setAntiAlias(false);
                    paint.setAlpha(255);
                }
                if (z2) {
                    canvas.drawBitmap(this.f1611i, i3 - (r2.getWidth() / 2), height - (this.f1611i.getHeight() / 2), paint);
                }
                synchronized (this.f1629w0) {
                    try {
                        str = this.f1629w0.size() > 0 ? this.f1629w0.get(0) : "";
                    } finally {
                    }
                }
                int length = str.length();
                ArrayList arrayList2 = new ArrayList();
                int i10 = this.S.right - ((int) ((this.F0 + this.G0) * this.f1602c0));
                int i11 = 1;
                int i12 = 0;
                while (i11 <= length) {
                    String substring = str.substring(0, i11);
                    if (this.f1606f.measureText(substring) > i10 && i12 > 0) {
                        arrayList2.add(str.substring(0, i12).trim());
                        if (Character.isSpaceChar(str.charAt(i12))) {
                            i12++;
                            str = str.substring(i12);
                        } else {
                            str = str.substring(i12);
                        }
                        length -= i12;
                        i11 = 1;
                        i12 = 0;
                    }
                    if (i11 == length) {
                        arrayList2.add(substring.trim());
                    } else {
                        int i13 = i11 - 1;
                        if (Character.isSpaceChar(str.charAt(i13)) || substring.endsWith(this.B0)) {
                            i12 = i13;
                        } else if (str.charAt(i13) == '/') {
                            i12 = i11;
                        }
                    }
                    i11++;
                }
                int i14 = (int) (this.S.left + (this.F0 * this.f1602c0));
                int textSize = (int) ((this.E0 * r6) + (this.f1606f.getTextSize() * 0.8d));
                int size = arrayList2.size();
                int i15 = 0;
                while (i15 < size) {
                    float textSize2 = ((int) ((this.f1606f.getTextSize() + 2.0f) * i15)) + textSize;
                    String str2 = (String) arrayList2.get(i15);
                    if (i15 != size - 1) {
                        float f2 = 0.0f;
                        int i16 = 0;
                        while (i16 < str2.length()) {
                            float measureText = this.f1606f.measureText(str2, i16, str2.length());
                            String valueOf = String.valueOf(str2.charAt(i16));
                            int i17 = textSize;
                            float measureText2 = this.f1606f.measureText(valueOf);
                            canvas.drawText(valueOf, i14 + f2, textSize2, this.f1606f);
                            f2 += measureText2 + (((i10 - f2) - measureText) / ((str2.length() - 1) - i16));
                            i16++;
                            textSize = i17;
                            arrayList2 = arrayList2;
                            size = size;
                        }
                        i4 = textSize;
                        arrayList = arrayList2;
                        i5 = size;
                    } else {
                        i4 = textSize;
                        arrayList = arrayList2;
                        i5 = size;
                        canvas.drawText(str2, i14, textSize2, this.f1606f);
                    }
                    i15++;
                    textSize = i4;
                    arrayList2 = arrayList;
                    size = i5;
                }
                if (this.m1) {
                    int round = Math.round(this.S.left + (this.f1602c0 * 5.0f));
                    float height2 = this.S.bottom - this.f1613j.getHeight();
                    float f3 = this.f1602c0;
                    int round2 = Math.round((height2 - (f3 * 21.0f)) - (f3 * 25.0f));
                    Drawable drawable = this.f1621p;
                    drawable.setBounds(round, round2, drawable.getIntrinsicWidth() + round, this.f1621p.getIntrinsicHeight() + round2);
                    this.f1621p.draw(canvas);
                }
                paint.setAntiAlias(true);
                Paint.Style style3 = paint.getStyle();
                int color = paint.getColor();
                paint.setStyle(Paint.Style.FILL);
                paint.setColor(getResources().getColor(p.primary));
                float f4 = this.S.left;
                float height3 = (r2.bottom - this.f1613j.getHeight()) - (this.f1602c0 * 21.0f);
                Rect rect2 = this.S;
                canvas.drawRect(f4, height3, rect2.right, rect2.bottom, paint);
                if (this.T0) {
                    paint.setColor(getResources().getColor(p.accent_transparent));
                    int width2 = ((this.G - 1) * this.S.width()) / (this.J - 1);
                    float f5 = this.S.left;
                    float height4 = (r3.bottom - this.f1613j.getHeight()) - (this.f1602c0 * 26.0f);
                    Rect rect3 = this.S;
                    canvas.drawRect(f5, height4, rect3.right - width2, (rect3.bottom - this.f1613j.getHeight()) - (this.f1602c0 * 21.0f), paint);
                }
                Bitmap bitmap6 = this.f1613j;
                Rect rect4 = this.S;
                canvas.drawBitmap(bitmap6, rect4.left + (this.f1602c0 * 5.0f), (rect4.bottom - bitmap6.getHeight()) - (this.f1602c0 * 16.0f), paint);
                canvas.drawBitmap(this.f1619o, this.S.left + (this.f1602c0 * 5.0f) + ((this.f1613j.getWidth() / 2) - (this.f1619o.getWidth() / 2)), this.S.bottom - (this.f1602c0 * 11.0f), paint);
                paint.setColor(-1);
                paint.setTextSize(this.f1602c0 * 10.0f);
                String str3 = this.f1630x;
                float f6 = this.S.left;
                float f7 = this.f1602c0;
                canvas.drawText(str3, f6 + (f7 * 5.0f), r3.bottom - (f7 * 5.0f), paint);
                canvas.drawText(this.f1632y, ((this.S.left + (this.f1602c0 * 5.0f)) + this.f1613j.getWidth()) - paint.measureText(this.f1632y), this.S.bottom - (this.f1602c0 * 5.0f), paint);
                paint.setTextSize(this.f1602c0 * 24.0f);
                paint.getTextBounds(this.f1631x0[this.G - 1], 0, this.f1631x0[this.G - 1].length(), new Rect());
                String str4 = this.f1631x0[this.G - 1];
                int i18 = this.S.right;
                canvas.drawText(str4, (i18 - ((i18 - r4.left) / 2)) - (r2.width() / 2), ((this.S.bottom - this.f1613j.getHeight()) - (this.f1602c0 * 16.0f)) - r2.top, paint);
                paint.setTextSize(this.f1602c0 * 12.0f);
                Rect rect5 = new Rect();
                String str5 = this.B;
                paint.getTextBounds(str5, 0, str5.length(), rect5);
                String str6 = this.B;
                canvas.drawText(str6, (this.S.right - (this.f1602c0 * 5.0f)) - paint.measureText(str6), ((this.S.bottom - this.f1613j.getHeight()) - (this.f1602c0 * 16.0f)) - rect5.top, paint);
                String str7 = this.C;
                canvas.drawText(str7, (this.S.right - (this.f1602c0 * 5.0f)) - paint.measureText(str7), this.S.bottom - (this.f1602c0 * 5.0f), paint);
                paint.setStyle(style3);
                paint.setColor(color);
                paint.setAntiAlias(false);
                if (i2 != -1) {
                    synchronized (this.R0) {
                        this.S0 = i2;
                        this.R0.notifyAll();
                    }
                }
            }
        }
    }

    public void p() {
        synchronized (this.I) {
            try {
                this.H = this.G;
                if (this.G == 1) {
                    this.G = this.J;
                } else {
                    this.G--;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        B();
        A();
    }

    public void q(double[] dArr, double[] dArr2, Rect rect, Projection projection, int i2) {
        ArrayList<h> arrayList;
        int i3;
        int i4;
        double[] dArr3;
        int r2;
        int i5;
        b bVar;
        int i6;
        b bVar2;
        Iterator<h> it;
        b bVar3 = this;
        k<h> kVar = bVar3.V;
        k<h> kVar2 = bVar3.W;
        float f2 = bVar3.P0;
        int i7 = i2 + ((int) f2);
        rect.top = (int) (rect.top - f2);
        ArrayList<h> arrayList2 = bVar3.U;
        synchronized (arrayList2) {
            try {
                try {
                    kVar.addAll(bVar3.U);
                    bVar3.U.clear();
                    kVar2.addAll(bVar3.f1615k0);
                    bVar3.f1615k0.clear();
                    double[] dArr4 = bVar3.V0;
                    dArr4[0] = dArr[0];
                    dArr4[1] = dArr[1];
                    i3 = rect.top;
                    i4 = rect.bottom;
                    dArr3 = dArr4;
                    arrayList = arrayList2;
                    try {
                        r2 = r(dArr4, rect, kVar, i7, true, bVar3.D, bVar3.f1623q0, bVar3.U, bVar3.f1605e0, bVar3.Z0, bVar3.f1598a1, false);
                        bVar3 = this;
                    } catch (Throwable th) {
                        th = th;
                    }
                } catch (Throwable th2) {
                    th = th2;
                    arrayList = arrayList2;
                }
            } catch (Throwable th3) {
                th = th3;
            }
            try {
                double d2 = bVar3.D;
                double d3 = bVar3.f1610h0;
                try {
                    if (d2 == d3 && bVar3.f1623q0 == bVar3.f1609g0) {
                        i5 = r2;
                        while (i5 < rect.right) {
                            int i8 = i3;
                            rect.top = i8;
                            int i9 = i4;
                            rect.bottom = i9;
                            rect.left = i5;
                            double[] dArr5 = dArr3;
                            dArr5[0] = -180.0d;
                            this.W0 = v.b.c(dArr5, this.W0);
                            i5 = r(dArr5, rect, kVar, i7, false, this.D, this.f1623q0, this.U, this.f1605e0, this.Z0, this.f1598a1, false);
                            i3 = i8;
                            i4 = i9;
                            dArr3 = dArr5;
                        }
                        bVar = this;
                        double[] dArr6 = dArr3;
                        int i10 = i3;
                        int i11 = i4;
                        if (bVar.D == bVar.f1610h0 && bVar.f1623q0 == bVar.f1609g0) {
                            bVar2 = bVar;
                            if (bVar2.D == bVar2.f1610h0 && bVar2.f1623q0 == bVar2.f1609g0) {
                                it = bVar2.U.iterator();
                                while (it.hasNext()) {
                                    bVar2.f1615k0.add(it.next().h());
                                }
                            }
                            if (kVar.size() > 0) {
                                synchronized (bVar2.i1) {
                                    bVar2.i1.addAll(kVar);
                                    bVar2.i1.notifyAll();
                                }
                                kVar.clear();
                            }
                            if (kVar2.size() <= 0) {
                                synchronized (bVar2.i1) {
                                    bVar2.i1.addAll(kVar2);
                                    bVar2.i1.notifyAll();
                                }
                                kVar2.clear();
                                return;
                            }
                            return;
                        }
                        i6 = r2;
                        while (i6 < rect.right) {
                            int i12 = i10;
                            rect.top = i12;
                            int i13 = i11;
                            rect.bottom = i13;
                            rect.left = i5;
                            double[] dArr7 = dArr6;
                            dArr7[0] = -180.0d;
                            bVar.W0 = v.b.c(dArr7, bVar.W0);
                            int i14 = i5;
                            i6 = r(dArr7, rect, kVar2, i7, false, bVar.f1610h0, bVar.f1609g0, bVar.f1615k0, bVar.f1607f0, bVar.f1600b1, bVar.c1, true);
                            bVar = this;
                            i11 = i13;
                            dArr6 = dArr7;
                            i10 = i12;
                            i5 = i14;
                        }
                        bVar2 = this;
                        if (bVar2.D == bVar2.f1610h0) {
                            it = bVar2.U.iterator();
                            while (it.hasNext()) {
                            }
                        }
                        if (kVar.size() > 0) {
                        }
                        if (kVar2.size() <= 0) {
                        }
                    }
                    if (bVar.D == bVar.f1610h0) {
                        bVar2 = bVar;
                        if (bVar2.D == bVar2.f1610h0) {
                        }
                        if (kVar.size() > 0) {
                        }
                        if (kVar2.size() <= 0) {
                        }
                    }
                    i6 = r2;
                    while (i6 < rect.right) {
                    }
                    bVar2 = this;
                    if (bVar2.D == bVar2.f1610h0) {
                    }
                    if (kVar.size() > 0) {
                    }
                    if (kVar2.size() <= 0) {
                    }
                } catch (Throwable th4) {
                    th = th4;
                    throw th;
                }
                i5 = r2;
                r2 = r(dArr3, rect, kVar2, i7, false, d3, bVar3.f1609g0, bVar3.f1615k0, bVar3.f1607f0, bVar3.f1600b1, bVar3.c1, true);
                while (i5 < rect.right) {
                }
                bVar = this;
                double[] dArr62 = dArr3;
                int i102 = i3;
                int i112 = i4;
            } catch (Throwable th5) {
                th = th5;
                throw th;
            }
        }
    }

    public final int r(double[] dArr, Rect rect, k<h> kVar, int i2, boolean z2, double d2, double d3, ArrayList<h> arrayList, int i3, double d4, double d5, boolean z3) {
        int i4;
        double[] dArr2 = this.W0;
        double[] dArr3 = this.f1625s0;
        float[] fArr = this.Y0;
        double d6 = dArr2[0];
        fArr[0] = (float) (d6 * d3);
        boolean z4 = true;
        fArr[1] = ((float) (dArr2[1] * d3)) - ((float) (this.P0 / d2));
        int i5 = rect.bottom;
        double d7 = d3 * d2;
        if (z2) {
            this.f1626t0[0] = v.c.c((dArr3[0] - d6) * d7);
            this.f1626t0[1] = v.c.c((dArr3[1] - dArr2[1]) * d7);
            int c2 = v.c.c(d7 * 40003.200000000004d);
            this.f1627u0 = c2;
            int[] iArr = this.f1626t0;
            int i6 = iArr[0];
            if (i6 < 0) {
                iArr[0] = i6 + c2;
            }
        }
        int i7 = (int) (fArr[0] / 256.0f);
        int i8 = (int) (fArr[1] / 256.0f);
        int a2 = v.c.a((rect.right - rect.left) / d4) + i7;
        int[] iArr2 = n1;
        if (i3 < iArr2.length) {
            i4 = iArr2[i3];
        } else {
            int i9 = iArr2[iArr2.length - 1];
            for (int length = iArr2.length; length <= i3; length++) {
                i9 *= 2;
            }
            i4 = i9;
        }
        int i10 = i4 - 1;
        int i11 = a2 > i10 ? i10 : a2;
        int a3 = v.c.a((rect.bottom - rect.top) / d5) + i8;
        int i12 = (i10 <= 0 || a3 < i10) ? a3 : i10;
        double d8 = fArr[0] * d2;
        double d9 = (fArr[1] * d2) + this.P0;
        int i13 = rect.right;
        int i14 = i7;
        while (i14 <= i11) {
            double d10 = (rect.left + (i14 * d4)) - d8;
            int i15 = (int) d10;
            int i16 = (int) (d10 + d4);
            int i17 = i14 == i11 ? i16 : i13;
            int i18 = i8;
            while (i18 <= i12) {
                double d11 = ((rect.top + (i18 * d5)) - d9) + this.P0;
                int i19 = i18;
                int i20 = i16;
                int i21 = i15;
                int i22 = i14;
                int i23 = i12;
                h hVar = new h(z3, i14, i18, i3, i15, (int) d11, i20, (int) (d11 + d5));
                arrayList.add(hVar);
                int indexOf = kVar.indexOf(hVar);
                while (indexOf >= 0) {
                    if (hVar.f1659i == kVar.get(indexOf).f1659i) {
                        kVar.remove(indexOf);
                        indexOf--;
                    }
                    indexOf = kVar.a(hVar, indexOf + 1);
                }
                i18 = i19 + 1;
                z4 = true;
                i14 = i22;
                i16 = i20;
                i15 = i21;
                i12 = i23;
            }
            i14++;
            i13 = i17;
        }
        return i13;
    }

    public void s() {
        synchronized (this.I) {
            this.H = this.G;
            this.G = this.J;
        }
        B();
        A();
    }

    public void setAnimated(boolean z2) {
        this.T0 = z2;
    }

    public void setBlackText(boolean z2) {
    }

    public void setIndex(int i2) {
        synchronized (this.I) {
            try {
                if (i2 == this.G) {
                    B();
                    return;
                }
                int i3 = this.J;
                if (i2 <= i3) {
                    i3 = 1;
                    if (i2 < 1) {
                    }
                    this.H = this.G;
                    this.G = i2;
                    B();
                    A();
                }
                i2 = i3;
                this.H = this.G;
                this.G = i2;
                B();
                A();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void setLocation(double[] dArr) {
        double[] dArr2 = this.f1624r0;
        double d2 = dArr2[0];
        double d3 = dArr[0];
        if (d2 == d3 && dArr2[1] == dArr[1]) {
            return;
        }
        this.f1624r0 = new double[]{d3, dArr[1]};
        double[] c2 = v.b.c(dArr, this.f1625s0);
        this.f1625s0 = c2;
        float f2 = this.H0;
        if (f2 > 0.0f) {
            this.I0 = v.b.a(dArr, c2, f2);
        }
        if (r.a.isValidLocation(dArr)) {
            this.f1628v0 = new GeomagneticField((float) dArr[1], (float) dArr[0], 0.0f, System.currentTimeMillis()).getDeclination();
        }
        G();
        A();
    }

    public void setMap(GoogleMap googleMap) {
        this.f1634z0 = googleMap;
    }

    public void setMapbox(boolean z2) {
        if (this.m1) {
            return;
        }
        this.m1 = z2;
        this.O0 = getContext().getText(w.source_mapbox_static).toString();
        F();
    }

    public e t(v.d dVar, int i2) {
        e eVar;
        if (i2 < 0) {
            return null;
        }
        HashMap<v.d, e>[] hashMapArr = this.f1601c;
        if (i2 >= hashMapArr.length) {
            return null;
        }
        synchronized (hashMapArr[i2]) {
            eVar = this.f1601c[i2].get(dVar);
        }
        return eVar;
    }

    public final e u(v.d dVar, int i2) {
        e eVar;
        if (i2 < 0) {
            return null;
        }
        HashMap<v.d, e>[] hashMapArr = this.f1601c;
        if (i2 >= hashMapArr.length) {
            return null;
        }
        synchronized (hashMapArr[i2]) {
            try {
                eVar = this.f1601c[i2].get(dVar);
                if (eVar == null) {
                    eVar = new e();
                    this.f1601c[i2].put(dVar, eVar);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return eVar;
    }

    public final int v(double d2) {
        int b2 = v.c.b(1.0d / d2);
        if (b2 % 2 == 1) {
            b2--;
        }
        while (b2 > 0 && !x(b2)) {
            b2 -= 2;
        }
        if (b2 < 1) {
            return 1;
        }
        return b2;
    }

    public boolean w() {
        return this.m1;
    }

    public boolean y() {
        return false;
    }

    public void z() {
        synchronized (this.I) {
            this.H = this.G;
            this.G = 1;
        }
        B();
        A();
    }
}