package com.seewo.ota.util;

import android.util.Log;
import com.google.gson.Gson;

/* JADX INFO: compiled from: GsonExt.kt */
/* JADX INFO: loaded from: classes.dex */
public final class m {
    private static final Gson a = new Gson();

    public static final <T> T a(Gson gson, String str, Class<T> cls) {
        f.z.d.k.e(gson, "<this>");
        f.z.d.k.e(str, "json");
        f.z.d.k.e(cls, "clazz");
        try {
            return (T) gson.fromJson(str, (Class) cls);
        } catch (Exception e2) {
            Log.e("GsonExt", "fromJsonOrNull: " + e2.getMessage() + '\n' + str);
            return null;
        }
    }

    public static final Gson b() {
        return a;
    }
}
