package com.huawei.hms.activity.internal; import com.huawei.hms.support.log.HMSLog; import com.huawei.hms.utils.JsonUtil; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public class ForegroundInnerHeader { private int a; private String b; private String c; public void fromJson(String str) { try { JSONObject jSONObject = new JSONObject(str); this.a = JsonUtil.getIntValue(jSONObject, "apkVersion"); this.b = JsonUtil.getStringValue(jSONObject, "action"); this.c = JsonUtil.getStringValue(jSONObject, "responseCallbackKey"); } catch (JSONException e) { StringBuilder sb = new StringBuilder("fromJson failed: "); sb.append(e.getMessage()); HMSLog.e("ForegroundInnerHeader", sb.toString()); } } public String toJson() { JSONObject jSONObject = new JSONObject(); try { jSONObject.put("apkVersion", this.a); jSONObject.put("action", this.b); jSONObject.put("responseCallbackKey", this.c); } catch (JSONException e) { StringBuilder sb = new StringBuilder("ForegroundInnerHeader toJson failed: "); sb.append(e.getMessage()); HMSLog.e("ForegroundInnerHeader", sb.toString()); } return jSONObject.toString(); } public String toString() { StringBuilder sb = new StringBuilder("apkVersion:"); sb.append(this.a); sb.append(", action:"); sb.append(this.b); sb.append(", responseCallbackKey:"); sb.append(this.c); return sb.toString(); } public void setResponseCallbackKey(String str) { this.c = str; } public void setApkVersion(int i) { this.a = i; } public void setAction(String str) { this.b = str; } public String getResponseCallbackKey() { return this.c; } public int getApkVersion() { return this.a; } public String getAction() { return this.b; } }