热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.qiyukf.unicorn;
import android.content.Context;
import android.os.Looper;
import android.text.TextUtils;
import com.google.android.material.timepicker.TimeModel;
import com.qiyukf.module.log.LogPulseClient;
import com.qiyukf.nimlib.sdk.NIMClient;
import com.qiyukf.nimlib.sdk.RequestCallback;
import com.qiyukf.nimlib.sdk.SDKOptions;
import com.qiyukf.nimlib.sdk.ServerAddresses;
import com.qiyukf.nimlib.sdk.StatusBarNotificationConfig;
import com.qiyukf.nimlib.sdk.msg.constant.MsgDirectionEnum;
import com.qiyukf.nimlib.sdk.msg.model.IMMessage;
import com.qiyukf.sentry.a.ai;
import com.qiyukf.sentry.a.aq;
import com.qiyukf.sentry.a.au;
import com.qiyukf.sentry.a.av;
import com.qiyukf.sentry.a.e.q;
import com.qiyukf.sentry.a.e.t;
import com.qiyukf.sentry.android.core.w;
import com.qiyukf.sentry.android.core.x;
import com.qiyukf.uikit.session.emoji.StickerManager;
import com.qiyukf.unicorn.api.UnicornImageLoader;
import com.qiyukf.unicorn.api.YSFOptions;
import com.qiyukf.unicorn.api.YSFUserInfo;
import com.qiyukf.unicorn.api.event.UnicornEventBase;
import com.qiyukf.unicorn.api.event.entry.ClickAvatarEntry;
import com.qiyukf.unicorn.c;
import com.qiyukf.unicorn.n.i;
import com.qiyukf.unicorn.n.j;
import com.qiyukf.unicorn.n.k;
import com.qiyukf.unicorn.n.l;
import com.qiyukf.unicorn.n.o;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class c {
private static Locale f21975i;
private static c f21979m;
private Context f21981b;
private String f21982c;
private YSFOptions f21983d;
private UnicornImageLoader f21984e;
private com.qiyukf.unicorn.k.d f21985f;
private b f21986g;
private com.qiyukf.unicorn.h.a f21987h;
private static final Logger f21974a = LoggerFactory.getLogger(c.class);
private static boolean f21976j = false;
private static boolean f21977k = false;
private static final Object f21978l = new Object();
private static List<a> f21980n = new ArrayList();
public interface a {
void onInit();
}
private c() {
}
public static Context e() {
return a().f21981b;
}
public static String f() {
return a().f21982c;
}
public static YSFOptions g() {
return a().f21983d;
}
public static UnicornImageLoader h() {
return a().f21984e;
}
public static com.qiyukf.unicorn.k.d i() {
return a().f21985f;
}
public static b j() {
return a().f21986g;
}
public static void n() {
NIMClient.initSDK();
com.qiyukf.nimlib.c.a(com.qiyukf.nimlib.ysf.b.b.a().a());
}
public static boolean o() {
f21977k = true;
return true;
}
private static void q() {
c cVar;
f21974a.info("init sdk is start");
if (d.a() && ((cVar = f21979m) == null || cVar.f21981b == null || TextUtils.isEmpty(cVar.f21982c) || f21979m.f21983d == null)) {
throw new IllegalStateException("initSdkPrivate,SDK should be config on Application#onCreate()!");
}
j.a(new AnonymousClass4());
}
public static c b(Context context, String str, YSFOptions ySFOptions, UnicornImageLoader unicornImageLoader) {
f(context, str, ySFOptions, unicornImageLoader);
return f21979m;
}
public static void d(Context context, String str, YSFOptions ySFOptions, UnicornImageLoader unicornImageLoader) {
try {
if (f21977k) {
b(ySFOptions);
} else {
e(context, str, ySFOptions, unicornImageLoader);
}
} catch (Throwable th) {
f21974a.error("init error", th);
}
}
private static void e(Context context, String str, YSFOptions ySFOptions, UnicornImageLoader unicornImageLoader) {
f(context, str, ySFOptions, unicornImageLoader);
q();
}
private static void f(Context context, String str, YSFOptions ySFOptions, final UnicornImageLoader unicornImageLoader) {
try {
if (f21976j) {
f21974a.info("initialize has started");
return;
}
boolean z10 = true;
f21976j = true;
d.a(context);
i.a(context);
if (ySFOptions == null || !ySFOptions.isMixSDK) {
z10 = false;
}
com.qiyukf.unicorn.d.c.a(context, str, z10);
if (d.a()) {
o.a(context);
l.a(context);
com.qiyukf.unicorn.a.b.a(context);
c cVar = new c();
f21979m = cVar;
cVar.f21981b = context;
cVar.f21982c = str;
cVar.f21983d = ySFOptions == null ? YSFOptions.DEFAULT : ySFOptions;
}
if (ySFOptions == null) {
ySFOptions = YSFOptions.DEFAULT;
}
a(context, str, ySFOptions);
f21974a.info("config sdk is end");
j.a(new Runnable() {
@Override
public final void run() {
try {
if (d.a()) {
c.f21979m.f21984e = UnicornImageLoader.this;
}
} catch (Throwable th) {
c.f21974a.error("init error", th);
}
}
});
} catch (Throwable th) {
f21979m = null;
b(th);
}
}
public static boolean c() {
return f21977k;
}
public static c a() {
c cVar = f21979m;
if (cVar != null) {
return cVar;
}
throw new IllegalStateException("QIYU not initialized!");
}
public static void b() {
q();
}
public static void b(a aVar) {
f21980n.remove(aVar);
}
public static class AnonymousClass4 implements Runnable {
public static void a(x xVar) {
xVar.a("https://8593144935bb47e4aeb6c1436e86aa68@sentry.music.163.com/1537");
xVar.d(String.format("%s@%s+%d", "com.qiyukf.unicorn", "7.10.0", 124));
xVar.g(String.format(TimeModel.NUMBER_FORMAT, 124));
xVar.a(false);
xVar.f(c.f21979m.f21981b.getPackageName());
xVar.a(new av.b() {
@Override
public final aq execute(aq aqVar, Object obj) {
aq a10;
a10 = c.AnonymousClass4.a(aqVar, obj);
return a10;
}
});
}
@Override
public final void run() {
try {
if (d.a()) {
com.qiyukf.unicorn.d.a.a(c.f21979m.f21981b, c.f21979m.f21982c, c.f21979m.f21983d);
}
YSFOptions ySFOptions = c.f21979m.f21983d;
Context unused = c.f21979m.f21981b;
String unused2 = c.f21979m.f21982c;
c.n();
c.a(c.f21979m.f21981b, ySFOptions);
if (d.a()) {
c.a(c.f21979m, c.f21979m.f21981b);
com.qiyukf.unicorn.f.a.a((Throwable) null);
}
w.a(c.f21979m.f21981b, new ai.a() {
@Override
public final void configure(av avVar) {
c.AnonymousClass4.a((x) avVar);
}
});
t tVar = new t();
HashMap hashMap = new HashMap();
hashMap.put(com.heytap.mcssdk.constant.b.f17208z, c.f21979m.f21982c);
hashMap.put("appName", k.b(c.f21979m.f21981b));
hashMap.put("isFusion", String.valueOf(c.f21979m.f21983d.isMixSDK));
tVar.b(hashMap);
ai.a(tVar);
c.o();
j.b(new Runnable() {
@Override
public final void run() {
for (a aVar : c.f21980n) {
if (aVar != null) {
aVar.onInit();
}
}
}
});
c.f21974a.info("init sdk is end");
} catch (Throwable th) {
if (c.f21979m == null) {
return;
}
Context unused3 = c.f21979m.f21981b;
c.b(th);
}
}
public static aq a(aq aqVar, Object obj) {
if (!au.INFO.equals(aqVar.j()) || aqVar.c().a().length() <= 0) {
if (aqVar.i() != null && aqVar.i().size() > 0) {
List<q> a10 = aqVar.i().get(0).b().a();
for (int size = a10.size() - 1; size >= 0; size--) {
q qVar = a10.get(size);
if (qVar.b().booleanValue() || qVar.a().startsWith("android.app.Instrumentation")) {
return null;
}
if (qVar.a().startsWith("com.qiyukf")) {
return aqVar;
}
}
}
return null;
}
return aqVar;
}
}
public static c a(Context context, final String str, final YSFOptions ySFOptions, final UnicornImageLoader unicornImageLoader) {
final Context applicationContext = context.getApplicationContext();
if (Looper.myLooper() == Looper.getMainLooper()) {
d(applicationContext, str, ySFOptions, unicornImageLoader);
} else {
j.b(new Runnable() {
@Override
public final void run() {
c.d(applicationContext, str, ySFOptions, unicornImageLoader);
synchronized (c.f21978l) {
c.f21978l.notifyAll();
}
}
});
try {
Object obj = f21978l;
synchronized (obj) {
obj.wait();
}
} catch (InterruptedException e10) {
f21974a.error("init in background thread interrupt", (Throwable) e10);
}
}
return f21979m;
}
public static Locale d() {
return f21975i;
}
public final void b(final String str, final String str2) {
new com.qiyukf.unicorn.n.a<Void, Void>(com.qiyukf.unicorn.n.a.HTTP_TAG) {
@Override
public final Void doInBackground(Void[] voidArr) {
com.qiyukf.unicorn.i.a.a(c.f(), com.qiyukf.unicorn.d.c.d(), str, str2);
return null;
}
}.execute(new Void[0]);
}
public static void b(Throwable th) {
f21974a.error("init error.", th);
if (d.a()) {
com.qiyukf.unicorn.f.a.a(th);
}
}
private static void b(YSFOptions ySFOptions) {
if (ySFOptions != null) {
if (d.a() || d.b()) {
com.qiyukf.nimlib.c.g().statusBarNotificationConfig = ySFOptions.statusBarNotificationConfig;
LogPulseClient.configLog(a().f21981b, ySFOptions.logSwitch, "");
if (d.a()) {
f21979m.f21983d = ySFOptions;
}
}
}
}
public static void a(a aVar) {
if (f21980n.contains(aVar)) {
return;
}
f21980n.add(aVar);
}
public static void a(String str, String str2) {
f21975i = new Locale(str, str2);
}
public final boolean a(YSFUserInfo ySFUserInfo, RequestCallback<Void> requestCallback) {
if (ySFUserInfo != null) {
try {
t tVar = new t();
tVar.a(ySFUserInfo.userId);
HashMap hashMap = new HashMap();
hashMap.put(com.heytap.mcssdk.constant.b.f17208z, f21979m.f21982c);
hashMap.put("appName", k.b(f21979m.f21981b));
hashMap.put("isFusion", String.valueOf(f21979m.f21983d.isMixSDK));
if (!TextUtils.isEmpty(ySFUserInfo.data)) {
hashMap.put("userData", ySFUserInfo.data);
}
tVar.b(hashMap);
ai.a(tVar);
} catch (Throwable th) {
f21974a.error("setUserInfo exception.", th);
return false;
}
}
return this.f21987h.a(ySFUserInfo, requestCallback);
}
public final void a(YSFOptions ySFOptions) {
if (!f21977k || ySFOptions == null) {
return;
}
try {
b(ySFOptions);
if (d.a()) {
com.qiyukf.unicorn.d.a.a(this.f21981b, this.f21982c, ySFOptions);
}
} catch (Throwable th) {
f21974a.error("update options error.", th);
}
}
public final boolean a(boolean z10) {
return this.f21987h.a(z10);
}
public static void a(String str, long j10) {
com.qiyukf.unicorn.k.c.a(new com.qiyukf.unicorn.h.a.f.k(com.qiyukf.unicorn.d.c.d(), j10), str);
}
private static void a(Context context, String str, YSFOptions ySFOptions) {
if (ySFOptions.isMixSDK) {
return;
}
StatusBarNotificationConfig statusBarNotificationConfig = ySFOptions.statusBarNotificationConfig;
SDKOptions sDKOptions = new SDKOptions();
if (ySFOptions.isUseYsfNotificationConfig) {
sDKOptions.messageNotifierCustomization = new com.qiyukf.uikit.a.a();
}
sDKOptions.disableAwake = true;
sDKOptions.appKey = str;
sDKOptions.statusBarNotificationConfig = statusBarNotificationConfig;
sDKOptions.sdkStorageRootPath = com.qiyukf.unicorn.n.b.e.a(context);
sDKOptions.userInfoProvider = null;
ServerAddresses serverAddresses = ySFOptions.serverAddresses;
if (serverAddresses != null) {
sDKOptions.serverConfig = serverAddresses;
}
if (com.qiyukf.unicorn.d.c.k() == 0) {
com.qiyukf.unicorn.d.c.a(com.qiyukf.unicorn.d.c.a() == null ? 2 : 1);
}
NIMClient.config(context, com.qiyukf.unicorn.h.a.b(), sDKOptions);
}
public static void a(Context context, YSFOptions ySFOptions) {
com.qiyukf.unicorn.n.e.d.a(context);
LogPulseClient.configLog(a().f21981b, ySFOptions.logSwitch, "");
}
public static void a(c cVar, Context context) {
com.qiyukf.unicorn.i.a.a.a().a(context);
com.qiyukf.unicorn.e.a.a(context);
if (cVar.f21986g == null) {
cVar.f21986g = new b();
}
if (cVar.f21985f == null) {
cVar.f21985f = new com.qiyukf.unicorn.k.d(context);
}
if (cVar.f21987h == null) {
cVar.f21987h = new com.qiyukf.unicorn.h.a();
}
StickerManager.getInstance().init();
com.qiyukf.unicorn.l.b.a();
com.qiyukf.unicorn.l.b.b();
com.qiyukf.unicorn.m.a.a().b();
com.qiyukf.uikit.b.a(context, cVar.f21985f.c());
if (a().f21983d.isMixSDK) {
com.qiyukf.uikit.b.a(com.qiyukf.nimlib.c.k());
}
if (a().f21983d.sdkEvents == null || a().f21983d.sdkEvents.eventProcessFactory == null) {
return;
}
com.qiyukf.uikit.b.a(new com.qiyukf.uikit.session.b() {
@Override
public final void a(Context context2, IMMessage iMMessage) {
UnicornEventBase eventOf = c.g().sdkEvents.eventProcessFactory.eventOf(4);
if (eventOf == null) {
return;
}
boolean z10 = iMMessage.getDirect() == MsgDirectionEnum.In;
ClickAvatarEntry clickAvatarEntry = new ClickAvatarEntry();
if (!z10) {
clickAvatarEntry.setUserId(c.this.f21987h.a());
clickAvatarEntry.setStaff(false);
} else {
clickAvatarEntry.setStaffId(iMMessage.getFromAccount());
clickAvatarEntry.setStaff(true);
}
eventOf.onEvent(clickAvatarEntry, context2, null);
}
});
}
}