package com.google.android.m4b.maps.bg;

import com.google.android.m4b.maps.ac.a;
import com.google.android.m4b.maps.al.d;
import com.google.android.m4b.maps.at.a.a;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Locale;

public final class b
{
  private static final Locale a = Locale.ENGLISH;
  private final int b = 512;
  private final e c;
  private final com.google.android.m4b.maps.z.b d;
  private boolean e;

  private b(int paramInt, File paramFile, com.google.android.m4b.maps.z.b paramb)
  {
    this.d = paramb;
    this.d.c();
    a.a locala = new a.a(paramFile);
    try
    {
      e locale2 = e.a("r", locala, null);
      localObject = locale2;
      if (localObject != null)
      {
        this.d.c();
        this.e = true;
      }
      this.c = ((e)localObject);
      return;
    }
    catch (IOException localIOException1)
    {
      while (true)
        try
        {
          e locale1 = e.a("r", this.b, 0, a, locala, null);
          localObject = locale1;
        }
        catch (IOException localIOException2)
        {
          d.a("DiskResourceCache", localIOException2);
          Object localObject = null;
        }
    }
  }

  public static b a(File paramFile)
  {
    return new b(512, paramFile, com.google.android.m4b.maps.ak.e.e().b());
  }

  // ERROR //
  public final com.google.android.m4b.maps.bi.a a(String paramString)
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_0
    //   3: getfield 52	com/google/android/m4b/maps/bg/b:e	Z
    //   6: istore_3
    //   7: aconst_null
    //   8: astore 4
    //   10: iload_3
    //   11: ifne +8 -> 19
    //   14: aload_0
    //   15: monitorexit
    //   16: aload 4
    //   18: areturn
    //   19: aload_0
    //   20: getfield 54	com/google/android/m4b/maps/bg/b:c	Lcom/google/android/m4b/maps/bg/e;
    //   23: aload_1
    //   24: invokestatic 79	com/google/android/m4b/maps/al/d:a	(Ljava/lang/String;)J
    //   27: aconst_null
    //   28: invokevirtual 82	com/google/android/m4b/maps/bg/e:a	(JLjava/lang/String;)[B
    //   31: astore 5
    //   33: aconst_null
    //   34: astore 4
    //   36: aload 5
    //   38: ifnull -24 -> 14
    //   41: aload 5
    //   43: arraylength
    //   44: istore 6
    //   46: aconst_null
    //   47: astore 4
    //   49: iload 6
    //   51: bipush 9
    //   53: if_icmple -39 -> 14
    //   56: aload 5
    //   58: iconst_0
    //   59: baload
    //   60: istore 7
    //   62: aconst_null
    //   63: astore 4
    //   65: iload 7
    //   67: iconst_1
    //   68: if_icmpne -54 -> 14
    //   71: aload 5
    //   73: iconst_1
    //   74: invokestatic 85	com/google/android/m4b/maps/bg/e:c	([BI)J
    //   77: lstore 8
    //   79: new 87	com/google/android/m4b/maps/ac/a
    //   82: dup
    //   83: getstatic 92	com/google/android/m4b/maps/cl/x:b	Lcom/google/android/m4b/maps/ac/b;
    //   86: invokespecial 95	com/google/android/m4b/maps/ac/a:<init>	(Lcom/google/android/m4b/maps/ac/b;)V
    //   89: astore 10
    //   91: aload 10
    //   93: new 97	java/io/ByteArrayInputStream
    //   96: dup
    //   97: aload 5
    //   99: bipush 9
    //   101: bipush 247
    //   103: aload 5
    //   105: arraylength
    //   106: iadd
    //   107: invokespecial 100	java/io/ByteArrayInputStream:<init>	([BII)V
    //   110: invokevirtual 103	com/google/android/m4b/maps/ac/a:a	(Ljava/io/InputStream;)Lcom/google/android/m4b/maps/ac/a;
    //   113: pop
    //   114: aload_1
    //   115: aload 10
    //   117: iconst_2
    //   118: invokevirtual 107	com/google/android/m4b/maps/ac/a:h	(I)Ljava/lang/String;
    //   121: invokevirtual 113	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   124: istore 13
    //   126: aconst_null
    //   127: astore 4
    //   129: iload 13
    //   131: ifeq -117 -> 14
    //   134: new 115	com/google/android/m4b/maps/bi/a
    //   137: dup
    //   138: invokespecial 116	com/google/android/m4b/maps/bi/a:<init>	()V
    //   141: astore 4
    //   143: aload 4
    //   145: iconst_1
    //   146: invokevirtual 119	com/google/android/m4b/maps/bi/a:a	(Z)V
    //   149: aload 4
    //   151: aload 10
    //   153: invokevirtual 122	com/google/android/m4b/maps/bi/a:a	(Lcom/google/android/m4b/maps/ac/a;)Z
    //   156: pop
    //   157: aload 4
    //   159: lload 8
    //   161: invokevirtual 125	com/google/android/m4b/maps/bi/a:a	(J)V
    //   164: goto -150 -> 14
    //   167: astore_2
    //   168: aload_0
    //   169: monitorexit
    //   170: aload_2
    //   171: athrow
    //   172: astore 11
    //   174: aconst_null
    //   175: astore 4
    //   177: goto -163 -> 14
    //
    // Exception table:
    //   from	to	target	type
    //   2	7	167	finally
    //   19	33	167	finally
    //   41	46	167	finally
    //   56	62	167	finally
    //   71	91	167	finally
    //   91	114	167	finally
    //   114	126	167	finally
    //   134	164	167	finally
    //   91	114	172	java/io/IOException
  }

  public final void a()
  {
    try
    {
      boolean bool = this.e;
      if (!bool);
      while (true)
      {
        return;
        try
        {
          this.c.a(0, a);
        }
        catch (IOException localIOException)
        {
          d.a("DiskResourceCache", "Clearing cache: " + localIOException);
        }
      }
    }
    finally
    {
    }
  }

  public final void a(a parama)
  {
    try
    {
      boolean bool = this.e;
      if (!bool);
      while (true)
      {
        return;
        String str = parama.h(2);
        try
        {
          long l = this.d.a();
          byte[] arrayOfByte1 = parama.d();
          byte[] arrayOfByte2 = new byte[9 + arrayOfByte1.length];
          arrayOfByte2[0] = 1;
          e.a(arrayOfByte2, 1, l);
          System.arraycopy(arrayOfByte1, 0, arrayOfByte2, 9, arrayOfByte1.length);
          ArrayList localArrayList = new ArrayList(1);
          localArrayList.add(e.a(d.a(str), arrayOfByte2));
          this.c.a(localArrayList);
        }
        catch (IOException localIOException)
        {
          d.a("DiskResourceCache", "Error inserting: " + str + " : " + localIOException);
        }
      }
    }
    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.bg.b
 * JD-Core Version:    0.6.2
 */