百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 d.java 源代码,内容仅作参考
package com.baidu.im.outapp.network;
import android.content.Context;
import com.baidu.im.frame.utils.ac;
import com.baidu.im.frame.utils.ai;
import com.baidu.im.frame.utils.h;
import com.baidu.im.frame.utils.k;
import com.baidu.im.frame.utils.p;
import com.baidu.im.frame.utils.t;
import com.baidu.im.frame.w;
import com.baidu.im.outapp.network.hichannel.Channelinfo;
import com.baidu.im.outapp.network.hichannel.HiCoreEnv;
import com.baidu.im.outapp.network.hichannel.HiCoreSession;
import com.baidu.im.outapp.network.hichannel.NetworkChange_T;
public class d {
private ac by;
private com.baidu.im.outapp.b eZ;
public int fq;
private HiCoreEnv fr;
private HiCoreSession fs;
private c ft;
public d() {
this.fq = 1;
this.fr = new HiCoreEnv();
this.fs = null;
this.by = null;
}
public d(com.baidu.im.outapp.b bVar, ac acVar) {
this.fq = 1;
this.fr = new HiCoreEnv();
this.fs = null;
this.by = null;
this.eZ = bVar;
this.by = acVar;
}
private Channelinfo t(Context context) {
String deviceToken = this.by.getDeviceToken();
if (ai.y(deviceToken) || !deviceToken.endsWith("@@@")) {
deviceToken = k.i(context);
if (deviceToken.endsWith("@@@")) {
this.by.x(deviceToken);
}
}
t.b("HiChannel", "prepare config: channelKey=, DeviceToken=" + deviceToken);
Channelinfo channelinfo = new Channelinfo();
h.a(context, channelinfo);
if (channelinfo.getOsversion() == null) {
channelinfo.setOsversion("");
}
channelinfo.setExtraInfo("");
channelinfo.setChannelKey("");
channelinfo.setDeviceToken(deviceToken);
channelinfo.setSdkversion("AND_1.1.1.1");
return channelinfo;
}
public void a(b bVar) {
try {
if (this.fs != null) {
this.fs.set_notify_callback(bVar);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public boolean a(byte[] bArr, int i) {
try {
if (this.fs != null) {
return this.fs.postMessage(bArr, bArr.length, i);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return false;
}
public int aK() {
try {
if (this.fs != null) {
t.b("HiCoreManager", "connet");
return this.fs.connect();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return -1;
}
public void aL() {
try {
t.b("HiCoreManager", "close");
if (this.fs != null) {
this.fs.deinitSession();
this.fr.destroySession(this.fs);
if (this.fr != null) {
this.fr.deinitEnv();
}
this.fs = null;
this.fr = null;
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void dumpSelf() {
try {
if (this.fs != null) {
this.fs.dumpSelf();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void networkChanged(NetworkChange_T networkChange_T) {
try {
if (this.fs != null) {
this.fs.networkChanged(networkChange_T);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void p() {
try {
if (this.fs != null) {
this.fs.sendKeepAlive();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public int u(Context context) {
try {
if (this.fr == null) {
this.fr = new HiCoreEnv();
}
this.fr.initEnv("");
boolean b = w.b(context);
t.df = b;
if (b) {
this.fq = 1;
} else {
this.fq = 0;
}
this.fr.enableLog(this.fq);
this.ft = new c();
this.fr.set_log_callback(this.ft);
this.fr.initChannelInfo(t(context));
this.fr.initIpist(p.a(this.eZ));
if (this.eZ.aI() == com.baidu.im.outapp.c.PRODUCT) {
this.fs = this.fr.createSession(null);
} else {
this.fs = this.fr.createSession("8001");
}
this.fs.initSession();
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return 0;
}
}