what-the-bank/sources/com/google/firebase/iid/zzay.java

56 lines
1.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.iid;
import android.text.TextUtils;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
final class zzay {
private static final long zzb = TimeUnit.DAYS.toMillis(7);
final String zza;
private final String zzc;
private final long zzd;
private zzay(String str, String str2, long j) {
this.zza = str;
this.zzc = str2;
this.zzd = j;
}
/* JADX INFO: Access modifiers changed from: package-private */
public static zzay zza(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
if (str.startsWith(UrlTreeKt.componentParamPrefix)) {
try {
JSONObject jSONObject = new JSONObject(str);
return new zzay(jSONObject.getString("token"), jSONObject.getString("appVersion"), jSONObject.getLong("timestamp"));
} catch (JSONException unused) {
return null;
}
}
return new zzay(str, null, 0L);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static String zza(String str, String str2, long j) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("token", str);
jSONObject.put("appVersion", str2);
jSONObject.put("timestamp", j);
return jSONObject.toString();
} catch (JSONException unused) {
return null;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final boolean zzb(String str) {
return System.currentTimeMillis() > this.zzd + zzb || !str.equals(this.zzc);
}
}