package com.google.firebase.messaging;

import android.text.TextUtils;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public final class c0 {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final long f24159d = TimeUnit.DAYS.toMillis(7);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final /* synthetic */ int f24160e = 0;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f24161a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f24162b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final long f24163c;

    public c0(String str, String str2, long j10) {
        this.f24161a = str;
        this.f24162b = str2;
        this.f24163c = j10;
    }

    public static c0 a(String str) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (!str.startsWith("{")) {
            return new c0(str, null, 0L);
        }
        try {
            JSONObject jSONObject = new JSONObject(str);
            return new c0(jSONObject.getString("token"), jSONObject.getString("appVersion"), jSONObject.getLong("timestamp"));
        } catch (JSONException e10) {
            e10.toString();
            return null;
        }
    }
}
