what-the-bank/sources/com/google/android/gms/internal/gtm/zzfd.java

106 lines
4.2 KiB
Java

package com.google.android.gms.internal.gtm;
import android.net.Uri;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.simpleframework.xml.strategy.Name;
/* loaded from: classes.dex */
public class zzfd {
private static zzfd zzaoq;
private volatile int zzaor = zza.zzaos;
private volatile String zzais = null;
private volatile String zzaec = null;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public enum zza {
public static final int zzaos = 1;
public static final int zzaot = 2;
private static final int[] zzaou = {1, 2};
}
zzfd() {
}
public static zzfd zzkr() {
zzfd zzfdVar;
synchronized (zzfd.class) {
if (zzaoq == null) {
zzaoq = new zzfd();
}
zzfdVar = zzaoq;
}
return zzfdVar;
}
public final boolean zza(String str, Uri uri) {
synchronized (this) {
try {
String decode = URLDecoder.decode(uri.toString(), "UTF-8");
if (!decode.matches("^tagmanager.c.\\S+:\\/\\/preview\\/p\\S+")) {
String valueOf = String.valueOf(decode);
zzev.zzac(valueOf.length() != 0 ? "Bad preview url: ".concat(valueOf) : new String("Bad preview url: "));
return false;
}
String queryParameter = uri.getQueryParameter(Name.MARK);
String queryParameter2 = uri.getQueryParameter("gtm_auth");
String queryParameter3 = uri.getQueryParameter("gtm_preview");
if (!str.equals(queryParameter)) {
zzev.zzac("Preview fails (container doesn't match the container specified by the asset)");
return false;
}
if (queryParameter != null && queryParameter.length() > 0) {
if (queryParameter3 != null && queryParameter3.length() == 0) {
if (queryParameter.equals(this.zzaec) && this.zzaor != zza.zzaos) {
String valueOf2 = String.valueOf(this.zzaec);
zzev.zzab(valueOf2.length() != 0 ? "Exit preview mode for container: ".concat(valueOf2) : new String("Exit preview mode for container: "));
this.zzaor = zza.zzaos;
this.zzaec = null;
this.zzais = null;
}
zzev.zzac("Error in exiting preview mode. The container is not in preview.");
return false;
}
if (queryParameter3 != null && queryParameter3.length() > 0 && queryParameter2 != null && queryParameter2.length() > 0) {
this.zzaor = zza.zzaot;
this.zzais = uri.getQuery();
this.zzaec = queryParameter;
} else {
String valueOf3 = String.valueOf(decode);
zzev.zzac(valueOf3.length() != 0 ? "Bad preview url: ".concat(valueOf3) : new String("Bad preview url: "));
return false;
}
return true;
}
String valueOf4 = String.valueOf(decode);
zzev.zzac(valueOf4.length() != 0 ? "Bad preview url: ".concat(valueOf4) : new String("Bad preview url: "));
return false;
} catch (UnsupportedEncodingException e) {
String valueOf5 = String.valueOf(e);
StringBuilder sb = new StringBuilder(String.valueOf(valueOf5).length() + 32);
sb.append("Error decoding the preview url: ");
sb.append(valueOf5);
zzev.zzac(sb.toString());
return false;
}
}
}
public final boolean isPreview() {
return this.zzaor == zza.zzaot;
}
public final boolean zzbw(String str) {
return isPreview() && this.zzaec.equals(str);
}
public final String zzks() {
return this.zzais;
}
public final String getContainerId() {
return this.zzaec;
}
}