CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 h.java 源代码,内容仅作参考
package l0;
import ak.im.module.Notice;
import ak.im.sdk.manager.f1;
import ak.im.utils.Log;
import com.huawei.hms.framework.common.ContainerUtils;
import java.net.URI;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
public class h extends HttpGet {
private Map<String, String> f42982a;
public h() {
HashMap hashMap = new HashMap();
this.f42982a = hashMap;
hashMap.put("device_type", "Bluetooth");
this.f42982a.put("serial_number", Notice.ALL_TYPE);
}
public static StringBuffer getRequestParameter(Map<String, String> map, String str) {
StringBuffer stringBuffer = new StringBuffer("?");
try {
for (Map.Entry<String, String> entry : map.entrySet()) {
stringBuffer.append(entry.getKey());
stringBuffer.append(ContainerUtils.KEY_VALUE_DELIMITER);
stringBuffer.append(URLEncoder.encode(entry.getValue(), str));
stringBuffer.append(ContainerUtils.FIELD_DELIMITER);
}
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
} catch (Exception e10) {
e10.printStackTrace();
}
return stringBuffer;
}
public f exec() {
DefaultHttpClient defaultHttpClient = new DefaultHttpClient();
StringBuffer requestParameter = getRequestParameter(this.f42982a, "UTF-8");
try {
String appSrvHost = f1.getInstance().getServer().getAppSrvHost();
if (appSrvHost != null && !appSrvHost.isEmpty()) {
setURI(new URI(String.format("http://%s/app/firmware/upgrade", appSrvHost) + requestParameter.toString()));
HttpResponse execute = defaultHttpClient.execute(this);
if (execute.getStatusLine().getStatusCode() != 200) {
return null;
}
String entityUtils = EntityUtils.toString(execute.getEntity(), "UTF-8");
Log.i("UpdateRequest", "req is " + entityUtils);
return f.parseJson(entityUtils);
}
return null;
} catch (Exception e10) {
e10.printStackTrace();
return null;
}
}
public String getCurrent_version() {
return this.f42982a.get("current_version");
}
public String getDevice_type() {
return this.f42982a.get("device_type");
}
public String getModule() {
return this.f42982a.get("module");
}
public String getSerial_number() {
return this.f42982a.get("serial_number");
}
public void setCurrent_version(String str) {
this.f42982a.put("current_version", str);
}
public void setDevice_type(String str) {
this.f42982a.put("device_type", str);
}
public void setModule(String str) {
this.f42982a.put("module", str);
}
public void setSerial_number(String str) {
this.f42982a.put("serial_number", str);
}
}