package com.google.android.m4b.maps.bu;

import android.content.Context;
import com.google.android.m4b.maps.ac.a;
import com.google.android.m4b.maps.ac.c;
import com.google.android.m4b.maps.ak.h;
import com.google.android.m4b.maps.ak.i;
import com.google.common.annotations.VisibleForTesting;
import java.io.DataInput;
import java.io.DataOutput;

final class bl
{
  private static bl a;
  private static final Object b = new Object();
  private final i c;
  private final b d;
  private boolean e;

  @VisibleForTesting
  private bl(i parami, b paramb)
  {
    this.c = parami;
    this.d = paramb;
  }

  static bl a(Context paramContext)
  {
    synchronized (b)
    {
      if (a == null)
        a = new bl(h.a(), new b(paramContext.getApplicationContext(), "com.google.android.m4b.maps._m_u"));
      return a;
    }
  }

  private void a()
  {
    try
    {
      if (!this.e)
      {
        this.e = true;
        this.c.c(new a());
      }
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  @VisibleForTesting
  static void a(a parama, int paramInt)
  {
    int i = Math.min(paramInt, parama.k(1));
    for (int j = 0; j < i; j++)
      parama.e(1, 0);
  }

  final void a(int paramInt)
  {
    try
    {
      a locala1 = this.d.a(com.google.android.m4b.maps.cl.b.a);
      if (locala1 == null)
        locala1 = new a(com.google.android.m4b.maps.cl.b.a);
      a locala2 = new a(com.google.android.m4b.maps.cl.b.b);
      locala2.a(1, 1);
      locala1.a(1, locala2);
      this.d.a(locala1);
      a();
      return;
    }
    finally
    {
    }
  }

  final class a extends com.google.android.m4b.maps.ak.b
  {
    private int a;

    a()
    {
    }

    public final void a(DataOutput paramDataOutput)
    {
      synchronized (bl.this)
      {
        a locala = bl.a(bl.this).a(com.google.android.m4b.maps.cl.b.a);
        this.a = locala.k(1);
        c.a(paramDataOutput, locala);
        return;
      }
    }

    public final boolean a(DataInput paramDataInput)
    {
      switch (c.a(com.google.android.m4b.maps.cl.b.c, paramDataInput).d(1))
      {
      case 0:
      default:
        return true;
      case 1:
        bx.a(6, "This application has been blocked by the Google Maps API. This might be because of an incorrectly registered key.");
        bl.b(bl.this).j();
        return true;
      case 2:
      }
      bx.a(6, "This application has exceeded its quota for the Google Maps API.");
      bl.b(bl.this).j();
      return true;
    }

    public final void g()
    {
      synchronized (bl.this)
      {
        a locala = bl.a(bl.this).a(com.google.android.m4b.maps.cl.b.a);
        bl.a(locala, this.a);
        bl.a(bl.this).a(locala);
        this.a = 0;
        bl.a(bl.this, false);
        return;
      }
    }

    public final void h()
    {
      synchronized (bl.this)
      {
        this.a = 0;
        bl.a(bl.this, false);
        return;
      }
    }

    public final int i()
    {
      return 147;
    }
  }

  public static class b
  {
    private final String a;
    private final Context b;

    public b(Context paramContext, String paramString)
    {
      this.b = paramContext;
      this.a = paramString;
    }

    // ERROR //
    public a a(com.google.android.m4b.maps.ac.b paramb)
    {
      // Byte code:
      //   0: aconst_null
      //   1: astore_2
      //   2: aload_0
      //   3: monitorenter
      //   4: aload_0
      //   5: getfield 15	com/google/android/m4b/maps/bu/bl$b:b	Landroid/content/Context;
      //   8: aload_0
      //   9: getfield 17	com/google/android/m4b/maps/bu/bl$b:a	Ljava/lang/String;
      //   12: invokevirtual 26	android/content/Context:openFileInput	(Ljava/lang/String;)Ljava/io/FileInputStream;
      //   15: astore 9
      //   17: aload 9
      //   19: astore 4
      //   21: aconst_null
      //   22: astore_2
      //   23: aload 4
      //   25: ifnull +27 -> 52
      //   28: new 28	com/google/android/m4b/maps/ac/a
      //   31: dup
      //   32: aload_1
      //   33: invokespecial 31	com/google/android/m4b/maps/ac/a:<init>	(Lcom/google/android/m4b/maps/ac/b;)V
      //   36: astore 10
      //   38: aload 10
      //   40: aload 4
      //   42: invokestatic 36	com/google/android/m4b/maps/aa/g:a	(Ljava/io/InputStream;)[B
      //   45: invokevirtual 39	com/google/android/m4b/maps/ac/a:a	([B)Lcom/google/android/m4b/maps/ac/a;
      //   48: pop
      //   49: aload 10
      //   51: astore_2
      //   52: aload 4
      //   54: invokestatic 42	com/google/android/m4b/maps/aa/g:b	(Ljava/io/InputStream;)V
      //   57: aload_0
      //   58: monitorexit
      //   59: aload_2
      //   60: areturn
      //   61: astore 7
      //   63: aconst_null
      //   64: astore 4
      //   66: aload_0
      //   67: getfield 15	com/google/android/m4b/maps/bu/bl$b:b	Landroid/content/Context;
      //   70: aload_0
      //   71: getfield 17	com/google/android/m4b/maps/bu/bl$b:a	Ljava/lang/String;
      //   74: invokevirtual 46	android/content/Context:deleteFile	(Ljava/lang/String;)Z
      //   77: pop
      //   78: aload 4
      //   80: invokestatic 42	com/google/android/m4b/maps/aa/g:b	(Ljava/io/InputStream;)V
      //   83: goto -26 -> 57
      //   86: astore 6
      //   88: aload_0
      //   89: monitorexit
      //   90: aload 6
      //   92: athrow
      //   93: astore_3
      //   94: aconst_null
      //   95: astore 4
      //   97: aload_3
      //   98: astore 5
      //   100: aload 4
      //   102: invokestatic 42	com/google/android/m4b/maps/aa/g:b	(Ljava/io/InputStream;)V
      //   105: aload 5
      //   107: athrow
      //   108: astore 5
      //   110: goto -10 -> 100
      //   113: astore 13
      //   115: aconst_null
      //   116: astore_2
      //   117: goto -51 -> 66
      //   120: astore 11
      //   122: aload 10
      //   124: astore_2
      //   125: goto -59 -> 66
      //
      // Exception table:
      //   from	to	target	type
      //   4	17	61	java/io/IOException
      //   52	57	86	finally
      //   78	83	86	finally
      //   100	108	86	finally
      //   4	17	93	finally
      //   28	38	108	finally
      //   38	49	108	finally
      //   66	78	108	finally
      //   28	38	113	java/io/IOException
      //   38	49	120	java/io/IOException
    }

    // ERROR //
    public void a(a parama)
    {
      // Byte code:
      //   0: aload_0
      //   1: monitorenter
      //   2: aload_1
      //   3: ifnonnull +18 -> 21
      //   6: aload_0
      //   7: getfield 15	com/google/android/m4b/maps/bu/bl$b:b	Landroid/content/Context;
      //   10: aload_0
      //   11: getfield 17	com/google/android/m4b/maps/bu/bl$b:a	Ljava/lang/String;
      //   14: invokevirtual 46	android/content/Context:deleteFile	(Ljava/lang/String;)Z
      //   17: pop
      //   18: aload_0
      //   19: monitorexit
      //   20: return
      //   21: aconst_null
      //   22: astore_2
      //   23: aload_0
      //   24: getfield 15	com/google/android/m4b/maps/bu/bl$b:b	Landroid/content/Context;
      //   27: aload_0
      //   28: getfield 17	com/google/android/m4b/maps/bu/bl$b:a	Ljava/lang/String;
      //   31: iconst_0
      //   32: invokevirtual 51	android/content/Context:openFileOutput	(Ljava/lang/String;I)Ljava/io/FileOutputStream;
      //   35: astore 10
      //   37: aload 10
      //   39: astore_2
      //   40: aload_2
      //   41: aload_1
      //   42: invokevirtual 55	com/google/android/m4b/maps/ac/a:d	()[B
      //   45: invokevirtual 61	java/io/FileOutputStream:write	([B)V
      //   48: aload_2
      //   49: invokestatic 64	com/google/android/m4b/maps/aa/g:a	(Ljava/io/OutputStream;)V
      //   52: goto -34 -> 18
      //   55: astore 6
      //   57: aload_0
      //   58: monitorexit
      //   59: aload 6
      //   61: athrow
      //   62: astore 7
      //   64: aload_0
      //   65: getfield 15	com/google/android/m4b/maps/bu/bl$b:b	Landroid/content/Context;
      //   68: aload_0
      //   69: getfield 17	com/google/android/m4b/maps/bu/bl$b:a	Ljava/lang/String;
      //   72: invokevirtual 46	android/content/Context:deleteFile	(Ljava/lang/String;)Z
      //   75: pop
      //   76: aload_2
      //   77: invokestatic 64	com/google/android/m4b/maps/aa/g:a	(Ljava/io/OutputStream;)V
      //   80: goto -62 -> 18
      //   83: aload 5
      //   85: invokestatic 64	com/google/android/m4b/maps/aa/g:a	(Ljava/io/OutputStream;)V
      //   88: aload 4
      //   90: athrow
      //   91: astore 8
      //   93: aload_2
      //   94: astore 5
      //   96: aload 8
      //   98: astore 4
      //   100: goto -17 -> 83
      //   103: astore_3
      //   104: aload_3
      //   105: astore 4
      //   107: aconst_null
      //   108: astore 5
      //   110: goto -27 -> 83
      //
      // Exception table:
      //   from	to	target	type
      //   6	18	55	finally
      //   48	52	55	finally
      //   76	80	55	finally
      //   83	91	55	finally
      //   23	37	62	java/io/IOException
      //   40	48	62	java/io/IOException
      //   40	48	91	finally
      //   64	76	91	finally
      //   23	37	103	finally
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bu.bl
 * JD-Core Version:    0.6.2
 */