what-the-bank/sources/com/huawei/hms/support/api/hwid/SignOutResult.java

36 lines
1.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.support.api.hwid;
import android.text.TextUtils;
import com.huawei.hms.support.api.client.Result;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.feature.result.CommonConstant;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public class SignOutResult extends Result {
public boolean isSuccess() {
return getStatus().isSuccess();
}
public SignOutResult fromJson(String str) throws JSONException {
if (TextUtils.isEmpty(str)) {
return this;
}
jsonToSuper(new JSONObject(str));
return this;
}
protected void jsonToSuper(JSONObject jSONObject) {
if (jSONObject.has("errorCode")) {
setStatus(new Status(jSONObject.optInt("errorCode"), jSONObject.has("errorMsg") ? jSONObject.optString("errorMsg") : ""));
return;
}
JSONObject optJSONObject = jSONObject.optJSONObject(CommonConstant.KEY_STATUS);
if (optJSONObject != null) {
setStatus(new Status(optJSONObject.optInt(HiAnalyticsConstant.HaKey.BI_KEY_RESULT), optJSONObject.optString("statusMessage", null)));
}
}
}