jimu-decompiled/sources/com/baidu/license/download/nx.java
2025-05-13 19:24:51 +02:00

79 lines
2.3 KiB
Java

package com.baidu.license.download;
import android.text.TextUtils;
import com.liulishuo.filedownloader.model.FileDownloadModel;
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
import com.unity3d.ads.metadata.MediationMetaData;
import org.json.JSONException;
import org.json.JSONObject;
/* compiled from: RequestTask.java */
/* loaded from: classes.dex */
public final class nx {
private int e;
private String h;
private String a = "";
private String b = "";
private String c = "";
private String d = "";
private String f = "";
private int g = 0;
public final JSONObject a() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(MediationMetaData.KEY_NAME, this.a);
jSONObject.put(JockstickDataConverter.ID, this.b);
jSONObject.put("image", this.c);
jSONObject.put("url", this.d);
jSONObject.put("progress", this.e);
jSONObject.put("downloadPerSize", this.f);
jSONObject.put(FileDownloadModel.STATUS, this.g);
jSONObject.put("savePath", this.h);
} catch (JSONException e) {
e.printStackTrace();
}
return jSONObject;
}
public final String b() {
return this.d;
}
public final void c(String str) {
this.h = str;
}
public final void b(String str) {
this.f = str;
}
public final void b(int i) {
this.g = i;
}
public final boolean a(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
try {
JSONObject jSONObject = new JSONObject(str);
this.a = jSONObject.optString(MediationMetaData.KEY_NAME);
this.b = jSONObject.optString(JockstickDataConverter.ID);
this.c = jSONObject.optString("image");
this.d = jSONObject.optString("url");
this.e = jSONObject.optInt("progress");
this.f = jSONObject.optString("downloadPerSize");
this.g = jSONObject.optInt(FileDownloadModel.STATUS);
this.h = jSONObject.optString("savePath");
return true;
} catch (JSONException unused) {
return false;
}
}
public final void a(int i) {
this.e = i;
}
}