/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  javax.microedition.lcdui.Canvas
 *  javax.microedition.lcdui.Display
 *  javax.microedition.lcdui.Image
 *  javax.microedition.midlet.MIDlet
 *  javax.microedition.rms.RecordStore
 *  javax.microedition.rms.RecordStoreException
 *  javax.microedition.rms.RecordStoreFullException
 *  javax.microedition.rms.RecordStoreNotFoundException
 */
import java.io.ByteArrayInputStream;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.InputStream;
import java.util.Vector;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.rms.RecordStore;
import javax.microedition.rms.RecordStoreException;
import javax.microedition.rms.RecordStoreFullException;
import javax.microedition.rms.RecordStoreNotFoundException;

/*
 * Duplicate member names - consider using --renamedupmembers true
 */
public final class lh
implements jf,
jz,
aa,
ee,
Runnable,
es {
    private volatile iv e;
    private volatile iv k;
    private volatile int m;
    private final MIDlet B;
    private final no b;
    private final lk f;
    private final Object i;
    private final Object j;
    private final hj n;
    private final lh o;
    private static boolean b;
    private static lh b;
    private static int[] b;
    private static String d;
    private static boolean d;
    private static String f;
    public static boolean A;
    public static int b;
    public static int g;
    public static int h;
    public static int i;
    public static int j;
    public static int k;
    public static int l;
    public static int n;
    public static int o;
    public static int p;
    public static int q;
    public static int r;
    public static int s;
    public static int t;
    public static int u;
    public static boolean v;
    public static boolean w;
    public static boolean x;
    public static boolean z;
    private in a;
    private gu a;
    private long f;
    private long g;
    private Thread h;
    private Vector h;
    public String c;
    public gu c;
    public px a;
    public lh a;
    public boolean a;
    public px[] a;
    public String a;
    public aa b;
    public String b;
    public es b;
    public ob d;
    public int d;
    public lh e;
    public boolean e;
    public boolean g;

    private static void a(RecordStoreException recordStoreException) {
        dd dd2;
        String string = recordStoreException.getMessage();
        int n = recordStoreException instanceof RecordStoreFullException ? -2 : -1;
        dd dd3 = dd2;
        dd3(string, n);
        throw dd3;
    }

    public int z() {
        return 39;
    }

    public void a(DataOutput dataOutput) {
        byte[] byArray = this.f.c();
        dataOutput.writeInt(byArray.length);
        dataOutput.write(byArray);
    }

    public aq a(mt mt2, String string, cq cq2, cq cq3) {
        return new aq(Display.getDisplay((MIDlet)this.B), mt2, string, cq2, cq3);
    }

    public bq a(mt mt2, String string, cq cq2, cq cq3) {
        return new bq(Display.getDisplay((MIDlet)this.B), mt2, string, cq2, cq3);
    }

    public static long c(lh lh2) {
        return lh2.f;
    }

    private static int a(String string, int n) {
        byte[] byArray = lh.b.b.g(string);
        if (byArray != null && byArray.length == 4) {
            return (byArray[0] & 0xFF) << 24 | (byArray[1] & 0xFF) << 16 | (byArray[2] & 0xFF) << 8 | byArray[3] & 0xFF;
        }
        return n;
    }

    private static void b(String string, int n) {
        lh.b.b.a(string, new byte[]{(byte)(n >>> 24), (byte)(n >>> 16), (byte)(n >>> 8), (byte)n});
    }

    public void i_() {
    }

    static {
        g = -9999;
        h = -9999;
        i = -9999;
        j = -9999;
        k = 42;
        l = 35;
        b = -9999;
        n = -9999;
        o = -9999;
        p = -9999;
        q = -9999;
        r = -9999;
        s = -9999;
        t = -9999;
        u = -9999;
        new Object();
    }

    public static boolean s() {
        return true;
    }

    public static boolean t() {
        return true;
    }

    public static boolean b() {
        return false;
    }

    public static boolean r() {
        return false;
    }

    public static boolean u() {
        return false;
    }

    public static boolean v() {
        return false;
    }

    public boolean A_() {
        return false;
    }

    public boolean z_() {
        return true;
    }

    public boolean y_() {
        return true;
    }

    public static lh a(lh lh2) {
        return lh2.a;
    }

    public void h() {
        this.a.q();
    }

    public void a() {
        this.a.ab();
    }

    public boolean a(String string, byte[] byArray) {
        return this.a.a(string, byArray);
    }

    public static long a(lh lh2, long l) {
        lh2.f = l;
        return l;
    }

    public static Thread a(lh lh2, Thread thread) {
        lh2.h = thread;
        return thread;
    }

    private static void e(String string) {
        nz.a("Jsr75Directory", string);
    }

    public String a() {
        return this.a("MIDlet-Version");
    }

    public static lh a(MIDlet mIDlet) {
        return new lh(mIDlet);
    }

    public String a(String string) {
        return this.B.getAppProperty(string);
    }

    public byte[] g(String string) {
        return this.a.a(string);
    }

    public void b(ee ee2) {
        this.h.addElement(ee2);
    }

    public void a(ee ee2) {
        this.h.addElement(ee2);
    }

    public lh(boolean bl2, boolean bl3, boolean bl4) {
        this(false);
    }

    public lh(String string, in in2) {
        this(null, string, -1);
        this.a = in2;
    }

    public lh(boolean bl2, boolean bl3) {
    }

    public lh(mo mo2, String string, String string2, String string3) {
        this.a = string;
        this.b = string2;
        this.c = string3;
    }

    public lh(boolean bl2) {
        this.a = new gu(this);
    }

    public lh(MIDlet mIDlet, boolean bl2, boolean bl3) {
        this.B = mIDlet;
    }

    public lh(MIDlet mIDlet, boolean bl2) {
        this.B = mIDlet;
    }

    public lh(lh lh2) {
        this.a = lh2;
    }

    public synchronized void s_() {
        this.e = false;
        this.j();
    }

    public void k_() {
        this.j();
    }

    public boolean k() {
        return this.e;
    }

    public static boolean b(lh lh2) {
        return lh2.g;
    }

    public aa f() {
        return this.b;
    }

    public ob h() {
        return this.d;
    }

    public px e() {
        return this.a;
    }

    public static Object a(lh lh2) {
        return lh2.i;
    }

    public gu g() {
        return this.c;
    }

    public static hj d(lh lh2) {
        return lh2.n;
    }

    public lh i() {
        return this.e;
    }

    public static lh k() {
        return b;
    }

    public static String p() {
        return d;
    }

    public static synchronized String o() {
        return lh.b.a.b;
    }

    public static String d(int n) {
        return lh.b.a.a(n);
    }

    public boolean e() {
        if (!b) {
            boolean bl2;
            try {
                Image.createImage((InputStream)oh.a("/test.jpg"));
                bl2 = true;
            }
            catch (Exception exception) {
                bl2 = false;
            }
            d = bl2;
            b = true;
        }
        return d;
    }

    public static int c(int n) {
        if (b != null) {
            if (n > 0) {
                n = Character.toLowerCase((char)n);
            }
            for (int i = 0; i < b.length; ++i) {
                if (n != b[i]) {
                    continue;
                }
                if (i != 10) {
                    if (i == 11) {
                        return l;
                    }
                    return 48 + i;
                }
                return k;
            }
        }
        return n;
    }

    public lk a() {
        lk lk2 = new lk(la.D);
        lk2.a(1, this.a);
        lk2.a(2, this.b);
        if (!ed.b(this.c)) {
            lk2.a(3, this.c);
        }
        return lk2;
    }

    public void a(ht ht2) {
        boolean bl2 = false;
        String string = null;
        if (this.c != null) {
            string = this.c;
            bl2 = this.d == 0 || this.d == 1;
            if (this.f == 0L) {
                this.f = System.currentTimeMillis() + (long)3000;
                this.g = System.currentTimeMillis() + (long)10000;
            }
        } else if (this.b == null) {
            if (this.a != null) {
                string = this.a;
                bl2 = false;
            }
        } else {
            bl2 = false;
            string = this.b;
        }
        if (string != null) {
            ps.a().a(ht2, string, bl2);
        }
    }

    public void a(String string, int n) {
        block2: {
            block3: {
                if (ed.b(string)) break block2;
                if (n != 3 && n != 1) break block3;
                if (this.h.contains(string)) break block2;
                this.h.addElement(string);
            }
            this.f = 0L;
            this.c = string;
            this.d = n;
            this.e = false;
        }
    }

    public void a(String string) {
        if (ed.b(string)) {
            string = null;
        }
        this.a = string;
    }

    public void b(String string) {
        if (ed.b(string)) {
            string = null;
        }
        this.b = string;
    }

    public synchronized void f(String string) {
        try {
            RecordStore.deleteRecordStore((String)string);
            return;
        }
        catch (RecordStoreException recordStoreException) {
            lh.a(recordStoreException);
            return;
        }
        catch (RecordStoreNotFoundException recordStoreNotFoundException) {
            return;
        }
    }

    public int b(String string, int n) {
        if ((string = this.a(string)) != null) {
            try {
                return Integer.parseInt(string);
            }
            catch (NumberFormatException numberFormatException) {}
        }
        return n;
    }

    public boolean a(String string, boolean bl2) {
        if ((string = this.a(string)) != null) {
            if (!"true".equals(string)) {
                if ("false".equals(string)) {
                    return false;
                }
            } else {
                return true;
            }
        }
        return bl2;
    }

    public boolean a(Object object, int n) {
        return n == lh.n || this.b(object, n) == 8;
    }

    public final void a(boolean bl2) {
        if (bl2) {
            px cfr_ignored_0 = this.a.a;
        }
    }

    public int c() {
        px px2 = this.p();
        if (px2 != null) {
            return px2.e;
        }
        return -1;
    }

    public int e() {
        px px2 = this.p();
        if (px2 != null) {
            return px2.f;
        }
        return -1;
    }

    public iv m() {
        px px2 = this.p();
        if (px2 != null) {
            return px2.d;
        }
        return null;
    }

    public String d() {
        px px2 = this.p();
        if (px2 != null) {
            return px2.b();
        }
        return "none";
    }

    public int f() {
        px px2 = this.p();
        if (px2 != null) {
            return px2.i();
        }
        return 99999;
    }

    public boolean i() {
        px px2 = this.p();
        return px2 != null && px2.j();
    }

    public boolean l() {
        px px2 = this.p();
        return px2 != null && px2.e();
    }

    public boolean g() {
        return this.d == 1;
    }

    public boolean h() {
        return this.d == 2;
    }

    public boolean m() {
        return this.p() != null;
    }

    public boolean f() {
        return this.d == 0;
    }

    public boolean a() {
        return this.c != null;
    }

    public boolean c() {
        if (this.c != null && this.f != 0L && (this.e && System.currentTimeMillis() > this.f || !this.e && System.currentTimeMillis() > this.g)) {
            this.c = null;
            this.g = 0L;
            this.f = 0L;
            return true;
        }
        return false;
    }

    public void b() {
        if (this.f > 0L) {
            this.e = true;
            this.c();
        }
    }

    public synchronized void j_() {
        this.e = true;
        this.d = lh.a("LOCATION_REPORTER_PRIVACY_SETTING", 0);
        this.i();
    }

    public synchronized void h_() {
        if (!iu.g()) {
            this.j();
            return;
        }
        this.e = true;
        this.d = lh.a("LOCATION_REPORTER_PRIVACY_SETTING", 0);
        this.i();
    }

    public int b(byte[] byArray, String string) {
        try {
            return this.a(byArray, string);
        }
        catch (dd dd2) {
            int n = dd2.a;
            me.b(string, dd2);
            return n;
        }
    }

    public boolean b(String string) {
        try {
            this.f(string);
            return true;
        }
        catch (dd dd2) {
            me.b(string, dd2);
            return false;
        }
    }

    private void j() {
        Object object = this.i;
        synchronized (object) {
            this.g = false;
            this.i.notifyAll();
            return;
        }
    }

    private void i() {
        Object object = this.i;
        synchronized (object) {
            this.g = true;
            if (this.h == null) {
                this.h = new lf(this, this);
                this.h.start();
            }
            this.i.notifyAll();
            return;
        }
    }

    public lh(no no2, String string, int n) {
        this.f = new lk(la.aU);
        this.b = no2;
        this.m = n;
        this.a = string;
        n = string.indexOf(35);
        if (n != -1) {
            this.c = string.substring(n + 1);
            string = string.substring(0, n);
        }
        this.f.b(4, string);
    }

    public lh() {
        this.h = new Vector();
    }

    public lh(gd gd2, hj hj2, lh lh2) {
        this.i = new Object();
        this.j = new Object();
        this.h = new Vector();
        this.n = hj2;
        this.o = lh2;
    }

    public synchronized String[] f(String string) {
        Vector<String> vector = new Vector<String>();
        String[] stringArray = RecordStore.listRecordStores();
        if (stringArray != null) {
            for (int i = 0; i < stringArray.length; ++i) {
                String string2 = stringArray[i];
                if (!string2.startsWith(string)) continue;
                vector.addElement(string2);
            }
        }
        Object[] objectArray = new String[vector.size()];
        vector.copyInto(objectArray);
        return objectArray;
    }

    public synchronized void c(String string) {
        String[] stringArray = RecordStore.listRecordStores();
        if (stringArray != null) {
            for (int i = 0; i < stringArray.length; ++i) {
                String string2 = stringArray[i];
                if (!string2.startsWith(string)) continue;
                this.b(string2);
            }
        }
    }

    private px p() {
        px px2 = null;
        for (int i = 0; i < this.a.length; ++i) {
            px px3 = this.a[i];
            boolean bl2 = px3 != null ? (px2 != null ? (px3.b <= px2.b + (long)11000 ? px3.i() < px2.i() : true) : px3.g) : false;
            if (!bl2) continue;
            px2 = this.a[i];
        }
        return px2;
    }

    public fy a() {
        if (gu.g().c()) {
            for (int i = 0; i < this.a.length; ++i) {
                px px2 = this.a[i];
                if (!(px2 instanceof fy)) {
                    continue;
                }
                return (fy)px2;
            }
        }
        return null;
    }

    public boolean n() {
        px px2 = this.p();
        if (px2 != null) {
            if (!px2.j()) {
                for (int i = 0; i < this.a.length; ++i) {
                    if (!this.a[i].c) {
                        continue;
                    }
                    return true;
                }
            }
        } else {
            return false;
        }
        return px2.c;
    }

    public boolean o() {
        px px2 = this.p();
        if (px2 != null) {
            if (px2.j()) {
                return px2.f();
            }
            for (int i = 0; i < this.a.length; ++i) {
                if (!this.a[i].f()) {
                    continue;
                }
                return true;
            }
        }
        return false;
    }

    public synchronized void f() {
        this.a = false;
        if (!this.e) {
            for (int i = 0; i < this.a.length; ++i) {
                this.a[i].l();
            }
        } else {
            this.e = false;
            new Thread(this).start();
        }
    }

    public void run() {
        try {
            Thread.sleep(2000);
        }
        catch (InterruptedException interruptedException) {}
        synchronized (this) {
            if (this.a) {
                this.e = true;
                return;
            }
        }
        synchronized (this) {
            if (!this.a) {
                for (int i = 0; i < this.a.length; ++i) {
                    this.a[i].l();
                }
            }
            return;
        }
    }

    public synchronized void g() {
        this.a = true;
        for (int i = 0; i < this.a.length; ++i) {
            this.a[i].k();
        }
    }

    public synchronized void l() {
        this.a = true;
        for (int i = 0; i < this.a.length; ++i) {
            if (this.a[i].d()) {
                this.a[i].k();
                continue;
            }
            this.a = false;
        }
    }

    public void e(boolean bl2) {
        if (bl2) {
            ck.e().a(new ht(0, this.n, new ko(this.n, this.o)));
        }
        if (this.d != 0) {
            this.d = 0;
            lh.b("LOCATION_REPORTER_PRIVACY_SETTING", this.d);
            this.b.e(bl2);
            this.a(true, true);
        }
    }

    public void b(boolean bl2) {
        if (bl2) {
            ck.e().a(new ht(2, this.n, new ko(this.n, this.o)));
        }
        if (this.d != 2) {
            this.d = 2;
            lh.b("LOCATION_REPORTER_PRIVACY_SETTING", this.d);
            this.b.b(bl2);
        }
    }

    /*
     * WARNING - void declaration
     */
    public void a(iv iv2, Long l, boolean bl2) {
        if (bl2) {
            ck.e().a(new ht(1, this.n, new ko(this.n, this.o)));
        }
        if (this.d != 1) {
            this.d = 1;
            lh.b("LOCATION_REPORTER_PRIVACY_SETTING", this.d);
        }
        this.b.a(iv2, l, bl2);
        if (iv2 != null) {
            void var3_6;
            if (l != null) {
                int n = (int)l.longValue();
            } else {
                boolean bl3 = false;
            }
            this.a(iv2, "manual", (int)var3_6, true, true, true);
        }
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public int b(Object object, int n) {
        if (v) {
            if (n == r) return 1;
            if (n == s) return 6;
            if (n == t) return 2;
            if (n == u) {
                return 5;
            }
        }
        if (n == h) return 0;
        if (n == j) return 0;
        int n2 = n >= 48 && n <= 57 ? n - 48 : -1;
        if (n2 != -1) return 0;
        n2 = 0;
        if (n2 != 0) return 0;
        if (n == lh.n) {
            return 8;
        }
        try {
            return ((Canvas)object).getGameAction(n);
        }
        catch (IllegalArgumentException illegalArgumentException) {}
        return 0;
    }

    private static int[] a(int n, String string) {
        if (string != null && string.length() != 0) {
            try {
                int n2;
                int[] nArray = new int[n];
                int n3 = 0;
                int n4 = 0;
                while ((n2 = string.indexOf(",", n3)) != -1) {
                    nArray[n4] = Integer.parseInt(string.substring(n3, n2));
                    n3 = n2 + 1;
                    ++n4;
                }
                nArray[n4] = Integer.parseInt(string.substring(n3));
                if (n4 + 1 != n) {
                    return null;
                }
                return nArray;
            }
            catch (ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException) {
                me.a("CONFIG", arrayIndexOutOfBoundsException);
                return null;
            }
            catch (NumberFormatException numberFormatException) {
                me.a("CONFIG", numberFormatException);
            }
        }
        return null;
    }

    public boolean d() {
        if (System.getProperty("microedition.io.file.FileConnection.version") != null && fz.a(this.B)) {
            aa aa2 = this.b;
            String string = nz.b("Jsr75Directory");
            if (!"JSR 75 NOT SUPPORTED".equals(string)) {
                try {
                    int n = string != null ? 0 : 1;
                    if (n != 0) {
                        string = fz.a(this.B, "GoogleAppsData");
                        if (string == null) {
                            lh.e("JSR 75 NOT SUPPORTED");
                            return false;
                        }
                        lh.e(string);
                    }
                    this.b = new fz(string, this.b);
                    this.b.a(new byte[]{1, 2, 3}, "TEST_STORE");
                    this.b.d("TEST_STORE");
                    this.b.f("TEST_STORE");
                    if (fz.b(this.B) != 1) {
                        this.b = aa2;
                        lh.e("JSR 75 NOT SUPPORTED");
                    }
                    if (n != 0) {
                        String[] stringArray = aa2.f("");
                        for (n = 0; n < stringArray.length; ++n) {
                            string = stringArray[n];
                            if (string.equals("Preferences")) continue;
                            this.b.a(aa2.d(string), string);
                            aa2.b(string);
                        }
                    }
                    return true;
                }
                catch (SecurityException securityException) {
                    me.b("Jsr75 Permission Denied", securityException);
                    lh.e("JSR 75 NOT SUPPORTED");
                    this.b = aa2;
                    return false;
                }
                catch (dd dd2) {
                    me.b("Jsr75 Write Error", dd2);
                    lh.e("JSR 75 NOT SUPPORTED");
                    this.b = aa2;
                }
            }
        }
        return false;
    }

    /*
     * WARNING - void declaration
     */
    private lh(MIDlet mIDlet) {
        this(false, false);
        void var2_9;
        void var2_6;
        this.B = mIDlet;
        b = this;
        h = -6;
        j = -7;
        "j2me".equals(System.getProperty("microedition.platform"));
        this.a = gu.a(this.a("DownloadLocale"));
        String string = System.getProperty("microedition.platform");
        string = string != null ? string.toLowerCase() : "";
        d = this.a("DistributionChannel");
        if (d == null) {
            d = "unknown";
        }
        if ((f = this.a("Carrier")) == null) {
            f = "unknown";
        }
        g = this.b("BackKey", g);
        h = this.b("LeftSoftKey", h);
        i = this.b("MiddleSoftKey", i);
        j = this.b("RightSoftKey", j);
        x = this.a("ReverseSoftkeys", string.startsWith("nokia"));
        this.a("SoftkeysOnSideInLandscape", false);
        z = this.a("QwertyKeyboard", false);
        if (x) {
            int bl2 = h;
            h = j;
            j = bl2;
        }
        b = this.b("MenuKey", b);
        n = this.b("SelectKey", n);
        o = this.b("TalkKey", o);
        p = this.b("VoiceSearchKey", p);
        q = this.b("ClearKey", q);
        if (!string.startsWith("nokia") && !string.startsWith("sony")) {
            boolean bl2 = true;
        } else {
            boolean bl3 = false;
        }
        w = this.a("UseNativeCommands", (boolean)var2_6);
        A = this.a("UseNativeMenus", false);
        this.b("SoftkeyHeight", 0);
        b = lh.a(12, this.a("AltNumberKeys"));
        int[] nArray = lh.a(4, this.a("AltArrowKeys"));
        if (nArray != null) {
            v = true;
            r = nArray[0];
            t = nArray[1];
            s = nArray[2];
            u = nArray[3];
        }
        if (A && !w) {
            w = true;
        }
        if (Display.getDisplay((MIDlet)mIDlet).numAlphaLevels() > 2) {
            boolean bl4 = true;
        } else {
            boolean bl5 = false;
        }
        this.e = var2_9;
        this.b = new lh(false, false, false);
        this.c = new gu(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
        this.d = new mg(new ht());
        this.a = new px();
        this.e = new lh(this.B, false);
        this.a = new lh(this.B, false, false);
    }

    public lh(boolean bl2, String string) {
        this.h = new Vector(2);
        this.a = new px[0];
        this.e = true;
        this.a = false;
        this.g = false;
        bl2 = bl2 || "foo".equals(ck.e());
        if (bl2) {
            Vector<px> vector = new Vector<px>();
            if (string != null) {
                vector.addElement(new ge(this, string));
            }
            if (gu.g().c()) {
                if (!f.equalsIgnoreCase("sprint")) {
                    vector.addElement(new fy(this));
                } else {
                    vector.addElement(new eo(this));
                }
                me.a((short)58, "jsr179", "c");
            }
            if (b.a("UseCellid", true)) {
                vector.addElement(new mv(this));
            }
            if (vector.size() > 0) {
                this.a = new px[vector.size()];
                vector.copyInto(this.a);
            }
        }
    }

    private void a(iv iv2, String string, int n, boolean bl2, boolean bl3, boolean bl4) {
        long l = System.currentTimeMillis();
        Object object = this.i;
        synchronized (object) {
            this.f = l;
        }
        ck.e().a((jf)new cw(iv2, string, n, bl2, bl3, bl4, this, this.n, new lh(this)));
    }

    public void a(boolean bl2, boolean bl3) {
        int n;
        String string;
        iv iv2;
        Object object;
        block8: {
            object = this.j;
            synchronized (object) {
                if (this.k != null) {
                    iv2 = this.k;
                    string = this.a;
                    n = this.m;
                    break block8;
                }
                return;
            }
        }
        if (this.e && this.d == 0) {
            this.a(iv2, string, n, this.g(), bl2, bl3);
            return;
        }
        object = this.i;
        synchronized (object) {
            this.f = System.currentTimeMillis();
            ck.e().a(new br(this, this.n, false));
            return;
        }
    }

    public void a(int n, lh lh2) {
        int n2 = this.h.size();
        for (int i = 0; i < n2; ++i) {
            ((ee)this.h.elementAt(i)).a(n, lh2);
        }
    }

    public void a(int n, px object) {
        px px2 = this.p();
        if (px2 != null && px2 != object) {
            return;
        }
        object = this.h;
        synchronized (object) {
            for (int i = 0; i < this.h.size(); ++i) {
                ((ee)this.h.elementAt(i)).a(n, this);
            }
            return;
        }
    }

    public void a(iv iv2, px object) {
        if (this.p() == object) {
            object = this.h;
            synchronized (object) {
                for (int i = 0; i < this.h.size(); ++i) {
                    ((ee)this.h.elementAt(i)).a(iv2, this);
                }
                return;
            }
        }
    }

    public void a(iv iv2, lh lh2) {
        int n;
        int n2 = this.h.size();
        for (n = 0; n < n2; ++n) {
            ((ee)this.h.elementAt(n)).a(iv2, lh2);
        }
        if (this.e && this.d == 0) {
            long l = System.currentTimeMillis();
            Object object = this.j;
            synchronized (object) {
                this.k = lh2.m();
                this.a = lh2.d();
                this.m = lh2.f();
            }
            if (l - this.g >= 60000L) {
                long l2 = gu.a(true);
                long l3 = gu.a(false);
                if (l2 != (long)-1 && l3 != (long)-1 && l - this.g >= l2) {
                    iv2 = lh2.m();
                    l2 = lh2.f();
                    iv iv3 = this.e;
                    if (iv3 != null) {
                        if (iv2 != null) {
                            if (l2 >= 0L && l2 != 99999L) {
                                if (l2 < (long)50) {
                                    l2 = 50;
                                }
                                n = iv3.b(iv2) <= l2 * l2 ? 0 : 1;
                            } else {
                                n = 0;
                            }
                        } else {
                            n = 0;
                        }
                    } else {
                        n = 0;
                    }
                    if (n != 0 || l - this.g >= l3) {
                        this.g = l;
                        this.e = lh2.m();
                        this.a(lh2.m(), lh2.d(), lh2.f(), false, true, false);
                    }
                }
            }
        }
    }

    public boolean a(DataInput object) {
        lk lk2 = ar.a(la.aV, (DataInput)object);
        int n = lk2.i(1);
        for (int i = 0; i < n; ++i) {
            String string;
            lk lk3 = lk2.e(1, i);
            String string2 = lk3.g(2);
            byte[] byArray = lk3.c(6);
            boolean bl2 = lk3.d(3) != 200;
            if (i == 0 && this.a != null) {
                object = this.a;
                string = this.a;
                Object object2 = !bl2 ? byArray : null;
                object.a(string, (byte[])object2);
            }
            if (this.b == null || (string = lk3.g(7)) == null) continue;
            string = string.toLowerCase();
            if (this.m == 1 && i == 0 && string.indexOf("html") != -1) {
                this.b.a(new ByteArrayInputStream(byArray), "UTF-8");
                if (this.c == null) {
                    this.b.F.d(2);
                    continue;
                }
                this.b.b(this.c);
                continue;
            }
            if (bl2) continue;
            if (!string.equals("text/css")) {
                if (string.startsWith("image/")) {
                    this.b.a(string2, lh.b.c.a(byArray, 0, byArray.length));
                    continue;
                }
                this.b.a(string2, byArray);
                continue;
            }
            this.b.a(string2, (Object)new String(byArray, "UTF-8"));
        }
        return true;
    }

    /*
     * Unable to fully structure code
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public synchronized int a(byte[] var1_1, String var2_2) {
        var6_3 = -1;
        if (var1_1 == null) {
            var1_1 = new byte[]{};
        }
        this.f(var2_2);
        try {
            var4_7 = RecordStore.openRecordStore((String)var2_2, (boolean)true);
            try {
                var4_7.addRecord(var1_1, 0, var1_1.length);
                var5_8 = var4_7.getSize();
                ** GOTO lbl23
            }
            catch (Throwable var3_4) {}
            try {
                ** try [egrp 3[TRYBLOCK] [1 : 81->100)] { 
lbl15:
                // 1 sources

            }
            catch (Throwable var3_5) {
                if (var6_3 < 0) {
                    this.b(var2_2);
                }
                throw var3_5;
            }
            {
                var4_7.closeRecordStore();
                throw var3_4;
lbl23:
                // 1 sources

                var6_3 = var5_8;
                var4_7.closeRecordStore();
            }
            if (var5_8 < 0) {
                this.b(var2_2);
            }
            return var5_8;
        }
        catch (RecordStoreException var7_9) {
            lh.a(var7_9);
            return var6_3;
        }
lbl32:
        // 1 sources

        catch (OutOfMemoryError var3_6) {
            throw var3_6;
        }
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public int e(String string) {
        int n = -1;
        boolean bl2 = true;
        try {
            int n2;
            RecordStore recordStore = RecordStore.openRecordStore((String)string, (boolean)false);
            try {
                n2 = recordStore.getNumRecords() <= 0 ? -1 : recordStore.getRecordSize(1);
            }
            catch (Throwable throwable) {}
            recordStore.closeRecordStore();
            throw throwable;
            n = n2;
            recordStore.closeRecordStore();
        }
        catch (RecordStoreNotFoundException recordStoreNotFoundException) {
            bl2 = false;
        }
        catch (RecordStoreException recordStoreException) {
            n = -1;
            me.b(string, recordStoreException);
        }
        if (n == -1 && bl2) {
            this.b(string);
        }
        return n;
    }

    /*
     * Unable to fully structure code
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public synchronized byte[] d(String var1_1) {
        var2_2 = null;
        var6_3 = true;
        {
            var3_6 = RecordStore.openRecordStore((String)var1_1, (boolean)false);
            try {
                var5_7 = var3_6.getNumRecords() > 0 ? var3_6.getRecord(1) : null;
            }
            catch (Throwable var4_5) {}
            var3_6.closeRecordStore();
            throw var4_5;
            ** try [egrp 0[TRYBLOCK] [2, 1 : 26->52)] { 
lbl10:
            // 1 sources

            var2_2 = var5_7;
            var3_6.closeRecordStore();
        }
lbl13:
        // 1 sources

        catch (RecordStoreException var4_4) {
            var2_2 = null;
            me.b(var1_1, var4_4);
        }
lbl17:
        // 1 sources

        catch (RecordStoreNotFoundException v0) {
            var6_3 = false;
        }
        if (var2_2 == null && var6_3) {
            this.b(var1_1);
        }
        return var2_2;
    }
}

