ku.java 19.3 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
import android.content.Context;
import com.google.android.gms.internal.zzai;
import com.google.android.gms.internal.zzaj.zzf;
import com.google.android.gms.internal.zzak.zza;
import com.google.android.gms.internal.zzbjd.zza;
import com.google.android.gms.internal.zzbjf;
import com.google.android.gms.internal.zzbjf.zza;
import com.google.android.gms.internal.zzbjf.zzb;
import com.google.android.gms.internal.zzbjf.zzc;
import com.google.android.gms.internal.zzbjf.zzd;
import com.google.android.gms.internal.zzbjf.zzg;
import com.google.android.gms.internal.zzbxs;
import com.google.android.gms.tagmanager.zzbn;
import com.google.android.gms.tagmanager.zzbo;
import com.google.android.gms.tagmanager.zzdl;
import com.google.android.gms.tagmanager.zzp.f;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONException;
import org.json.JSONObject;

public final class ku
  implements zzp.f
{
  final String a;
  zzbn<zzbjd.zza> b;
  private final Context c;
  private final ExecutorService d;
  
  public ku(Context paramContext, String paramString)
  {
    this.c = paramContext;
    this.a = paramString;
    this.d = Executors.newSingleThreadExecutor();
  }
  
  private static zzbjf.zzc a(ByteArrayOutputStream paramByteArrayOutputStream)
  {
    try
    {
      paramByteArrayOutputStream = zzdl.zzR(jk.a(new JSONObject(paramByteArrayOutputStream.toString("UTF-8"))));
      zzbjf.zzd localzzd = zzbjf.zzc.zzTy();
      int i = 0;
      while (i < paramByteArrayOutputStream.zzlv.length)
      {
        localzzd.zzc(zzbjf.zza.zzTw().zzb(zzai.zzhI.toString(), paramByteArrayOutputStream.zzlv[i]).zzb(zzai.zzhw.toString(), zzdl.zzhw(lq.a())).zzb(lq.b(), paramByteArrayOutputStream.zzlw[i]).zzTx());
        i += 1;
      }
      paramByteArrayOutputStream = localzzd.zzTA();
      return paramByteArrayOutputStream;
    }
    catch (UnsupportedEncodingException paramByteArrayOutputStream)
    {
      zzbo.zzbf("Failed to convert binary resource to string for JSON parsing; the file format is not UTF-8 format.");
      return null;
    }
    catch (JSONException paramByteArrayOutputStream)
    {
      zzbo.zzbh("Failed to extract the container from the resource file. Resource is a UTF-8 encoded string but doesn't contain a JSON container");
    }
    return null;
  }
  
  private static zzbjf.zzc a(byte[] paramArrayOfByte)
  {
    try
    {
      paramArrayOfByte = zzbjf.zzb(zzaj.zzf.zzf(paramArrayOfByte));
      if (paramArrayOfByte != null) {
        zzbo.v("The container was successfully loaded from the resource (using binary file)");
      }
      return paramArrayOfByte;
    }
    catch (zzbxs paramArrayOfByte)
    {
      zzbo.e("The resource file is corrupted. The container cannot be extracted from the binary file");
      return null;
    }
    catch (zzbjf.zzg paramArrayOfByte)
    {
      zzbo.zzbh("The resource file is invalid. The container from the binary file is invalid");
    }
    return null;
  }
  
  /* Error */
  public final zzbjf.zzc a(int paramInt)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 26	ku:c	Landroid/content/Context;
    //   4: invokevirtual 179	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   7: iload_1
    //   8: invokevirtual 185	android/content/res/Resources:openRawResource	(I)Ljava/io/InputStream;
    //   11: astore_2
    //   12: aload_0
    //   13: getfield 26	ku:c	Landroid/content/Context;
    //   16: invokevirtual 179	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   19: iload_1
    //   20: invokevirtual 189	android/content/res/Resources:getResourceName	(I)Ljava/lang/String;
    //   23: invokestatic 195	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   26: astore_3
    //   27: new 197	java/lang/StringBuilder
    //   30: dup
    //   31: aload_3
    //   32: invokestatic 195	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   35: invokevirtual 201	java/lang/String:length	()I
    //   38: bipush 66
    //   40: iadd
    //   41: invokespecial 204	java/lang/StringBuilder:<init>	(I)V
    //   44: ldc -50
    //   46: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   49: iload_1
    //   50: invokevirtual 213	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   53: ldc -41
    //   55: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   58: aload_3
    //   59: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   62: ldc -39
    //   64: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   67: invokevirtual 218	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   70: invokestatic 161	com/google/android/gms/tagmanager/zzbo:v	(Ljava/lang/String;)V
    //   73: new 48	java/io/ByteArrayOutputStream
    //   76: dup
    //   77: invokespecial 219	java/io/ByteArrayOutputStream:<init>	()V
    //   80: astore_3
    //   81: aload_2
    //   82: aload_3
    //   83: invokestatic 222	com/google/android/gms/internal/zzbjf:zzc	(Ljava/io/InputStream;Ljava/io/OutputStream;)V
    //   86: aload_3
    //   87: invokestatic 224	ku:a	(Ljava/io/ByteArrayOutputStream;)Lcom/google/android/gms/internal/zzbjf$zzc;
    //   90: astore_2
    //   91: aload_2
    //   92: ifnull +37 -> 129
    //   95: ldc -30
    //   97: invokestatic 161	com/google/android/gms/tagmanager/zzbo:v	(Ljava/lang/String;)V
    //   100: aload_2
    //   101: areturn
    //   102: astore_2
    //   103: new 197	java/lang/StringBuilder
    //   106: dup
    //   107: bipush 98
    //   109: invokespecial 204	java/lang/StringBuilder:<init>	(I)V
    //   112: ldc -28
    //   114: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   117: iload_1
    //   118: invokevirtual 213	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   121: invokevirtual 218	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   124: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   127: aconst_null
    //   128: areturn
    //   129: aload_3
    //   130: invokevirtual 232	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   133: invokestatic 234	ku:a	([B)Lcom/google/android/gms/internal/zzbjf$zzc;
    //   136: astore_2
    //   137: aload_2
    //   138: areturn
    //   139: astore_2
    //   140: aload_0
    //   141: getfield 26	ku:c	Landroid/content/Context;
    //   144: invokevirtual 179	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   147: iload_1
    //   148: invokevirtual 189	android/content/res/Resources:getResourceName	(I)Ljava/lang/String;
    //   151: invokestatic 195	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   154: astore_2
    //   155: new 197	java/lang/StringBuilder
    //   158: dup
    //   159: aload_2
    //   160: invokestatic 195	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   163: invokevirtual 201	java/lang/String:length	()I
    //   166: bipush 67
    //   168: iadd
    //   169: invokespecial 204	java/lang/StringBuilder:<init>	(I)V
    //   172: ldc -20
    //   174: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   177: iload_1
    //   178: invokevirtual 213	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   181: ldc -41
    //   183: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   186: aload_2
    //   187: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   190: ldc -39
    //   192: invokevirtual 210	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   195: invokevirtual 218	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   198: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   201: aconst_null
    //   202: areturn
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	203	0	this	ku
    //   0	203	1	paramInt	int
    //   11	90	2	localObject1	Object
    //   102	1	2	localNotFoundException	android.content.res.Resources.NotFoundException
    //   136	2	2	localzzc	zzbjf.zzc
    //   139	1	2	localIOException	java.io.IOException
    //   154	33	2	str	String
    //   26	104	3	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   0	12	102	android/content/res/Resources$NotFoundException
    //   73	91	139	java/io/IOException
    //   95	100	139	java/io/IOException
    //   129	137	139	java/io/IOException
  }
  
  public final void a()
  {
    this.d.execute(new Runnable()
    {
      /* Error */
      public final void run()
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 16	ku$1:a	Lku;
        //   4: astore_1
        //   5: aload_1
        //   6: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   9: ifnonnull +13 -> 22
        //   12: new 32	java/lang/IllegalStateException
        //   15: dup
        //   16: ldc 34
        //   18: invokespecial 37	java/lang/IllegalStateException:<init>	(Ljava/lang/String;)V
        //   21: athrow
        //   22: ldc 39
        //   24: invokestatic 44	com/google/android/gms/tagmanager/zzbo:v	(Ljava/lang/String;)V
        //   27: invokestatic 49	ki:a	()Lki;
        //   30: getfield 52	ki:a	Lki$a;
        //   33: getstatic 56	ki$a:b	Lki$a;
        //   36: if_acmpeq +15 -> 51
        //   39: invokestatic 49	ki:a	()Lki;
        //   42: getfield 52	ki:a	Lki$a;
        //   45: getstatic 59	ki$a:c	Lki$a;
        //   48: if_acmpne +32 -> 80
        //   51: aload_1
        //   52: getfield 62	ku:a	Ljava/lang/String;
        //   55: invokestatic 49	ki:a	()Lki;
        //   58: getfield 64	ki:b	Ljava/lang/String;
        //   61: invokevirtual 70	java/lang/String:equals	(Ljava/lang/Object;)Z
        //   64: ifeq +16 -> 80
        //   67: aload_1
        //   68: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   71: getstatic 76	com/google/android/gms/tagmanager/zzbn$zza:zzbGI	Lcom/google/android/gms/tagmanager/zzbn$zza;
        //   74: invokeinterface 81 2 0
        //   79: return
        //   80: new 83	java/io/FileInputStream
        //   83: dup
        //   84: aload_1
        //   85: invokevirtual 86	ku:b	()Ljava/io/File;
        //   88: invokespecial 89	java/io/FileInputStream:<init>	(Ljava/io/File;)V
        //   91: astore_2
        //   92: new 91	java/io/ByteArrayOutputStream
        //   95: dup
        //   96: invokespecial 92	java/io/ByteArrayOutputStream:<init>	()V
        //   99: astore_3
        //   100: aload_2
        //   101: aload_3
        //   102: invokestatic 98	com/google/android/gms/internal/zzbjf:zzc	(Ljava/io/InputStream;Ljava/io/OutputStream;)V
        //   105: aload_3
        //   106: invokevirtual 102	java/io/ByteArrayOutputStream:toByteArray	()[B
        //   109: invokestatic 108	com/google/android/gms/internal/zzbjd$zza:zzQ	([B)Lcom/google/android/gms/internal/zzbjd$zza;
        //   112: astore_3
        //   113: aload_3
        //   114: getfield 112	com/google/android/gms/internal/zzbjd$zza:zzlr	Lcom/google/android/gms/internal/zzaj$zzf;
        //   117: ifnonnull +67 -> 184
        //   120: aload_3
        //   121: getfield 116	com/google/android/gms/internal/zzbjd$zza:zzbNf	Lcom/google/android/gms/internal/zzaj$zzj;
        //   124: ifnonnull +60 -> 184
        //   127: new 26	java/lang/IllegalArgumentException
        //   130: dup
        //   131: ldc 118
        //   133: invokespecial 119	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;)V
        //   136: athrow
        //   137: astore_3
        //   138: aload_1
        //   139: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   142: getstatic 122	com/google/android/gms/tagmanager/zzbn$zza:zzbGJ	Lcom/google/android/gms/tagmanager/zzbn$zza;
        //   145: invokeinterface 81 2 0
        //   150: ldc 124
        //   152: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   155: aload_2
        //   156: invokevirtual 130	java/io/FileInputStream:close	()V
        //   159: ldc -124
        //   161: invokestatic 44	com/google/android/gms/tagmanager/zzbo:v	(Ljava/lang/String;)V
        //   164: return
        //   165: astore_2
        //   166: ldc -122
        //   168: invokestatic 137	com/google/android/gms/tagmanager/zzbo:zzbf	(Ljava/lang/String;)V
        //   171: aload_1
        //   172: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   175: getstatic 76	com/google/android/gms/tagmanager/zzbn$zza:zzbGI	Lcom/google/android/gms/tagmanager/zzbn$zza;
        //   178: invokeinterface 81 2 0
        //   183: return
        //   184: aload_1
        //   185: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   188: aload_3
        //   189: invokeinterface 140 2 0
        //   194: aload_2
        //   195: invokevirtual 130	java/io/FileInputStream:close	()V
        //   198: goto -39 -> 159
        //   201: astore_1
        //   202: ldc -114
        //   204: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   207: goto -48 -> 159
        //   210: astore_1
        //   211: ldc -114
        //   213: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   216: goto -57 -> 159
        //   219: astore_3
        //   220: aload_1
        //   221: getfield 30	ku:b	Lcom/google/android/gms/tagmanager/zzbn;
        //   224: getstatic 122	com/google/android/gms/tagmanager/zzbn$zza:zzbGJ	Lcom/google/android/gms/tagmanager/zzbn$zza;
        //   227: invokeinterface 81 2 0
        //   232: ldc -112
        //   234: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   237: aload_2
        //   238: invokevirtual 130	java/io/FileInputStream:close	()V
        //   241: goto -82 -> 159
        //   244: astore_1
        //   245: ldc -114
        //   247: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   250: goto -91 -> 159
        //   253: astore_1
        //   254: aload_2
        //   255: invokevirtual 130	java/io/FileInputStream:close	()V
        //   258: aload_1
        //   259: athrow
        //   260: astore_2
        //   261: ldc -114
        //   263: invokestatic 127	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
        //   266: goto -8 -> 258
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	269	0	this	1
        //   4	181	1	localku	ku
        //   201	1	1	localIOException1	java.io.IOException
        //   210	11	1	localIOException2	java.io.IOException
        //   244	1	1	localIOException3	java.io.IOException
        //   253	6	1	localObject1	Object
        //   91	65	2	localFileInputStream	java.io.FileInputStream
        //   165	90	2	localFileNotFoundException	java.io.FileNotFoundException
        //   260	1	2	localIOException4	java.io.IOException
        //   99	22	3	localObject2	Object
        //   137	52	3	localIOException5	java.io.IOException
        //   219	1	3	localIllegalArgumentException	IllegalArgumentException
        // Exception table:
        //   from	to	target	type
        //   92	137	137	java/io/IOException
        //   184	194	137	java/io/IOException
        //   80	92	165	java/io/FileNotFoundException
        //   194	198	201	java/io/IOException
        //   155	159	210	java/io/IOException
        //   92	137	219	java/lang/IllegalArgumentException
        //   184	194	219	java/lang/IllegalArgumentException
        //   237	241	244	java/io/IOException
        //   92	137	253	finally
        //   138	155	253	finally
        //   184	194	253	finally
        //   220	237	253	finally
        //   254	258	260	java/io/IOException
      }
    });
  }
  
  public final void a(final zzbjd.zza paramzza)
  {
    this.d.execute(new Runnable()
    {
      public final void run()
      {
        ku.this.b(paramzza);
      }
    });
  }
  
  public final void a(zzbn<zzbjd.zza> paramzzbn)
  {
    this.b = paramzzbn;
  }
  
  final File b()
  {
    String str1 = String.valueOf("resource_");
    String str2 = String.valueOf(this.a);
    if (str2.length() != 0) {}
    for (str1 = str1.concat(str2);; str1 = new String(str1)) {
      return new File(this.c.getDir("google_tagmanager", 0), str1);
    }
  }
  
  /* Error */
  final boolean b(zzbjd.zza paramzza)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 277	ku:b	()Ljava/io/File;
    //   4: astore_3
    //   5: new 279	java/io/FileOutputStream
    //   8: dup
    //   9: aload_3
    //   10: invokespecial 282	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   13: astore_2
    //   14: aload_2
    //   15: aload_1
    //   16: invokestatic 287	com/google/android/gms/internal/zzbxt:zzf	(Lcom/google/android/gms/internal/zzbxt;)[B
    //   19: invokevirtual 291	java/io/FileOutputStream:write	([B)V
    //   22: aload_2
    //   23: invokevirtual 294	java/io/FileOutputStream:close	()V
    //   26: iconst_1
    //   27: ireturn
    //   28: astore_1
    //   29: ldc_w 296
    //   32: invokestatic 166	com/google/android/gms/tagmanager/zzbo:e	(Ljava/lang/String;)V
    //   35: iconst_0
    //   36: ireturn
    //   37: astore_1
    //   38: ldc_w 298
    //   41: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   44: goto -18 -> 26
    //   47: astore_1
    //   48: ldc_w 300
    //   51: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   54: aload_3
    //   55: invokevirtual 304	java/io/File:delete	()Z
    //   58: pop
    //   59: aload_2
    //   60: invokevirtual 294	java/io/FileOutputStream:close	()V
    //   63: iconst_0
    //   64: ireturn
    //   65: astore_1
    //   66: ldc_w 298
    //   69: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   72: iconst_0
    //   73: ireturn
    //   74: astore_1
    //   75: aload_2
    //   76: invokevirtual 294	java/io/FileOutputStream:close	()V
    //   79: aload_1
    //   80: athrow
    //   81: astore_2
    //   82: ldc_w 298
    //   85: invokestatic 140	com/google/android/gms/tagmanager/zzbo:zzbh	(Ljava/lang/String;)V
    //   88: goto -9 -> 79
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	91	0	this	ku
    //   0	91	1	paramzza	zzbjd.zza
    //   13	63	2	localFileOutputStream	java.io.FileOutputStream
    //   81	1	2	localIOException	java.io.IOException
    //   4	51	3	localFile	File
    // Exception table:
    //   from	to	target	type
    //   5	14	28	java/io/FileNotFoundException
    //   22	26	37	java/io/IOException
    //   14	22	47	java/io/IOException
    //   59	63	65	java/io/IOException
    //   14	22	74	finally
    //   48	59	74	finally
    //   75	79	81	java/io/IOException
  }
  
  public final void release()
  {
    try
    {
      this.d.shutdown();
      return;
    }
    finally
    {
      localObject = finally;
      throw ((Throwable)localObject);
    }
  }
}


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