package com.google.android.gms.common.util;

import android.util.Base64;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import defpackage.vo6;

/* JADX INFO: loaded from: classes2.dex */
@KeepForSdk
public final class Base64Utils {
    @vo6
    @KeepForSdk
    public static byte[] decode(@vo6 String str) {
        if (str == null) {
            return null;
        }
        return Base64.decode(str, 0);
    }

    @vo6
    @KeepForSdk
    public static byte[] decodeUrlSafe(@vo6 String str) {
        if (str == null) {
            return null;
        }
        return Base64.decode(str, 10);
    }

    @ResultIgnorabilityUnspecified
    @vo6
    @KeepForSdk
    public static byte[] decodeUrlSafeNoPadding(@vo6 String str) {
        if (str == null) {
            return null;
        }
        return Base64.decode(str, 11);
    }

    @vo6
    @KeepForSdk
    public static String encode(@vo6 byte[] bArr) {
        if (bArr == null) {
            return null;
        }
        return Base64.encodeToString(bArr, 0);
    }

    @vo6
    @KeepForSdk
    public static String encodeUrlSafe(@vo6 byte[] bArr) {
        if (bArr == null) {
            return null;
        }
        return Base64.encodeToString(bArr, 10);
    }

    @vo6
    @KeepForSdk
    public static String encodeUrlSafeNoPadding(@vo6 byte[] bArr) {
        if (bArr == null) {
            return null;
        }
        return Base64.encodeToString(bArr, 11);
    }
}
