性メ囘め意 v4.1.7版本的 MD5 值为:454244359250cd2ed989b9b0210c6279
以下内容为反编译后的 WindApp.java 源代码,内容仅作参考
package com.wind.im;
import android.app.Application;
import android.content.Intent;
import android.os.Build;
import android.text.TextUtils;
import androidx.lifecycle.Observer;
import com.alibaba.android.arouter.launcher.ARouter;
import com.cf.msc.sdk.AppVest;
import com.fm.openinstall.OpenInstall;
import com.fm.openinstall.OpenInstallHelper;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.pawethbhky.message.ImKitMessage;
import com.tencent.bugly.crashreport.CrashReport;
import com.wind.im.push.KitPushApplication;
import com.wind.im.push.PushClientCallable;
import com.wind.im.service.WindMessageForegroundService;
import com.wind.imlib.WindClient;
import com.wind.imlib.bean.PushType;
import com.wind.imlib.bean.WindIMEvent;
import com.wind.imlib.bean.WindIMMessage;
import com.wind.imlib.bean.event.WindEvent;
import com.wind.imlib.connect.TokenManager;
import com.wind.imlib.connect.callback.ConnectStatusCallBack;
import com.wind.imlib.connect.http.error.ApiException;
import com.wind.imlib.connect.http.error.TokenInvalidException;
import com.wind.imlib.db.manager.CommSettingManager;
import com.wind.imlib.protocol.event.MessageRemindEvent;
import com.wind.kit.ImKit;
import com.wind.kit.KitRoutePath;
import com.wind.kit.common.KitToast;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import timber.log.Timber;
public class WindApp extends Application implements PushClientCallable {
@Override
public void onError(PushType type, String message) {
}
@Override
public void onReceivedToken(PushType type, String token) {
}
@Override
public void onCreate() {
super.onCreate();
handleSSLHandshake();
if (!TextUtils.isEmpty("d54bd5ac75afabf91078e5295c9df199") && !TextUtils.isEmpty("Y9Dzb98W/UYg6EaKPpzCr7kT/TK6/s7mXccUJ4i7nd92LoGoR6tdWw0tiLjwEy1xYwkjyutizgo8l2Y0W+/DW55/FmRqHEn+eDQPYu4nUoWZPDkCXB4uSFYHqhlEoO0/KNu5a/5DdI7HU5cv5bDc4BtyV0EYoi7UMRgFX63pTvCsfZnetxP7ho6c") && AppVest.init("d54bd5ac75afabf91078e5295c9df199", "Y9Dzb98W/UYg6EaKPpzCr7kT/TK6/s7mXccUJ4i7nd92LoGoR6tdWw0tiLjwEy1xYwkjyutizgo8l2Y0W+/DW55/FmRqHEn+eDQPYu4nUoWZPDkCXB4uSFYHqhlEoO0/KNu5a/5DdI7HU5cv5bDc4BtyV0EYoi7UMRgFX63pTvCsfZnetxP7ho6c") == -1) {
Timber.i("MainActivity Appvest init failed", new Object[0]);
}
ImKit.getInstance().init(this);
CrashReport.UserStrategy userStrategy = new CrashReport.UserStrategy(this);
userStrategy.setAppChannel("lxine.xingliaoshiduiejiqun.iyig");
CrashReport.initCrashReport(getApplicationContext(), userStrategy);
if (!TextUtils.isEmpty("s5w0ra") && OpenInstallHelper.isMainProcess(getApplicationContext())) {
OpenInstall.init(getApplicationContext());
}
String userIpNode = TokenManager.getUserIpNode();
if (TextUtils.isEmpty(userIpNode)) {
userIpNode = "http://www.baidu.com:8805";
}
WindClient.getInstance().init(WindClient.ConnectMethod.HTTP, userIpNode, "http://www.baidu.com:8805", "", BuildConfig.IGNORE_IP_SERVERS, false, BuildConfig.HIDE_SERVER).connect(new ConnectStatusCallBack() {
@Override
public void onPingDelay(int timeout) {
LiveEventBus.get(WindEvent.PING, Integer.class).post(Integer.valueOf(timeout));
}
@Override
public void onError(Throwable throwable) {
if (throwable instanceof ApiException) {
ApiException apiException = (ApiException) throwable;
if (apiException.getCode() == 1004) {
LiveEventBus.get(WindEvent.PING, Integer.class).post(999);
return;
} else {
Timber.e(apiException.getDisplayMessage(), new Object[0]);
return;
}
}
Timber.e(throwable);
}
@Override
public void onConnectSuccess(WindClient.ConnectMethod method) {
Timber.i("%s Connect Success", method.name());
Timber.i("userId=%s,token=%s", Long.valueOf(TokenManager.getUserId()), TokenManager.getToken());
}
@Override
public void onTokenInvalid(TokenInvalidException e) {
Timber.e(e.getDisplayMessage(), new Object[0]);
WindClient.getInstance().quit();
KitToast.error("登录信息失效,请重新登录");
ARouter.getInstance().build(KitRoutePath.LOGIN).navigation();
}
@Override
public void onAuthSuccess() {
KitPushApplication.getInstance().onAuthSuccess();
}
@Override
public void onReceiveMessage(List<WindIMMessage> message) {
MessageCenter.receivedMessage(message);
}
@Override
public void onReceiveEvent(List<WindIMEvent> events) {
EventCenter.onReceiveEvent(events);
}
});
KitPushApplication.getInstance().init(this, this);
LiveEventBus.get(WindEvent.MESSAGE_REMIND_EVENT, MessageRemindEvent.class).observeForever(new Observer<MessageRemindEvent>() {
@Override
public void onChanged(MessageRemindEvent messageRemindEvent) {
ImKitMessage.getInstance().showGroupStrongRemind(messageRemindEvent);
}
});
LiveEventBus.get(WindEvent.PUSH_ENABLE, Boolean.class).observeForever(new Observer<Boolean>() {
@Override
public void onChanged(Boolean aBoolean) {
if (aBoolean.booleanValue()) {
KitPushApplication.getInstance().openPush();
} else {
KitPushApplication.getInstance().closePush();
}
}
});
LiveEventBus.get("strong_push", Boolean.class).observeForever(new Observer<Boolean>() {
@Override
public void onChanged(Boolean aBoolean) {
if (aBoolean.booleanValue()) {
Intent intent = new Intent(WindApp.this, (Class<?>) WindMessageForegroundService.class);
if (Build.VERSION.SDK_INT >= 26) {
WindApp.this.startForegroundService(intent);
} else {
WindApp.this.startService(intent);
}
KitPushApplication.getInstance().closePush();
return;
}
WindApp.this.stopService(new Intent(WindApp.this, (Class<?>) WindMessageForegroundService.class));
if (CommSettingManager.getPushEnable()) {
KitPushApplication.getInstance().openPush();
}
}
});
if (CommSettingManager.getStrongPushEnable()) {
Intent intent = new Intent(this, (Class<?>) WindMessageForegroundService.class);
if (Build.VERSION.SDK_INT >= 26) {
startForegroundService(intent);
} else {
startService(intent);
}
KitPushApplication.getInstance().closePush();
return;
}
if (CommSettingManager.getPushEnable()) {
KitPushApplication.getInstance().openPush();
}
}
public static void handleSSLHandshake() {
try {
TrustManager[] trustManagerArr = {new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}};
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, trustManagerArr, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sSLContext.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
} catch (Exception unused) {
}
}
}