百度手机卫士 v8.4.5版本的 MD5 值为:c65ef854a40bb6200c4d8c4603c58403
以下内容为反编译后的 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 bx;
private com.baidu.im.outapp.b eW;
public int fn;
private HiCoreEnv fo;
private HiCoreSession fp;
private c fq;
public d() {
this.fn = 1;
this.fo = new HiCoreEnv();
this.fp = null;
this.bx = null;
}
public d(com.baidu.im.outapp.b bVar, ac acVar) {
this.fn = 1;
this.fo = new HiCoreEnv();
this.fp = null;
this.bx = null;
this.eW = bVar;
this.bx = acVar;
}
private Channelinfo t(Context context) {
String deviceToken = this.bx.getDeviceToken();
if (ai.y(deviceToken) || !deviceToken.endsWith("@@@")) {
deviceToken = k.i(context);
if (deviceToken.endsWith("@@@")) {
this.bx.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.fp != null) {
this.fp.set_notify_callback(bVar);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public boolean a(byte[] bArr, int i) {
try {
if (this.fp != null) {
return this.fp.postMessage(bArr, bArr.length, i);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return false;
}
public int aK() {
try {
if (this.fp != null) {
t.b("HiCoreManager", "connet");
return this.fp.connect();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return -1;
}
public void aL() {
try {
t.b("HiCoreManager", "close");
if (this.fp != null) {
this.fp.deinitSession();
this.fo.destroySession(this.fp);
if (this.fo != null) {
this.fo.deinitEnv();
}
this.fp = null;
this.fo = null;
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void dumpSelf() {
try {
if (this.fp != null) {
this.fp.dumpSelf();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void networkChanged(NetworkChange_T networkChange_T) {
try {
if (this.fp != null) {
this.fp.networkChanged(networkChange_T);
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public void p() {
try {
if (this.fp != null) {
this.fp.sendKeepAlive();
}
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
}
public int u(Context context) {
try {
if (this.fo == null) {
this.fo = new HiCoreEnv();
}
this.fo.initEnv("");
boolean b = w.b(context);
t.dd = b;
if (b) {
this.fn = 1;
} else {
this.fn = 0;
}
this.fo.enableLog(this.fn);
this.fq = new c();
this.fo.set_log_callback(this.fq);
this.fo.initChannelInfo(t(context));
this.fo.initIpist(p.a(this.eW));
if (this.eW.aI() == com.baidu.im.outapp.c.PRODUCT) {
this.fp = this.fo.createSession(null);
} else {
this.fp = this.fo.createSession("8001");
}
this.fp.initSession();
} catch (Throwable th) {
t.e("HiCoreManager", th);
}
return 0;
}
}