Aqara Home v2.4.1版本的 MD5 值为:529779ac2bc0131db52a1fc3098d2b35
以下内容为反编译后的 WebHelper.java 源代码,内容仅作参考
package com.lumiunited.aqara.web.repository;
import android.content.Context;
import android.util.DisplayMetrics;
import androidx.annotation.Keep;
import com.lumi.external.utils.DateUtilKt;
import com.lumiunited.aqara.service.bean.BlockDetailAttrsEntity;
import com.lumiunited.aqara.service.bean.BlockDetailEntity;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import k.u.c.g0.c.f;
import k.u.c.i.j3.z;
public class WebHelper {
public static int a = 0;
public static int b = 1;
public static int c = 2;
public static final String d = "S_SERVICE_MIX";
public static final String f12838e = "http://192.168.1.24:8089/";
public static final String f12839f = "file:///android_asset/html/index.html";
public static String f12840g = "file:///android_asset/html/index.html";
@Keep
public static class ServiceLogQuery {
public List<String> attrs = new ArrayList();
public String dataRange;
public String sid;
public ServiceLogQuery(BlockDetailEntity blockDetailEntity, int i2) {
char c;
this.sid = blockDetailEntity.getServiceId();
String serviceType = blockDetailEntity.getServiceType();
switch (serviceType.hashCode()) {
case -945557058:
if (serviceType.equals("S_DIMMER")) {
c = 3;
break;
}
c = 65535;
break;
case 213370502:
if (serviceType.equals("S_CURTAIN")) {
c = 1;
break;
}
c = 65535;
break;
case 1564775215:
if (serviceType.equals("S_ARGB_LIGHT")) {
c = 2;
break;
}
c = 65535;
break;
case 1797041684:
if (serviceType.equals("S_CT_LIGHT")) {
c = 4;
break;
}
c = 65535;
break;
case 1979228534:
if (serviceType.equals("S_AQARA_LOCK")) {
c = 0;
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
if (c == 0) {
for (BlockDetailAttrsEntity blockDetailAttrsEntity : blockDetailEntity.getAttrs()) {
if (blockDetailAttrsEntity.getAttr().equals("lock_open_uid")) {
this.attrs.add(blockDetailAttrsEntity.getAttr());
}
}
} else if (c == 1) {
for (BlockDetailAttrsEntity blockDetailAttrsEntity2 : blockDetailEntity.getAttrs()) {
if (blockDetailAttrsEntity2.getAttr().equals("curtain_level")) {
this.attrs.add(blockDetailAttrsEntity2.getAttr());
}
}
} else if (c != 2 && c != 3 && c != 4) {
for (BlockDetailAttrsEntity blockDetailAttrsEntity3 : blockDetailEntity.getAttrs()) {
this.attrs.add(blockDetailAttrsEntity3.getAttr());
}
} else {
for (BlockDetailAttrsEntity blockDetailAttrsEntity4 : blockDetailEntity.getAttrs()) {
if (blockDetailAttrsEntity4.getAttr().equals("on_off")) {
this.attrs.add(blockDetailAttrsEntity4.getAttr());
}
}
}
UpdateDateType(i2);
}
public void UpdateDateType(int i2) {
this.dataRange = i2 == WebHelper.a ? "day" : i2 == WebHelper.b ? "week" : "month";
}
public List<String> getAttrs() {
return this.attrs;
}
public String getSid() {
return this.sid;
}
public void setAttrs(List<String> list) {
this.attrs = list;
}
public void setSid(String str) {
this.sid = str;
}
}
public static class b {
public static final WebHelper a = new WebHelper();
}
public static WebHelper a() {
return b.a;
}
public WebHelper() {
}
public String a(Context context, String str, String str2, int i2) {
String str3 = f12840g;
String language = Locale.getDefault().getLanguage();
String a2 = a(str, str2);
if (context != null) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
int i3 = displayMetrics.widthPixels;
int i4 = displayMetrics.heightPixels;
}
if (str2.contains("lumi.ctrl_dimmer3") || str2.contains("lumi.dimmer.c3egl01") || str2.contains("lumi.ctrl_ln2") || str2.contains("lumi.switch.b2") || str2.contains("lumi.switch.l2") || str2.contains("lumi.ctrl_dualchn") || str2.contains("lumi.ctrl_neutral2")) {
a2 = "multichannel";
} else if (str2.contains("lumi.sensor_86sw2")) {
a2 = "multiPulse";
}
return z.t(str2) ? String.format("%s#/curve/%s?language=%s&isFullScreen=%d&temperatureUnit=%d&model=%s&serviceType=%s", str3, a2, language, Integer.valueOf(i2), Integer.valueOf(!f.d().b()), str2, str) : String.format("%s#/curve/%s?language=%s&isFullScreen=%d&model=%s&serviceType=%s", str3, a2, language, Integer.valueOf(i2), str2, str);
}
public String a(String str, String str2) {
char c2;
switch (str.hashCode()) {
case -2074208615:
if (str.equals("S_SENSOR_VIBRATION")) {
c2 = 11;
break;
}
c2 = 65535;
break;
case -2057105162:
if (str.equals("S_SENSOR_SMOKE")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case -1871546452:
if (str.equals("S_SENSOR_HUMIDITY")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -1349500219:
if (str.equals("S_SENSOR_HT")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -1349500075:
if (str.equals("S_SENSOR_MI")) {
c2 = DateUtilKt.ENTER_CHAR;
break;
}
c2 = 65535;
break;
case 65828936:
if (str.equals("S_SENSOR_ILLUMINATION")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case 210267054:
if (str.equals("S_SENSOR_CUBE")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case 484468975:
if (str.equals("S_SENSOR_MOTION")) {
c2 = 14;
break;
}
c2 = 65535;
break;
case 500166481:
if (str.equals("S_SENSOR_NATGAS")) {
c2 = 7;
break;
}
c2 = 65535;
break;
case 599150910:
if (str.equals("S_SENSOR_PRESSURE")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case 663314541:
if (str.equals("S_SENSOR_SWITCH")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case 1021170598:
if (str.equals(d)) {
c2 = '\f';
break;
}
c2 = 65535;
break;
case 1115166251:
if (str.equals("S_SENSOR_HTP")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case 1228079035:
if (str.equals("S_SENSOR_TEMPERATURE")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 1979228534:
if (str.equals("S_AQARA_LOCK")) {
c2 = '\n';
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return "line";
case '\b':
if (str2.contains("lumi.sensor_86sw1") || str2.contains("lumi.sensor_86sw2")) {
return (str2.contains("lumi.remote.b186a") || str2.contains("lumi.remote.b286a")) ? "multiMultiple" : "pulse";
}
break;
case '\t':
case '\n':
case 11:
break;
case '\f':
return "multiCurve";
case '\r':
return "sensor";
case 14:
return "pulse";
default:
return "stepLine";
}
return "multiple";
}
}