Aqara Home v2.4.1版本的 MD5 值为:529779ac2bc0131db52a1fc3098d2b35
以下内容为反编译后的 v0.java 源代码,内容仅作参考
package k.u.c.d.g.d;
import android.content.Context;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.lumiunited.aqara.device.adddevicepage.bean.BindGatewayResult;
import com.lumiunited.aqara.device.adddevicepage.bean.BindUserWithHomeKit;
import com.lumiunited.aqara.device.adddevicepage.gateway.view.AddGatewayWaitingPageFragment;
import com.lumiunited.aqara.device.adddevicepage.view.bean.AddDeviceListCategoryEntitiy;
import com.lumiunited.aqara.device.devicepage.scenepanel.SceneSubDeviceFragment;
import com.lumiunited.aqara.device.devicewidgets.scenepanel.SceneRelatedBean;
import com.lumiunited.aqara.device.lock.bean.LogEntity;
import com.lumiunited.aqara.device.lock.bean.VerifyManageBean;
import com.lumiunited.aqara.ifttt.bean.DeviceDetailEntity;
import com.lumiunited.aqara.login.bean.UserInfo;
import com.lumiunited.aqara.service.mainpage.bean.OfflineInferEntity;
import com.lumiunited.aqara.service.mainpage.bean.ProfilesEntity;
import com.lumiunited.aqara.user.minepage.bean.ConfigurationEntity;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.taobao.accs.utl.BaseMonitor;
import com.umeng.analytics.AnalyticsConfig;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import k.u.c.d.g.d.v0;
import okhttp3.HttpUrl;
public class v0 {
public static final String A = "app/v1.0/lumi/dev/bluetooth/unbind/gateway";
public static final String B = "app/v1.0/lumi/app/customaction/query";
public static final String C = "app/v1.0/lumi/app/customaction/set";
public static final String D = "app/v1.0/lumi/app/customaction/delete";
public static final String E = "app/v1.0/lumi/dev/bind/query";
public static final String F = "app/v1.0/lumi/app/customaction/write";
public static final String G = "app/v1.0/lumi/app/sequence/detail";
public static final String H = "app/v1.0/lumi/app/sequence/stop";
public static final String I = "app/v1.0/lumi/dev/bindkey";
public static final String J = "app/v1.0/lumi/dev/bind/query";
public static final String K = "app/v1.0/lumi/app/view/config/query";
public static final String L = "app/v1.0/lumi/devex/countdown/task";
public static final String M = "app/v1.0/lumi/devex/countdown/task/query";
public static final String N = "app/v1.0/lumi/devex/countdown/task/pause";
public static final String O = "app/v1.0/lumi/dev/bluetooth/query";
public static final String P = "app/v1.0/lumi/dev/bluetooth/report";
public static final String Q = "app/v1.0/lumi/app/scene/panel/config";
public static final String R = "app/v1.0/lumi/app/scene/panel/type/config";
public static final String S = "app/v1.0/lumi/app/scene/panel/info";
public static final String T = "app/v1.0/lumi/app/scene/panel/query/subscribe";
public static final String U = "app/v1.0/lumi/dev/unbind";
public static final String V = "app/v1.0/lumi/app/config/queryByArea";
public static final String W = "app/v1.0/lumi/app/devicetemplate/query";
public static final String X = "app/v1.0/lumi/dev/installcode";
public static final String Y = "app/v1.0/lumi/app/view/config/support/info/query";
public static final String Z = "app/v1.0/lumi/app/view/panel/config/refresh";
public static String a = "app/v1.0/lumi/app/dev/threecode/query";
public static final String f22112a0 = "app/v1.0/lumi/app/group/config/get";
public static final String b = "app/v1.0/lumi/app/position/device/query";
public static final String f22113b0 = "app/v1.0/lumi/app/group/set";
public static final String c = "app/v1.0/lumi/position/gateway/query";
public static final String f22114c0 = "app/v1.0/lumi/app/dev/query/offline/infer";
public static final String d = "app/v1.0/lumi/dev/replace/select";
public static final String f22115d0 = "app/v1.0/lumi/app/dev/support/query";
public static final String f22116e = "app/v1.0/lumi/app/dev/query/detail";
public static final String e0 = "app/v1.0/lumi/alert/device/query";
public static final String f22117f = "app/v1.0/lumi/dev/info/upload";
public static final String f0 = "app/v1.0/lumi/alert/device/silencer";
public static final String f22118g = "app/v1.0/lumi/dev/unbind";
public static final String g0 = "http://110.43.34.124/app";
public static final String f22119h = "app/v1.0/lumi/dev/replace";
public static final String f22120i = "app/v1.0/lumi/dev/children/query";
public static final String f22121j = "app/v1.0/lumi/dev/subdevice/connect/info";
public static final String f22122k = "app/v1.0/lumi/dev/check/config";
public static final String f22123l = "app/v1.0/lumi/app/dev/query/online";
public static final String f22124m = "app/v1.0/lumi/res/history/aggr/query";
public static final String f22125n = "app/v1.0/lumi/res/history/aggr/query/new";
public static final String f22126o = "app/v1.0/lumi/ota/query/firmware";
public static final String f22127p = "app/v1.0/lumi/ota/upgrade/firmware";
public static final String f22128q = "app/v1.0/lumi/ota/query/upgrade/firmware/progress";
public static final String f22129r = "app/v1.0/lumi/ota/upgrade/cancel";
public static final String f22130s = "app/v1.0/lumi/ota/upgrade/process/info";
public static final String f22131t = "app/v1.0/lumi/position/gateway/support";
public static final String f22132u = "app/v1.0/lumi/dev/bind/user";
public static final String f22133v = "http://192.168.5.1:4567/example";
public static final String f22134w = "app/v1.0/lumi/dev/join/gateway";
public static final String f22135x = "app/v1.0/lumi/dev/lock/query";
public static final String f22136y = "app/v1.0/lumi/dev/lock/update/name";
public static final String f22137z = "app/v1.0/lumi/app/dev/guide/query";
public static class a implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public a(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
if (this.a.isDisposed()) {
return;
}
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class b implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public b(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
JSONArray jSONArray = JSON.parseObject(str).getJSONArray("resultList");
double d = 0.0d;
for (int i2 = 0; i2 < jSONArray.size(); i2++) {
d += Double.parseDouble(jSONArray.getJSONObject(i2).getString("value"));
}
if (this.a.isDisposed()) {
return;
}
this.a.onSuccess(Double.valueOf(d));
}
@Override
public void onFailed(int i2, String str) {
if (this.a.isDisposed()) {
return;
}
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class c implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public c(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class d implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public d(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class e implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public e(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class f implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public f(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class g implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public g(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class h implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public h(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class i implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public i(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class j implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public j(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class k implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public k(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class l implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public l(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class m implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public m(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(JSON.parseArray(str, ConfigurationEntity.class));
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class n implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public n(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(JSON.parseObject(str, OfflineInferEntity.class));
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class o implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public o(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(JSON.parseArray(str, AddDeviceListCategoryEntitiy.class));
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class p implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public p(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class q implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public q(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
if (TextUtils.isEmpty(str)) {
this.a.onSuccess(new ArrayList());
} else {
this.a.onSuccess(JSON.parseArray(str, VerifyManageBean.class));
}
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class r implements k.u.c.d.j.n<String> {
public final k.u.c.d.j.n a;
public r(k.u.c.d.j.n nVar) {
this.a = nVar;
}
@Override
public void onSuccess(String str) {
JSONArray parseArray = JSON.parseArray(str);
if (parseArray != null && parseArray.size() > 0) {
this.a.onSuccess(parseArray.getString(0));
} else {
this.a.onSuccess("");
}
}
@Override
public void onFailed(int i2, String str) {
this.a.onFailed(i2, str);
}
}
public static class s implements k.u.c.d.j.n<String> {
public final p.a.m0 a;
public s(p.a.m0 m0Var) {
this.a = m0Var;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(JSON.parseArray(str, DeviceDetailEntity.class));
}
@Override
public void onFailed(int i2, String str) {
this.a.onError(new k.u.c.d.d.r0.c(i2, str));
}
}
public static class t implements k.u.c.d.j.n<String> {
public final k.u.c.d.j.n a;
public final List b;
public t(k.u.c.d.j.n nVar, List list) {
this.a = nVar;
this.b = list;
}
@Override
public void onSuccess(String str) {
JSONArray jSONArray = JSON.parseObject(str).getJSONArray("devices");
JSONArray jSONArray2 = new JSONArray();
if (jSONArray == null) {
this.a.onSuccess("");
return;
}
List list = this.b;
if (list != null && list.size() > 0) {
for (int i2 = 0; i2 < jSONArray.size(); i2++) {
Iterator it = this.b.iterator();
while (true) {
if (it.hasNext()) {
if (jSONArray.getJSONObject(i2).getString("model").contains((String) it.next())) {
jSONArray2.add(jSONArray.get(i2));
break;
}
}
}
}
this.a.onSuccess(jSONArray2.toJSONString());
return;
}
this.a.onSuccess(jSONArray.toJSONString());
}
@Override
public void onFailed(int i2, String str) {
this.a.onFailed(i2, str);
}
}
public static class u implements k.u.c.d.j.n<String> {
public final k.u.c.d.j.n a;
public u(k.u.c.d.j.n nVar) {
this.a = nVar;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onFailed(i2, str);
}
}
public static class v implements k.u.c.d.j.n<String> {
public final k.u.c.d.j.n a;
public v(k.u.c.d.j.n nVar) {
this.a = nVar;
}
@Override
public void onSuccess(String str) {
this.a.onSuccess(str);
}
@Override
public void onFailed(int i2, String str) {
this.a.onFailed(i2, str);
}
}
public static class w implements k.u.c.d.j.n<String> {
public final k.u.c.d.j.n a;
public w(k.u.c.d.j.n nVar) {
this.a = nVar;
}
@Override
public void onSuccess(String str) {
JSONArray parseArray = JSON.parseArray(str);
if (parseArray == null) {
this.a.onSuccess(HttpUrl.PATH_SEGMENT_ENCODE_SET_URI);
} else {
this.a.onSuccess(parseArray.toJSONString());
}
}
@Override
public void onFailed(int i2, String str) {
this.a.onFailed(i2, str);
}
}
public static void b(String str, String str2) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("subjectId", (Object) str);
jSONObject.put("viewId", (Object) str2);
p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.Z, JSONObject.this, (k.u.c.d.j.n<String>) new v0.k(m0Var));
}
}).b(2L).j().a(k.u.c.d.d.r0.g.b()).subscribe();
}
public static void c(String str, String str2, String str3, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("deviceId", (Object) str);
jSONObject.put("typeValue", (Object) str2);
jSONObject.put("typeName", (Object) str3);
k.u.c.d.d.l0.i().a(f22135x, jSONObject, nVar);
}
public static void e(String str, String str2, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("oldDeviceId", (Object) str);
jSONObject.put("newDeviceId", (Object) str2);
jSONObject.put("rename", (Object) "1");
jSONObject.put("remove", (Object) "1");
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.b(k.u.c.d.g.c.a() + f22119h, jSONObject.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static void f(String str, k.u.c.d.j.n<String> nVar) {
String str2;
if (TextUtils.isEmpty(str)) {
str2 = null;
} else {
str2 = "did=" + str;
}
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(k.u.c.d.g.c.a() + f22126o, "GET", str2, k.u.c.d.d.l0.f(), nVar);
}
public static void g(String str, String str2, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("name", (Object) str2);
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.b(k.u.c.d.g.c.a() + f22117f, jSONObject.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static void h(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(k.u.c.d.g.c.a() + f22128q, "GET", "did=" + str, k.u.c.d.d.l0.f(), nVar);
}
public static void i(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("positionId", (Object) str);
k.u.c.d.d.l0.i().b(I, jSONObject.toJSONString(), nVar);
}
public static void j(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(O, "macAddress=" + str, nVar);
}
public static void k(String str, k.u.c.d.j.n<String> nVar) {
HashMap hashMap = new HashMap();
hashMap.put("bindKey", str);
k.u.c.d.d.l0.i().a("app/v1.0/lumi/dev/bind/query", hashMap, nVar);
}
public static void l(String str, k.u.c.d.j.n<String> nVar) {
HashMap hashMap = new HashMap();
hashMap.put("did", str);
k.u.c.d.d.l0.i().a(f22123l, hashMap, nVar);
}
public static void m(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(k.u.c.d.g.c.a() + a, "GET", "did=" + str, k.u.c.d.d.l0.f(), nVar);
}
public static void n(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(d, "did=" + str, nVar);
}
public static void o(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(k.u.c.d.g.c.a() + f22121j, "GET", "&did=" + str, k.u.c.d.d.l0.f(), nVar);
}
public static void p(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(k.u.c.d.g.c.a() + f22120i, "GET", "did=" + str, k.u.c.d.d.l0.f(), new w(nVar));
}
public static void q(String str, k.u.c.d.j.n<String> nVar) {
HashMap hashMap = new HashMap();
hashMap.put("model", str);
UserInfo a2 = k.u.c.d.d.q0.b().a();
String str2 = "USA";
if (a2 != null && !TextUtils.isEmpty(a2.getArea())) {
str2 = k.u.c.d.d.q0.b().a().getArea();
} else if (!k.u.c.r.l.d.b((Context) null).equals("USA")) {
str2 = "CHN";
}
hashMap.put("area", str2);
k.u.c.d.d.l0.i().a(f22137z, hashMap, nVar);
}
public static void r(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("deviceId", (Object) str);
k.u.c.d.d.l0.i().a(H, jSONObject, nVar);
}
public static void s(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("unbindRule", (Object) "00001");
k.u.c.d.d.l0.i().a("app/v1.0/lumi/dev/unbind", jSONObject, nVar);
}
public static void t(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("unbindRule", (Object) "00001");
k.u.c.d.d.l0.i().a("app/v1.0/lumi/dev/unbind", jSONObject, nVar);
}
public static void u(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("deviceId", (Object) str);
k.u.c.d.d.l0.i().a(A, jSONObject, nVar);
}
public static void v(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().b(P, str, nVar);
}
public static p.a.k0<String> a() {
return p.a.k0.a((p.a.o0) new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.Y, "", new v0.p(m0Var));
}
}).b(3L).a(p.a.s0.d.a.a());
}
public static void d(String str, k.u.c.d.j.n nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("positionId", (Object) str);
k.u.c.d.d.l0.i().a(I, jSONObject, (k.u.c.d.j.n<String>) nVar);
}
public static void a(String str, int i2, p.a.m0 m0Var) throws Exception {
HashMap hashMap = new HashMap();
hashMap.put("deviceId", str);
hashMap.put("type", Integer.valueOf(i2));
k.u.c.d.d.l0.i().a(f22135x, hashMap, new q(m0Var));
}
public static void h(String str, String str2, k.u.c.d.j.n<String> nVar) {
StringBuilder sb = new StringBuilder();
sb.append("model=");
sb.append(str);
if (!TextUtils.isEmpty(str2)) {
sb.append("&type=");
sb.append(str2);
}
k.u.c.d.d.l0.i().a(W, sb.toString(), nVar);
}
public static void d(String str, String str2, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(G, "deviceId=" + str + "&actionId=" + str2, nVar);
}
public static void f(String str, String str2, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("unbindRule", (Object) str2);
k.u.c.d.d.l0.i().a("app/v1.0/lumi/dev/unbind", jSONObject, nVar);
}
public static void g(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(k.u.c.d.g.c.a() + f22130s, "GET", "did=" + str, k.u.c.d.d.l0.f(), nVar);
}
public static p.a.k0<List<VerifyManageBean>> b(final String str, final int i2) {
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
v0.a(str, i2, m0Var);
}
});
}
public static void c(String str, String str2, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(k.u.c.d.g.c.a() + f22116e, "GET", "dids=[\"" + str + "\"]&area=" + str2, k.u.c.d.d.l0.f(), new r(nVar));
}
public static void b(String str, int i2, k.u.c.d.j.n<String> nVar) {
HashMap hashMap = new HashMap();
hashMap.put("deviceId", str);
hashMap.put("type", Integer.valueOf(i2));
k.u.c.d.d.l0.i().a(f22135x, hashMap, nVar);
}
public static void e(String str, k.u.c.d.j.n nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("bindKey", (Object) str);
k.u.c.d.d.l0.i().a("app/v1.0/lumi/dev/bind/query", (Map<String, Object>) jSONObject, (k.u.c.d.j.n<String>) nVar);
}
public static p.a.k0<List<DeviceDetailEntity>> a(List<String> list) {
final StringBuilder sb = new StringBuilder();
sb.append("dids=" + list.toString());
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.f22116e, sb.toString(), new v0.s(m0Var));
}
}).j().a(k.u.c.d.d.r0.g.b());
}
public static p.a.k0<String> d(String str, String str2) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("type", (Object) str2);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.T, (Map<String, Object>) JSONObject.this, (k.u.c.d.j.n<String>) new v0.j(m0Var));
}
});
}
public static void c(String str, k.u.c.d.j.n<String> nVar) {
String str2;
if (TextUtils.isEmpty(str)) {
str2 = null;
} else {
str2 = "positionId=" + str;
}
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(k.u.c.d.g.c.a() + f22126o, "GET", str2, k.u.c.d.d.l0.f(), nVar);
}
public static void a(String str, String str2, boolean z2, k.u.c.d.j.n<String> nVar) {
String str3;
if (z2) {
str3 = "positionId=" + str;
} else {
str3 = "deviceId=" + str2;
}
k.u.c.d.d.l0.i().a(k.u.c.d.g.c.a() + e0, str3, k.u.c.d.d.l0.f(), nVar);
}
public static void b(String str, String str2, String str3, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("wifi", (Object) str);
jSONObject.put("pwd", (Object) str2);
jSONObject.put("bindKey", (Object) str3);
jSONObject.put("country_domain", (Object) k.u.c.r.l.d.g());
k.u.c.d.d.l0.i().b("http://192.168.5.1:4567/example", jSONObject.toString(), (HashMap<String, String>) null, nVar);
}
public static p.a.k0<String> c(String str, String str2) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put(SceneSubDeviceFragment.e7, (Object) str2);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.T, (Map<String, Object>) JSONObject.this, (k.u.c.d.j.n<String>) new v0.i(m0Var));
}
});
}
public static void a(String str, String str2, String str3, boolean z2, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
if (z2) {
jSONObject.put("positionId", (Object) str);
jSONObject.put("deviceModel", (Object) str2);
} else {
jSONObject.put("deviceId", (Object) str3);
}
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.b(k.u.c.d.g.c.a() + f0, jSONObject.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static void b(k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().b(f22134w, "", nVar);
}
public static void b(String str, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("customActionId", (Object) str);
k.u.c.d.d.l0.i().a(D, (Map<String, Object>) jSONObject, nVar);
}
public static p.a.k0<OfflineInferEntity> c(String str) {
final StringBuilder sb = new StringBuilder();
sb.append("did=" + str);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.f22114c0, sb.toString(), new v0.n(m0Var));
}
}).j().a(k.u.c.d.d.r0.g.b());
}
public static void a(JSONObject jSONObject, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.b(k.u.c.d.g.c.a() + f22117f, jSONObject.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static void a(String str, int i2, List<String> list, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i3 = k.u.c.d.d.l0.i();
i3.a(k.u.c.d.g.c.a() + b, "GET", (("positionId=" + str) + "&startIndex=" + i2) + "&size=100", k.u.c.d.d.l0.f(), new t(nVar, list));
}
public static p.a.k0<Map<String, String>> b(String str, String str2, List<String> list) {
final JSONObject a2 = a(str, str2, list);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.f22125n, JSONObject.this, (k.u.c.d.j.n<String>) new v0.a(m0Var));
}
}).i(new p.a.x0.o() {
@Override
public final Object apply(Object obj) {
return v0.a((String) obj);
}
}).a(k.u.c.d.d.r0.g.b());
}
public static void a(String str, int i2, int i3, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i4 = k.u.c.d.d.l0.i();
i4.a(k.u.c.d.g.c.a() + b, "GET", "positionId=" + str + "&startIndex=" + i2 + "&size=" + i3, k.u.c.d.d.l0.f(), new u(nVar));
}
public static void b(String str, String str2, k.u.c.d.j.n<String> nVar) {
HashMap hashMap = new HashMap();
hashMap.put("subjectId", str);
hashMap.put("extraKey", str2);
k.u.c.d.d.l0.i().a(M, hashMap, nVar);
}
public static void a(String str, String str2, String str3, int i2, int i3, k.u.c.d.j.n<String> nVar) {
StringBuilder sb = new StringBuilder();
sb.append("positionId=");
sb.append(str);
sb.append("&startIndex=");
sb.append(i2);
sb.append("&size=");
sb.append(i3);
if (!TextUtils.isEmpty(str3)) {
sb.append("&categoryValue=");
sb.append(str3);
}
if (!TextUtils.isEmpty(str2)) {
sb.append("&deviceName=");
sb.append(str2);
}
k.u.c.d.d.l0 i4 = k.u.c.d.d.l0.i();
i4.a(k.u.c.d.g.c.a() + b, "GET", sb.toString(), k.u.c.d.d.l0.f(), new v(nVar));
}
public static void b(String str, String str2, String str3, String str4, k.u.c.d.j.n<String> nVar) {
StringBuilder sb = new StringBuilder();
sb.append("subjectId=");
sb.append(str);
sb.append("&viewId=");
sb.append(str2);
if (!TextUtils.isEmpty(str4)) {
sb.append("&options=");
sb.append(str4);
}
if (!TextUtils.isEmpty(str3)) {
sb.append("&version=");
sb.append(str3);
}
k.u.c.d.d.l0.i().a(K, sb.toString(), nVar);
}
public static void a(String str, String str2, int i2, int i3, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(f22131t, "positionId=" + str + "&model=" + str2 + "&startIndex=" + i2 + "&size=" + i3, nVar);
}
public static p.a.k0<String> b(String str, int i2, List<String> list) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("subjectType", (Object) Integer.valueOf(i2));
jSONObject.put("type", (Object) list);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.S, (Map<String, Object>) JSONObject.this, (k.u.c.d.j.n<String>) new v0.h(m0Var));
}
});
}
public static p.a.k0<String> b(String str) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.X, (Map<String, Object>) JSONObject.this, (k.u.c.d.j.n<String>) new v0.l(m0Var));
}
}).j().a(k.u.c.d.d.r0.g.b());
}
public static void a(String str, int i2, k.u.c.d.j.n<String> nVar) {
StringBuilder sb = new StringBuilder();
sb.append("&positionId=" + str);
sb.append("&startIndex=" + i2);
sb.append("&size=300");
k.u.c.d.d.l0 i3 = k.u.c.d.d.l0.i();
i3.a(k.u.c.d.g.c.a() + c, "GET", sb.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static p.a.k0<List<AddDeviceListCategoryEntitiy>> b(String str, String str2, String str3) {
final StringBuilder sb = new StringBuilder();
sb.append("area=" + str);
if (!TextUtils.isEmpty(str2)) {
sb.append("&models=" + str2);
}
if (!TextUtils.isEmpty(str3)) {
sb.append("&pids=" + str3);
}
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.f22115d0, sb.toString(), new v0.o(m0Var));
}
}).j().a(k.u.c.d.d.r0.g.b());
}
public static void a(List<String> list, Map<String, List<String>> map, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("dids", (Object) list);
jSONObject.put("type", (Object) "1");
if (map != null) {
jSONObject.put("didMap", (Object) map);
}
k.u.c.d.d.l0.i().a(f22127p, jSONObject, nVar);
}
public static void a(List<String> list, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("dids", (Object) list);
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.b(k.u.c.d.g.c.a() + f22129r, jSONObject.toString(), k.u.c.d.d.l0.f(), nVar);
}
public static void a(Map<String, String> map, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, String> entry : map.entrySet()) {
jSONObject.put(entry.getKey(), (Object) entry.getValue());
}
k.u.c.d.d.l0.i().b("http://192.168.5.1:4567/example", jSONObject.toString(), (HashMap<String, String>) null, nVar);
}
public static void a(k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(BaseMonitor.COUNT_ACK, (Object) 1);
k.u.c.d.d.l0.i().b("http://192.168.5.1:4567/example", jSONObject.toString(), (HashMap<String, String>) null, nVar);
}
public static p.a.l a(BindUserWithHomeKit bindUserWithHomeKit) {
return k.u.c.d.d.r0.f.a(k.u.c.d.g.c.a() + f22132u, JSON.toJSONString(bindUserWithHomeKit.getDids().get(0)), BindGatewayResult.class);
}
public static void a(String str, String str2, k.u.c.d.j.n nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("positionId", (Object) str2);
k.u.c.d.d.l0.i().b(f22132u, jSONObject.toJSONString(), nVar);
}
public static void a(BindUserWithHomeKit bindUserWithHomeKit, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0.i().a(f22132u, (JSONObject) JSON.toJSON(bindUserWithHomeKit.getDids().get(0)), nVar);
}
public static void a(String str, k.u.c.d.j.n<String> nVar) {
k.u.c.d.d.l0 i2 = k.u.c.d.d.l0.i();
i2.a(f22122k, "did=" + str, nVar);
}
public static void a(String str, String str2, String str3, String str4, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("userDeviceId", (Object) str);
jSONObject.put("deviceModel", (Object) str2);
jSONObject.put("actionId", (Object) str3);
jSONObject.put("channel", (Object) str4);
k.u.c.d.d.l0.i().a(B, jSONObject, nVar);
}
public static void a(String str, String str2, String str3, String str4, String str5, String str6, String str7, k.u.c.d.j.n<String> nVar) {
a(str, str2, null, str3, str4, str5, str6, str7, null, 0, null, nVar);
}
public static void a(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, int i2, String str10, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("actionType", (Object) str);
jSONObject.put("customName", (Object) str2);
jSONObject.put("icon", (Object) str3);
jSONObject.put("deviceModel", (Object) str4);
jSONObject.put("userDeviceId", (Object) str5);
jSONObject.put("customActionId", (Object) str6);
jSONObject.put("value", (Object) str7);
jSONObject.put("actionId", (Object) str8);
jSONObject.put("channel", (Object) str10);
if (!TextUtils.isEmpty(str9)) {
jSONObject.put("subType", (Object) str9);
}
jSONObject.put("preview", (Object) Integer.valueOf(i2));
k.u.c.d.d.l0.i().a(C, jSONObject, nVar);
}
public static void a(ProfilesEntity.DefaultCustomActionsBean defaultCustomActionsBean, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("actionType", (Object) defaultCustomActionsBean.getActionType());
jSONObject.put("customName", (Object) defaultCustomActionsBean.getCustomName());
jSONObject.put("deviceModel", (Object) defaultCustomActionsBean.getDeviceModel());
jSONObject.put("userDeviceId", (Object) defaultCustomActionsBean.getUserDeviceId());
jSONObject.put("customActionId", (Object) defaultCustomActionsBean.getCustomActionId());
jSONObject.put("value", (Object) defaultCustomActionsBean.getValue());
jSONObject.put("actionId", (Object) defaultCustomActionsBean.getActionId());
k.d.a.d("url = " + k.u.c.d.g.c.a() + C);
k.u.c.d.d.l0.i().a(C, jSONObject, nVar);
}
public static Map a(String str) throws Exception {
HashMap hashMap = new HashMap();
if (str != null && !"".equals(str)) {
for (LogEntity logEntity : JSON.parseArray(JSON.parseObject(str).getString("resultList"), LogEntity.class)) {
hashMap.put(logEntity.getAttr(), logEntity.getValue());
}
}
return hashMap;
}
public static p.a.k0<Double> a(String str, String str2) {
ArrayList arrayList = new ArrayList();
arrayList.add("cost_energy");
final JSONObject a2 = a(str, str2, (List<String>) arrayList);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.f22125n, JSONObject.this, (k.u.c.d.j.n<String>) new v0.b(m0Var));
}
}).a(k.u.c.d.d.r0.g.b());
}
public static p.a.k0<Double> a(String str, int i2) {
return a(str, i2 != 1 ? "month" : "day");
}
public static JSONObject a(String str, String str2, List<String> list) {
char c2;
long timeInMillis;
long timeInMillis2;
long j2;
Calendar calendar = Calendar.getInstance();
int hashCode = str2.hashCode();
if (hashCode != 99228) {
if (hashCode == 104080000 && str2.equals("month")) {
c2 = 1;
}
c2 = 65535;
} else {
if (str2.equals("day")) {
c2 = 0;
}
c2 = 65535;
}
long j3 = 0;
if (c2 == 0) {
timeInMillis = calendar.getTimeInMillis();
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, 0);
calendar.set(14, 0);
timeInMillis2 = calendar.getTimeInMillis();
} else if (c2 == 1) {
timeInMillis = calendar.getTimeInMillis();
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, 0);
calendar.set(14, 0);
calendar.set(5, 1);
timeInMillis2 = calendar.getTimeInMillis();
} else {
j2 = 0;
JSONObject jSONObject = new JSONObject();
jSONObject.put("subjectId", (Object) str);
jSONObject.put("attrs", (Object) list);
jSONObject.put("dimensionType", (Object) str2);
jSONObject.put(AnalyticsConfig.RTD_START_TIME, (Object) Long.valueOf(j3));
jSONObject.put("endTime", (Object) Long.valueOf(j2));
jSONObject.put("aggrType", (Object) "difference");
return jSONObject;
}
long j4 = timeInMillis2;
j2 = timeInMillis;
j3 = j4;
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("subjectId", (Object) str);
jSONObject2.put("attrs", (Object) list);
jSONObject2.put("dimensionType", (Object) str2);
jSONObject2.put(AnalyticsConfig.RTD_START_TIME, (Object) Long.valueOf(j3));
jSONObject2.put("endTime", (Object) Long.valueOf(j2));
jSONObject2.put("aggrType", (Object) "difference");
return jSONObject2;
}
public static void a(String str, String str2, String str3, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("positionId", (Object) str);
jSONObject.put(AddGatewayWaitingPageFragment.j7, (Object) str2);
jSONObject.put("deviceCipherText", (Object) str3);
k.u.c.d.d.l0.i().b(I, jSONObject.toJSONString(), nVar);
}
public static void a(int i2, int i3, String str, String str2, String str3, Object obj, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(PushConstants.MZ_PUSH_MESSAGE_METHOD, (Object) Integer.valueOf(i2));
jSONObject.put("countdown", (Object) Integer.valueOf(i3));
jSONObject.put("subjectId", (Object) str);
jSONObject.put("subjectModel", (Object) str2);
jSONObject.put("extraKey", (Object) str3);
jSONObject.put(NotificationCompat.WearableExtender.KEY_ACTIONS, obj);
k.u.c.d.d.l0.i().a(L, jSONObject, nVar);
}
public static void a(int i2, String str, String str2, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(PushConstants.MZ_PUSH_MESSAGE_METHOD, (Object) Integer.valueOf(i2));
jSONObject.put("subjectId", (Object) str);
jSONObject.put("extraKey", (Object) str2);
k.u.c.d.d.l0.i().a(N, jSONObject, nVar);
}
public static void a(String str, JSONObject jSONObject, k.u.c.d.j.n<String> nVar) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("subjectId", (Object) str);
jSONObject2.put("data", (Object) jSONObject);
k.u.c.d.d.l0.i().a(F, jSONObject2, nVar);
}
public static p.a.k0<String> a(String str, String str2, String str3) {
final StringBuilder sb = new StringBuilder();
sb.append("subjectId=");
sb.append(str);
sb.append("&viewId=");
sb.append(str2);
if (!TextUtils.isEmpty(str3)) {
sb.append("&options=");
sb.append(str3);
}
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.K, sb.toString(), new v0.c(m0Var));
}
});
}
public static p.a.k0<String> a(String str, List<SceneRelatedBean> list) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("configs", (Object) list);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().b(v0.Q, JSONObject.this.toString(), new v0.d(m0Var));
}
});
}
public static p.a.k0<String> a(String str, SceneRelatedBean sceneRelatedBean) {
final JSONObject jSONObject = new JSONObject();
ArrayList arrayList = new ArrayList();
arrayList.add(sceneRelatedBean);
jSONObject.put("did", (Object) str);
jSONObject.put("subjectType", (Object) sceneRelatedBean.getSubjectType());
jSONObject.put("typeInfos", (Object) arrayList);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().b(v0.R, JSONObject.this.toString(), new v0.e(m0Var));
}
});
}
public static p.a.k0<String> a(String str, String str2, ArrayList<SceneRelatedBean> arrayList) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("subjectType", (Object) str2);
jSONObject.put("typeInfos", (Object) arrayList);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().b(v0.R, JSONObject.this.toString(), new v0.f(m0Var));
}
});
}
public static p.a.k0<String> a(String str, int i2, List<String> list) {
final JSONObject jSONObject = new JSONObject();
jSONObject.put("did", (Object) str);
jSONObject.put("subjectType", (Object) Integer.valueOf(i2));
jSONObject.put("configValues", (Object) Arrays.asList(1, 2));
jSONObject.put(SceneSubDeviceFragment.e7, (Object) list);
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.S, (Map<String, Object>) JSONObject.this, (k.u.c.d.j.n<String>) new v0.g(m0Var));
}
});
}
public static p.a.k0<List<ConfigurationEntity>> a(List<String> list, String str) {
final StringBuilder sb = new StringBuilder();
sb.append("symbols=" + list.toString() + "&");
StringBuilder sb2 = new StringBuilder();
sb2.append("area=");
sb2.append(str);
sb.append(sb2.toString());
return p.a.k0.a(new p.a.o0() {
@Override
public final void subscribe(p.a.m0 m0Var) {
k.u.c.d.d.l0.i().a(v0.V, sb.toString(), new v0.m(m0Var));
}
}).j().a(k.u.c.d.d.r0.g.b());
}
}