- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
81 lines
3.5 KiB
Java
81 lines
3.5 KiB
Java
package com.glu.plugins.gluanalytics.eventbus;
|
|
|
|
import android.text.TextUtils;
|
|
import com.facebook.share.internal.ShareConstants;
|
|
import com.glu.plugins.gluanalytics.eventbus.GluEventBus;
|
|
import com.glu.plugins.gluanalytics.util.Common;
|
|
import com.glu.plugins.gluanalytics.util.ConfigUtil;
|
|
import com.glu.plugins.gluanalytics.util.IAction2;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import java.util.Collections;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ConfigGetterEventHandler implements GluEventBus.IEventHandler {
|
|
private static final String CHANNEL_SDK = "#csdk.gluAnalytics";
|
|
private static final String ID_HANDLER = "@csdk.gluAnalytics.configGetter";
|
|
private final String mDefaultConfig;
|
|
private final GluEventBus mEventBus;
|
|
private final IAction2<String, String> mInitFn;
|
|
private Object mToken;
|
|
private boolean mut_initialized;
|
|
|
|
private ConfigGetterEventHandler(GluEventBus gluEventBus, IAction2<String, String> iAction2, String str) {
|
|
this.mEventBus = gluEventBus;
|
|
this.mInitFn = iAction2;
|
|
this.mDefaultConfig = str;
|
|
}
|
|
|
|
public static ConfigGetterEventHandler subscribe(GluEventBus gluEventBus, Object obj, IAction2<String, String> iAction2, String str) {
|
|
ConfigGetterEventHandler configGetterEventHandler = new ConfigGetterEventHandler(gluEventBus, iAction2, str);
|
|
configGetterEventHandler.mToken = gluEventBus.subscribe(obj, ID_HANDLER, Collections.singletonList(CHANNEL_SDK), configGetterEventHandler);
|
|
return configGetterEventHandler;
|
|
}
|
|
|
|
public void requestConfig(long j) {
|
|
this.mEventBus.publish(this.mToken, new GluEventBus.Event("#csdk.gluAnalytics.evt", "configRequested", null, Collections.singletonMap("jsonConfig", this.mDefaultConfig)));
|
|
if (j > 0) {
|
|
Common.runOnUIThreadDelayed(new Runnable() { // from class: com.glu.plugins.gluanalytics.eventbus.ConfigGetterEventHandler.1
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
ConfigGetterEventHandler configGetterEventHandler = ConfigGetterEventHandler.this;
|
|
configGetterEventHandler.initOnce(configGetterEventHandler.mDefaultConfig, "app-timeout");
|
|
ConfigGetterEventHandler.this.onDestroy();
|
|
}
|
|
}, j);
|
|
}
|
|
}
|
|
|
|
public void onDestroy() {
|
|
this.mEventBus.unsubscribe(this.mToken);
|
|
}
|
|
|
|
@Override // com.glu.plugins.gluanalytics.eventbus.GluEventBus.IEventHandler
|
|
public void handleEvent(GluEventBus gluEventBus, Object obj, String str, GluEventBus.Event event) throws Exception {
|
|
String str2;
|
|
if (TextUtils.equals(event.channel, CHANNEL_SDK) && TextUtils.equals(event.action, "reconfigure")) {
|
|
String string = ConfigUtil.getString(event.data, "jsonConfig");
|
|
if (TextUtils.isEmpty(string)) {
|
|
string = this.mDefaultConfig;
|
|
str2 = MBridgeConstans.DYNAMIC_VIEW_WX_APP;
|
|
} else {
|
|
str2 = ConfigUtil.getString(event.data, ShareConstants.FEED_SOURCE_PARAM);
|
|
}
|
|
initOnce(string, str2);
|
|
gluEventBus.unsubscribe(obj);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void initOnce(String str, String str2) {
|
|
boolean z;
|
|
synchronized (this) {
|
|
z = this.mut_initialized;
|
|
this.mut_initialized = true;
|
|
}
|
|
if (z) {
|
|
return;
|
|
}
|
|
this.mInitFn.apply(str, str2);
|
|
}
|
|
}
|