package com.google.android.gms.internal.measurement;

import android.content.Context;
import android.net.Uri;
import androidx.collection.a;
import com.amplifyframework.core.model.ModelIdentifier;

/* loaded from: classes3.dex */
public final class zzhk {
    private static final a zza = new a();

    public static synchronized Uri zza(String str) {
        Uri uri;
        synchronized (zzhk.class) {
            a aVar = zza;
            uri = (Uri) aVar.get(str);
            if (uri == null) {
                uri = Uri.parse("content://com.google.android.gms.phenotype/" + Uri.encode(str));
                aVar.put(str, uri);
            }
        }
        return uri;
    }

    public static String zza(Context context, String str) {
        if (!str.contains(ModelIdentifier.Helper.PRIMARY_KEY_DELIMITER)) {
            return str + ModelIdentifier.Helper.PRIMARY_KEY_DELIMITER + "" + context.getPackageName();
        }
        throw new IllegalArgumentException("The passed in package cannot already have a subpackage: " + str);
    }

    public static boolean zza(String str, String str2) {
        if (str.equals("eng") || str.equals("userdebug")) {
            return str2.contains("dev-keys") || str2.contains("test-keys");
        }
        return false;
    }
}
