lw.java 24.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build.VERSION;
import android.text.TextUtils;
import com.google.android.gms.common.util.zze;
import com.google.android.gms.common.util.zzi;
import com.google.android.gms.tagmanager.DataLayer.a;
import com.google.android.gms.tagmanager.DataLayer.zzc;
import com.google.android.gms.tagmanager.DataLayer.zzc.zza;
import com.google.android.gms.tagmanager.zzbo;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public final class lw
  implements DataLayer.zzc
{
  private static final String a = String.format("CREATE TABLE IF NOT EXISTS %s ( '%s' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, '%s' STRING NOT NULL, '%s' BLOB NOT NULL, '%s' INTEGER NOT NULL);", new Object[] { "datalayer", "ID", "key", "value", "expires" });
  private final Executor b;
  private final Context c;
  private lw.a d;
  private zze e;
  private int f;
  
  public lw(Context paramContext)
  {
    this(paramContext, zzi.zzzc(), "google_tagmanager.db", Executors.newSingleThreadExecutor());
  }
  
  private lw(Context paramContext, zze paramzze, String paramString, Executor paramExecutor)
  {
    this.c = paramContext;
    this.e = paramzze;
    this.f = 2000;
    this.b = paramExecutor;
    this.d = new lw.a(this.c, paramString);
  }
  
  /* Error */
  private static Object a(byte[] paramArrayOfByte)
  {
    // Byte code:
    //   0: new 92	java/io/ByteArrayInputStream
    //   3: dup
    //   4: aload_0
    //   5: invokespecial 95	java/io/ByteArrayInputStream:<init>	([B)V
    //   8: astore_2
    //   9: new 97	java/io/ObjectInputStream
    //   12: dup
    //   13: aload_2
    //   14: invokespecial 100	java/io/ObjectInputStream:<init>	(Ljava/io/InputStream;)V
    //   17: astore_0
    //   18: aload_0
    //   19: invokevirtual 104	java/io/ObjectInputStream:readObject	()Ljava/lang/Object;
    //   22: astore_1
    //   23: aload_0
    //   24: invokevirtual 107	java/io/ObjectInputStream:close	()V
    //   27: aload_2
    //   28: invokevirtual 108	java/io/ByteArrayInputStream:close	()V
    //   31: aload_1
    //   32: areturn
    //   33: astore_0
    //   34: aconst_null
    //   35: astore_0
    //   36: aload_0
    //   37: ifnull +7 -> 44
    //   40: aload_0
    //   41: invokevirtual 107	java/io/ObjectInputStream:close	()V
    //   44: aload_2
    //   45: invokevirtual 108	java/io/ByteArrayInputStream:close	()V
    //   48: aconst_null
    //   49: areturn
    //   50: astore_0
    //   51: aconst_null
    //   52: areturn
    //   53: astore_0
    //   54: aconst_null
    //   55: astore_0
    //   56: aload_0
    //   57: ifnull +7 -> 64
    //   60: aload_0
    //   61: invokevirtual 107	java/io/ObjectInputStream:close	()V
    //   64: aload_2
    //   65: invokevirtual 108	java/io/ByteArrayInputStream:close	()V
    //   68: aconst_null
    //   69: areturn
    //   70: astore_0
    //   71: aconst_null
    //   72: areturn
    //   73: astore_1
    //   74: aconst_null
    //   75: astore_0
    //   76: aload_0
    //   77: ifnull +7 -> 84
    //   80: aload_0
    //   81: invokevirtual 107	java/io/ObjectInputStream:close	()V
    //   84: aload_2
    //   85: invokevirtual 108	java/io/ByteArrayInputStream:close	()V
    //   88: aload_1
    //   89: athrow
    //   90: astore_0
    //   91: goto -3 -> 88
    //   94: astore_1
    //   95: goto -19 -> 76
    //   98: astore_1
    //   99: goto -43 -> 56
    //   102: astore_1
    //   103: goto -67 -> 36
    //   106: astore_0
    //   107: aload_1
    //   108: areturn
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	109	0	paramArrayOfByte	byte[]
    //   22	10	1	localObject1	Object
    //   73	16	1	localObject2	Object
    //   94	1	1	localObject3	Object
    //   98	1	1	localClassNotFoundException	ClassNotFoundException
    //   102	6	1	localIOException	java.io.IOException
    //   8	77	2	localByteArrayInputStream	java.io.ByteArrayInputStream
    // Exception table:
    //   from	to	target	type
    //   9	18	33	java/io/IOException
    //   40	44	50	java/io/IOException
    //   44	48	50	java/io/IOException
    //   9	18	53	java/lang/ClassNotFoundException
    //   60	64	70	java/io/IOException
    //   64	68	70	java/io/IOException
    //   9	18	73	finally
    //   80	84	90	java/io/IOException
    //   84	88	90	java/io/IOException
    //   18	23	94	finally
    //   18	23	98	java/lang/ClassNotFoundException
    //   18	23	102	java/io/IOException
    //   23	31	106	java/io/IOException
  }
  
  /* Error */
  private List<String> a(int paramInt)
  {
    // Byte code:
    //   0: new 114	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 115	java/util/ArrayList:<init>	()V
    //   7: astore 6
    //   9: iload_1
    //   10: ifgt +11 -> 21
    //   13: ldc 117
    //   15: invokestatic 123	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   18: aload 6
    //   20: areturn
    //   21: aload_0
    //   22: ldc 125
    //   24: invokespecial 128	lw:b	(Ljava/lang/String;)Landroid/database/sqlite/SQLiteDatabase;
    //   27: astore_3
    //   28: aload_3
    //   29: ifnonnull +6 -> 35
    //   32: aload 6
    //   34: areturn
    //   35: ldc -126
    //   37: iconst_1
    //   38: anewarray 4	java/lang/Object
    //   41: dup
    //   42: iconst_0
    //   43: ldc 36
    //   45: aastore
    //   46: invokestatic 48	java/lang/String:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   49: astore 4
    //   51: iload_1
    //   52: invokestatic 136	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   55: astore 5
    //   57: aload_3
    //   58: ldc 34
    //   60: iconst_1
    //   61: anewarray 44	java/lang/String
    //   64: dup
    //   65: iconst_0
    //   66: ldc 36
    //   68: aastore
    //   69: aconst_null
    //   70: aconst_null
    //   71: aconst_null
    //   72: aconst_null
    //   73: aload 4
    //   75: aload 5
    //   77: invokevirtual 142	android/database/sqlite/SQLiteDatabase:query	(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    //   80: astore 4
    //   82: aload 4
    //   84: astore_3
    //   85: aload 4
    //   87: invokeinterface 148 1 0
    //   92: ifeq +40 -> 132
    //   95: aload 4
    //   97: astore_3
    //   98: aload 6
    //   100: aload 4
    //   102: iconst_0
    //   103: invokeinterface 152 2 0
    //   108: invokestatic 156	java/lang/String:valueOf	(J)Ljava/lang/String;
    //   111: invokeinterface 162 2 0
    //   116: pop
    //   117: aload 4
    //   119: astore_3
    //   120: aload 4
    //   122: invokeinterface 165 1 0
    //   127: istore_2
    //   128: iload_2
    //   129: ifne -34 -> 95
    //   132: aload 4
    //   134: ifnull +10 -> 144
    //   137: aload 4
    //   139: invokeinterface 166 1 0
    //   144: aload 6
    //   146: areturn
    //   147: astore 5
    //   149: aconst_null
    //   150: astore 4
    //   152: aload 4
    //   154: astore_3
    //   155: aload 5
    //   157: invokevirtual 169	android/database/sqlite/SQLiteException:getMessage	()Ljava/lang/String;
    //   160: invokestatic 172	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   163: astore 5
    //   165: aload 4
    //   167: astore_3
    //   168: aload 5
    //   170: invokevirtual 176	java/lang/String:length	()I
    //   173: ifeq +38 -> 211
    //   176: aload 4
    //   178: astore_3
    //   179: ldc -78
    //   181: aload 5
    //   183: invokevirtual 182	java/lang/String:concat	(Ljava/lang/String;)Ljava/lang/String;
    //   186: astore 5
    //   188: aload 4
    //   190: astore_3
    //   191: aload 5
    //   193: invokestatic 123	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   196: aload 4
    //   198: ifnull -54 -> 144
    //   201: aload 4
    //   203: invokeinterface 166 1 0
    //   208: goto -64 -> 144
    //   211: aload 4
    //   213: astore_3
    //   214: new 44	java/lang/String
    //   217: dup
    //   218: ldc -78
    //   220: invokespecial 184	java/lang/String:<init>	(Ljava/lang/String;)V
    //   223: astore 5
    //   225: goto -37 -> 188
    //   228: astore 5
    //   230: aload_3
    //   231: astore 4
    //   233: aload 5
    //   235: astore_3
    //   236: aload 4
    //   238: ifnull +10 -> 248
    //   241: aload 4
    //   243: invokeinterface 166 1 0
    //   248: aload_3
    //   249: athrow
    //   250: astore_3
    //   251: aconst_null
    //   252: astore 4
    //   254: goto -18 -> 236
    //   257: astore 5
    //   259: goto -107 -> 152
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	262	0	this	lw
    //   0	262	1	paramInt	int
    //   127	2	2	bool	boolean
    //   27	222	3	localObject1	Object
    //   250	1	3	localObject2	Object
    //   49	204	4	localObject3	Object
    //   55	21	5	str1	String
    //   147	9	5	localSQLiteException1	SQLiteException
    //   163	61	5	str2	String
    //   228	6	5	localObject4	Object
    //   257	1	5	localSQLiteException2	SQLiteException
    //   7	138	6	localArrayList	ArrayList
    // Exception table:
    //   from	to	target	type
    //   35	82	147	android/database/sqlite/SQLiteException
    //   85	95	228	finally
    //   98	117	228	finally
    //   120	128	228	finally
    //   155	165	228	finally
    //   168	176	228	finally
    //   179	188	228	finally
    //   191	196	228	finally
    //   214	225	228	finally
    //   35	82	250	finally
    //   85	95	257	android/database/sqlite/SQLiteException
    //   98	117	257	android/database/sqlite/SQLiteException
    //   120	128	257	android/database/sqlite/SQLiteException
  }
  
  private void a(long paramLong)
  {
    SQLiteDatabase localSQLiteDatabase = b("Error opening database for deleteOlderThan.");
    if (localSQLiteDatabase == null) {
      return;
    }
    try
    {
      int i = localSQLiteDatabase.delete("datalayer", "expires <= ?", new String[] { Long.toString(paramLong) });
      zzbo.v(33 + "Deleted " + i + " expired items");
      return;
    }
    catch (SQLiteException localSQLiteException)
    {
      zzbo.zzbh("Error deleting old entries.");
    }
  }
  
  /* Error */
  private static byte[] a(Object paramObject)
  {
    // Byte code:
    //   0: new 252	java/io/ByteArrayOutputStream
    //   3: dup
    //   4: invokespecial 253	java/io/ByteArrayOutputStream:<init>	()V
    //   7: astore_2
    //   8: new 255	java/io/ObjectOutputStream
    //   11: dup
    //   12: aload_2
    //   13: invokespecial 258	java/io/ObjectOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   16: astore_1
    //   17: aload_1
    //   18: aload_0
    //   19: invokevirtual 262	java/io/ObjectOutputStream:writeObject	(Ljava/lang/Object;)V
    //   22: aload_2
    //   23: invokevirtual 266	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   26: astore_0
    //   27: aload_1
    //   28: invokevirtual 267	java/io/ObjectOutputStream:close	()V
    //   31: aload_2
    //   32: invokevirtual 268	java/io/ByteArrayOutputStream:close	()V
    //   35: aload_0
    //   36: areturn
    //   37: astore_0
    //   38: aconst_null
    //   39: astore_1
    //   40: aload_1
    //   41: ifnull +7 -> 48
    //   44: aload_1
    //   45: invokevirtual 267	java/io/ObjectOutputStream:close	()V
    //   48: aload_2
    //   49: invokevirtual 268	java/io/ByteArrayOutputStream:close	()V
    //   52: aconst_null
    //   53: areturn
    //   54: astore_0
    //   55: aconst_null
    //   56: areturn
    //   57: astore_0
    //   58: aconst_null
    //   59: astore_1
    //   60: aload_1
    //   61: ifnull +7 -> 68
    //   64: aload_1
    //   65: invokevirtual 267	java/io/ObjectOutputStream:close	()V
    //   68: aload_2
    //   69: invokevirtual 268	java/io/ByteArrayOutputStream:close	()V
    //   72: aload_0
    //   73: athrow
    //   74: astore_1
    //   75: goto -3 -> 72
    //   78: astore_0
    //   79: goto -19 -> 60
    //   82: astore_0
    //   83: goto -43 -> 40
    //   86: astore_1
    //   87: aload_0
    //   88: areturn
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	89	0	paramObject	Object
    //   16	49	1	localObjectOutputStream	java.io.ObjectOutputStream
    //   74	1	1	localIOException1	java.io.IOException
    //   86	1	1	localIOException2	java.io.IOException
    //   7	62	2	localByteArrayOutputStream	java.io.ByteArrayOutputStream
    // Exception table:
    //   from	to	target	type
    //   8	17	37	java/io/IOException
    //   44	48	54	java/io/IOException
    //   48	52	54	java/io/IOException
    //   8	17	57	finally
    //   64	68	74	java/io/IOException
    //   68	72	74	java/io/IOException
    //   17	27	78	finally
    //   17	27	82	java/io/IOException
    //   27	35	86	java/io/IOException
  }
  
  private SQLiteDatabase b(String paramString)
  {
    try
    {
      SQLiteDatabase localSQLiteDatabase = this.d.getWritableDatabase();
      return localSQLiteDatabase;
    }
    catch (SQLiteException localSQLiteException)
    {
      zzbo.zzbh(paramString);
    }
    return null;
  }
  
  private List<DataLayer.a> b()
  {
    try
    {
      a(this.e.currentTimeMillis());
      Object localObject = c();
      ArrayList localArrayList = new ArrayList();
      localObject = ((List)localObject).iterator();
      while (((Iterator)localObject).hasNext())
      {
        lw.b localb = (lw.b)((Iterator)localObject).next();
        localArrayList.add(new DataLayer.a(localb.a, a(localb.b)));
      }
    }
    finally
    {
      e();
    }
    return localList;
  }
  
  private void b(List<lw.b> paramList, long paramLong)
  {
    for (;;)
    {
      try
      {
        long l = this.e.currentTimeMillis();
        a(l);
        int i = paramList.size() + (d() - this.f);
        if (i > 0)
        {
          localObject = a(i);
          i = ((List)localObject).size();
          zzbo.zzbg(64 + "DataLayer store full, deleting " + i + " entries to make room.");
          localObject = (String[])((List)localObject).toArray(new String[0]);
          if ((localObject != null) && (localObject.length != 0)) {}
        }
        else
        {
          c(paramList, l + paramLong);
        }
      }
      finally
      {
        SQLiteDatabase localSQLiteDatabase;
        String str;
        e();
      }
      try
      {
        e();
        return;
      }
      finally {}
      localSQLiteDatabase = b("Error opening database for deleteEntries.");
      if (localSQLiteDatabase != null)
      {
        str = String.format("%s in (%s)", new Object[] { "ID", TextUtils.join(",", Collections.nCopies(localObject.length, "?")) });
        try
        {
          localSQLiteDatabase.delete("datalayer", str, (String[])localObject);
        }
        catch (SQLiteException localSQLiteException)
        {
          localObject = String.valueOf(Arrays.toString((Object[])localObject));
          if (((String)localObject).length() == 0) {}
        }
      }
    }
    for (Object localObject = "Error deleting entries ".concat((String)localObject);; localObject = new String("Error deleting entries "))
    {
      zzbo.zzbh((String)localObject);
      break;
    }
  }
  
  private List<lw.b> c()
  {
    Object localObject = b("Error opening database for loadSerialized.");
    ArrayList localArrayList = new ArrayList();
    if (localObject == null) {
      return localArrayList;
    }
    localObject = ((SQLiteDatabase)localObject).query("datalayer", new String[] { "key", "value" }, null, null, null, null, "ID", null);
    try
    {
      if (((Cursor)localObject).moveToNext()) {
        localArrayList.add(new lw.b(((Cursor)localObject).getString(0), ((Cursor)localObject).getBlob(1)));
      }
      return localList;
    }
    finally
    {
      ((Cursor)localObject).close();
    }
  }
  
  private void c(List<lw.b> paramList, long paramLong)
  {
    SQLiteDatabase localSQLiteDatabase = b("Error opening database for writeEntryToDatabase.");
    if (localSQLiteDatabase == null) {}
    for (;;)
    {
      return;
      paramList = paramList.iterator();
      while (paramList.hasNext())
      {
        lw.b localb = (lw.b)paramList.next();
        ContentValues localContentValues = new ContentValues();
        localContentValues.put("expires", Long.valueOf(paramLong));
        localContentValues.put("key", localb.a);
        localContentValues.put("value", localb.b);
        localSQLiteDatabase.insert("datalayer", null, localContentValues);
      }
    }
  }
  
  private int d()
  {
    Object localObject3 = null;
    Object localObject1 = null;
    int i = 0;
    int j = 0;
    Object localObject5 = b("Error opening database for getNumStoredEntries.");
    if (localObject5 == null) {}
    for (;;)
    {
      return j;
      try
      {
        localObject5 = ((SQLiteDatabase)localObject5).rawQuery("SELECT COUNT(*) from datalayer", null);
        localObject1 = localObject5;
        localObject3 = localObject5;
        if (((Cursor)localObject5).moveToFirst())
        {
          localObject1 = localObject5;
          localObject3 = localObject5;
          long l = ((Cursor)localObject5).getLong(0);
          i = (int)l;
        }
        j = i;
        return i;
      }
      catch (SQLiteException localSQLiteException)
      {
        localObject4 = localObject1;
        zzbo.zzbh("Error getting numStoredEntries");
        return 0;
      }
      finally
      {
        Object localObject4;
        if (localObject4 != null) {
          ((Cursor)localObject4).close();
        }
      }
    }
  }
  
  private void e()
  {
    try
    {
      this.d.close();
      return;
    }
    catch (SQLiteException localSQLiteException) {}
  }
  
  public final void a(final DataLayer.zzc.zza paramzza)
  {
    this.b.execute(new Runnable()
    {
      public final void run()
      {
        paramzza.zzM(lw.a(lw.this));
      }
    });
  }
  
  public final void a(final String paramString)
  {
    this.b.execute(new Runnable()
    {
      public final void run()
      {
        lw.a(lw.this, paramString);
      }
    });
  }
  
  public final void a(List<DataLayer.a> paramList, final long paramLong)
  {
    final ArrayList localArrayList = new ArrayList();
    paramList = paramList.iterator();
    while (paramList.hasNext())
    {
      DataLayer.a locala = (DataLayer.a)paramList.next();
      localArrayList.add(new lw.b(locala.a, a(locala.b)));
    }
    this.b.execute(new Runnable()
    {
      public final void run()
      {
        lw.a(lw.this, localArrayList, paramLong);
      }
    });
  }
  
  final class a
    extends SQLiteOpenHelper
  {
    a(Context paramContext, String paramString)
    {
      super(paramString, null, 1);
    }
    
    /* Error */
    private static boolean a(String paramString, SQLiteDatabase paramSQLiteDatabase)
    {
      // Byte code:
      //   0: aconst_null
      //   1: astore_3
      //   2: aload_1
      //   3: ldc 21
      //   5: iconst_1
      //   6: anewarray 23	java/lang/String
      //   9: dup
      //   10: iconst_0
      //   11: ldc 25
      //   13: aastore
      //   14: ldc 27
      //   16: iconst_1
      //   17: anewarray 23	java/lang/String
      //   20: dup
      //   21: iconst_0
      //   22: aload_0
      //   23: aastore
      //   24: aconst_null
      //   25: aconst_null
      //   26: aconst_null
      //   27: invokevirtual 33	android/database/sqlite/SQLiteDatabase:query	(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
      //   30: astore_1
      //   31: aload_1
      //   32: invokeinterface 39 1 0
      //   37: istore_2
      //   38: aload_1
      //   39: ifnull +9 -> 48
      //   42: aload_1
      //   43: invokeinterface 43 1 0
      //   48: iload_2
      //   49: ireturn
      //   50: astore_1
      //   51: aconst_null
      //   52: astore_1
      //   53: aload_0
      //   54: invokestatic 47	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
      //   57: astore_0
      //   58: aload_0
      //   59: invokevirtual 51	java/lang/String:length	()I
      //   62: ifeq +26 -> 88
      //   65: ldc 53
      //   67: aload_0
      //   68: invokevirtual 57	java/lang/String:concat	(Ljava/lang/String;)Ljava/lang/String;
      //   71: astore_0
      //   72: aload_0
      //   73: invokestatic 63	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
      //   76: aload_1
      //   77: ifnull +9 -> 86
      //   80: aload_1
      //   81: invokeinterface 43 1 0
      //   86: iconst_0
      //   87: ireturn
      //   88: new 23	java/lang/String
      //   91: dup
      //   92: ldc 53
      //   94: invokespecial 65	java/lang/String:<init>	(Ljava/lang/String;)V
      //   97: astore_0
      //   98: goto -26 -> 72
      //   101: astore_0
      //   102: aload_1
      //   103: ifnull +9 -> 112
      //   106: aload_1
      //   107: invokeinterface 43 1 0
      //   112: aload_0
      //   113: athrow
      //   114: astore_0
      //   115: aload_3
      //   116: astore_1
      //   117: goto -15 -> 102
      //   120: astore_0
      //   121: goto -19 -> 102
      //   124: astore_3
      //   125: goto -72 -> 53
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	128	0	paramString	String
      //   0	128	1	paramSQLiteDatabase	SQLiteDatabase
      //   37	12	2	bool	boolean
      //   1	115	3	localObject	Object
      //   124	1	3	localSQLiteException	SQLiteException
      // Exception table:
      //   from	to	target	type
      //   2	31	50	android/database/sqlite/SQLiteException
      //   53	72	101	finally
      //   72	76	101	finally
      //   88	98	101	finally
      //   2	31	114	finally
      //   31	38	120	finally
      //   31	38	124	android/database/sqlite/SQLiteException
    }
    
    public final SQLiteDatabase getWritableDatabase()
    {
      Object localObject1 = null;
      try
      {
        localObject2 = super.getWritableDatabase();
        localObject1 = localObject2;
      }
      catch (SQLiteException localSQLiteException)
      {
        for (;;)
        {
          Object localObject2;
          lw.b(lw.this).getDatabasePath("google_tagmanager.db").delete();
        }
      }
      localObject2 = localObject1;
      if (localObject1 == null) {
        localObject2 = super.getWritableDatabase();
      }
      return (SQLiteDatabase)localObject2;
    }
    
    public final void onCreate(SQLiteDatabase paramSQLiteDatabase)
    {
      ix.a(paramSQLiteDatabase.getPath());
    }
    
    public final void onOpen(SQLiteDatabase paramSQLiteDatabase)
    {
      Object localObject1;
      if (Build.VERSION.SDK_INT < 15) {
        localObject1 = paramSQLiteDatabase.rawQuery("PRAGMA journal_mode=memory", null);
      }
      do
      {
        try
        {
          ((Cursor)localObject1).moveToFirst();
          ((Cursor)localObject1).close();
          if (!a("datalayer", paramSQLiteDatabase))
          {
            paramSQLiteDatabase.execSQL(lw.a());
            return;
          }
        }
        finally
        {
          ((Cursor)localObject1).close();
        }
        paramSQLiteDatabase = paramSQLiteDatabase.rawQuery("SELECT * FROM datalayer WHERE 0", null);
        localObject1 = new HashSet();
        try
        {
          String[] arrayOfString = paramSQLiteDatabase.getColumnNames();
          int i = 0;
          while (i < arrayOfString.length)
          {
            ((Set)localObject1).add(arrayOfString[i]);
            i += 1;
          }
          paramSQLiteDatabase.close();
          if ((!((Set)localObject1).remove("key")) || (!((Set)localObject1).remove("value")) || (!((Set)localObject1).remove("ID")) || (!((Set)localObject1).remove("expires"))) {
            throw new SQLiteException("Database column missing");
          }
        }
        finally
        {
          paramSQLiteDatabase.close();
        }
      } while (((Set)localObject2).isEmpty());
      throw new SQLiteException("Database has extra columns");
    }
    
    public final void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2) {}
  }
  
  static final class b
  {
    final String a;
    final byte[] b;
    
    b(String paramString, byte[] paramArrayOfByte)
    {
      this.a = paramString;
      this.b = paramArrayOfByte;
    }
    
    public final String toString()
    {
      String str = this.a;
      int i = Arrays.hashCode(this.b);
      return String.valueOf(str).length() + 54 + "KeyAndSerialized: key = " + str + " serialized hash = " + i;
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/lw.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */