package com.ifpdos.debugmenu.action;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.ifpdos.debugmenu.R;
import com.ifpdos.debugmenu.action.base.ItemInfoAction;
import com.ifpdos.udi.sdk.UdiSdk;
import com.seewo.sdk.model.HardwareInfo;
import d.f.a.v0;
import java.io.IOException;
import okhttp3.Request;
import okhttp3.Response;

/* JADX INFO: loaded from: classes.dex */
public class ShowEdidChecksumAction extends ItemInfoAction implements v0 {
    private static final String TAG = "ShowEdidChecksumAction";
    private String standard_data;

    public ShowEdidChecksumAction(Context context) {
        super(context);
    }

    @Override // com.ifpdos.debugmenu.action.base.ItemInfoAction
    @SuppressLint({"LongLogTag"})
    public String getValue(Context context) {
        Log.i(TAG, TAG);
        try {
            Response responseExecute = UdiSdk.newOkHttpClientBuilder().build().newCall(new Request.Builder().url(UdiSdk.getFullUrl("/v1/device/hardware/info/edid/checksum")).build()).execute();
            JsonObject jsonObject = (JsonObject) new Gson().fromJson(responseExecute.body().string(), JsonObject.class);
            Log.i(TAG, "ShowEdidChecksumAction status:" + jsonObject.get("status"));
            Log.i(TAG, "ShowEdidChecksumAction info:" + jsonObject.get("info"));
            return (responseExecute.code() == 200 && HardwareInfo.HardwareStatus.PASS.name().equals(jsonObject.get("status").getAsString())) ? jsonObject.get("info").getAsString() : this.mContext.getString(R.string.fail);
        } catch (IOException e2) {
            e2.printStackTrace();
            return this.mContext.getString(R.string.fail);
        }
    }

    @Override // d.f.a.v0
    public void setStandData(String str) {
        this.standard_data = str;
    }
}
