Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJActionRequest {
void cancelled();
void completed();
String getRequestId();
String getToken();
}

View File

@@ -0,0 +1,109 @@
package com.tapjoy;
import android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
/* loaded from: classes4.dex */
public class TJActivity extends Activity implements View.OnClickListener {
public RelativeLayout a = null;
public RelativeLayout.LayoutParams b;
public TJCloseButton c;
public ProgressBar d;
public static /* synthetic */ WindowInsetsCompat a(View view, WindowInsetsCompat windowInsetsCompat) {
return windowInsetsCompat;
}
public void a() {
}
@Override // android.app.Activity
public void onBackPressed() {
a();
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
onBackPressed();
}
@Override // android.app.Activity
public void onCreate(Bundle bundle) {
WindowInsetsController insetsController;
int statusBars;
int navigationBars;
requestWindowFeature(1);
super.onCreate(bundle);
int i = Build.VERSION.SDK_INT;
if (i >= 29) {
ViewCompat.setOnApplyWindowInsetsListener(getWindow().getDecorView(), new OnApplyWindowInsetsListener() { // from class: com.tapjoy.TJActivity$$ExternalSyntheticLambda0
@Override // androidx.core.view.OnApplyWindowInsetsListener
public final WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat windowInsetsCompat) {
return TJActivity.a(view, windowInsetsCompat);
}
});
}
getWindow().setFlags(1024, 1024);
getWindow().setFlags(16777216, 16777216);
if (i >= 30) {
getWindow().setDecorFitsSystemWindows(false);
insetsController = getWindow().getInsetsController();
if (insetsController != null) {
statusBars = WindowInsets.Type.statusBars();
navigationBars = WindowInsets.Type.navigationBars();
insetsController.hide(statusBars | navigationBars);
insetsController.setSystemBarsBehavior(2);
}
} else {
getWindow().getDecorView().setSystemUiVisibility(4102);
}
getWindow().setBackgroundDrawable(new ColorDrawable(0));
this.b = new RelativeLayout.LayoutParams(-1, -1);
RelativeLayout relativeLayout = new RelativeLayout(this);
this.a = relativeLayout;
relativeLayout.setLayoutParams(this.b);
this.a.setBackgroundColor(0);
this.d = new ProgressBar(this, null, R.attr.progressBarStyleLarge);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(13);
this.d.setLayoutParams(layoutParams);
TJCloseButton tJCloseButton = new TJCloseButton(this);
this.c = tJCloseButton;
tJCloseButton.setOnClickListener(this);
}
public void setCloseButtonClickable(boolean z) {
this.c.setClickableRequested(z);
}
public void setCloseButtonVisibility(boolean z) {
if (z) {
this.c.setVisibility(0);
} else {
this.c.setVisibility(4);
}
}
public void setProgressSpinnerVisibility(boolean z) {
TapjoyUtil.runOnMainThread(new a(this, z));
}
public void showErrorDialog() {
if (isFinishing()) {
return;
}
new AlertDialog.Builder(this, R.style.Theme.Material.Light.Dialog.Alert).setMessage("An error occurred. Please try again later.").setPositiveButton("OK", new b(this)).create().show();
}
}

View File

@@ -0,0 +1,188 @@
package com.tapjoy;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.VisibleForTesting;
/* loaded from: classes4.dex */
public class TJAdUnit {
public TJAdUnitWebViewListener a;
public TJAdUnitActivity b;
public TJAdUnitJSBridge c;
public View d;
public TJWebView e;
public boolean f;
public boolean g;
public boolean h;
public volatile boolean i;
public boolean j;
public com.tapjoy.internal.z0 k;
public final d l = new d(this);
public final e m = new e(this);
public interface TJAdUnitWebViewListener {
void onClick();
void onClosed();
void onContentReady();
}
public void closeRequested(boolean z) {
this.c.closeRequested(Boolean.valueOf(z));
}
public View getBackgroundView() {
return this.d;
}
public boolean getCloseRequested() {
return this.c.closeRequested;
}
public com.tapjoy.internal.z0 getSdkBeacon() {
return this.k;
}
public TJWebView getWebView() {
return this.e;
}
public boolean hasCalledLoad() {
return this.g;
}
public boolean isPrerendered() {
return this.h;
}
public boolean preload(TJPlacementData tJPlacementData, Context context) {
if (this.g || !tJPlacementData.isPrerenderingRequested() || !TJPlacementManager.canPreRenderPlacement() || TapjoyConnectCore.getInstance().isViewOpen()) {
fireContentReady();
return false;
}
TapjoyLog.i("TJAdUnit", "Pre-rendering ad unit for placement: " + tJPlacementData.getPlacementName());
TJPlacementManager.incrementPlacementPreRenderCount();
load(tJPlacementData, true, context);
return true;
}
public void resetContentLoadState() {
this.g = false;
this.j = false;
this.h = false;
}
public void setAdUnitActivity(TJAdUnitActivity tJAdUnitActivity) {
this.b = tJAdUnitActivity;
}
public void setWebViewListener(TJAdUnitWebViewListener tJAdUnitWebViewListener) {
this.a = tJAdUnitWebViewListener;
}
@VisibleForTesting
public void destroy() {
TJAdUnitJSBridge tJAdUnitJSBridge = this.c;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.destroy();
}
View view = this.d;
if (view != null) {
ViewGroup viewGroup = (ViewGroup) view.getParent();
if (viewGroup != null) {
viewGroup.removeView(this.d);
}
this.d = null;
}
TJWebView tJWebView = this.e;
if (tJWebView != null) {
tJWebView.destroy();
this.e = null;
}
this.i = false;
this.f = false;
setAdUnitActivity(null);
TJAdUnitWebViewListener tJAdUnitWebViewListener = this.a;
if (tJAdUnitWebViewListener != null) {
tJAdUnitWebViewListener.onClosed();
}
resetContentLoadState();
}
public void fireContentReady() {
TJAdUnitWebViewListener tJAdUnitWebViewListener = this.a;
if (tJAdUnitWebViewListener != null) {
tJAdUnitWebViewListener.onContentReady();
}
}
public void invokeBridgeCallback(String str, Object... objArr) {
TJAdUnitJSBridge tJAdUnitJSBridge = this.c;
if (tJAdUnitJSBridge == null || str == null) {
return;
}
tJAdUnitJSBridge.invokeJSCallback(str, objArr);
}
public void notifyOrientationChanged() {
TJAdUnitActivity tJAdUnitActivity;
if (this.c == null || (tJAdUnitActivity = this.b) == null) {
return;
}
TJDeviceUtils tJDeviceUtils = TJDeviceUtils.INSTANCE;
int screenWidth = tJDeviceUtils.getScreenWidth(tJAdUnitActivity);
int screenHeight = tJDeviceUtils.getScreenHeight(this.b);
this.c.notifyOrientationChanged(tJDeviceUtils.getOrientationString(screenWidth, screenHeight), screenWidth, screenHeight);
}
public void pause() {
TJAdUnitJSBridge tJAdUnitJSBridge = this.c;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.setEnabled(false);
this.c.pause();
}
}
public void setVisible(boolean z) {
TJAdUnitJSBridge tJAdUnitJSBridge;
TJAdUnitActivity tJAdUnitActivity;
if (this.c != null && (tJAdUnitActivity = this.b) != null) {
TJDeviceUtils tJDeviceUtils = TJDeviceUtils.INSTANCE;
int screenWidth = tJDeviceUtils.getScreenWidth(tJAdUnitActivity);
int screenHeight = tJDeviceUtils.getScreenHeight(this.b);
this.c.notifyOrientationChanged(tJDeviceUtils.getOrientationString(screenWidth, screenHeight), screenWidth, screenHeight);
}
this.f = z;
if (z && this.j && (tJAdUnitJSBridge = this.c) != null) {
tJAdUnitJSBridge.display();
}
}
public void load(TJPlacementData tJPlacementData, boolean z, Context context) {
this.g = false;
TapjoyUtil.runOnMainThread(new c(this, context, tJPlacementData, z));
}
public void resume() {
TJAdUnitJSBridge tJAdUnitJSBridge = this.c;
if (tJAdUnitJSBridge == null) {
TJAdUnitActivity tJAdUnitActivity = this.b;
if (tJAdUnitActivity != null) {
tJAdUnitActivity.finish();
TapjoyLog.w("TJAdUnit", "Failed to resume TJAdUnit. TJAdUnitBridge is null.");
return;
}
return;
}
if (tJAdUnitJSBridge.didLaunchOtherActivity) {
TapjoyLog.d("TJAdUnit", "onResume bridge.didLaunchOtherActivity callbackID: " + this.c.otherActivityCallbackID);
TJAdUnitJSBridge tJAdUnitJSBridge2 = this.c;
tJAdUnitJSBridge2.invokeJSCallback(tJAdUnitJSBridge2.otherActivityCallbackID, Boolean.TRUE);
this.c.didLaunchOtherActivity = false;
}
this.c.setEnabled(true);
this.c.resume();
}
}

View File

@@ -0,0 +1,183 @@
package com.tapjoy;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.ViewGroup;
import com.ironsource.v8;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyErrorMessage;
/* loaded from: classes4.dex */
public class TJAdUnitActivity extends TJActivity {
public static TJAdUnitActivity i;
public TJAdUnit f;
public TJPlacementData g;
public final Handler e = new Handler(Looper.getMainLooper());
public boolean h = false;
@Override // com.tapjoy.TJActivity
public final void a() {
a(false);
}
@Override // com.tapjoy.TJActivity, android.view.View.OnClickListener
public void onClick(View view) {
a(false);
}
@Override // android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
TJAdUnit tJAdUnit = this.f;
if (tJAdUnit != null) {
tJAdUnit.notifyOrientationChanged();
}
}
@Override // com.tapjoy.TJActivity, android.app.Activity
public final void onCreate(Bundle bundle) {
TapjoyLog.d("TJAdUnitActivity", "TJAdUnitActivity onCreate: " + bundle);
super.onCreate(bundle);
i = this;
Bundle extras = getIntent().getExtras();
String string = extras != null ? extras.getString(TJAdUnitConstants.EXTRA_TJ_PLACEMENT_NAME) : null;
TJPlacementData tJPlacementData = string != null ? (TJPlacementData) TJMemoryDataStorage.getInstance().get(string) : null;
this.g = tJPlacementData;
if (tJPlacementData == null) {
TapjoyLog.e("TJAdUnitActivity", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Failed to launch AdUnit Activity"));
finish();
return;
}
if (tJPlacementData.getContentViewId() != null) {
TapjoyConnectCore.getInstance().viewWillOpen(this.g.getContentViewId());
}
if (TJPlacementManager.a(this.g.getKey()) != null) {
this.f = TJPlacementManager.a(this.g.getKey()).getAdUnit();
} else {
this.f = new TJAdUnit();
}
if (!this.f.hasCalledLoad()) {
TapjoyLog.d("TJAdUnitActivity", "No content loaded for ad unit -- loading now");
this.f.load(this.g, false, this);
}
this.f.setAdUnitActivity(this);
try {
setRequestedOrientation(TJDeviceUtils.INSTANCE.getScreenOrientation(this));
View backgroundView = this.f.getBackgroundView();
backgroundView.setLayoutParams(this.b);
if (backgroundView.getParent() != null) {
((ViewGroup) backgroundView.getParent()).removeView(backgroundView);
}
TJWebView webView = this.f.getWebView();
webView.setLayoutParams(this.b);
if (webView.getParent() != null) {
((ViewGroup) webView.getParent()).removeView(webView);
}
this.a.addView(backgroundView);
this.a.addView(webView);
if (this.g.hasProgressSpinner()) {
setProgressSpinnerVisibility(true);
} else {
setProgressSpinnerVisibility(false);
}
this.a.addView(this.d);
this.a.addView(this.c);
setContentView(this.a);
this.f.setVisible(true);
} catch (Exception e) {
TapjoyLog.e("TJAdUnitActivity", e.getMessage());
}
}
@Override // android.app.Activity
public final void onDestroy() {
super.onDestroy();
if (!this.h) {
b();
}
i = null;
}
@Override // android.app.Activity
public final void onPause() {
TJPlacementData tJPlacementData;
super.onPause();
TapjoyLog.d("TJAdUnitActivity", v8.h.t0);
TJAdUnit tJAdUnit = this.f;
if (tJAdUnit != null) {
tJAdUnit.pause();
} else {
finish();
}
if (isFinishing() && (tJPlacementData = this.g) != null && tJPlacementData.shouldHandleDismissOnPause()) {
TapjoyLog.d("TJAdUnitActivity", "is Finishing");
b();
}
}
@Override // android.app.Activity
public final void onResume() {
TapjoyLog.d("TJAdUnitActivity", v8.h.u0);
super.onResume();
TJAdUnit tJAdUnit = this.f;
if (tJAdUnit != null) {
tJAdUnit.resume();
}
}
@Override // android.app.Activity
public final void onStart() {
super.onStart();
TapjoyLog.d("TJAdUnitActivity", "onStart");
}
@Override // android.app.Activity
public final void onStop() {
super.onStop();
TapjoyLog.d("TJAdUnitActivity", "onStop");
}
public final void a(boolean z) {
TJAdUnit tJAdUnit = this.f;
if (tJAdUnit != null) {
if (!tJAdUnit.getCloseRequested()) {
TapjoyLog.d("TJAdUnitActivity", TJAdUnitConstants.String.CLOSE_REQUESTED);
this.f.closeRequested(z);
this.e.postDelayed(new l(this), 1000L);
}
} else {
finish();
}
if (this.g != null) {
TJMemoryDataStorage.getInstance().remove(this.g.getPlacementName());
}
}
public final void b() {
TJPlacement a;
i = null;
this.h = true;
TJAdUnit tJAdUnit = this.f;
if (tJAdUnit != null) {
tJAdUnit.destroy();
}
TJPlacementData tJPlacementData = this.g;
if (tJPlacementData != null) {
if (tJPlacementData.getContentViewId() != null) {
TapjoyConnectCore.getInstance().viewDidClose(this.g.getContentViewId());
}
TJCorePlacement a2 = TJPlacementManager.a(this.g.getKey());
if (a2 == null || (a = a2.a("SHOW")) == null || a.getListener() == null) {
return;
}
TapjoyLog.i("TJCorePlacement", "Content dismissed for placement " + a2.d.getPlacementName());
TJPlacementListener tJPlacementListener = a.c;
if (tJPlacementListener != null) {
tJPlacementListener.onContentDismiss(a);
}
}
}
}

View File

@@ -0,0 +1,92 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TJAdUnitConstants {
public static final java.lang.String ADUNIT_CALLBACK_METHOD = "if(window.AndroidWebViewJavascriptBridge) AndroidWebViewJavascriptBridge._handleMessageFromAndroid";
public static final int CUSTOM_CLOSE_TIMEOUT = 1000;
public static final java.lang.String EVENTS_PROXY_PATH = "events/proxy?";
public static final java.lang.String EXTRA_TJ_PLACEMENT_DATA = "placement_data";
public static final java.lang.String EXTRA_TJ_PLACEMENT_NAME = "placement_name";
public static final java.lang.String JAVASCRIPT_INTERFACE_ID = "AndroidJavascriptInterface";
public static final java.lang.String PARAM_ENTRY_POINT = "entrypoint";
public static final java.lang.String PARAM_PLACEMENT_BY_SDK = "system_placement";
public static final java.lang.String PARAM_PLACEMENT_NAME = "event_name";
public static final java.lang.String PARAM_PLACEMENT_PRELOAD = "event_preload";
public static final java.lang.String SHARE_CHOOSE_TITLE = "Select";
public static final java.lang.String SPINNER_TITLE = "Loading...";
public class String {
public static final java.lang.String AD_IMPRESSION = "impression";
public static final java.lang.String AD_USER_INTERACTION = "adUserInteraction";
public static final java.lang.String ANIMATION_EVENT_ON_OPEN = "onOpen";
public static final java.lang.String ANIMATION_TYPE_SLIDE_UP = "slideUp";
public static final java.lang.String ARGUMENTS = "arguments";
public static final java.lang.String BACKGROUND_COLOR = "backgroundColor";
public static final java.lang.String BACKGROUND_CONTENT = "backgroundContent";
public static final java.lang.String BEACON_ERROR_PATH = "error";
public static final java.lang.String BEACON_PARAMS = "params";
public static final java.lang.String BEACON_PATH_MAP = "path_map";
public static final java.lang.String BEACON_SHOW_PATH = "show";
public static final java.lang.String BUNDLE = "bundle";
public static final java.lang.String BUTTONS = "buttons";
public static final java.lang.String CALLBACK_ID = "callbackId";
public static final java.lang.String CLICKABLE = "clickable";
public static final java.lang.String CLOSE = "close";
public static final java.lang.String CLOSE_REQUESTED = "closeRequested";
public static final java.lang.String COMMAND = "command";
public static final java.lang.String CONNECTIVITY_LOST = "connectivityLost";
public static final java.lang.String CURRENCY_ID = "currencyId";
public static final java.lang.String CUSTOM_CLOSE = "customClose";
public static final java.lang.String DATA = "data";
public static final java.lang.String DISPLAY = "display";
public static final java.lang.String ENABLED = "enabled";
public static final java.lang.String EVENT_NAME = "eventName";
public static final java.lang.String FALSE = "false";
public static final java.lang.String FORCE_CLOSE = "forceClose";
public static final java.lang.String HEIGHT = "height";
public static final java.lang.String HIDDEN = "hidden";
public static final java.lang.String HTML = "html";
public static final java.lang.String INLINE = "inline";
public static final java.lang.String LANDSCAPE = "landscape";
public static final java.lang.String LANDSCAPE_LEFT = "landscapeLeft";
public static final java.lang.String LANDSCAPE_RIGHT = "landscapeRight";
public static final java.lang.String LOGGING_LEVEL = "loggingLevel";
public static final java.lang.String MESSAGE = "message";
public static final java.lang.String METHOD = "method";
public static final java.lang.String OM_JAVASCRIPT_URL = "omJavaScriptURL";
public static final java.lang.String ORIENTATION = "orientation";
public static final java.lang.String ORIENTATION_CHANGED_EVENT = "orientationChanged";
public static final java.lang.String PORTRAIT = "portrait";
public static final java.lang.String REUSE_HTML = "reuseHTML";
public static final java.lang.String ROTATION = "rotation";
public static final java.lang.String SPLIT_VIEW_ANIMATION = "animation";
public static final java.lang.String SPLIT_VIEW_ERROR_DIALOG_STRINGS = "errorDialogStrings";
public static final java.lang.String SPLIT_VIEW_EXIT_HOSTS = "splitViewExitHosts";
public static final java.lang.String SPLIT_VIEW_LAYOUT = "splitViewLayout";
public static final java.lang.String SPLIT_VIEW_SHOW_TOOLBAR = "showToolBar";
public static final java.lang.String SPLIT_VIEW_SHOW_URL = "showURL";
public static final java.lang.String SPLIT_VIEW_TRIGGER = "splitViewTrigger";
public static final java.lang.String SPLIT_VIEW_TRIGGER_ON = "on";
public static final java.lang.String SPLIT_VIEW_TRIGGER_TO = "to";
public static final java.lang.String SPLIT_VIEW_URL_FOR_EXTERNAL_OPEN = "urlForExternalOpen";
public static final java.lang.String STYLE = "style";
public static final java.lang.String STYLE_SPLIT = "split";
public static final java.lang.String TEXT_ZOOM = "textZoom";
public static final java.lang.String TITLE = "title";
public static final java.lang.String TJC_PLACEMENT_CACHE_LIMIT = "eventPreloadLimit";
public static final java.lang.String TJC_PLACEMENT_PRE_RENDERED_LIMIT = "prerenderLimit";
public static final java.lang.String TRANSPARENT = "transparent";
public static final java.lang.String TRUE = "true";
public static final java.lang.String URL = "url";
public static final java.lang.String USER_AGENT = "userAgent";
public static final java.lang.String VENDORS = "vendors";
public static final java.lang.String VENDOR_JS_URL = "vendorJSResource";
public static final java.lang.String VENDOR_NAME = "vendorName";
public static final java.lang.String VENDOR_PARAMETERS = "vendorParameters";
public static final java.lang.String VISIBLE = "visible";
public static final java.lang.String WIDTH = "width";
public String(TJAdUnitConstants tJAdUnitConstants) {
}
}
}

View File

@@ -0,0 +1,796 @@
package com.tapjoy;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Pair;
import android.webkit.WebView;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyErrorMessage;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@SuppressLint({"SetJavaScriptEnabled"})
/* loaded from: classes4.dex */
public class TJAdUnitJSBridge implements TJWebViewJSInterfaceListener {
public static Object g;
public TJWebViewJSInterface a;
public final TJJSBridgeDelegate b;
public TJSplitWebView c;
public ProgressDialog d;
public boolean e;
public boolean didLaunchOtherActivity = false;
public boolean allowRedirect = true;
public String otherActivityCallbackID = null;
public boolean customClose = false;
public boolean closeRequested = false;
public String splitWebViewCallbackID = null;
public final ConcurrentLinkedQueue f = new ConcurrentLinkedQueue();
@SuppressLint({"AddJavascriptInterface"})
public TJAdUnitJSBridge(TJJSBridgeDelegate tJJSBridgeDelegate) {
this.b = tJJSBridgeDelegate;
TapjoyLog.i("TJAdUnitJSBridge", "creating AdUnit/JS Bridge");
WebView webView = tJJSBridgeDelegate.getWebView();
if (webView == null) {
TapjoyLog.e("TJAdUnitJSBridge", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Cannot create AdUnitJSBridge -- webview is NULL"));
return;
}
TJWebViewJSInterface tJWebViewJSInterface = new TJWebViewJSInterface(webView, this);
this.a = tJWebViewJSInterface;
webView.addJavascriptInterface(tJWebViewJSInterface, TJAdUnitConstants.JAVASCRIPT_INTERFACE_ID);
setEnabled(true);
try {
Context context = tJJSBridgeDelegate.getContext();
Bundle bundle = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData;
if (bundle.containsKey("appJSMessageHandler")) {
if (g == null) {
g = Class.forName(bundle.getString("appJSMessageHandler")).newInstance();
}
g.getClass().getDeclaredMethod("setHandler", Object.class, String.class).invoke(g, new v(this), v.class.getDeclaredMethods()[0].getName());
}
} catch (PackageManager.NameNotFoundException e) {
e = e;
throw new RuntimeException(e);
} catch (ClassNotFoundException unused) {
TapjoyLog.d("TJAdUnitJSBridge", "No app-provided support for JS handler");
} catch (IllegalAccessException e2) {
e = e2;
throw new RuntimeException(e);
} catch (InstantiationException e3) {
e = e3;
throw new RuntimeException(e);
} catch (NoSuchMethodException e4) {
e = e4;
throw new RuntimeException(e);
} catch (InvocationTargetException e5) {
e = e5;
throw new RuntimeException(e);
}
}
public final /* synthetic */ void a(WebView webView, boolean z, boolean z2) {
if (webView != null) {
webView.post(new w(this, webView, z, z2));
}
}
/* JADX WARN: Removed duplicated region for block: B:36:0x00ac */
/* JADX WARN: Removed duplicated region for block: B:9:0x0047 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void alert(org.json.JSONObject r9, java.lang.String r10) {
/*
r8 = this;
java.lang.StringBuilder r0 = new java.lang.StringBuilder
java.lang.String r1 = "alert_method: "
r0.<init>(r1)
r0.append(r9)
java.lang.String r0 = r0.toString()
java.lang.String r1 = "TJAdUnitJSBridge"
com.tapjoy.TapjoyLog.d(r1, r0)
java.lang.String r0 = ""
java.lang.String r2 = "title"
java.lang.String r2 = r9.getString(r2) // Catch: java.lang.Exception -> L2d
java.lang.String r3 = "message"
java.lang.String r0 = r9.getString(r3) // Catch: java.lang.Exception -> L28
java.lang.String r3 = "buttons"
org.json.JSONArray r9 = r9.getJSONArray(r3) // Catch: java.lang.Exception -> L28
goto L3f
L28:
r9 = move-exception
r7 = r2
r2 = r0
r0 = r7
goto L2f
L2d:
r9 = move-exception
r2 = r0
L2f:
java.lang.Boolean r3 = java.lang.Boolean.FALSE
java.lang.Object[] r3 = new java.lang.Object[]{r3}
r8.invokeJSCallback(r10, r3)
r9.printStackTrace()
r9 = 0
r7 = r2
r2 = r0
r0 = r7
L3f:
com.tapjoy.TJJSBridgeDelegate r3 = r8.b
android.content.Context r3 = r3.getContext()
if (r3 == 0) goto Lac
android.app.AlertDialog$Builder r1 = new android.app.AlertDialog$Builder
r4 = 16974394(0x103023a, float:2.4062497E-38)
r1.<init>(r3, r4)
android.app.AlertDialog$Builder r1 = r1.setTitle(r2)
android.app.AlertDialog$Builder r0 = r1.setMessage(r0)
android.app.AlertDialog r0 = r0.create()
if (r9 == 0) goto La2
int r1 = r9.length()
if (r1 != 0) goto L64
goto La2
L64:
java.util.ArrayList r1 = new java.util.ArrayList
r1.<init>()
r2 = 0
r3 = r2
L6b:
int r4 = r9.length()
if (r3 >= r4) goto L98
if (r3 == 0) goto L7a
r4 = 1
if (r3 == r4) goto L78
r4 = -1
goto L7b
L78:
r4 = -3
goto L7b
L7a:
r4 = -2
L7b:
java.lang.String r5 = r9.getString(r3) // Catch: java.lang.Exception -> L83
r1.add(r5) // Catch: java.lang.Exception -> L83
goto L87
L83:
r5 = move-exception
r5.printStackTrace()
L87:
java.lang.Object r5 = r1.get(r3)
java.lang.CharSequence r5 = (java.lang.CharSequence) r5
com.tapjoy.m r6 = new com.tapjoy.m
r6.<init>(r8, r10)
r0.setButton(r4, r5, r6)
int r3 = r3 + 1
goto L6b
L98:
r0.setCancelable(r2)
r0.setCanceledOnTouchOutside(r2)
r0.show()
goto Lb1
La2:
java.lang.Boolean r9 = java.lang.Boolean.FALSE
java.lang.Object[] r9 = new java.lang.Object[]{r9}
r8.invokeJSCallback(r10, r9)
goto Lb1
Lac:
java.lang.String r9 = "Cannot alert -- TJAdUnitActivity is null"
com.tapjoy.TapjoyLog.d(r1, r9)
Lb1:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJAdUnitJSBridge.alert(org.json.JSONObject, java.lang.String):void");
}
public void cachePathForURL(JSONObject jSONObject, String str) {
try {
String string = jSONObject.getString("url");
if (TapjoyCache.getInstance() != null) {
invokeJSCallback(str, TapjoyCache.getInstance().getPathOfCachedURL(string));
} else {
invokeJSCallback(str, "");
}
} catch (Exception unused) {
invokeJSCallback(str, "");
}
}
public void clearCache(JSONObject jSONObject, String str) {
if (TapjoyCache.getInstance() == null) {
invokeJSCallback(str, Boolean.FALSE);
} else {
TapjoyCache.getInstance().clearTapjoyCache();
invokeJSCallback(str, Boolean.TRUE);
}
}
public void clearLoggingLevel(JSONObject jSONObject, String str) {
TapjoyAppSettings.getInstance().clearLoggingLevel();
}
public void contentReady(JSONObject jSONObject, String str) {
invokeJSCallback(str, Boolean.valueOf(this.b.fireContentReady()));
}
public void destroy() {
}
public void dismiss(JSONObject jSONObject, String str) {
invokeJSCallback(str, Boolean.TRUE);
this.b.dismiss();
}
public void dismissSplitView(JSONObject jSONObject, String str) {
TapjoyUtil.runOnMainThread(new t(this, str));
}
public void dismissStoreView(JSONObject jSONObject, String str) {
dismissSplitView(jSONObject, str);
}
public void display() {
invokeJSAdunitMethod("display", new Object[0]);
}
public void displayFullscreenWebview(JSONObject jSONObject, String str) {
String str2;
Boolean bool = null;
try {
str2 = jSONObject.getString("url");
} catch (JSONException unused) {
str2 = null;
}
try {
if (jSONObject.has(TJAdUnitConstants.String.REUSE_HTML)) {
bool = Boolean.valueOf(jSONObject.getBoolean(TJAdUnitConstants.String.REUSE_HTML));
}
} catch (JSONException unused2) {
}
if ((str2 == null || str2.length() == 0) && bool == null) {
invokeJSCallback(str, Boolean.FALSE);
return;
}
Intent intent = new Intent(this.b.getContext(), (Class<?>) TJWebViewActivity.class);
intent.setAction("android.intent.action.VIEW");
intent.setPackage(this.b.getContext().getPackageName());
intent.putExtra("url", str2);
intent.putExtra(TJAdUnitConstants.String.REUSE_HTML, bool);
String str3 = (String) this.b.getData(TJAdUnitConstants.String.HTML, String.class);
if (str3 != null) {
intent.putExtra(TJAdUnitConstants.String.HTML, str3);
}
this.b.getContext().startActivity(intent);
invokeJSCallback(str, Boolean.TRUE);
}
public void displayStoreURL(JSONObject jSONObject, String str) {
displayURL(jSONObject, str);
}
public void displayURL(JSONObject jSONObject, String str) {
String str2;
String str3;
try {
String optString = jSONObject.optString("style");
String string = jSONObject.getString("url");
JSONObject optJSONObject = jSONObject.optJSONObject(TJAdUnitConstants.String.SPLIT_VIEW_LAYOUT);
JSONArray optJSONArray = jSONObject.optJSONArray(TJAdUnitConstants.String.SPLIT_VIEW_EXIT_HOSTS);
String optString2 = jSONObject.optString(TJAdUnitConstants.String.USER_AGENT, null);
JSONObject optJSONObject2 = jSONObject.optJSONObject(TJAdUnitConstants.String.SPLIT_VIEW_TRIGGER);
if (optJSONObject2 != null) {
String optString3 = optJSONObject2.optString(TJAdUnitConstants.String.SPLIT_VIEW_TRIGGER_ON, null);
str3 = optJSONObject2.optString("to", null);
str2 = optString3;
} else {
str2 = null;
str3 = null;
}
if (TJAdUnitConstants.String.STYLE_SPLIT.equals(optString)) {
TapjoyUtil.runOnMainThread(new n(this, jSONObject, optJSONArray, optJSONObject, optString2, str2, str3, str, string));
return;
}
this.didLaunchOtherActivity = true;
this.otherActivityCallbackID = str;
this.b.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(string)));
} catch (Exception e) {
invokeJSCallback(str, Boolean.TRUE);
e.printStackTrace();
}
}
public void fetchData(JSONObject jSONObject, String str) {
try {
invokeJSCallback(str, new TJDataFetcher().a(jSONObject.getJSONArray("values")));
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void flushBacklogMessageQueue() {
while (true) {
Pair pair = (Pair) this.f.poll();
if (pair == null) {
return;
} else {
onDispatchMethod((String) pair.first, (JSONObject) pair.second);
}
}
}
public void getCachedAssets(JSONObject jSONObject, String str) {
if (TapjoyCache.getInstance() != null) {
invokeJSCallback(str, TapjoyCache.getInstance().cachedAssetsToJSON());
} else {
invokeJSCallback(str, "");
}
}
public void getKeyValue(JSONObject jSONObject, String str) {
try {
invokeJSCallback(str, new TJKeyValueStorage(this.b.getContext()).getValue(jSONObject.getString("key")));
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void getOrientation(JSONObject jSONObject, String str) {
invokeJSCallback(str, this.b.getOrientation());
}
public void getSplitViewURL(JSONObject jSONObject, String str) {
TapjoyUtil.runOnMainThread(new u(this, str));
}
public void getStatusBarHeight(JSONObject jSONObject, String str) {
try {
invokeJSCallback(str, Integer.valueOf(this.b.getStatusBarHeight()));
} catch (Exception unused) {
}
}
public void getTextZoom(JSONObject jSONObject, String str) {
TapjoyUtil.runOnMainThread(new p(this, str));
}
public void hasSplitView(JSONObject jSONObject, String str) {
TapjoyUtil.runOnMainThread(new s(this, str));
}
public void invokeJSAdunitMethod(String str, Object... objArr) {
ArrayList<?> arrayList = new ArrayList<>(Arrays.asList(objArr));
TJWebViewJSInterface tJWebViewJSInterface = this.a;
if (tJWebViewJSInterface != null) {
tJWebViewJSInterface.callback(arrayList, str, (String) null);
}
}
public void invokeJSCallback(String str, Object... objArr) {
if (TextUtils.isEmpty(str)) {
TapjoyLog.d("TJAdUnitJSBridge", "invokeJSCallback -- no callbackID provided");
return;
}
ArrayList<?> arrayList = new ArrayList<>(Arrays.asList(objArr));
TJWebViewJSInterface tJWebViewJSInterface = this.a;
if (tJWebViewJSInterface != null) {
tJWebViewJSInterface.callback(arrayList, "", str);
}
}
public void isNetworkAvailable(JSONObject jSONObject, String str) {
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.b.getContext().getSystemService("connectivity")).getActiveNetworkInfo();
invokeJSCallback(str, Boolean.valueOf(activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.isConnected()));
} catch (Exception unused) {
invokeJSCallback(str, Boolean.FALSE);
}
}
public void log(JSONObject jSONObject, String str) {
try {
TapjoyLog.d("TJAdUnitJSBridge", "Logging message=" + jSONObject.getString("message"));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void notifyOrientationChanged(String str, int i, int i2) {
HashMap hashMap = new HashMap();
hashMap.put("orientation", str);
hashMap.put("width", Integer.valueOf(i));
hashMap.put("height", Integer.valueOf(i2));
invokeJSAdunitMethod(TJAdUnitConstants.String.ORIENTATION_CHANGED_EVENT, hashMap);
}
public void openApp(JSONObject jSONObject, String str) {
try {
Context context = this.b.getContext();
context.startActivity(context.getPackageManager().getLaunchIntentForPackage(jSONObject.getString(TJAdUnitConstants.String.BUNDLE)));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void pause() {
try {
invokeJSAdunitMethod("onVisibilityStateChange", "hidden");
} catch (Exception e) {
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void removeAssetFromCache(JSONObject jSONObject, String str) {
try {
String string = jSONObject.getString("url");
if (TapjoyCache.getInstance() != null) {
invokeJSCallback(str, Boolean.valueOf(TapjoyCache.getInstance().removeAssetFromCache(string)));
} else {
invokeJSCallback(str, Boolean.FALSE);
}
} catch (Exception unused) {
TapjoyLog.w("TJAdUnitJSBridge", "Unable to cache asset. Invalid parameters.");
invokeJSCallback(str, Boolean.FALSE);
}
}
public void resume() {
try {
invokeJSAdunitMethod("onVisibilityStateChange", TJAdUnitConstants.String.VISIBLE);
} catch (Exception e) {
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void setAllowRedirect(JSONObject jSONObject, String str) {
boolean z;
try {
z = jSONObject.getBoolean("enabled");
} catch (Exception unused) {
z = true;
}
this.allowRedirect = z;
invokeJSCallback(str, Boolean.TRUE);
}
public void setBackgroundColor(JSONObject jSONObject, String str) {
try {
this.b.setBackgroundColor(jSONObject.getString("backgroundColor"), new q(this, str));
} catch (Exception unused) {
TapjoyLog.w("TJAdUnitJSBridge", "Unable to set background color. Invalid parameters.");
invokeJSCallback(str, Boolean.FALSE);
}
}
public void setCloseButtonClickable(JSONObject jSONObject, String str) {
try {
this.b.setCloseButtonClickable(jSONObject.optBoolean(TJAdUnitConstants.String.CLICKABLE));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void setCloseButtonVisible(JSONObject jSONObject, String str) {
try {
this.b.setCloseButtonVisible(jSONObject.getBoolean(TJAdUnitConstants.String.VISIBLE));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void setEventPreloadLimit(JSONObject jSONObject, String str) {
if (TapjoyCache.getInstance() == null) {
invokeJSCallback(str, Boolean.FALSE);
return;
}
try {
TJPlacementManager.setCachedPlacementLimit(jSONObject.getInt(TJAdUnitConstants.String.TJC_PLACEMENT_CACHE_LIMIT));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception unused) {
TapjoyLog.w("TJAdUnitJSBridge", "Unable to set Tapjoy cache's event preload limit. Invalid parameters.");
invokeJSCallback(str, Boolean.FALSE);
}
}
public void setKeyValue(JSONObject jSONObject, String str) {
try {
new TJKeyValueStorage(this.b.getContext()).setValue(jSONObject.getString("key"), jSONObject.get("value"));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void setLoggingLevel(JSONObject jSONObject, String str) {
try {
TapjoyAppSettings.getInstance().saveLoggingLevel(String.valueOf(jSONObject.getString(TJAdUnitConstants.String.LOGGING_LEVEL)));
} catch (Exception e) {
TapjoyLog.d("TJAdUnitJSBridge", "setLoggingLevel exception " + e.getLocalizedMessage());
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void setNavigationEventBlocker(JSONObject jSONObject, String str) {
invokeJSCallback(str, Boolean.FALSE);
}
public void setOrientation(JSONObject jSONObject, String str) {
int i;
try {
String string = jSONObject.getString("orientation");
if (!string.equals("landscape") && !string.equals(TJAdUnitConstants.String.LANDSCAPE_LEFT)) {
i = string.equals(TJAdUnitConstants.String.LANDSCAPE_RIGHT) ? 0 : 1;
invokeJSCallback(str, Boolean.valueOf(this.b.setOrientation(i)));
}
i = 8;
invokeJSCallback(str, Boolean.valueOf(this.b.setOrientation(i)));
} catch (Exception unused) {
invokeJSCallback(str, Boolean.FALSE);
}
}
public void setPrerenderLimit(JSONObject jSONObject, String str) {
try {
TJPlacementManager.setPreRenderedPlacementLimit(jSONObject.getInt(TJAdUnitConstants.String.TJC_PLACEMENT_PRE_RENDERED_LIMIT));
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception unused) {
TapjoyLog.w("TJAdUnitJSBridge", "Unable to set Tapjoy placement pre-render limit. Invalid parameters.");
invokeJSCallback(str, Boolean.FALSE);
}
}
public void setScrollable(JSONObject jSONObject, String str) {
invokeJSCallback(str, Boolean.FALSE);
}
public void setSpinnerVisible(JSONObject jSONObject, String str) {
try {
boolean z = jSONObject.getBoolean(TJAdUnitConstants.String.VISIBLE);
String optString = jSONObject.optString("title");
String optString2 = jSONObject.optString("message");
Context context = this.b.getContext();
if (context != null) {
TapjoyUtil.runOnMainThread(new r(this, z, context, optString, optString2, str));
} else {
TapjoyLog.d("TJAdUnitJSBridge", "Cannot setSpinnerVisible -- Context is null");
invokeJSCallback(str, Boolean.FALSE);
}
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void setTextZoom(JSONObject jSONObject, String str) {
try {
float f = (float) jSONObject.getDouble(TJAdUnitConstants.String.TEXT_ZOOM);
this.b.setTextZoom(f);
invokeJSAdunitMethod(str, Float.valueOf(f));
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
public void setupSdkBeacons(JSONObject jSONObject, String str) {
TapjoyLog.d("TJAdUnitJSBridge", "setupSdkBeacons_method: " + jSONObject);
try {
this.b.setupSdkBeacons(new com.tapjoy.internal.z0(jSONObject.getString("url"), jSONObject.getJSONObject("params"), jSONObject.getJSONObject(TJAdUnitConstants.String.BEACON_PATH_MAP)));
HashMap hashMap = new HashMap();
hashMap.put("status", "true");
invokeJSCallback(str, hashMap);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void shouldClose(JSONObject jSONObject, String str) {
try {
this.b.shouldClose(Boolean.valueOf(jSONObject.getString("close")).booleanValue());
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
this.b.shouldClose(true);
e.printStackTrace();
}
this.closeRequested = false;
}
public void unsetOrientation(JSONObject jSONObject, String str) {
invokeJSCallback(str, Boolean.valueOf(this.b.unsetOrientation()));
}
public void cacheAsset(JSONObject jSONObject, String str) {
String str2;
Long l = 0L;
try {
String string = jSONObject.getString("url");
try {
str2 = jSONObject.getString(TapjoyConstants.TJC_PLACEMENT_OFFER_ID);
} catch (Exception unused) {
str2 = "";
}
try {
l = Long.valueOf(jSONObject.getLong(TapjoyConstants.TJC_TIME_TO_LIVE));
} catch (Exception unused2) {
}
if (TapjoyCache.getInstance() != null) {
invokeJSCallback(str, TapjoyCache.getInstance().cacheAssetFromURL(string, str2, l.longValue()));
} else {
invokeJSCallback(str, Boolean.FALSE);
}
} catch (Exception unused3) {
TapjoyLog.w("TJAdUnitJSBridge", "Unable to cache asset. Invalid parameters.");
invokeJSCallback(str, Boolean.FALSE);
}
}
public void cleanUpJSBridge() {
TJWebViewJSInterface tJWebViewJSInterface = this.a;
if (tJWebViewJSInterface != null) {
WebView webView = tJWebViewJSInterface.b;
if (webView != null) {
webView.removeAllViews();
this.a.b.destroy();
this.a.b = null;
}
this.a = null;
}
}
public void closeRequested(Boolean bool) {
TJSplitWebView tJSplitWebView = this.c;
if (tJSplitWebView != null) {
if (tJSplitWebView.goBack()) {
return;
}
this.c.j.dismissSplitView(null, null);
} else {
this.closeRequested = true;
HashMap hashMap = new HashMap();
hashMap.put("forceClose", bool);
invokeJSAdunitMethod(TJAdUnitConstants.String.CLOSE_REQUESTED, hashMap);
}
}
public void present(JSONObject jSONObject, String str) {
try {
Boolean bool = Boolean.FALSE;
Boolean valueOf = Boolean.valueOf(jSONObject.getString(TJAdUnitConstants.String.VISIBLE));
try {
bool = Boolean.valueOf(jSONObject.getString("transparent"));
} catch (Exception unused) {
}
try {
this.customClose = Boolean.valueOf(jSONObject.getString(TJAdUnitConstants.String.CUSTOM_CLOSE)).booleanValue();
} catch (Exception unused2) {
}
final boolean booleanValue = valueOf.booleanValue();
final boolean booleanValue2 = bool.booleanValue();
final WebView webView = this.b.getWebView();
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJAdUnitJSBridge$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TJAdUnitJSBridge.this.a(webView, booleanValue, booleanValue2);
}
});
invokeJSCallback(str, Boolean.TRUE);
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
e.printStackTrace();
}
}
public void sendMessageToApp(JSONObject jSONObject, String str) {
try {
Object obj = g;
if (obj != null) {
obj.getClass().getDeclaredMethod("onMessage", String.class, Object.class).invoke(g, "message", jSONObject.get("message"));
invokeJSCallback(str, Boolean.TRUE);
}
} catch (Exception e) {
invokeJSCallback(str, Boolean.FALSE);
TapjoyLog.e("TJAdUnitJSBridge", "Exception: " + e.toString());
}
}
public void setEnabled(boolean z) {
this.e = z;
if (z) {
flushBacklogMessageQueue();
}
}
public void contentError(JSONObject jSONObject, String str) {
int i;
String str2;
try {
i = jSONObject.getInt("code");
} catch (JSONException e) {
TapjoyLog.e("TJAdUnitJSBridge", e.getLocalizedMessage());
i = -1;
}
try {
str2 = jSONObject.getString("message");
} catch (JSONException e2) {
TapjoyLog.e("TJAdUnitJSBridge", e2.getLocalizedMessage());
str2 = "Unknown Content Error";
}
TJJSBridgeDelegate tJJSBridgeDelegate = this.b;
if (tJJSBridgeDelegate != null) {
tJJSBridgeDelegate.fireContentError(new TJError(i, str2));
invokeJSCallback(str, Boolean.TRUE);
} else {
invokeJSCallback(str, Boolean.FALSE);
}
}
public void flushMessageQueue() {
TJWebViewJSInterface tJWebViewJSInterface = this.a;
if (tJWebViewJSInterface == null) {
return;
}
tJWebViewJSInterface.flushMessageQueue();
}
public void invokeJSAdunitMethod(String str, Map<String, Object> map) {
TJWebViewJSInterface tJWebViewJSInterface = this.a;
if (tJWebViewJSInterface != null) {
tJWebViewJSInterface.callback(map, str, (String) null);
}
}
@Override // com.tapjoy.TJWebViewJSInterfaceListener
public void onDispatchMethod(String str, JSONObject jSONObject) {
if (this.e) {
String str2 = null;
try {
str2 = jSONObject.optString(TJAdUnitConstants.String.CALLBACK_ID, null);
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
Method method = TJAdUnitJSBridge.class.getMethod(str, JSONObject.class, String.class);
TapjoyLog.d("TJAdUnitJSBridge", "Dispatching method: " + method + " with data=" + jSONObject2 + "; callbackID=" + str2);
if (this.a == null) {
return;
}
method.invoke(this, jSONObject2, str2);
return;
} catch (Exception e) {
e.printStackTrace();
invokeJSCallback(str2, Boolean.FALSE);
return;
}
}
TapjoyLog.d("TJAdUnitJSBridge", "Bridge currently disabled. Adding " + str + " to message queue");
this.f.add(new Pair(str, jSONObject));
}
public void invokeJSCallback(String str, Map<String, Object> map) {
this.a.callback(map, "", str);
}
}

View File

@@ -0,0 +1,100 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJAppInfo {
public static final TJAppInfo INSTANCE = new TJAppInfo();
public static String a;
public static String b;
public static String c;
public static String d;
public static String e;
public static Integer f;
public static String g;
public static String h;
public static TJKeyValueStorage i;
public final String getAppGroupId() {
return g;
}
public final String getAppVersion() {
return a;
}
public final long getInstallTime() {
TJKeyValueStorage tJKeyValueStorage = i;
long j = tJKeyValueStorage != null ? tJKeyValueStorage.getLong("pref_installed", 0L) : 0L;
if (j == 0) {
j = System.currentTimeMillis();
TJKeyValueStorage tJKeyValueStorage2 = i;
if (tJKeyValueStorage2 != null) {
tJKeyValueStorage2.setValue("pref_installed", Long.valueOf(j));
}
}
return j;
}
public final String getInstaller() {
return b;
}
public final String getManagedDeviceID() {
return h;
}
public final String getPkgId() {
return c;
}
public final Integer getPkgRev() {
return f;
}
public final String getPkgSign() {
return d;
}
public final String getPkgVer() {
return e;
}
public final void setAppGroupId(String str) {
g = str;
}
/* JADX WARN: Can't wrap try/catch for region: R(20:2|3|4|(3:6|(1:10)|66)(3:67|(1:69)|66)|(1:64)(4:14|15|16|17)|18|(2:19|20)|(4:(15:22|23|24|25|(1:27)(1:55)|28|29|30|31|(6:33|(1:37)|(1:42)|43|44|45)(6:50|(1:52)|(2:40|42)|43|44|45)|38|(0)|43|44|45)|43|44|45)|58|23|24|25|(0)(0)|28|29|30|31|(0)(0)|38|(0)) */
/* JADX WARN: Can't wrap try/catch for region: R(24:2|3|4|(3:6|(1:10)|66)(3:67|(1:69)|66)|(1:64)(4:14|15|16|17)|18|19|20|(15:22|23|24|25|(1:27)(1:55)|28|29|30|31|(6:33|(1:37)|(1:42)|43|44|45)(6:50|(1:52)|(2:40|42)|43|44|45)|38|(0)|43|44|45)|58|23|24|25|(0)(0)|28|29|30|31|(0)(0)|38|(0)|43|44|45) */
/* JADX WARN: Code restructure failed: missing block: B:35:0x00d4, code lost:
r1 = r2.getInstallSourceInfo(r1);
*/
/* JADX WARN: Code restructure failed: missing block: B:56:0x00bc, code lost:
r2 = 0;
*/
/* JADX WARN: Code restructure failed: missing block: B:8:0x0053, code lost:
r5 = r5.signingInfo;
*/
/* JADX WARN: Removed duplicated region for block: B:27:0x00b3 A[Catch: Exception -> 0x00bc, TryCatch #1 {Exception -> 0x00bc, blocks: (B:25:0x00a6, B:27:0x00b3, B:55:0x00b9), top: B:24:0x00a6 }] */
/* JADX WARN: Removed duplicated region for block: B:33:0x00ce A[Catch: NameNotFoundException -> 0x00eb, TryCatch #5 {NameNotFoundException -> 0x00eb, blocks: (B:31:0x00c8, B:33:0x00ce, B:35:0x00d4, B:37:0x00da, B:50:0x00e0, B:52:0x00e6), top: B:30:0x00c8 }] */
/* JADX WARN: Removed duplicated region for block: B:40:0x00ed */
/* JADX WARN: Removed duplicated region for block: B:50:0x00e0 A[Catch: NameNotFoundException -> 0x00eb, TryCatch #5 {NameNotFoundException -> 0x00eb, blocks: (B:31:0x00c8, B:33:0x00ce, B:35:0x00d4, B:37:0x00da, B:50:0x00e0, B:52:0x00e6), top: B:30:0x00c8 }] */
/* JADX WARN: Removed duplicated region for block: B:55:0x00b9 A[Catch: Exception -> 0x00bc, TRY_LEAVE, TryCatch #1 {Exception -> 0x00bc, blocks: (B:25:0x00a6, B:27:0x00b3, B:55:0x00b9), top: B:24:0x00a6 }] */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:64:0x0069 -> B:11:0x006a). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void setContext(android.content.Context r8) {
/*
Method dump skipped, instructions count: 258
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJAppInfo.setContext(android.content.Context):void");
}
public final void setManagedDeviceID(String str) {
h = str;
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJAppInfoKt {
}

View File

@@ -0,0 +1,19 @@
package com.tapjoy;
import android.content.Context;
import com.google.android.gms.appset.AppSet;
import com.tapjoy.internal.r1;
import java.util.Locale;
/* loaded from: classes4.dex */
public class TJAppSetId {
public void fetch(Context context, TJTaskHandler<String> tJTaskHandler) {
try {
AppSet.getClient(context.getApplicationContext()).getAppSetIdInfo().addOnSuccessListener(new r1(tJTaskHandler));
} catch (Exception e) {
Locale locale = Locale.ENGLISH;
TapjoyLog.d("TJAppSetId", "AppSetId class not found: " + e.getMessage());
tJTaskHandler.onComplete("");
}
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJAwardCurrencyListener {
void onAwardCurrencyResponse(String str, int i);
void onAwardCurrencyResponseFailure(String str);
}

View File

@@ -0,0 +1,6 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJCacheListener {
void onCachingComplete(int i);
}

View File

@@ -0,0 +1,92 @@
package com.tapjoy;
import android.content.Context;
import android.os.Handler;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.core.view.ViewCompat;
/* loaded from: classes4.dex */
public class TJCloseButton extends ImageButton {
public boolean a;
public boolean b;
public enum ClosePosition {
TOP_LEFT,
TOP_CENTER,
TOP_RIGHT,
CENTER,
BOTTOM_LEFT,
BOTTOM_CENTER,
BOTTOM_RIGHT;
ClosePosition() {
}
}
public TJCloseButton(Context context) {
this(context, ClosePosition.TOP_RIGHT);
}
@Override // android.widget.ImageView, android.view.View
public final void onAttachedToWindow() {
super.onAttachedToWindow();
setAlpha(0.0f);
setVisibility(0);
this.b = true;
setClickable(false);
new Handler().postDelayed(new y(this), 2000L);
}
public TJCloseButton(Context context, ClosePosition closePosition) {
super(context);
this.a = true;
float density = TJDeviceUtils.INSTANCE.getDensity(getContext());
setImageBitmap(TapjoyIcons.getCloseCircularImage(density));
setScaleType(ImageView.ScaleType.FIT_XY);
setBackgroundColor(ViewCompat.MEASURED_SIZE_MASK);
int i = (int) (density * 75.0d);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i, i);
switch (z.a[closePosition.ordinal()]) {
case 1:
layoutParams.addRule(10);
layoutParams.addRule(9);
break;
case 2:
layoutParams.addRule(10);
layoutParams.addRule(14);
break;
case 3:
layoutParams.addRule(10);
layoutParams.addRule(11);
break;
case 4:
layoutParams.addRule(13);
break;
case 5:
layoutParams.addRule(12);
layoutParams.addRule(9);
break;
case 6:
layoutParams.addRule(12);
layoutParams.addRule(14);
break;
case 7:
layoutParams.addRule(12);
layoutParams.addRule(11);
break;
}
int i2 = (int) (density * (-10.0f));
layoutParams.setMargins(0, i2, i2, 0);
setLayoutParams(layoutParams);
}
public void setClickableRequested(boolean z) {
this.a = z;
if (this.b) {
return;
}
setClickable(z);
}
}

View File

@@ -0,0 +1,10 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJConnectInterface {
void onConnectFailure(int i, String str);
void onConnectSuccess();
void onConnectWarning(int i, String str);
}

View File

@@ -0,0 +1,16 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public abstract class TJConnectListener implements TJConnectInterface {
@Override // com.tapjoy.TJConnectInterface
public void onConnectFailure(int i, String str) {
}
@Override // com.tapjoy.TJConnectInterface
public void onConnectSuccess() {
}
@Override // com.tapjoy.TJConnectInterface
public void onConnectWarning(int i, String str) {
}
}

View File

@@ -0,0 +1,294 @@
package com.tapjoy;
import android.content.Context;
import android.text.TextUtils;
import com.tapjoy.TapjoyErrorMessage;
import com.tapjoy.internal.d3;
import com.tapjoy.internal.s2;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJCorePlacement {
public Context b;
public Map c;
public final TJPlacementData d;
public TJCurrencyParameters e;
public final String f;
public long g;
public final TJAdUnit h;
public boolean k;
public final HashMap a = new HashMap();
public boolean i = false;
public boolean j = false;
public volatile boolean l = false;
public volatile boolean m = false;
public volatile boolean n = false;
public volatile boolean o = false;
public TJCorePlacement(String str, String str2) {
a0 a0Var = new a0(this);
Context context = com.tapjoy.internal.j.a;
if (context == null) {
WeakReference weakReference = com.tapjoy.internal.j.c.a;
context = (Context) (weakReference != null ? weakReference.get() : null);
}
this.b = context;
if (context == null) {
TapjoyLog.d("TJCorePlacement", "context is NULL.");
}
TJPlacementData tJPlacementData = new TJPlacementData(str2, getPlacementContentUrl());
this.d = tJPlacementData;
tJPlacementData.setPlacementName(str);
this.e = new TJCurrencyParameters(this.b);
this.f = UUID.randomUUID().toString();
TJAdUnit tJAdUnit = new TJAdUnit();
this.h = tJAdUnit;
tJAdUnit.setWebViewListener(a0Var);
}
public final void a(String str, TJPlacement tJPlacement) {
synchronized (this.a) {
try {
this.a.put(str, tJPlacement);
if (tJPlacement != null) {
TapjoyLog.d("TJCorePlacement", "Setting " + str + " placement: " + tJPlacement.getGUID());
}
} catch (Throwable th) {
throw th;
}
}
}
public TJAdUnit getAdUnit() {
return this.h;
}
public Context getContext() {
return this.b;
}
public String getPlacementContentUrl() {
String appID = TapjoyConnectCore.getInstance().getAppID();
if (TextUtils.isEmpty(appID)) {
TapjoyLog.i("TJCorePlacement", "Placement content URL cannot be generated for null app ID");
return "";
}
return TapjoyConnectCore.getInstance().getPlacementURL() + "v1/apps/" + appID + "/content?";
}
public TJPlacementData getPlacementData() {
return this.d;
}
public boolean isContentAvailable() {
return this.n;
}
public boolean isContentReady() {
return this.o;
}
public final synchronized void c(String str) {
float f;
com.tapjoy.internal.k kVar;
long parseLong;
long parseLong2;
long parseLong3;
double parseDouble;
if (this.l) {
TapjoyLog.i("TJCorePlacement", "Placement " + this.d.getPlacementName() + " is already requesting content");
return;
}
this.d.resetPlacementRequestData();
this.h.resetContentLoadState();
this.l = false;
this.m = false;
this.n = false;
this.o = false;
this.l = true;
TJPlacement a = a("REQUEST");
Map<String, String> baseURLParams = TapjoyConnectCore.getInstance().getBaseURLParams();
this.c = baseURLParams;
TJCurrencyParameters tJCurrencyParameters = this.e;
tJCurrencyParameters.getClass();
HashMap hashMap = new HashMap();
Context context = tJCurrencyParameters.a;
if (context != null && !tJCurrencyParameters.f) {
tJCurrencyParameters.c = new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).getInt(TapjoyConstants.PREF_SERVER_CURRENCY_BALANCE, -9999);
}
if (tJCurrencyParameters.i.size() > 0 && !tJCurrencyParameters.f && tJCurrencyParameters.c >= 0) {
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_ID_BALANCE, (String) tJCurrencyParameters.i.get(0), true);
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_BALANCE, Integer.toString(tJCurrencyParameters.c), true);
} else if (tJCurrencyParameters.i.contains(tJCurrencyParameters.b) && tJCurrencyParameters.f && tJCurrencyParameters.c >= 0) {
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_ID_BALANCE, tJCurrencyParameters.b, true);
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_BALANCE, Integer.toString(tJCurrencyParameters.c), true);
}
if (tJCurrencyParameters.i.contains(tJCurrencyParameters.d) && tJCurrencyParameters.e > 0) {
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_ID_REQUIRED, tJCurrencyParameters.d, true);
TapjoyUtil.safePut(hashMap, TapjoyConstants.TJC_CURRENCY_AMOUNT_REQUIRED, Integer.toString(tJCurrencyParameters.e), true);
}
baseURLParams.putAll(hashMap);
TapjoyUtil.safePut(this.c, TJAdUnitConstants.PARAM_PLACEMENT_NAME, this.d.getPlacementName(), true);
TapjoyUtil.safePut(this.c, TJAdUnitConstants.PARAM_PLACEMENT_PRELOAD, String.valueOf(true), true);
TapjoyUtil.safePut(this.c, "debug", Boolean.toString(TapjoyLog.isLoggingEnabled()), true);
TapjoyUtil.safePut(this.c, TJAdUnitConstants.PARAM_PLACEMENT_BY_SDK, String.valueOf(this.k), true);
if (a.getEntryPoint() != null) {
TapjoyUtil.safePut(this.c, TJAdUnitConstants.PARAM_ENTRY_POINT, a.getEntryPoint().getValue(), true);
}
if (!TextUtils.isEmpty(TapjoyConnectCore.getInstance().getCustomParameter())) {
TapjoyUtil.safePut(this.c, "cp", TapjoyConnectCore.getInstance().getCustomParameter(), true);
}
Iterator it = s2.c.a.a.iterator();
while (true) {
if (!it.hasNext()) {
f = 0.0f;
break;
}
Map map = ((com.tapjoy.internal.n) it.next()).a;
Object obj = map != null ? map.get("placement_request_content_retry_timeout") : null;
if (obj != null) {
if (obj instanceof Number) {
f = ((Number) obj).floatValue();
break;
} else if (obj instanceof String) {
try {
f = Float.parseFloat((String) obj);
break;
} catch (IllegalArgumentException unused) {
continue;
}
} else {
continue;
}
}
}
d3 d3Var = new d3((long) f);
Iterator it2 = s2.c.a.a.iterator();
while (true) {
if (!it2.hasNext()) {
kVar = com.tapjoy.internal.k.f;
break;
}
Map map2 = ((com.tapjoy.internal.n) it2.next()).a;
Object obj2 = map2 != null ? map2.get("placement_request_content_retry_backoff") : null;
if (obj2 instanceof List) {
List list = (List) obj2;
try {
Object obj3 = list.get(0);
if (obj3 instanceof Number) {
parseLong = ((Number) obj3).longValue();
} else {
if (!(obj3 instanceof String)) {
throw new IllegalArgumentException();
}
parseLong = Long.parseLong((String) obj3);
}
long j = parseLong;
Object obj4 = list.get(1);
if (obj4 instanceof Number) {
parseLong2 = ((Number) obj4).longValue();
} else {
if (!(obj4 instanceof String)) {
throw new IllegalArgumentException();
}
parseLong2 = Long.parseLong((String) obj4);
}
Object obj5 = list.get(2);
if (obj5 instanceof Number) {
parseLong3 = ((Number) obj5).longValue();
} else {
if (!(obj5 instanceof String)) {
throw new IllegalArgumentException();
}
parseLong3 = Long.parseLong((String) obj5);
}
Object obj6 = list.get(3);
if (obj6 instanceof Number) {
parseDouble = ((Number) obj6).doubleValue();
} else {
if (!(obj6 instanceof String)) {
throw new IllegalArgumentException();
}
parseDouble = Double.parseDouble((String) obj6);
}
kVar = new com.tapjoy.internal.k(j, parseLong2, parseLong3, parseDouble);
} catch (RuntimeException unused2) {
}
}
}
new c0(this, str, a, d3Var, kVar).start();
}
public void setContext(Context context) {
this.b = context;
this.e = new TJCurrencyParameters(context);
}
public final void b(String str) {
if (str != null) {
try {
TapjoyLog.d("TJCorePlacement", "Disable preload flag is set for placement " + this.d.getPlacementName());
this.d.setRedirectURL(new JSONObject(str).getString(TapjoyConstants.TJC_REDIRECT_URL));
this.d.setPreloadDisabled(true);
this.d.setHasProgressSpinner(true);
TapjoyLog.d("TJCorePlacement", "redirect_url:" + this.d.getRedirectURL());
return;
} catch (JSONException unused) {
throw new TapjoyException("TJPlacement request failed, malformed server response");
}
}
throw new TapjoyException("TJPlacement request failed due to null response");
}
public final TJPlacement a(String str) {
TJPlacement tJPlacement;
synchronized (this.a) {
try {
tJPlacement = (TJPlacement) this.a.get(str);
if (tJPlacement != null) {
TapjoyLog.d("TJCorePlacement", "Returning " + str + " placement: " + tJPlacement.getGUID());
}
} catch (Throwable th) {
throw th;
}
}
return tJPlacement;
}
public final void a(TJPlacement tJPlacement) {
if (tJPlacement == null || tJPlacement.getListener() == null) {
return;
}
TapjoyLog.i("TJCorePlacement", "Content request delivered successfully for placement " + this.d.getPlacementName() + ", contentAvailable: " + isContentAvailable());
tJPlacement.getListener().onRequestSuccess(tJPlacement);
}
public final void a(TJPlacement tJPlacement, TapjoyErrorMessage.ErrorType errorType, TJError tJError) {
TapjoyLog.e("TJCorePlacement", new TapjoyErrorMessage(errorType, "Content request failed for placement " + this.d.getPlacementName() + "; Reason= " + tJError.message));
if (tJPlacement == null || tJPlacement.getListener() == null) {
return;
}
tJPlacement.getListener().onRequestFailure(tJPlacement, tJError);
}
public final void a() {
if (this.m) {
return;
}
this.o = true;
TapjoyLog.i("TJCorePlacement", "Content is ready for placement " + this.d.getPlacementName());
TJPlacement a = a("REQUEST");
if (a == null || a.getListener() == null) {
return;
}
a.getListener().onContentReady(a);
this.m = true;
}
}

View File

@@ -0,0 +1,98 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import com.tapjoy.TapjoyErrorMessage;
import java.util.Map;
/* loaded from: classes4.dex */
public class TJCurrency {
public static TJEarnedCurrencyListener c;
public final Context a;
public Boolean b;
public TJCurrency(Context context) {
this.a = context;
}
public void awardCurrency(int i, TJAwardCurrencyListener tJAwardCurrencyListener) {
if (i < 0) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "Amount must be a positive number for the awardCurrency API"));
if (tJAwardCurrencyListener != null) {
tJAwardCurrencyListener.onAwardCurrencyResponseFailure("Amount must be a positive number for the awardCurrency API");
return;
}
return;
}
if (a()) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "awardCurrency is not supported with self managed currency"));
if (tJAwardCurrencyListener != null) {
tJAwardCurrencyListener.onAwardCurrencyResponseFailure("awardCurrency is not supported with self managed currency");
return;
}
return;
}
Map<String, String> baseURLParams = TapjoyConnectCore.getInstance().getBaseURLParams();
TapjoyUtil.safePut(baseURLParams, TapjoyConstants.TJC_CURRENCY, String.valueOf(i), true);
baseURLParams.putAll(TJVerifier.INSTANCE.getTapjoyAwardCurrencyVerifierAndTimeStampParams(i));
new Thread(new h0(this, baseURLParams, tJAwardCurrencyListener)).start();
}
public void getCurrencyBalance(TJGetCurrencyBalanceListener tJGetCurrencyBalanceListener) {
if (!a()) {
new Thread(new f0(this, TapjoyConnectCore.getInstance().getBaseURLParams(), tJGetCurrencyBalanceListener)).start();
return;
}
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "getCurrencyBalance is not supported with self managed currency"));
if (tJGetCurrencyBalanceListener != null) {
tJGetCurrencyBalanceListener.onGetCurrencyBalanceResponseFailure("getCurrencyBalance is not supported with self managed currency");
}
}
public int getLocalCurrencyBalance() {
return this.a.getSharedPreferences(TapjoyConstants.TJC_PREFERENCE, 0).getInt(TapjoyConstants.PREF_SERVER_CURRENCY_BALANCE, -9999);
}
public void saveCurrencyBalance(int i) {
SharedPreferences.Editor edit = this.a.getSharedPreferences(TapjoyConstants.TJC_PREFERENCE, 0).edit();
edit.putInt(TapjoyConstants.PREF_SERVER_CURRENCY_BALANCE, i);
edit.apply();
}
public void setEarnedCurrencyListener(TJEarnedCurrencyListener tJEarnedCurrencyListener) {
c = tJEarnedCurrencyListener;
}
public void spendCurrency(int i, TJSpendCurrencyListener tJSpendCurrencyListener) {
if (i < 0) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "Amount must be a positive number for the spendCurrency API"));
if (tJSpendCurrencyListener != null) {
tJSpendCurrencyListener.onSpendCurrencyResponseFailure("Amount must be a positive number for the spendCurrency API");
return;
}
return;
}
if (a()) {
TapjoyLog.e("TJCurrency", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "spendCurrency is not supported with self managed currency"));
if (tJSpendCurrencyListener != null) {
tJSpendCurrencyListener.onSpendCurrencyResponseFailure("spendCurrency is not supported with self managed currency");
return;
}
return;
}
Map<String, String> baseURLParams = TapjoyConnectCore.getInstance().getBaseURLParams();
TapjoyUtil.safePut(baseURLParams, TapjoyConstants.TJC_CURRENCY, "" + i, true);
new Thread(new g0(this, baseURLParams, tJSpendCurrencyListener)).start();
}
public final boolean a() {
if (this.b == null) {
SharedPreferences sharedPreferences = this.a.getSharedPreferences(TapjoyConstants.TJC_PREFERENCE, 0);
if (!sharedPreferences.contains("self_managed")) {
return false;
}
this.b = Boolean.valueOf(sharedPreferences.getBoolean("self_managed", false));
}
return this.b.booleanValue();
}
}

View File

@@ -0,0 +1,53 @@
package com.tapjoy;
import android.content.Context;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJCurrencyParameters {
public final Context a;
public final boolean f;
public final ArrayList i;
public String b = null;
public int c = -1;
public String d = null;
public int e = -1;
public final HashMap g = new HashMap();
public final HashMap h = new HashMap();
public TJCurrencyParameters(Context context) {
this.f = false;
this.i = new ArrayList();
if (context != null && this.a == null) {
this.a = context;
}
Context context2 = this.a;
if (context2 == null) {
return;
}
TJKeyValueStorage tJKeyValueStorage = new TJKeyValueStorage(context2, TapjoyConstants.TJC_PREFERENCE);
if (tJKeyValueStorage.contains(TapjoyConstants.PREF_SERVER_CURRENCY_IDS)) {
String string = tJKeyValueStorage.getString(TapjoyConstants.PREF_SERVER_CURRENCY_IDS, "[]");
ArrayList arrayList = new ArrayList();
try {
JSONArray jSONArray = new JSONArray(string);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
String optString = jSONObject.optString("currency_id");
this.f = jSONObject.optString(TapjoyConstants.PREF_SERVER_CURRENCY_TYPE).equals("self_managed");
arrayList.add(optString);
}
} catch (JSONException unused) {
TapjoyLog.e("CurrencyParams", "Failed to parse currency id list");
}
if (arrayList.isEmpty()) {
return;
}
this.i = arrayList;
}
}
}

View File

@@ -0,0 +1,47 @@
package com.tapjoy;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJDataFetcher {
public final JSONObject a = new JSONObject();
/* JADX WARN: Code restructure failed: missing block: B:9:0x0021, code lost:
if (r4 != false) goto L11;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final org.json.JSONObject a(org.json.JSONArray r6) {
/*
r5 = this;
r0 = 0
L1:
int r1 = r6.length()
if (r0 >= r1) goto L2b
java.lang.Object r1 = r6.get(r0)
java.lang.String r2 = "USER_ID"
boolean r1 = r1.equals(r2)
if (r1 == 0) goto L28
com.tapjoy.TJUser r1 = com.tapjoy.TJUser.INSTANCE
java.lang.String r1 = r1.getUserID()
org.json.JSONObject r3 = r5.a
if (r1 == 0) goto L23
boolean r4 = r1.isEmpty()
if (r4 == 0) goto L25
L23:
java.lang.Object r1 = org.json.JSONObject.NULL
L25:
r3.put(r2, r1)
L28:
int r0 = r0 + 1
goto L1
L2b:
org.json.JSONObject r6 = r5.a
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJDataFetcher.a(org.json.JSONArray):org.json.JSONObject");
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public abstract /* synthetic */ class TJDeviceInfo$$ExternalSyntheticApiModelOutline0 {
}

View File

@@ -0,0 +1,199 @@
package com.tapjoy;
import android.app.UiModeManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Insets;
import android.media.AudioManager;
import android.os.BatteryManager;
import android.os.Build;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
import java.math.BigDecimal;
import java.math.RoundingMode;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJDeviceInfo {
public static final TJDeviceInfo INSTANCE = new TJDeviceInfo();
public final Float getBatteryLevel(Context context) {
Object systemService = context != null ? context.getSystemService("batterymanager") : null;
if ((systemService instanceof BatteryManager ? (BatteryManager) systemService : null) == null) {
return null;
}
return Float.valueOf(r3.getIntProperty(4) / 100.0f);
}
public final Float getBrightness(Context context) {
ContentResolver contentResolver;
if (context != null) {
try {
contentResolver = context.getContentResolver();
} catch (Settings.SettingNotFoundException e) {
TapjoyLog.e("TJDeviceInfo", e.getLocalizedMessage());
return null;
}
} else {
contentResolver = null;
}
if (contentResolver == null) {
return null;
}
return Float.valueOf(new BigDecimal(Settings.System.getInt(contentResolver, "screen_brightness") / 255.0f).setScale(2, RoundingMode.HALF_UP).floatValue());
}
public final Integer getDeviceScreenLayoutSize(Context context) {
Resources resources;
Configuration configuration = (context == null || (resources = context.getResources()) == null) ? null : resources.getConfiguration();
if (configuration == null) {
return null;
}
try {
return Integer.valueOf(configuration.screenLayout & 15);
} catch (Exception e) {
TapjoyLog.e("TJDeviceInfo", "Error getting screen density/dimensions/layout: " + e);
return null;
}
}
public final Integer getScreenHeight(Context context) {
Object systemService;
Resources resources;
WindowMetrics currentWindowMetrics;
WindowInsets windowInsets;
int statusBars;
Insets insets;
int i;
DisplayMetrics displayMetrics;
if (context != null) {
try {
systemService = context.getSystemService("window");
} catch (Exception e) {
TapjoyLog.d("TJDeviceInfo", e.getMessage());
return null;
}
} else {
systemService = null;
}
WindowManager windowManager = systemService instanceof WindowManager ? (WindowManager) systemService : null;
if (windowManager == null) {
return null;
}
if (Build.VERSION.SDK_INT >= 30) {
currentWindowMetrics = windowManager.getCurrentWindowMetrics();
Intrinsics.checkNotNullExpressionValue(currentWindowMetrics, "getCurrentWindowMetrics(...)");
windowInsets = currentWindowMetrics.getWindowInsets();
statusBars = WindowInsets.Type.statusBars();
insets = windowInsets.getInsets(statusBars);
i = insets.top;
Resources resources2 = context.getResources();
if (resources2 == null || (displayMetrics = resources2.getDisplayMetrics()) == null) {
return null;
}
return Integer.valueOf(displayMetrics.heightPixels - i);
}
DisplayMetrics displayMetrics2 = new DisplayMetrics();
Display defaultDisplay = windowManager.getDefaultDisplay();
if (defaultDisplay != null) {
defaultDisplay.getMetrics(displayMetrics2);
}
int i2 = 0;
try {
Resources resources3 = context.getResources();
int identifier = resources3 != null ? resources3.getIdentifier("status_bar_height", "dimen", "android") : 0;
if (identifier > 0 && (resources = context.getResources()) != null) {
i2 = resources.getDimensionPixelSize(identifier);
}
} catch (Exception unused) {
}
int i3 = displayMetrics2.heightPixels - i2;
displayMetrics2.heightPixels = i3;
return Integer.valueOf(i3);
}
public final String getTheme(Context context) {
Object systemService = context != null ? context.getSystemService("uimode") : null;
UiModeManager uiModeManager = systemService instanceof UiModeManager ? (UiModeManager) systemService : null;
Integer valueOf = uiModeManager != null ? Integer.valueOf(uiModeManager.getNightMode()) : null;
return (valueOf != null && valueOf.intValue() == 2) ? TapjoyConstants.TJC_THEME_DARK : TapjoyConstants.TJC_THEME_LIGHT;
}
public final Float getVolume(Context context) {
Object systemService;
if (context != null) {
try {
systemService = context.getSystemService("audio");
} catch (Exception unused) {
TapjoyLog.e("TJDeviceInfo", "Unable to fetch volume");
return null;
}
} else {
systemService = null;
}
if ((systemService instanceof AudioManager ? (AudioManager) systemService : null) == null) {
return null;
}
return Float.valueOf(new BigDecimal(r4.getStreamVolume(3) / r4.getStreamMaxVolume(3)).setScale(2, RoundingMode.HALF_UP).floatValue());
}
public final Integer getScreenDPI(Context context) {
Resources resources;
DisplayMetrics displayMetrics;
try {
if (Build.VERSION.SDK_INT >= 30) {
if (context == null || (resources = context.getResources()) == null || (displayMetrics = resources.getDisplayMetrics()) == null) {
return null;
}
return Integer.valueOf(displayMetrics.densityDpi);
}
Object systemService = context != null ? context.getSystemService("window") : null;
WindowManager windowManager = systemService instanceof WindowManager ? (WindowManager) systemService : null;
if (windowManager == null) {
return null;
}
DisplayMetrics displayMetrics2 = new DisplayMetrics();
Display defaultDisplay = windowManager.getDefaultDisplay();
if (defaultDisplay != null) {
defaultDisplay.getMetrics(displayMetrics2);
}
return Integer.valueOf(displayMetrics2.densityDpi);
} catch (Exception e) {
TapjoyLog.d("TJDeviceInfo", e.getMessage());
return null;
}
}
public final Integer getScreenWidth(Context context) {
Resources resources;
DisplayMetrics displayMetrics;
try {
if (Build.VERSION.SDK_INT >= 30) {
if (context == null || (resources = context.getResources()) == null || (displayMetrics = resources.getDisplayMetrics()) == null) {
return null;
}
return Integer.valueOf(displayMetrics.widthPixels);
}
Object systemService = context != null ? context.getSystemService("window") : null;
WindowManager windowManager = systemService instanceof WindowManager ? (WindowManager) systemService : null;
if (windowManager == null) {
return null;
}
DisplayMetrics displayMetrics2 = new DisplayMetrics();
Display defaultDisplay = windowManager.getDefaultDisplay();
if (defaultDisplay != null) {
defaultDisplay.getMetrics(displayMetrics2);
}
return Integer.valueOf(displayMetrics2.widthPixels);
} catch (Exception e) {
TapjoyLog.d("TJDeviceInfo", e.getMessage());
return null;
}
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJDeviceInfoKt {
}

View File

@@ -0,0 +1,221 @@
package com.tapjoy;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJDeviceNetwork {
public static final TJDeviceNetwork INSTANCE = new TJDeviceNetwork();
public static String a = "";
public static String b = "";
public static String c = "";
public static String d = "";
public static String e = "";
public static String f = "";
public static String g = "";
public static String h = "";
/* JADX WARN: Code restructure failed: missing block: B:15:0x0070, code lost:
if (r5 == null) goto L18;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static void c(android.content.Context r5) {
/*
java.lang.String r0 = "TJDeviceNetwork"
java.lang.String r1 = "substring(...)"
java.lang.String r2 = "phone"
java.lang.Object r5 = r5.getSystemService(r2)
android.telephony.TelephonyManager r5 = (android.telephony.TelephonyManager) r5
if (r5 == 0) goto L91
java.lang.String r2 = r5.getNetworkOperatorName() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r3 = "getNetworkOperatorName(...)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r3) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
com.tapjoy.TJDeviceNetwork.a = r2 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r2 = r5.getSimOperatorName() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r3 = "getSimOperatorName(...)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r3) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
com.tapjoy.TJDeviceNetwork.b = r2 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r2 = r5.getNetworkCountryIso() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r3 = "getNetworkCountryIso(...)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r3) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
com.tapjoy.TJDeviceNetwork.c = r2 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r2 = r5.getNetworkOperator() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
if (r2 == 0) goto L5a
int r3 = r2.length() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
r4 = 5
if (r3 == r4) goto L46
int r3 = r2.length() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
r4 = 6
if (r3 != r4) goto L5a
goto L46
L44:
r5 = move-exception
goto L77
L46:
r3 = 0
r4 = 3
java.lang.String r3 = r2.substring(r3, r4) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r1) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
com.tapjoy.TJDeviceNetwork.d = r3 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r2 = r2.substring(r4) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r1) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
com.tapjoy.TJDeviceNetwork.e = r2 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
L5a:
java.lang.String r5 = r5.getSimCountryIso() // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
if (r5 == 0) goto L72
java.util.Locale r1 = java.util.Locale.US // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r2 = "US"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r1, r2) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r5 = r5.toUpperCase(r1) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
java.lang.String r1 = "toUpperCase(...)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r5, r1) // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
if (r5 != 0) goto L74
L72:
java.lang.String r5 = ""
L74:
com.tapjoy.TJDeviceNetwork.h = r5 // Catch: java.lang.Exception -> L44 java.lang.SecurityException -> L8c
goto L91
L77:
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
java.lang.String r2 = "Error getting carrier info: "
r1.append(r2)
r1.append(r5)
java.lang.String r5 = r1.toString()
com.tapjoy.TapjoyLog.e(r0, r5)
goto L91
L8c:
java.lang.String r5 = "Error accessing network operator info"
com.tapjoy.TapjoyLog.i(r0, r5)
L91:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJDeviceNetwork.c(android.content.Context):void");
}
public final String getCarrierCountryCode() {
return c;
}
public final String getCarrierName() {
return a;
}
public final String getCarrierNameSim() {
return b;
}
public final String getConnectionSubType() {
return g;
}
public final String getConnectionType() {
return f;
}
public final String getDeviceCountrySIM() {
return h;
}
public final String getMobileCountryCode() {
return d;
}
public final String getMobileNetworkCode() {
return e;
}
public final void setCarrierCountryCode(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
c = str;
}
public final void setCarrierName(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
a = str;
}
public final void setCarrierNameSim(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
b = str;
}
public final void setConnectionSubType(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
g = str;
}
public final void setConnectionType(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
f = str;
}
public final void setContext(Context context) {
if (context != null) {
INSTANCE.getClass();
c(context);
f = b(context);
g = a(context);
}
}
public final void setDeviceCountrySIM(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
h = str;
}
public final void setMobileCountryCode(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
d = str;
}
public final void setMobileNetworkCode(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
e = str;
}
public static String a(Context context) {
String str = "";
try {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
if (connectivityManager != null) {
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
String subtypeName = activeNetworkInfo != null ? activeNetworkInfo.getSubtypeName() : null;
if (subtypeName != null) {
str = subtypeName;
}
TapjoyLog.d("TJDeviceNetwork", "connection_sub_type: " + str);
}
} catch (Exception e2) {
TapjoyLog.e("TJDeviceNetwork", "getConnectionSubType error: " + e2);
}
return str;
}
public static String b(Context context) {
ConnectivityManager connectivityManager;
Network activeNetwork;
String str = "";
try {
connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
} catch (Exception e2) {
TapjoyLog.e("TJDeviceNetwork", "getConnectionType error: " + e2);
}
if (connectivityManager != null && (activeNetwork = connectivityManager.getActiveNetwork()) != null) {
NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork);
str = (networkCapabilities == null || !networkCapabilities.hasTransport(1)) ? TJDeviceNetworkKt.TJC_CONNECTION_TYPE_MOBILE : "wifi";
TapjoyLog.d("TJDeviceNetwork", "connectivity: " + (networkCapabilities != null ? networkCapabilities.toString() : null));
TapjoyLog.d("TJDeviceNetwork", "connection_type: " + str);
return str;
}
return "";
}
}

View File

@@ -0,0 +1,7 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJDeviceNetworkKt {
public static final String TJC_CONNECTION_TYPE_MOBILE = "mobile";
public static final String TJC_CONNECTION_TYPE_WIFI = "wifi";
}

View File

@@ -0,0 +1,146 @@
package com.tapjoy;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Insets;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
import androidx.core.hardware.display.DisplayManagerCompat;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJDeviceUtils {
public static final TJDeviceUtils INSTANCE = new TJDeviceUtils();
public final long getAvailableDiskSpace() {
return new StatFs(Environment.getDataDirectory().getPath()).getFreeBytes() / 1000000;
}
public final float getDensity(Context context) {
Resources resources;
DisplayMetrics displayMetrics;
if (context == null || (resources = context.getResources()) == null || (displayMetrics = resources.getDisplayMetrics()) == null) {
return 1.0f;
}
return displayMetrics.density;
}
public final String getOrientationString(int i, int i2) {
return i > i2 ? "landscape" : "portrait";
}
public final int getScreenHeight(Context context) {
Display display;
if (context == null || (display = DisplayManagerCompat.getInstance(context).getDisplay(0)) == null) {
return 0;
}
return context.createDisplayContext(display).getResources().getDisplayMetrics().heightPixels;
}
public final int getScreenOrientation(Activity activity) {
PackageInfo packageInfo = null;
PackageManager packageManager = activity != null ? activity.getPackageManager() : null;
if (packageManager == null) {
return -1;
}
try {
packageInfo = packageManager.getPackageInfo(activity.getPackageName(), 1);
} catch (PackageManager.NameNotFoundException e) {
TapjoyLog.e("TJDeviceInfo", e.getMessage());
}
if (packageInfo != null) {
ActivityInfo[] activities = packageInfo.activities;
Intrinsics.checkNotNullExpressionValue(activities, "activities");
if (activities.length != 0) {
return packageInfo.activities[0].screenOrientation;
}
}
return -1;
}
public final int getScreenRotation(Context context, int i, int i2) {
if (context == null) {
return 0;
}
Display display = DisplayManagerCompat.getInstance(context).getDisplay(0);
int rotation = display != null ? display.getRotation() : 0;
if (((rotation == 0 || rotation == 2) && i2 > i) || ((rotation == 1 || rotation == 3) && i > i2)) {
if (rotation != 1) {
if (rotation != 2) {
if (rotation != 3) {
TapjoyLog.w("TJDeviceInfo", "Unknown screen orientation. Defaulting to landscape.");
return 0;
}
return 90;
}
return 180;
}
return 270;
}
if (rotation != 0) {
if (rotation == 1) {
return 0;
}
if (rotation != 2) {
if (rotation != 3) {
TapjoyLog.w("TJDeviceInfo", "Unknown screen orientation. Defaulting to landscape.");
return 0;
}
return 180;
}
return 90;
}
return 270;
}
public final int getScreenWidth(Context context) {
Display display;
if (context == null || (display = DisplayManagerCompat.getInstance(context).getDisplay(0)) == null) {
return 0;
}
return context.createDisplayContext(display).getResources().getDisplayMetrics().widthPixels;
}
public final long getTotalDiskSpace() {
return new StatFs(Environment.getDataDirectory().getPath()).getTotalBytes() / 1000000;
}
public final int getStatusBarHeight(Context context) {
WindowMetrics currentWindowMetrics;
WindowInsets windowInsets;
int displayCutout;
Insets insetsIgnoringVisibility;
int i;
int i2;
int i3;
int i4;
Intrinsics.checkNotNullParameter(context, "context");
if (Build.VERSION.SDK_INT <= 34 || context.getApplicationInfo().targetSdkVersion <= 34) {
return 0;
}
Object systemService = context.getSystemService("window");
Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.view.WindowManager");
currentWindowMetrics = ((WindowManager) systemService).getCurrentWindowMetrics();
Intrinsics.checkNotNullExpressionValue(currentWindowMetrics, "getCurrentWindowMetrics(...)");
windowInsets = currentWindowMetrics.getWindowInsets();
displayCutout = WindowInsets.Type.displayCutout();
insetsIgnoringVisibility = windowInsets.getInsetsIgnoringVisibility(displayCutout);
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility, "getInsetsIgnoringVisibility(...)");
i = insetsIgnoringVisibility.left;
i2 = insetsIgnoringVisibility.top;
double max = Math.max(i, i2);
i3 = insetsIgnoringVisibility.right;
i4 = insetsIgnoringVisibility.bottom;
return (int) (((int) Math.max(max, Math.max(i3, i4))) / (context.getResources().getDisplayMetrics().densityDpi / 160.0f));
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJDeviceUtilsKt {
}

View File

@@ -0,0 +1,6 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJEarnedCurrencyListener {
void onEarnedCurrency(String str, int i);
}

View File

@@ -0,0 +1,58 @@
package com.tapjoy;
import com.ironsource.v8;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public enum TJEntryPoint {
ENTRY_POINT_UNKNOWN(null),
ENTRY_POINT_OTHER("other"),
ENTRY_POINT_MAIN_MENU("main_menu"),
ENTRY_POINT_HUD("hud"),
ENTRY_POINT_EXIT("exit"),
ENTRY_POINT_FAIL(v8.f.e),
ENTRY_POINT_COMPLETE(CampaignEx.JSON_NATIVE_VIDEO_COMPLETE),
ENTRY_POINT_INBOX("inbox"),
ENTRY_POINT_INIT("initialisation"),
ENTRY_POINT_STORE(v8.h.U);
public final String a;
TJEntryPoint(String str) {
this.a = str;
}
public static TJEntryPoint fromOrdinal(int i) {
return values()[i];
}
public static TJEntryPoint fromString(String str) {
str.getClass();
switch (str) {
case "complete":
return ENTRY_POINT_COMPLETE;
case "main_menu":
return ENTRY_POINT_MAIN_MENU;
case "hud":
return ENTRY_POINT_HUD;
case "exit":
return ENTRY_POINT_EXIT;
case "fail":
return ENTRY_POINT_FAIL;
case "inbox":
return ENTRY_POINT_INBOX;
case "other":
return ENTRY_POINT_OTHER;
case "store":
return ENTRY_POINT_STORE;
case "initialisation":
return ENTRY_POINT_INIT;
default:
return ENTRY_POINT_UNKNOWN;
}
}
public String getValue() {
return this.a;
}
}

View File

@@ -0,0 +1,12 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TJError {
public int code;
public String message;
public TJError(int i, String str) {
this.code = i;
this.message = str;
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJGetCurrencyBalanceListener {
void onGetCurrencyBalanceResponse(String str, int i);
void onGetCurrencyBalanceResponseFailure(String str);
}

View File

@@ -0,0 +1,42 @@
package com.tapjoy;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.widget.ImageButton;
/* loaded from: classes4.dex */
public class TJImageButton extends ImageButton {
public Bitmap a;
public Bitmap b;
public TJImageButton(Context context) {
super(context);
}
public void setDisableImageBitmap(Bitmap bitmap) {
this.b = bitmap;
}
@Override // android.view.View
public void setEnabled(boolean z) {
super.setEnabled(z);
setImageBitmap(z ? this.a : this.b);
}
public void setEnabledImageBitmap(Bitmap bitmap) {
this.a = bitmap;
}
public TJImageButton(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public TJImageButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public TJImageButton(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
}
}

View File

@@ -0,0 +1,131 @@
package com.tapjoy;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import com.tapjoy.TJAdUnitConstants;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nTJIntegrationCheck.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TJIntegrationCheck.kt\ncom/tapjoy/TJIntegrationCheck\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,201:1\n1549#2:202\n1620#2,3:203\n*S KotlinDebug\n*F\n+ 1 TJIntegrationCheck.kt\ncom/tapjoy/TJIntegrationCheck\n*L\n76#1:202\n76#1:203,3\n*E\n"})
/* loaded from: classes4.dex */
public final class TJIntegrationCheck {
public static final TJIntegrationCheck INSTANCE = new TJIntegrationCheck();
public static final String[] a = {"android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE"};
public static final List b;
public final void integrationCheck(Context context) {
List<ActivityInfo> listOf;
Intrinsics.checkNotNullParameter(context, "context");
try {
ActivityInfo[] activities = context.getPackageManager().getPackageInfo(context.getPackageName(), 1).activities;
Intrinsics.checkNotNullExpressionValue(activities, "activities");
listOf = CollectionsKt__CollectionsKt.listOf(Arrays.copyOf(activities, activities.length));
a(listOf);
for (ActivityInfo activityInfo : listOf) {
Intrinsics.checkNotNull(activityInfo);
a(activityInfo);
}
a(context);
try {
Intrinsics.checkNotNullExpressionValue(TJAdUnitJSBridge.class, "forName(...)");
try {
TJAdUnitJSBridge.class.getMethod(TJAdUnitConstants.String.CLOSE_REQUESTED, (Class[]) Arrays.copyOf(new Class[]{Boolean.TRUE.getClass()}, 1));
if (Intrinsics.areEqual(TapjoyConnectCore.getInstance().getConnectFlagValue(TapjoyConnectFlag.DISABLE_ADVERTISING_ID_CHECK), "true")) {
TapjoyLog.i("TJIntegrationCheck", "Skipping integration check for Google Play Services and Advertising ID. Do this only if you do not have access to Google Play Services.");
return;
}
TJTracking tJTracking = TJTracking.INSTANCE;
if (!tJTracking.isGpsAvailable()) {
throw new TapjoyIntegrationException("Tapjoy SDK is disabled because Google Play Services was not found. For more information about including the Google Play services client library visit https://developers.google.com/android/guides/setup or https://dev.tapjoy.com/en/android-sdk/Manual-Integration");
}
if (!tJTracking.isGpsManifestConfigured()) {
throw new TapjoyIntegrationException("Failed to load AndroidManifest.xml meta-data, 'com.google.android.gms.version' not found. For more information about including the Google Play services client library visit https://developers.google.com/android/guides/setup or https://dev.tapjoy.com/en/android-sdk/Manual-Integration");
}
} catch (NoSuchMethodException unused) {
throw new TapjoyIntegrationException("Try configuring Proguard or other code obfuscation tools to ignore com.tapjoy classes. Visit http://dev.tapjoy.com for more information.");
}
} catch (ClassNotFoundException unused2) {
throw new TapjoyIntegrationException("ClassNotFoundException: com.tapjoy.TJAdUnitJSBridge was not found.");
}
} catch (PackageManager.NameNotFoundException unused3) {
throw new TapjoyIntegrationException("Error while getting package info.");
}
}
static {
List listOf;
listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new String[]{"com.tapjoy.TJAdUnitActivity", "com.tapjoy.TJWebViewActivity"});
b = listOf;
}
public static void a(List list) {
int i = 0;
String str = "";
for (String str2 : b) {
ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list, 10));
Iterator it = list.iterator();
while (it.hasNext()) {
arrayList.add(((ActivityInfo) it.next()).name);
}
if (!arrayList.contains(str2)) {
str = str + (i > 0 ? ", " : "") + str2;
i++;
}
}
if (str.length() > 0) {
throw new TapjoyIntegrationException("Missing " + str + " " + (i == 1 ? "activity" : "activities") + " in AndroidManifest.");
}
}
public static void a(Context context) {
ArrayList arrayList = new ArrayList();
String[] strArr = a;
for (int i = 0; i < 2; i++) {
String str = strArr[i];
if (context.getPackageManager().checkPermission(str, context.getPackageName()) != 0) {
arrayList.add(str);
}
}
if (arrayList.isEmpty()) {
return;
}
throw new TapjoyIntegrationException("Missing " + (arrayList.size() == 1 ? "permission" : "permissions") + " in AndroidManifest: " + arrayList);
}
public static void a(ActivityInfo activityInfo) {
List list = b;
if (list.contains(activityInfo.name)) {
int indexOf = list.indexOf(activityInfo.name);
try {
Class.forName((String) list.get(indexOf));
ArrayList arrayList = new ArrayList();
if ((activityInfo.configChanges & 128) != 128) {
arrayList.add("orientation");
}
if ((activityInfo.configChanges & 32) != 32) {
arrayList.add("keyboardHidden");
}
if (!arrayList.isEmpty()) {
throw new TapjoyIntegrationException(arrayList + " " + (arrayList.size() == 1 ? "property is" : "properties are") + " not specified in AndroidManifest configChanges for " + list.get(indexOf));
}
if ((activityInfo.flags & 512) == 512) {
if ((activityInfo.configChanges & 1024) != 1024) {
TapjoyLog.w("TJIntegrationCheck", "WARNING -- screenSize property is not specified in AndroidManifest configChanges for " + list.get(indexOf));
return;
}
return;
}
throw new TapjoyIntegrationException("'hardwareAccelerated' property not specified in AndroidManifest for " + list.get(indexOf));
} catch (ClassNotFoundException unused) {
throw new TapjoyIntegrationException("[ClassNotFoundException] Could not find dependency class " + b.get(indexOf));
}
}
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJIntegrationCheckKt {
}

View File

@@ -0,0 +1,69 @@
package com.tapjoy;
import android.content.Context;
import android.webkit.WebView;
import androidx.annotation.Nullable;
import java.util.Map;
/* loaded from: classes4.dex */
public abstract class TJJSBridgeDelegate {
public boolean dismiss() {
return false;
}
public boolean fireContentError(TJError tJError) {
return false;
}
public boolean fireContentReady() {
return false;
}
public abstract Context getContext();
public <T> T getData(String str, Class<T> cls) {
return null;
}
public Map<String, Object> getOrientation() {
return null;
}
public int getStatusBarHeight() {
return 0;
}
public void getTextZoom(TJTaskHandler<Float> tJTaskHandler) {
tJTaskHandler.onComplete(Float.valueOf(1.0f));
}
@Nullable
public abstract WebView getWebView();
public void setBackgroundColor(String str, TJTaskHandler<Boolean> tJTaskHandler) {
tJTaskHandler.onComplete(Boolean.FALSE);
}
public void setCloseButtonClickable(boolean z) {
}
public void setCloseButtonVisible(boolean z) {
}
public boolean setOrientation(int i) {
return false;
}
public void setTextZoom(float f) {
}
public void setupSdkBeacons(com.tapjoy.internal.z0 z0Var) {
}
public void shouldClose(boolean z) {
}
public boolean unsetOrientation() {
return false;
}
}

View File

@@ -0,0 +1,117 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJKeyValueStorage {
public static SharedPreferences a;
public TJKeyValueStorage(Context context) {
a = context.getSharedPreferences("tjJSSharedPreference", 0);
}
public boolean contains(String str) {
return a.contains(str);
}
public boolean getBoolean(String str, boolean z) {
return a.getBoolean(str, z);
}
public double getDouble(String str, double d) {
return Double.longBitsToDouble(a.getLong(str, (long) d));
}
public float getFloat(String str, float f) {
return a.getFloat(str, f);
}
public int getInt(String str, int i) {
return a.getInt(str, i);
}
public long getLong(String str, long j) {
return a.getLong(str, j);
}
public int getSize() {
return a.getAll().size();
}
public String getString(String str, String str2) {
return a.getString(str, str2);
}
public Object getValue(String str) {
Object obj = a.getAll().get(str);
if (obj == null) {
return null;
}
if (obj.getClass() != String.class) {
return obj.getClass() == Long.class ? Double.valueOf(Double.longBitsToDouble(((Long) obj).longValue())) : obj;
}
String str2 = (String) obj;
return str2.contains("tjJSON@") ? new JSONObject(str2.replace("tjJSON@", "")) : str2.contains("tjJSONArray@") ? new JSONArray(str2.replace("tjJSONArray@", "")) : obj;
}
public Object getValueType(String str) {
Object obj = a.getAll().get(str);
if (obj == null) {
return null;
}
return obj.getClass();
}
public void remove(String str) {
a.edit().remove(str).apply();
}
public void reset() {
a.getAll().clear();
}
public void setValue(String str, Object obj) {
if (obj == null || obj == JSONObject.NULL) {
a.edit().remove(str).apply();
return;
}
Class<?> cls = obj.getClass();
if (cls == String.class) {
a.edit().putString(str, ((String) obj).replace("\"", "\\\"")).apply();
return;
}
if (cls == Integer.class) {
a.edit().putInt(str, ((Integer) obj).intValue()).apply();
return;
}
if (cls == JSONObject.class) {
a.edit().putString(str, "tjJSON@" + obj).apply();
return;
}
if (cls == JSONArray.class) {
a.edit().putString(str, "tjJSONArray@" + obj).apply();
return;
}
if (cls == Long.class) {
a.edit().putLong(str, ((Long) obj).longValue()).apply();
return;
}
if (cls == Double.class) {
a.edit().putLong(str, Double.doubleToRawLongBits(((Double) obj).doubleValue())).apply();
} else if (cls == Float.class) {
a.edit().putFloat(str, ((Float) obj).floatValue()).apply();
} else {
if (cls != Boolean.class) {
throw new IllegalArgumentException("Unknown value type.");
}
a.edit().putBoolean(str, ((Boolean) obj).booleanValue()).apply();
}
}
public TJKeyValueStorage(Context context, String str) {
a = context.getSharedPreferences(str, 0);
}
}

View File

@@ -0,0 +1,35 @@
package com.tapjoy;
import java.util.WeakHashMap;
/* loaded from: classes4.dex */
public class TJMemoryDataStorage {
public static TJMemoryDataStorage b;
public final WeakHashMap a = new WeakHashMap();
public Object get(String str) {
return this.a.get(str);
}
public void put(String str, Object obj) {
this.a.put(str, obj);
}
public Object remove(String str) {
return this.a.remove(str);
}
public static TJMemoryDataStorage getInstance() {
if (b == null) {
synchronized (TJMemoryDataStorage.class) {
try {
if (b == null) {
b = new TJMemoryDataStorage();
}
} finally {
}
}
}
return b;
}
}

View File

@@ -0,0 +1,12 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJOfferwallDiscoverListener {
void contentError(TJError tJError);
void contentReady();
void requestFailure(TJError tJError);
void requestSuccess();
}

View File

@@ -0,0 +1,114 @@
package com.tapjoy;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.tapjoy.internal.b3;
/* loaded from: classes4.dex */
public class TJOfferwallDiscoverView extends FrameLayout {
public TJWebView a;
public TJAdUnitJSBridge b;
public TJOfferwallDiscoverListener c;
public b3 d;
public boolean e;
public boolean f;
public TJOfferwallDiscoverView(Context context) {
super(context);
this.e = false;
this.f = false;
}
public void clearContent() {
TapjoyUtil.runOnMainThread(new k0(this));
}
@Override // android.view.ViewGroup, android.view.View
public final void dispatchVisibilityChanged(View view, int i) {
super.dispatchVisibilityChanged(view, i);
if (i == 0) {
TJAdUnitJSBridge tJAdUnitJSBridge = this.b;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.resume();
return;
}
return;
}
TJAdUnitJSBridge tJAdUnitJSBridge2 = this.b;
if (tJAdUnitJSBridge2 != null) {
tJAdUnitJSBridge2.pause();
}
}
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
TJAdUnitJSBridge tJAdUnitJSBridge = this.b;
if (tJAdUnitJSBridge == null || this.e || !this.f) {
return;
}
tJAdUnitJSBridge.display();
this.e = true;
}
public void requestContent(Context context, String str) {
if (!TapjoyConnectCore.getInstance().isConnected()) {
TJOfferwallDiscoverListener tJOfferwallDiscoverListener = this.c;
if (tJOfferwallDiscoverListener != null) {
tJOfferwallDiscoverListener.requestFailure(new TJError(-1, "Tapjoy SDK is not connected"));
return;
}
return;
}
if (context == null) {
TJOfferwallDiscoverListener tJOfferwallDiscoverListener2 = this.c;
if (tJOfferwallDiscoverListener2 != null) {
tJOfferwallDiscoverListener2.requestFailure(new TJError(0, "Context is null"));
}
clearContent();
return;
}
if (str == null || str.length() == 0) {
TJOfferwallDiscoverListener tJOfferwallDiscoverListener3 = this.c;
if (tJOfferwallDiscoverListener3 != null) {
tJOfferwallDiscoverListener3.requestFailure(new TJError(0, "Placement is null"));
}
clearContent();
return;
}
clearContent();
TJWebView tJWebView = new TJWebView(context);
this.a = tJWebView;
tJWebView.setWebViewClient(new q0(this));
this.b = new TJAdUnitJSBridge(new p0(this));
addView(this.a, -1, -1);
new j0(this, str).start();
}
public void setListener(TJOfferwallDiscoverListener tJOfferwallDiscoverListener) {
this.c = tJOfferwallDiscoverListener;
}
public TJOfferwallDiscoverView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.e = false;
this.f = false;
}
public TJOfferwallDiscoverView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.e = false;
this.f = false;
}
@TargetApi(21)
public TJOfferwallDiscoverView(Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.e = false;
this.f = false;
}
}

View File

@@ -0,0 +1,247 @@
package com.tapjoy;
import android.content.Context;
import android.content.Intent;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import com.google.android.gms.drive.DriveFile;
import com.tapjoy.TapjoyErrorMessage;
import java.lang.ref.WeakReference;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.UUID;
/* loaded from: classes4.dex */
public class TJPlacement {
public final TJCorePlacement a;
public final TJPlacementListener b;
public final TJPlacementListener c;
public final String d;
public TJEntryPoint e;
@Deprecated
public TJPlacement(Context context, String str, TJPlacementListener tJPlacementListener) {
this.e = null;
TJCorePlacement a = TJPlacementManager.a(str);
a = a == null ? TJPlacementManager.a(str, false) : a;
a.setContext(context);
this.a = a;
this.d = UUID.randomUUID().toString();
this.b = tJPlacementListener;
this.c = tJPlacementListener != null ? (TJPlacementListener) Proxy.newProxyInstance(TJPlacementListener.class.getClassLoader(), new Class[]{TJPlacementListener.class}, new com.tapjoy.internal.e(tJPlacementListener, Thread.currentThread(), Looper.myLooper())) : null;
}
public static void dismissContent() {
if ("true".equals(TapjoyConnectCore.getInstance().getConnectFlagValue("TJC_OPTION_DISMISS_CONTENT_ALL"))) {
TJPlacementManager.dismissContentShowing();
}
}
public TJEntryPoint getEntryPoint() {
return this.e;
}
public String getGUID() {
return this.d;
}
public TJPlacementListener getListener() {
return this.b;
}
public String getName() {
return this.a.getPlacementData() != null ? this.a.getPlacementData().getPlacementName() : "";
}
public boolean isContentAvailable() {
return this.a.isContentAvailable();
}
public boolean isContentReady() {
return this.a.isContentReady();
}
public void requestContent() {
String name = getName();
TapjoyLog.i("TJPlacement", "requestContent() called for placement " + name);
if (TJPrivacyPolicy.getInstance() != null && TJPrivacyPolicy.getInstance().getUserConsent() == TJStatus.UNKNOWN) {
TapjoyLog.w("TJPlacement", "[INFO] Your application calls requestContent without having previously called setUserConsent. You can review Tapjoy supported consent API here - https://dev.tapjoy.com/sdk-integration/#sdk11122_gdpr_release.");
}
if (!TapjoyConnectCore.getInstance().isConnected()) {
this.a.a(this, TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, new TJError(0, "SDK not connected -- connect must be called first with a successful callback"));
return;
}
if (this.a.getContext() == null) {
TJCorePlacement tJCorePlacement = this.a;
Context context = com.tapjoy.internal.j.a;
if (context == null) {
WeakReference weakReference = com.tapjoy.internal.j.c.a;
context = (Context) (weakReference != null ? weakReference.get() : null);
}
tJCorePlacement.setContext(context);
}
if (this.a.getContext() == null) {
this.a.a(this, TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, new TJError(0, "Context is null -- TJPlacement requires a valid Context."));
return;
}
if (TextUtils.isEmpty(name)) {
this.a.a(this, TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, new TJError(0, "Invalid placement name -- TJPlacement requires a valid placement name."));
return;
}
TJCorePlacement tJCorePlacement2 = this.a;
tJCorePlacement2.a("REQUEST", this);
if (tJCorePlacement2.g - SystemClock.elapsedRealtime() > 0) {
TapjoyLog.d("TJCorePlacement", "Content has not expired yet for " + tJCorePlacement2.d.getPlacementName());
if (!tJCorePlacement2.n) {
tJCorePlacement2.a(this);
return;
}
tJCorePlacement2.m = false;
tJCorePlacement2.a(this);
tJCorePlacement2.a();
return;
}
synchronized (tJCorePlacement2) {
String url = tJCorePlacement2.d.getUrl();
if (TextUtils.isEmpty(url)) {
url = tJCorePlacement2.getPlacementContentUrl();
if (TextUtils.isEmpty(url)) {
tJCorePlacement2.a(tJCorePlacement2.a("REQUEST"), TapjoyErrorMessage.ErrorType.SDK_ERROR, new TJError(0, "TJPlacement is missing APP_ID"));
return;
}
tJCorePlacement2.d.updateUrl(url);
}
TapjoyLog.d("TJCorePlacement", "sendContentRequest -- URL: " + url + " name: " + tJCorePlacement2.d.getPlacementName());
tJCorePlacement2.c(url);
}
}
public void setCurrencyAmountRequired(String str, int i, TJSetCurrencyAmountRequiredListener tJSetCurrencyAmountRequiredListener) {
if (str != null && !str.isEmpty() && this.a.e.i.contains(str) && i > 0) {
TJCurrencyParameters tJCurrencyParameters = this.a.e;
tJCurrencyParameters.d = str;
tJCurrencyParameters.e = i;
tJCurrencyParameters.h.put(str, Integer.valueOf(i));
if (tJSetCurrencyAmountRequiredListener != null) {
tJSetCurrencyAmountRequiredListener.onSetCurrencyAmountRequiredSuccess();
return;
}
return;
}
if (str != null && str.isEmpty() && tJSetCurrencyAmountRequiredListener != null) {
tJSetCurrencyAmountRequiredListener.onSetCurrencyAmountRequiredFailure(1, "Currency id is null or empty");
return;
}
if (!this.a.e.i.contains(str) && tJSetCurrencyAmountRequiredListener != null) {
tJSetCurrencyAmountRequiredListener.onSetCurrencyAmountRequiredFailure(1, "Invalid currency id");
} else {
if (i > 0 || tJSetCurrencyAmountRequiredListener == null) {
return;
}
tJSetCurrencyAmountRequiredListener.onSetCurrencyAmountRequiredFailure(1, "Amount is negative or zero");
}
}
public void setCurrencyBalance(String str, int i, TJSetCurrencyBalanceListener tJSetCurrencyBalanceListener) {
if (str != null && !str.isEmpty() && this.a.e.i.contains(str)) {
TJCurrencyParameters tJCurrencyParameters = this.a.e;
if (tJCurrencyParameters.f && i >= 0) {
tJCurrencyParameters.b = str;
tJCurrencyParameters.c = i;
tJCurrencyParameters.g.put(str, Integer.valueOf(i));
if (tJSetCurrencyBalanceListener != null) {
tJSetCurrencyBalanceListener.onSetCurrencyBalanceSuccess();
return;
}
return;
}
}
if (str != null && str.isEmpty() && tJSetCurrencyBalanceListener != null) {
tJSetCurrencyBalanceListener.onSetCurrencyBalanceFailure(1, "Currency id is null or empty");
return;
}
if (!this.a.e.i.contains(str) && tJSetCurrencyBalanceListener != null) {
tJSetCurrencyBalanceListener.onSetCurrencyBalanceFailure(1, "Invalid currency id");
return;
}
if (!this.a.e.f && tJSetCurrencyBalanceListener != null) {
tJSetCurrencyBalanceListener.onSetCurrencyBalanceFailure(1, "App uses Tapjoy managed currencies");
} else {
if (i >= 0 || tJSetCurrencyBalanceListener == null) {
return;
}
tJSetCurrencyBalanceListener.onSetCurrencyBalanceFailure(1, "Balance is negative");
}
}
public void setEntryPoint(TJEntryPoint tJEntryPoint) {
this.e = tJEntryPoint;
}
public void showContent() {
TapjoyLog.i("TJPlacement", "showContent() called for placement " + getName());
if (!this.a.isContentAvailable()) {
TapjoyLog.e("TJPlacement", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "No placement content available. Can not show content for non-200 placement."));
return;
}
TJCorePlacement tJCorePlacement = this.a;
tJCorePlacement.getClass();
if (TapjoyConnectCore.getInstance().isViewOpen()) {
TapjoyLog.w("TJCorePlacement", "Only one view can be presented at a time.");
return;
}
tJCorePlacement.a("SHOW", this);
tJCorePlacement.d.setContentViewId(UUID.randomUUID().toString());
TJMemoryDataStorage.getInstance().put(tJCorePlacement.d.getPlacementName(), tJCorePlacement.d);
Intent intent = new Intent(tJCorePlacement.b, (Class<?>) TJAdUnitActivity.class);
intent.putExtra(TJAdUnitConstants.EXTRA_TJ_PLACEMENT_NAME, tJCorePlacement.d.getPlacementName());
intent.setFlags(DriveFile.MODE_READ_ONLY);
TapjoyLog.i("TJCorePlacement", "Content shown for placement " + tJCorePlacement.d.getPlacementName());
TJPlacement a = tJCorePlacement.a("SHOW");
if (a != null && a.getListener() != null) {
a.getListener().onContentShow(a);
}
if (tJCorePlacement.h.getSdkBeacon() != null) {
com.tapjoy.internal.z0 sdkBeacon = tJCorePlacement.h.getSdkBeacon();
if (!TextUtils.isEmpty(sdkBeacon.c) && !sdkBeacon.f) {
sdkBeacon.f = true;
new com.tapjoy.internal.x0(sdkBeacon, new HashMap(sdkBeacon.b)).start();
}
}
TapjoyUtil.runOnMainThread(new d0(tJCorePlacement, intent));
tJCorePlacement.g = 0L;
tJCorePlacement.n = false;
tJCorePlacement.o = false;
}
public int getCurrencyAmountRequired(String str) {
if (!this.a.e.i.contains(str)) {
return -1;
}
TJCurrencyParameters tJCurrencyParameters = this.a.e;
if (tJCurrencyParameters.h.containsKey(str)) {
return ((Integer) tJCurrencyParameters.h.get(str)).intValue();
}
return -1;
}
public int getCurrencyBalance(String str) {
if ((str != null || this.a.e.f) && !this.a.e.i.contains(str)) {
return -1;
}
TJCurrencyParameters tJCurrencyParameters = this.a.e;
if (tJCurrencyParameters.g.containsKey(str)) {
return ((Integer) tJCurrencyParameters.g.get(str)).intValue();
}
return -1;
}
public TJPlacement(TJCorePlacement tJCorePlacement, TJPlacementListener tJPlacementListener) {
this.e = null;
this.a = tJCorePlacement;
this.d = UUID.randomUUID().toString();
this.b = tJPlacementListener;
this.c = tJPlacementListener != null ? (TJPlacementListener) Proxy.newProxyInstance(TJPlacementListener.class.getClassLoader(), new Class[]{TJPlacementListener.class}, new com.tapjoy.internal.e(tJPlacementListener, Thread.currentThread(), Looper.myLooper())) : null;
}
}

View File

@@ -0,0 +1,147 @@
package com.tapjoy;
import android.text.TextUtils;
import java.io.Serializable;
/* loaded from: classes4.dex */
public class TJPlacementData implements Serializable {
public String a;
public String b;
public String c;
public String d;
public int e;
public String f;
public boolean g;
public String h;
public boolean i;
public final String j;
public String k;
public boolean l = false;
public boolean m;
public TJPlacementData(String str, String str2) {
setKey(str);
updateUrl(str2);
}
public String getBaseURL() {
return this.c;
}
public String getCallbackID() {
return this.j;
}
public String getContentViewId() {
return this.k;
}
public String getHttpResponse() {
return this.d;
}
public int getHttpStatusCode() {
return this.e;
}
public String getKey() {
return this.a;
}
public String getPlacementName() {
return this.f;
}
public String getRedirectURL() {
return this.h;
}
public String getUrl() {
return this.b;
}
public boolean hasProgressSpinner() {
return this.g;
}
public boolean isPreloadDisabled() {
return this.l;
}
public boolean isPrerenderingRequested() {
return this.i;
}
public void resetPlacementRequestData() {
setHttpResponse(null);
setHttpStatusCode(0);
setRedirectURL(null);
setHasProgressSpinner(false);
setPrerenderingRequested(false);
setPreloadDisabled(false);
setContentViewId(null);
setHandleDismissOnPause(false);
}
public void setBaseURL(String str) {
this.c = str;
}
public void setContentViewId(String str) {
this.k = str;
}
public void setHandleDismissOnPause(boolean z) {
this.m = z;
}
public void setHasProgressSpinner(boolean z) {
this.g = z;
}
public void setHttpResponse(String str) {
this.d = str;
}
public void setHttpStatusCode(int i) {
this.e = i;
}
public void setKey(String str) {
this.a = str;
}
public void setPlacementName(String str) {
this.f = str;
}
public void setPreloadDisabled(boolean z) {
this.l = z;
}
public void setPrerenderingRequested(boolean z) {
this.i = z;
}
public void setRedirectURL(String str) {
this.h = str;
}
public boolean shouldHandleDismissOnPause() {
return this.m;
}
public void updateUrl(String str) {
this.b = str;
if (TextUtils.isEmpty(str)) {
return;
}
setBaseURL(str.substring(0, str.indexOf(47, str.indexOf("//") + 3)));
}
public TJPlacementData(String str, String str2, String str3) {
setBaseURL(str);
setHttpResponse(str2);
this.j = str3;
}
}

View File

@@ -0,0 +1,20 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJPlacementListener {
void onClick(TJPlacement tJPlacement);
void onContentDismiss(TJPlacement tJPlacement);
void onContentReady(TJPlacement tJPlacement);
void onContentShow(TJPlacement tJPlacement);
void onPurchaseRequest(TJPlacement tJPlacement, TJActionRequest tJActionRequest, String str);
void onRequestFailure(TJPlacement tJPlacement, TJError tJError);
void onRequestSuccess(TJPlacement tJPlacement);
void onRewardRequest(TJPlacement tJPlacement, TJActionRequest tJActionRequest, String str, int i);
}

View File

@@ -0,0 +1,136 @@
package com.tapjoy;
import android.content.Context;
import android.text.TextUtils;
import com.tapjoy.internal.h3;
/* loaded from: classes4.dex */
public class TJPlacementManager {
public static final h3 a = new h3();
public static int b = 0;
public static int c = 0;
public static int d = 3;
public static int e = 3;
public static boolean canCachePlacement() {
return getCachedPlacementCount() < getCachedPlacementLimit();
}
public static boolean canPreRenderPlacement() {
return getPreRenderedPlacementCount() < getPreRenderedPlacementLimit();
}
public static TJPlacement createPlacement(Context context, String str, boolean z, TJPlacementListener tJPlacementListener) {
TJCorePlacement a2 = a(str, z);
a2.k = z;
a2.setContext(context);
return new TJPlacement(a2, tJPlacementListener);
}
public static void decrementPlacementPreRenderCount() {
int i = c - 1;
c = i;
if (i < 0) {
c = 0;
}
}
public static void dismissContentShowing() {
TJAdUnitActivity tJAdUnitActivity = TJAdUnitActivity.i;
if (tJAdUnitActivity != null) {
tJAdUnitActivity.a(true);
}
}
public static int getCachedPlacementCount() {
return b;
}
public static int getCachedPlacementLimit() {
return d;
}
public static int getPreRenderedPlacementCount() {
return c;
}
public static int getPreRenderedPlacementLimit() {
return e;
}
public static void incrementPlacementPreRenderCount() {
int i = c + 1;
c = i;
int i2 = e;
if (i > i2) {
c = i2;
}
}
public static void printPlacementCacheInformation() {
TapjoyLog.i("TJPlacementManager", "Space available in placement cache: " + b + " out of " + d);
}
public static void printPlacementPreRenderInformation() {
TapjoyLog.i("TJPlacementManager", "Space available for placement pre-render: " + c + " out of " + e);
}
public static void setCachedPlacementLimit(int i) {
d = i;
}
public static void setPreRenderedPlacementLimit(int i) {
e = i;
}
public static TJCorePlacement a(String str, boolean z) {
TJCorePlacement a2;
StringBuilder sb = new StringBuilder();
sb.append(z ? "!SYSTEM!" : "");
sb.append(!TextUtils.isEmpty(str) ? str : "");
String sb2 = sb.toString();
TapjoyLog.d("TJPlacementManager", "TJCorePlacement key=" + sb2);
h3 h3Var = a;
synchronized (h3Var) {
try {
a2 = a(sb2);
if (a2 == null) {
a2 = new TJCorePlacement(str, sb2);
h3Var.put(sb2, a2);
TapjoyLog.d("TJPlacementManager", "Created TJCorePlacement with GUID: " + a2.f);
}
} catch (Throwable th) {
throw th;
}
}
return a2;
}
public static void decrementPlacementCacheCount() {
int i = b - 1;
b = i;
if (i < 0) {
b = 0;
}
printPlacementCacheInformation();
}
public static void incrementPlacementCacheCount() {
int i = b + 1;
b = i;
int i2 = d;
if (i > i2) {
b = i2;
}
printPlacementCacheInformation();
}
public static TJCorePlacement a(String str) {
TJCorePlacement tJCorePlacement;
h3 h3Var = a;
synchronized (h3Var) {
tJCorePlacement = (TJCorePlacement) h3Var.get(str);
}
return tJCorePlacement;
}
}

View File

@@ -0,0 +1,61 @@
package com.tapjoy;
import android.content.SharedPreferences;
import android.util.Log;
import java.util.List;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJPreferencesMigration {
public final TJKeyValueStorage a;
public final SharedPreferences b;
public final Map c;
public final List d;
public TJPreferencesMigration(TJKeyValueStorage tjKeyValueStorage, SharedPreferences migratingPreferences, Map<String, String> migratingKeysMapping, List<String> listOfDoubles) {
Intrinsics.checkNotNullParameter(tjKeyValueStorage, "tjKeyValueStorage");
Intrinsics.checkNotNullParameter(migratingPreferences, "migratingPreferences");
Intrinsics.checkNotNullParameter(migratingKeysMapping, "migratingKeysMapping");
Intrinsics.checkNotNullParameter(listOfDoubles, "listOfDoubles");
this.a = tjKeyValueStorage;
this.b = migratingPreferences;
this.c = migratingKeysMapping;
this.d = listOfDoubles;
}
public final void a(String str, Object obj) {
if (this.b.contains(str)) {
Object valueOf = obj instanceof Boolean ? Boolean.valueOf(this.b.getBoolean(str, false)) : obj instanceof Float ? Float.valueOf(this.b.getFloat(str, 0.0f)) : obj instanceof Integer ? Integer.valueOf(this.b.getInt(str, 0)) : obj instanceof Long ? Long.valueOf(this.b.getLong(str, 0L)) : obj instanceof String ? this.b.getString(str, null) : null;
String str2 = (String) this.c.get(str);
if (str2 == null) {
str2 = str;
}
if (valueOf != null) {
try {
if (this.d.contains(str)) {
this.a.setValue(str2, Double.valueOf(Double.parseDouble(valueOf.toString())));
} else {
this.a.setValue(str2, valueOf);
}
} catch (IllegalArgumentException unused) {
Log.e("TJPreferencesMigration", "Failed to migrate key: " + str);
}
}
this.b.edit().remove(str).apply();
}
}
public final void migrateAllKeysIfExists() {
Map<String, ?> all = this.b.getAll();
if (all != null) {
for (Map.Entry<String, ?> entry : all.entrySet()) {
if (this.c.containsKey(entry.getKey())) {
String key = entry.getKey();
Intrinsics.checkNotNullExpressionValue(key, "<get-key>(...)");
a(key, entry.getValue());
}
}
}
}
}

View File

@@ -0,0 +1,167 @@
package com.tapjoy;
import android.content.Context;
import java.util.Objects;
/* loaded from: classes4.dex */
public class TJPrivacyPolicy {
public static TJPrivacyPolicy f;
public TJStatus a = null;
public TJStatus b = null;
public TJStatus c = null;
public String d = null;
public Context e;
public TJStatus getBelowConsentAge() {
return this.c;
}
public TJStatus getSubjectToGDPR() {
return this.a;
}
public String getUSPrivacy() {
return this.d;
}
public TJStatus getUserConsent() {
return this.b;
}
public static TJPrivacyPolicy getInstance() {
if (f == null) {
f = new TJPrivacyPolicy();
}
return f;
}
public void setBelowConsentAge(TJStatus tJStatus) {
this.c = tJStatus;
Context context = this.e;
if (context == null || tJStatus == null) {
return;
}
if (tJStatus == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_BELOW_CONSENT_AGE);
} else {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_BELOW_CONSENT_AGE, Integer.valueOf(this.c.getValue()));
}
}
public void setSubjectToGDPR(TJStatus tJStatus) {
this.a = tJStatus;
Context context = this.e;
if (context == null || tJStatus == null) {
return;
}
if (tJStatus == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_SUBJECT_TO_GDPR);
} else {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_SUBJECT_TO_GDPR, Integer.valueOf(this.a.getValue()));
}
}
public void setUSPrivacy(String str) {
this.d = str;
if (this.e == null || str == null) {
return;
}
if (str.isEmpty()) {
new TJKeyValueStorage(this.e, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_US_PRIVACY);
} else {
new TJKeyValueStorage(this.e, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_US_PRIVACY, this.d);
}
}
public void setUserConsent(TJStatus tJStatus) {
this.b = tJStatus;
Context context = this.e;
if (context == null || tJStatus == null) {
return;
}
if (tJStatus == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_USER_CONSENT);
} else {
new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_USER_CONSENT, Integer.valueOf(this.b.getValue()));
}
}
public final synchronized void a(Context context) {
String str;
TJStatus tJStatus;
TJStatus tJStatus2;
if (context != null) {
try {
if (this.e == null) {
this.e = context;
}
} catch (Throwable th) {
throw th;
}
}
TJPrivacyPolicy tJPrivacyPolicy = getInstance();
Context context2 = tJPrivacyPolicy.e;
if (context2 != null) {
TJKeyValueStorage tJKeyValueStorage = new TJKeyValueStorage(context2, TapjoyConstants.TJC_PREFERENCE);
if (tJPrivacyPolicy.a == null && tJKeyValueStorage.contains(TapjoyConstants.PREF_SUBJECT_TO_GDPR)) {
if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_SUBJECT_TO_GDPR) == Boolean.class) {
tJPrivacyPolicy.a = tJKeyValueStorage.getBoolean(TapjoyConstants.PREF_SUBJECT_TO_GDPR, false) ? TJStatus.TRUE : TJStatus.FALSE;
} else if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_SUBJECT_TO_GDPR) == Integer.class) {
tJPrivacyPolicy.a = TJStatus.valueOf(tJKeyValueStorage.getInt(TapjoyConstants.PREF_SUBJECT_TO_GDPR, TJStatus.UNKNOWN.getValue()));
}
}
if (tJPrivacyPolicy.b == null && tJKeyValueStorage.contains(TapjoyConstants.PREF_USER_CONSENT)) {
if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_USER_CONSENT) == String.class) {
tJPrivacyPolicy.b = Objects.equals(tJKeyValueStorage.getString(TapjoyConstants.PREF_USER_CONSENT, ""), "1") ? TJStatus.TRUE : TJStatus.FALSE;
} else if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_USER_CONSENT) == Integer.class) {
tJPrivacyPolicy.b = TJStatus.valueOf(tJKeyValueStorage.getInt(TapjoyConstants.PREF_USER_CONSENT, TJStatus.UNKNOWN.getValue()));
}
}
if (tJPrivacyPolicy.c == null && tJKeyValueStorage.contains(TapjoyConstants.PREF_BELOW_CONSENT_AGE)) {
if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_BELOW_CONSENT_AGE) == Boolean.class) {
tJPrivacyPolicy.c = tJKeyValueStorage.getBoolean(TapjoyConstants.PREF_BELOW_CONSENT_AGE, false) ? TJStatus.TRUE : TJStatus.FALSE;
} else if (tJKeyValueStorage.getValueType(TapjoyConstants.PREF_BELOW_CONSENT_AGE) == Integer.class) {
tJPrivacyPolicy.c = TJStatus.valueOf(tJKeyValueStorage.getInt(TapjoyConstants.PREF_BELOW_CONSENT_AGE, TJStatus.UNKNOWN.getValue()));
}
}
if (tJPrivacyPolicy.d == null) {
tJPrivacyPolicy.d = tJKeyValueStorage.getString(TapjoyConstants.PREF_US_PRIVACY, "");
}
}
TJPrivacyPolicy tJPrivacyPolicy2 = getInstance();
Context context3 = tJPrivacyPolicy2.e;
if (context3 != null) {
TJStatus tJStatus3 = tJPrivacyPolicy2.a;
if (tJStatus3 != null) {
if (tJStatus3 == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context3, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_SUBJECT_TO_GDPR);
} else {
new TJKeyValueStorage(context3, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_SUBJECT_TO_GDPR, Integer.valueOf(tJPrivacyPolicy2.a.getValue()));
}
}
Context context4 = tJPrivacyPolicy2.e;
if (context4 != null && (tJStatus2 = tJPrivacyPolicy2.b) != null) {
if (tJStatus2 == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context4, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_USER_CONSENT);
} else {
new TJKeyValueStorage(context4, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_USER_CONSENT, Integer.valueOf(tJPrivacyPolicy2.b.getValue()));
}
}
Context context5 = tJPrivacyPolicy2.e;
if (context5 != null && (tJStatus = tJPrivacyPolicy2.c) != null) {
if (tJStatus == TJStatus.UNKNOWN) {
new TJKeyValueStorage(context5, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_BELOW_CONSENT_AGE);
} else {
new TJKeyValueStorage(context5, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_BELOW_CONSENT_AGE, Integer.valueOf(tJPrivacyPolicy2.c.getValue()));
}
}
if (tJPrivacyPolicy2.e != null && (str = tJPrivacyPolicy2.d) != null) {
if (str.isEmpty()) {
new TJKeyValueStorage(tJPrivacyPolicy2.e, TapjoyConstants.TJC_PREFERENCE).remove(TapjoyConstants.PREF_US_PRIVACY);
} else {
new TJKeyValueStorage(tJPrivacyPolicy2.e, TapjoyConstants.TJC_PREFERENCE).setValue(TapjoyConstants.PREF_US_PRIVACY, tJPrivacyPolicy2.d);
}
}
}
}
}

View File

@@ -0,0 +1,130 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import java.util.List;
import java.util.Map;
import kotlin.TuplesKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJPurchases {
public static final TJPurchases INSTANCE = new TJPurchases();
public static String a;
public static int b;
public static double c;
public static double d;
public static long e;
public static TJKeyValueStorage f;
public final String getPurchaseCurrency() {
String str = a;
return str == null ? "" : str;
}
public final Double getPurchaseLastPrice() {
double d2 = d;
if (d2 > 0.0d) {
return Double.valueOf(d2);
}
return null;
}
public final Long getPurchaseLastTime() {
long j = e;
if (j > 0) {
return Long.valueOf(j);
}
return null;
}
public final Integer getPurchaseTotalCount() {
int i = b;
if (i > 0) {
return Integer.valueOf(i);
}
return null;
}
public final Double getPurchaseTotalPrice() {
double d2 = c;
if (d2 > 0.0d) {
return Double.valueOf(d2);
}
return null;
}
public final void setContext(Context context) {
Map mapOf;
List listOf;
TJKeyValueStorage tJKeyValueStorage;
TJKeyValueStorage tJKeyValueStorage2;
TJKeyValueStorage tJKeyValueStorage3;
TJKeyValueStorage tJKeyValueStorage4;
TJKeyValueStorage tJKeyValueStorage5;
if (context != null) {
TJKeyValueStorage tJKeyValueStorage6 = new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE);
f = tJKeyValueStorage6;
SharedPreferences sharedPreferences = context.getSharedPreferences("fiverocks", 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "getSharedPreferences(...)");
mapOf = MapsKt__MapsKt.mapOf(TuplesKt.to("ptc", "pref_purchase_currency"), TuplesKt.to("pc", "pref_purchase_total_count"), TuplesKt.to("ptp", "pref_purchase_total_price"), TuplesKt.to("plp", "pref_purchase_last_price"), TuplesKt.to("lpt", "pref_purchase_last_time"));
listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new String[]{"ptp", "plp"});
new TJPreferencesMigration(tJKeyValueStorage6, sharedPreferences, mapOf, listOf).migrateAllKeysIfExists();
INSTANCE.getClass();
TJKeyValueStorage tJKeyValueStorage7 = f;
if (tJKeyValueStorage7 != null) {
a = tJKeyValueStorage7.getString("pref_purchase_currency", null);
b = tJKeyValueStorage7.getInt("pref_purchase_total_count", 0);
c = tJKeyValueStorage7.getDouble("pref_purchase_total_price", 0.0d);
d = tJKeyValueStorage7.getDouble("pref_purchase_last_price", 0.0d);
e = tJKeyValueStorage7.getLong("pref_purchase_last_time", 0L);
}
String str = a;
if (str != null && str.length() != 0 && (tJKeyValueStorage5 = f) != null) {
tJKeyValueStorage5.setValue("pref_purchase_currency", a);
}
int i = b;
if (i > 0 && (tJKeyValueStorage4 = f) != null) {
tJKeyValueStorage4.setValue("pref_purchase_total_count", Integer.valueOf(i));
}
double d2 = c;
if (d2 > 0.0d && (tJKeyValueStorage3 = f) != null) {
tJKeyValueStorage3.setValue("pref_purchase_total_price", Double.valueOf(d2));
}
double d3 = d;
if (d3 > 0.0d && (tJKeyValueStorage2 = f) != null) {
tJKeyValueStorage2.setValue("pref_purchase_last_price", Double.valueOf(d3));
}
long j = e;
if (j > 0 && (tJKeyValueStorage = f) != null) {
tJKeyValueStorage.setValue("pref_purchase_last_time", Long.valueOf(j));
}
}
}
/* JADX WARN: Code restructure failed: missing block: B:13:0x0023, code lost:
if (r3 == null) goto L13;
*/
/* JADX WARN: Code restructure failed: missing block: B:23:0x0052, code lost:
if (r3 == null) goto L26;
*/
/* JADX WARN: Code restructure failed: missing block: B:6:0x0014, code lost:
if (r2.length() == 0) goto L16;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void trackPurchase(java.lang.String r17, java.lang.Double r18) {
/*
Method dump skipped, instructions count: 251
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJPurchases.trackPurchase(java.lang.String, java.lang.Double):void");
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJPurchasesKt {
}

View File

@@ -0,0 +1,32 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public enum TJSegment {
NON_PAYER,
PAYER,
VIP,
UNKNOWN;
TJSegment() {
}
public static TJSegment valueOf(int i) {
return i != 0 ? i != 1 ? i != 2 ? UNKNOWN : VIP : PAYER : NON_PAYER;
}
public int getValue() {
int i = r0.a[ordinal()];
if (i == 1) {
return 0;
}
if (i != 2) {
return i != 3 ? -1 : 2;
}
return 1;
}
@Override // java.lang.Enum
public String toString() {
return String.valueOf(getValue());
}
}

View File

@@ -0,0 +1,236 @@
package com.tapjoy;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import java.lang.ref.WeakReference;
import java.util.Hashtable;
import java.util.Map;
import java.util.UUID;
import kotlin.TuplesKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
/* loaded from: classes4.dex */
public final class TJSession {
public static final TJSession INSTANCE = new TJSession();
public static String a = "";
public static Integer b;
public static Integer c;
public static Integer d;
public static Long e;
public static Long f;
public static long g;
public static Long h;
public static volatile boolean i;
public static boolean j;
public static TJKeyValueStorage k;
public static boolean l;
public final String getSessionId() {
if (a.length() == 0) {
a = a();
}
return a;
}
public final Long getSessionLastDuration() {
return h;
}
public final Long getSessionLastLength() {
return h;
}
public final Long getSessionLastTime() {
return f;
}
public final int getSessionMonthlyFrequency() {
Integer num = c;
if (num != null) {
return num.intValue();
}
return 0;
}
public final int getSessionTotalCount() {
Integer num = d;
if (num != null) {
return num.intValue();
}
return 0;
}
public final Long getSessionTotalLength() {
return e;
}
public final int getSessionWeeklyFrequency() {
Integer num = b;
if (num != null) {
return num.intValue();
}
return 0;
}
public final boolean isSemiAutoSessionTrackingStarted() {
return j;
}
public final void onActivityStart(Activity activity) {
if (activity == null) {
TapjoyLog.e("TJSession", "onActivityStart: The given activity was null");
return;
}
com.tapjoy.internal.j.a(activity.getApplication());
com.tapjoy.internal.j.b++;
com.tapjoy.internal.j.c.a = new WeakReference(activity);
if (startSession()) {
com.tapjoy.internal.g.a(activity);
}
}
public final void onActivityStop(Activity activity) {
if (activity == null) {
TapjoyLog.e("TJSession", "onActivityStop: The given activity was null");
return;
}
int i2 = com.tapjoy.internal.j.b - 1;
com.tapjoy.internal.j.b = i2;
com.tapjoy.internal.j.c.a = null;
if (i2 < 0) {
com.tapjoy.internal.j.b = 0;
}
if (com.tapjoy.internal.j.b > 0) {
return;
}
endSession();
}
public final void setAutomaticSessionTracking(Context applicationContext, Hashtable<String, ?> hashtable) {
boolean equals;
Intrinsics.checkNotNullParameter(applicationContext, "applicationContext");
if (hashtable != null) {
equals = StringsKt__StringsJVMKt.equals(String.valueOf(hashtable.get(TapjoyConnectFlag.DISABLE_AUTOMATIC_SESSION_TRACKING)), "true", true);
if (equals) {
TapjoyLog.i("TJSession", "Automatic session tracking is disabled.");
return;
}
}
com.tapjoy.internal.c.a(applicationContext);
}
public final void setContext(Context context) {
Map mapOf;
if (context != null) {
TJKeyValueStorage tJKeyValueStorage = new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE);
k = tJKeyValueStorage;
SharedPreferences sharedPreferences = context.getSharedPreferences("fiverocks", 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "getSharedPreferences(...)");
mapOf = MapsKt__MapsKt.mapOf(TuplesKt.to("fql", "pref_daily_frequency_last"), TuplesKt.to("fq", "pref_daily_frequency"), TuplesKt.to("ss", "pref_session_total_count"), TuplesKt.to("std", "pref_session_total_duration"), TuplesKt.to("slt", "pref_session_last_time"), TuplesKt.to("sld", "pref_session_last_duration"));
new TJPreferencesMigration(tJKeyValueStorage, sharedPreferences, mapOf, CollectionsKt__CollectionsKt.emptyList()).migrateAllKeysIfExists();
int i2 = tJKeyValueStorage.getInt("pref_daily_frequency", 0);
INSTANCE.getClass();
b = Integer.valueOf(Integer.bitCount(i2 & 127));
c = Integer.valueOf(Integer.bitCount(i2 & 1073741823));
int i3 = tJKeyValueStorage.getInt("pref_session_total_count", 0);
if (i3 > 0) {
d = Integer.valueOf(i3);
}
long j2 = tJKeyValueStorage.getLong("pref_session_total_duration", 0L);
if (j2 > 0) {
e = Long.valueOf(j2);
}
long j3 = tJKeyValueStorage.getLong("pref_session_last_time", 0L);
if (j3 > 0) {
f = Long.valueOf(j3);
}
long j4 = tJKeyValueStorage.getLong("pref_session_last_duration", 0L);
if (j4 > 0) {
h = Long.valueOf(j4);
}
}
}
public final void setSemiAutoSessionTrackingStarted(boolean z) {
j = z;
}
public static String a() {
TapjoyLog.i("TJSession", "generating sessionID...");
try {
long currentTimeMillis = System.currentTimeMillis() / 1000;
UUID randomUUID = UUID.randomUUID();
StringBuilder sb = new StringBuilder();
sb.append(currentTimeMillis);
sb.append(randomUUID);
String SHA256 = TapjoyUtil.SHA256(sb.toString());
Intrinsics.checkNotNullExpressionValue(SHA256, "SHA256(...)");
return SHA256;
} catch (Exception e2) {
TapjoyLog.e("TJSession", "unable to generate session id: " + e2);
return "";
}
}
public final Long getDuration() {
if (g > 0) {
return Long.valueOf(System.currentTimeMillis() - g);
}
return null;
}
public final void initSession() {
if (l) {
a = a();
l = false;
}
if (startSession()) {
com.tapjoy.internal.g.a(null);
}
}
/* JADX WARN: Removed duplicated region for block: B:25:0x00cf */
/* JADX WARN: Removed duplicated region for block: B:27:0x00d1 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final boolean startSession() {
/*
Method dump skipped, instructions count: 302
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJSession.startSession():boolean");
}
public final void endSession() {
l = true;
if (i) {
i = false;
TapjoyLog.i("TJSession", "The session ended");
long currentTimeMillis = System.currentTimeMillis() - g;
TJKeyValueStorage tJKeyValueStorage = k;
long j2 = (tJKeyValueStorage != null ? tJKeyValueStorage.getLong("pref_session_total_duration", 0L) : 0L) + currentTimeMillis;
TJKeyValueStorage tJKeyValueStorage2 = k;
if (tJKeyValueStorage2 != null) {
tJKeyValueStorage2.setValue("pref_session_total_duration", Long.valueOf(j2));
}
e = Long.valueOf(j2);
long currentTimeMillis2 = System.currentTimeMillis();
TJKeyValueStorage tJKeyValueStorage3 = k;
if (tJKeyValueStorage3 != null) {
tJKeyValueStorage3.setValue("pref_session_last_time", Long.valueOf(currentTimeMillis2));
}
TJKeyValueStorage tJKeyValueStorage4 = k;
if (tJKeyValueStorage4 != null) {
tJKeyValueStorage4.setValue("pref_session_last_duration", Long.valueOf(currentTimeMillis));
}
f = Long.valueOf(currentTimeMillis2);
h = Long.valueOf(currentTimeMillis);
}
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJSessionKt {
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJSetCurrencyAmountRequiredListener {
void onSetCurrencyAmountRequiredFailure(int i, String str);
void onSetCurrencyAmountRequiredSuccess();
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJSetCurrencyBalanceListener {
void onSetCurrencyBalanceFailure(int i, String str);
void onSetCurrencyBalanceSuccess();
}

View File

@@ -0,0 +1,14 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJSetUserIDListener {
default void onSetUserIDFailure(int i, String str) {
}
@Deprecated
default void onSetUserIDFailure(String str) {
}
default void onSetUserIDSuccess() {
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJSpendCurrencyListener {
void onSpendCurrencyResponse(String str, int i);
void onSpendCurrencyResponseFailure(String str);
}

View File

@@ -0,0 +1,371 @@
package com.tapjoy;
import android.R;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.google.android.gms.drive.DriveFile;
import com.tapjoy.TJAdUnitConstants;
import java.util.Arrays;
import java.util.HashSet;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJSplitWebView extends RelativeLayout {
public TJWebView a;
public a1 b;
public a1 c;
public String d;
public String e;
public String f;
public Uri g;
public HashSet h;
public final JSONObject i;
public TJAdUnitJSBridge j;
public final Context k;
public final Boolean l;
public final boolean m;
public RelativeLayout n;
public FrameLayout o;
public ProgressBar p;
public TextView q;
public TJImageButton r;
public TJImageButton s;
public final String t;
public boolean u;
public String v;
public String w;
public String x;
public TJSplitWebView(Context context, JSONObject jSONObject, TJAdUnitJSBridge tJAdUnitJSBridge) {
super(context);
this.j = tJAdUnitJSBridge;
this.k = context;
JSONObject optJSONObject = jSONObject.optJSONObject(TJAdUnitConstants.String.SPLIT_VIEW_LAYOUT);
JSONArray optJSONArray = jSONObject.optJSONArray(TJAdUnitConstants.String.SPLIT_VIEW_EXIT_HOSTS);
JSONObject optJSONObject2 = jSONObject.optJSONObject(TJAdUnitConstants.String.SPLIT_VIEW_ERROR_DIALOG_STRINGS);
this.t = jSONObject.optString(TJAdUnitConstants.String.SPLIT_VIEW_URL_FOR_EXTERNAL_OPEN);
this.i = jSONObject.optJSONObject(TJAdUnitConstants.String.SPLIT_VIEW_ANIMATION);
setLayoutOption(optJSONObject);
setExitHosts(optJSONArray);
setErrorDialog(optJSONObject2);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
TJWebView tJWebView = new TJWebView(context);
this.a = tJWebView;
tJWebView.setId(TapjoyUtil.generateViewId());
this.a.setBackgroundColor(-1);
WebSettings settings = this.a.getSettings();
if (settings != null) {
settings.setUseWideViewPort(true);
}
this.a.setWebViewClient(new b1(this));
Boolean valueOf = Boolean.valueOf(jSONObject.optBoolean(TJAdUnitConstants.String.SPLIT_VIEW_SHOW_TOOLBAR));
this.l = valueOf;
this.m = jSONObject.optBoolean(TJAdUnitConstants.String.SPLIT_VIEW_SHOW_URL, true);
if (valueOf.booleanValue()) {
addToolbar();
addLineBreak();
addProgressBar();
this.a.setWebChromeClient(new s0(this));
}
addView(this.a, layoutParams);
}
public void addLineBreak() {
FrameLayout frameLayout = new FrameLayout(getContext());
this.o = frameLayout;
frameLayout.setBackgroundColor(Color.parseColor("#dddddd"));
addView(this.o);
}
public void addProgressBar() {
ProgressBar progressBar = new ProgressBar(this.k, null, R.attr.progressBarStyleHorizontal);
this.p = progressBar;
progressBar.setMax(100);
this.p.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#5d95ff")));
this.p.setProgressBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#dddddd")));
addView(this.p);
}
public void addToolbar() {
RelativeLayout relativeLayout = new RelativeLayout(this.k);
this.n = relativeLayout;
relativeLayout.setId(TapjoyUtil.generateViewId());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, (int) (TJDeviceUtils.INSTANCE.getDensity(this.k) * 40.0f));
layoutParams.addRule(6);
this.n.setBackgroundColor(-1);
this.n.setVisibility(0);
setupToolbarUI();
addView(this.n, layoutParams);
}
public void animateOpen(ViewGroup viewGroup) {
JSONObject jSONObject = this.i;
if (jSONObject != null && jSONObject.has(TJAdUnitConstants.String.ANIMATION_EVENT_ON_OPEN) && this.i.optString(TJAdUnitConstants.String.ANIMATION_EVENT_ON_OPEN).equalsIgnoreCase(TJAdUnitConstants.String.ANIMATION_TYPE_SLIDE_UP)) {
setY(viewGroup.getHeight());
animate().translationY(0.0f);
}
}
public void applyLayoutOption(JSONObject jSONObject) {
setLayoutOption(jSONObject);
a(getWidth(), getHeight());
}
public String getLastUrl() {
return this.e;
}
public boolean goBack() {
if (!this.a.canGoBack()) {
return false;
}
this.a.goBack();
return true;
}
public void isFirstOrLastPage() {
this.r.setEnabled(this.a.canGoBack());
this.s.setEnabled(this.a.canGoForward());
}
@Override // android.widget.RelativeLayout, android.view.View
public final void onMeasure(int i, int i2) {
int size = View.MeasureSpec.getSize(i);
int size2 = View.MeasureSpec.getSize(i2);
if (this.a != null) {
a(size, size2);
}
super.onMeasure(i, i2);
}
public void openInExternalBrowser() {
Uri parse;
if (TextUtils.isEmpty(this.t)) {
parse = Uri.parse(this.a.getUrl());
if (parse == null) {
parse = Uri.parse(getLastUrl());
}
} else {
parse = Uri.parse(this.t);
}
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(parse);
intent.addFlags(DriveFile.MODE_READ_ONLY);
if (this.a.getContext() != null) {
try {
this.a.getContext().startActivity(intent);
} catch (Exception e) {
TapjoyLog.d("TJSplitWebView", e.getMessage());
}
}
}
public void setLayoutOption(JSONObject jSONObject) {
if (jSONObject != null) {
JSONObject optJSONObject = jSONObject.optJSONObject("landscape");
this.c = optJSONObject != null ? new a1(optJSONObject) : null;
JSONObject optJSONObject2 = jSONObject.optJSONObject("portrait");
this.b = optJSONObject2 != null ? new a1(optJSONObject2) : null;
}
}
public void setTrigger(@Nullable String str, @Nullable String str2) {
if (str == null || str.length() == 0) {
str = null;
}
this.f = str;
this.g = str2 != null ? Uri.parse(str2) : null;
}
public void setUserAgent(String str) {
this.a.getSettings().setUserAgentString(str);
}
public void setupToolbarUI() {
float density = TJDeviceUtils.INSTANCE.getDensity(getContext());
RelativeLayout relativeLayout = new RelativeLayout(getContext());
TJImageButton tJImageButton = new TJImageButton(this.k);
this.r = tJImageButton;
tJImageButton.setId(TapjoyUtil.generateViewId());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(15);
layoutParams.addRule(9);
int i = (int) (10.0f * density);
layoutParams.setMargins(i, i, i, i);
int i2 = (int) (5.0f * density);
this.r.setPadding(i2, i, i, i);
this.r.setEnabledImageBitmap(TapjoyIcons.getBackEnabledImage(density));
this.r.setDisableImageBitmap(TapjoyIcons.getBackDisabledImage(density));
this.r.setBackgroundColor(0);
this.r.setOnClickListener(new t0(this));
relativeLayout.addView(this.r, layoutParams);
this.s = new TJImageButton(this.k);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams2.addRule(15);
layoutParams2.addRule(1, this.r.getId());
layoutParams2.setMargins(i, i, i, i);
this.s.setPadding(i, i, i2, i);
this.s.setEnabledImageBitmap(TapjoyIcons.getForwardEnabledImage(density));
this.s.setDisableImageBitmap(TapjoyIcons.getForwardDisabledImage(density));
this.s.setBackgroundColor(0);
this.s.setOnClickListener(new u0(this));
relativeLayout.addView(this.s, layoutParams2);
ImageButton imageButton = new ImageButton(this.k);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.addRule(15);
layoutParams3.addRule(11);
layoutParams3.setMargins(i, i, i, i);
imageButton.setPadding(i2, i2, i2, i2);
imageButton.setImageBitmap(TapjoyIcons.getCloseImage(density));
imageButton.setBackgroundColor(0);
imageButton.setOnClickListener(new v0(this));
relativeLayout.addView(imageButton, layoutParams3);
TextView textView = new TextView(this.k);
this.q = textView;
textView.setId(TapjoyUtil.generateViewId());
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.addRule(13);
this.q.setMaxLines(1);
this.q.setMaxEms(200);
this.q.setTextAlignment(4);
this.q.setTextColor(Color.parseColor("#5d95ff"));
this.q.setBackgroundColor(0);
this.q.setEnabled(false);
this.q.setTypeface(Typeface.create("sans-serif-medium", 0));
relativeLayout.addView(this.q, layoutParams4);
ImageButton imageButton2 = new ImageButton(this.k);
imageButton2.setId(TapjoyUtil.generateViewId());
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams5.addRule(1, this.q.getId());
layoutParams5.addRule(15);
imageButton2.setPadding(i2, i2, i2, i2);
imageButton2.setImageBitmap(TapjoyIcons.getOpenBrowserImage(density));
imageButton2.setBackgroundColor(0);
imageButton2.setOnClickListener(new w0(this));
relativeLayout.addView(imageButton2, layoutParams5);
if (!this.m) {
this.q.setVisibility(4);
imageButton2.setVisibility(4);
}
this.n.addView(relativeLayout, new RelativeLayout.LayoutParams(-1, -2));
}
public void showErrorDialog() {
new AlertDialog.Builder(this.k, R.style.Theme.Material.Light.Dialog.Alert).setMessage(this.v).setPositiveButton(this.w, new y0()).setNegativeButton(this.x, new x0(this)).create().show();
}
public void setErrorDialog(JSONObject jSONObject) {
if (jSONObject != null) {
this.u = true;
this.v = jSONObject.optString("description");
this.w = jSONObject.optString("close");
this.x = jSONObject.optString("reload");
}
}
public final void a(int i, int i2) {
a1 a1Var = i <= i2 ? this.b : this.c;
if (a1Var == null) {
this.a.setVisibility(4);
return;
}
double d = i;
int i3 = (int) (a1Var.a * d);
double d2 = i2;
int i4 = (int) (a1Var.b * d2);
if (i3 != 0 && i4 != 0) {
int i5 = (int) (d * a1Var.c);
int i6 = (int) (d2 * a1Var.d);
int i7 = (i - i3) - i5;
int i8 = (i2 - i4) - i6;
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.a.getLayoutParams();
layoutParams.width = i3;
layoutParams.height = i4;
Boolean bool = this.l;
if (bool != null && bool.booleanValue()) {
float density = TJDeviceUtils.INSTANCE.getDensity(getContext());
int height = this.o.getHeight() + ((int) (40.0f * density));
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.n.getLayoutParams();
layoutParams2.setMargins(i5, i6, i7, i8);
this.n.setLayoutParams(layoutParams2);
layoutParams.setMargins(i5, i6 + height, i7, i8);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(i3, (int) density);
layoutParams3.setMargins(i5, layoutParams.topMargin - this.p.getHeight(), i7, i8);
this.p.setLayoutParams(layoutParams3);
this.o.setLayoutParams(layoutParams3);
} else {
layoutParams.setMargins(i5, i6, i7, i8);
}
this.a.setLayoutParams(layoutParams);
this.a.setVisibility(0);
float f = a1Var.e;
if (f > 0.0f) {
float[] fArr = new float[8];
float f2 = f * getResources().getDisplayMetrics().density;
Boolean bool2 = this.l;
if (bool2 != null && bool2.booleanValue()) {
this.n.setOutlineProvider(new z0(f2));
this.n.setClipToOutline(true);
return;
}
Arrays.fill(fArr, f2);
ShapeDrawable shapeDrawable = new ShapeDrawable(new RoundRectShape(fArr, null, null));
shapeDrawable.getPaint().setColor(-1);
this.a.setBackground(shapeDrawable);
this.a.setClipToOutline(true);
return;
}
this.a.setBackground(null);
this.a.setClipToOutline(false);
Boolean bool3 = this.l;
if (bool3 == null || !bool3.booleanValue()) {
return;
}
this.n.setClipToOutline(false);
return;
}
this.a.setVisibility(4);
}
public void loadUrl(String str) {
TJWebView tJWebView = this.a;
if (tJWebView != null) {
this.d = str;
this.e = str;
tJWebView.loadUrl(str);
}
}
public void setExitHosts(JSONArray jSONArray) {
if (jSONArray == null) {
this.h = null;
return;
}
this.h = new HashSet();
for (int i = 0; i <= jSONArray.length(); i++) {
String optString = jSONArray.optString(i);
if (optString != null) {
this.h.add(optString);
}
}
}
}

View File

@@ -0,0 +1,39 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public enum TJStatus {
FALSE,
TRUE,
UNKNOWN;
TJStatus() {
}
public static TJStatus valueOf(int i) {
return i != 0 ? i != 1 ? UNKNOWN : TRUE : FALSE;
}
public Boolean getBoolean() {
int i = c1.a[ordinal()];
if (i == 1) {
return Boolean.FALSE;
}
if (i != 2) {
return null;
}
return Boolean.TRUE;
}
public int getValue() {
int i = c1.a[ordinal()];
if (i != 1) {
return i != 2 ? 2 : 1;
}
return 0;
}
@Override // java.lang.Enum
public String toString() {
return String.valueOf(getValue());
}
}

View File

@@ -0,0 +1,46 @@
package com.tapjoy;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
/* loaded from: classes4.dex */
public final class TJStore {
public static final TJStore INSTANCE = new TJStore();
public static String a;
public static boolean b;
public static void a(Context context) {
try {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("market://details"));
Intent.createChooser(intent, "Google Play store in US");
b = intent.resolveActivity(context.getPackageManager()) != null;
} catch (Exception e) {
TapjoyLog.e("TJStore", "Error trying to detect store intent on device: " + e);
}
}
public final String getStore() {
return a;
}
public final boolean getStoreView() {
return b;
}
public final void setContext(Context context) {
if (context != null) {
INSTANCE.getClass();
a(context);
}
}
public final void setStore(String str) {
a = str;
}
public final void setStoreView(boolean z) {
b = z;
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJStoreKt {
}

View File

@@ -0,0 +1,6 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public interface TJTaskHandler<T> {
void onComplete(T t);
}

View File

@@ -0,0 +1,393 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.tapjoy.internal.j2;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJTracking {
public static final TJTracking INSTANCE = new TJTracking();
public static String a = null;
public static String b = null;
public static String c = "";
public static String d = "";
public static String e = "";
public static String f = "";
public static String g = "";
public static boolean h;
public static boolean i;
public static boolean j;
public static boolean k;
public static boolean l;
public static long m;
public static int n;
public static boolean o;
public static boolean p;
public static AdvertisingIdClient.Info q;
public static SharedPreferences r;
public static final Lazy s;
static {
Lazy lazy;
lazy = LazyKt__LazyJVMKt.lazy(j2.a);
s = lazy;
}
public static final void a(Context context) {
if (context != null) {
INSTANCE.fetchAdvertisingID(context);
}
}
public final boolean getAdIdCheckDisabled() {
return o;
}
public final boolean getAdTrackingEnableIfPresent() {
if (isAdvertisingIdPresent()) {
return i;
}
return false;
}
public final String getAdvertisingID() {
return c;
}
public final String getAdvertisingIdIfAllowed() {
return (isAdvertisingIdPresent() && isAdvertisingIdAllowed()) ? c : "";
}
public final String getAndroidID() {
return e;
}
public final String getAndroidIDIfAllowed() {
if ((!isLegacyIdFallbackAllowed() || isAdvertisingIdPresent()) && isGooglePlayServiceIntegrated()) {
return null;
}
return e;
}
public final String getAppSetID() {
return g;
}
public final Long getDeviceGpsVersion() {
long j2 = m;
if (j2 != 0) {
return Long.valueOf(j2);
}
return null;
}
public final String getInstallID() {
return d;
}
public final boolean getLegacyIdFallbackAllowed() {
return p;
}
public final String getLevelPlayAuid() {
return b;
}
public final Integer getPackagedGpsVersion() {
int i2 = n;
if (i2 != 0) {
return Integer.valueOf(i2);
}
return null;
}
public final String getTestID() {
return f;
}
public final String getUnityAdsIdfi() {
return a;
}
public final boolean isAdvertisingIdAllowed() {
SharedPreferences sharedPreferences = r;
if (sharedPreferences == null || !sharedPreferences.contains(TapjoyConstants.PREF_OPTOUT_ADVERTISING_ID)) {
return true;
}
return !(r != null ? r0.getBoolean(TapjoyConstants.PREF_OPTOUT_ADVERTISING_ID, false) : false);
}
public final boolean isAdvertisingIdPresent() {
return c.length() > 0;
}
public final boolean isAndroidIdPresent() {
return e.length() > 0;
}
public final boolean isGooglePlayServiceIntegrated() {
String connectFlagValue = TapjoyConnectCore.getInstance().getConnectFlagValue(TapjoyConnectFlag.DISABLE_ADVERTISING_ID_CHECK);
return ((k || l) && connectFlagValue != null && Intrinsics.areEqual(connectFlagValue, "true")) ? false : true;
}
public final boolean isGpsAvailable() {
return k;
}
public final boolean isGpsManifestConfigured() {
return l;
}
public final boolean isLegacyIdFallbackAllowed() {
return TapjoyConnectCore.getInstance().getConnectFlagValue(TapjoyConnectFlag.ALLOW_LEGACY_ID_FALLBACK) != null && Intrinsics.areEqual(TapjoyConnectCore.getInstance().getConnectFlagValue(TapjoyConnectFlag.ALLOW_LEGACY_ID_FALLBACK), "true");
}
public final void optOutAdvertisingID(final Context context, boolean z) {
SharedPreferences sharedPreferences;
SharedPreferences.Editor edit = (context == null || (sharedPreferences = context.getSharedPreferences(TapjoyConstants.TJC_PREFERENCE, 0)) == null) ? null : sharedPreferences.edit();
if (edit != null) {
edit.putBoolean(TapjoyConstants.PREF_OPTOUT_ADVERTISING_ID, z);
}
if (edit != null) {
edit.apply();
}
if (Tapjoy.isConnected()) {
if (z) {
c = "";
} else if (c.length() == 0 || Intrinsics.areEqual(c, "00000000-0000-0000-0000-000000000000")) {
h = false;
((ExecutorService) s.getValue()).submit(new Runnable() { // from class: com.tapjoy.TJTracking$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TJTracking.a(context);
}
});
}
}
}
public final void setAppSetID(String id) {
Intrinsics.checkNotNullParameter(id, "id");
g = id;
}
/* JADX WARN: Code restructure failed: missing block: B:6:0x002f, code lost:
if (r0 == null) goto L8;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void setContext(android.content.Context r6) {
/*
r5 = this;
if (r6 == 0) goto L10c
java.lang.String r0 = "tjcPrefrences"
r1 = 0
android.content.SharedPreferences r0 = r6.getSharedPreferences(r0, r1)
com.tapjoy.TJTracking.r = r0
com.tapjoy.TJTracking r0 = com.tapjoy.TJTracking.INSTANCE
r0.getClass()
android.content.ContentResolver r0 = r6.getContentResolver()
java.lang.String r2 = "android_id"
java.lang.String r0 = android.provider.Settings.Secure.getString(r0, r2)
java.lang.String r2 = "9774d56d682e549c"
boolean r2 = kotlin.jvm.internal.Intrinsics.areEqual(r2, r0)
java.lang.String r3 = "toLowerCase(...)"
if (r2 != 0) goto L31
if (r0 == 0) goto L31
java.util.Locale r2 = java.util.Locale.ROOT
java.lang.String r0 = r0.toLowerCase(r2)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r3)
if (r0 != 0) goto L33
L31:
java.lang.String r0 = ""
L33:
com.tapjoy.TJTracking.e = r0
java.lang.String r0 = a()
com.tapjoy.TJTracking.d = r0
java.lang.String r0 = b()
com.tapjoy.TJTracking.f = r0
java.lang.String r0 = "unityads-installinfo"
android.content.SharedPreferences r0 = r6.getSharedPreferences(r0, r1)
java.lang.String r2 = "unityads-idfi"
r4 = 0
java.lang.String r0 = r0.getString(r2, r4)
com.tapjoy.TJTracking.a = r0
java.lang.String r0 = "supersonic_shared_preferen"
android.content.SharedPreferences r0 = r6.getSharedPreferences(r0, r1)
java.lang.String r2 = "auid"
java.lang.String r0 = r0.getString(r2, r4)
com.tapjoy.TJTracking.b = r0
boolean r0 = com.tapjoy.TJTracking.k
r2 = 1
if (r0 != 0) goto L74
java.lang.ClassLoader r0 = r6.getClassLoader() // Catch: java.lang.Error -> L6f java.lang.Exception -> L72
java.lang.String r4 = "com.google.android.gms.ads.identifier.AdvertisingIdClient"
r0.loadClass(r4) // Catch: java.lang.Error -> L6f java.lang.Exception -> L72
com.tapjoy.TJTracking.k = r2 // Catch: java.lang.Error -> L6f java.lang.Exception -> L72
goto L74
L6f:
com.tapjoy.TJTracking.k = r1
goto L74
L72:
com.tapjoy.TJTracking.k = r1
L74:
boolean r0 = com.tapjoy.TJTracking.l
if (r0 != 0) goto L9a
android.content.pm.PackageManager r0 = r6.getPackageManager() // Catch: java.lang.Exception -> L98
java.lang.String r6 = r6.getPackageName() // Catch: java.lang.Exception -> L98
r4 = 128(0x80, float:1.8E-43)
android.content.pm.ApplicationInfo r6 = r0.getApplicationInfo(r6, r4) // Catch: java.lang.Exception -> L98
java.lang.String r0 = "getApplicationInfo(...)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r0) // Catch: java.lang.Exception -> L98
android.os.Bundle r6 = r6.metaData // Catch: java.lang.Exception -> L98
java.lang.String r0 = "com.google.android.gms.version"
int r6 = r6.getInt(r0) // Catch: java.lang.Exception -> L98
com.tapjoy.TJTracking.n = r6 // Catch: java.lang.Exception -> L98
com.tapjoy.TJTracking.l = r2 // Catch: java.lang.Exception -> L98
goto L9a
L98:
com.tapjoy.TJTracking.l = r1
L9a:
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r0 = "TJC_OPTION_ALLOW_LEGACY_ID_FALLBACK"
java.lang.String r6 = r6.getConnectFlagValue(r0)
java.lang.String r1 = "true"
java.lang.String r2 = "getConnectFlagValue(...)"
if (r6 == 0) goto Ld5
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r6 = r6.getConnectFlagValue(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r2)
int r6 = r6.length()
if (r6 <= 0) goto Ld5
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r6 = r6.getConnectFlagValue(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r2)
java.util.Locale r0 = java.util.Locale.ROOT
java.lang.String r6 = r6.toLowerCase(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r3)
boolean r6 = kotlin.jvm.internal.Intrinsics.areEqual(r6, r1)
com.tapjoy.TJTracking.p = r6
Ld5:
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r0 = "TJC_OPTION_DISABLE_ADVERTISING_ID_CHECK"
java.lang.String r6 = r6.getConnectFlagValue(r0)
if (r6 == 0) goto L10c
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r6 = r6.getConnectFlagValue(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r2)
int r6 = r6.length()
if (r6 <= 0) goto L10c
com.tapjoy.TapjoyConnectCore r6 = com.tapjoy.TapjoyConnectCore.getInstance()
java.lang.String r6 = r6.getConnectFlagValue(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r2)
java.util.Locale r0 = java.util.Locale.ROOT
java.lang.String r6 = r6.toLowerCase(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r6, r3)
boolean r6 = kotlin.jvm.internal.Intrinsics.areEqual(r6, r1)
com.tapjoy.TJTracking.o = r6
L10c:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJTracking.setContext(android.content.Context):void");
}
public static String b() {
SharedPreferences sharedPreferences = r;
if (sharedPreferences != null) {
String str = "";
String string = sharedPreferences.getString(TapjoyConstants.PREF_TEST_ID, "");
if (string != null) {
Intrinsics.checkNotNull(string);
str = string;
}
f = str;
if (str.length() == 0) {
try {
String uuid = UUID.randomUUID().toString();
Intrinsics.checkNotNullExpressionValue(uuid, "toString(...)");
f = uuid;
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString(TapjoyConstants.PREF_TEST_ID, f);
edit.apply();
} catch (Exception e2) {
TapjoyLog.e("TJTracking", "Error generating test id: " + e2);
}
}
}
return f;
}
public static String a() {
SharedPreferences sharedPreferences = r;
if (sharedPreferences != null) {
String str = "";
String string = sharedPreferences.getString(TapjoyConstants.PREF_INSTALL_ID, "");
if (string != null) {
Intrinsics.checkNotNull(string);
str = string;
}
d = str;
if (str.length() == 0) {
try {
String SHA256 = TapjoyUtil.SHA256(UUID.randomUUID().toString() + System.currentTimeMillis());
Intrinsics.checkNotNullExpressionValue(SHA256, "SHA256(...)");
d = SHA256;
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString(TapjoyConstants.PREF_INSTALL_ID, d);
edit.apply();
} catch (Exception e2) {
TapjoyLog.e("TJTracking", "Error generating install id: " + e2);
}
}
}
return d;
}
public final void fetchAdvertisingID(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
if (h) {
return;
}
try {
a(context, !isLegacyIdFallbackAllowed());
h = true;
} catch (Exception e2) {
TapjoyLog.i("TJTracking", "Error fetching advertising id: " + e2);
e2.printStackTrace();
}
}
/* JADX WARN: Can't wrap try/catch for region: R(13:5|(13:46|47|48|8|9|10|11|12|13|(1:15)(1:42)|16|17|(7:19|(1:21)(1:31)|(1:23)|24|(1:26)(1:30)|27|28)(2:32|(2:34|(2:36|37)(2:38|39))(1:40)))|7|8|9|10|11|12|13|(0)(0)|16|17|(0)(0)) */
/* JADX WARN: Code restructure failed: missing block: B:43:0x008e, code lost:
com.tapjoy.TapjoyLog.i("TJTracking", "Error getting device's Google Play Services version");
*/
/* JADX WARN: Code restructure failed: missing block: B:45:0x0056, code lost:
com.tapjoy.TapjoyLog.i("TJTracking", "Error getting device's Google Play Services version");
*/
/* JADX WARN: Removed duplicated region for block: B:15:0x0061 A[Catch: Exception -> 0x008e, TRY_ENTER, TryCatch #0 {Exception -> 0x008e, blocks: (B:12:0x0059, B:15:0x0061, B:16:0x0079, B:42:0x006e), top: B:11:0x0059 }] */
/* JADX WARN: Removed duplicated region for block: B:19:0x0097 */
/* JADX WARN: Removed duplicated region for block: B:32:0x00e1 */
/* JADX WARN: Removed duplicated region for block: B:42:0x006e A[Catch: Exception -> 0x008e, TryCatch #0 {Exception -> 0x008e, blocks: (B:12:0x0059, B:15:0x0061, B:16:0x0079, B:42:0x006e), top: B:11:0x0059 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(android.content.Context r9, boolean r10) {
/*
Method dump skipped, instructions count: 258
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TJTracking.a(android.content.Context, boolean):void");
}
}

View File

@@ -0,0 +1,5 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJTrackingKt {
}

View File

@@ -0,0 +1,469 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Base64;
import com.tapjoy.TapjoyErrorMessage;
import com.tapjoy.internal.c3;
import com.tapjoy.internal.k2;
import java.io.EOFException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.TuplesKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import org.w3c.dom.Document;
@SourceDebugExtension({"SMAP\nTJUser.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TJUser.kt\ncom/tapjoy/TJUser\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,323:1\n1855#2,2:324\n*S KotlinDebug\n*F\n+ 1 TJUser.kt\ncom/tapjoy/TJUser\n*L\n97#1:324,2\n*E\n"})
/* loaded from: classes4.dex */
public final class TJUser {
public static String a = null;
public static int b = -1;
public static int c = -1;
public static int d = -1;
public static TJSegment e;
public static TJKeyValueStorage g;
public static final Lazy h;
public static final TJUser INSTANCE = new TJUser();
public static final HashSet f = new HashSet();
static {
Lazy lazy;
lazy = LazyKt__LazyJVMKt.lazy(k2.a);
h = lazy;
}
public static void a() {
HashSet hashSet = f;
if (hashSet.isEmpty()) {
TJKeyValueStorage tJKeyValueStorage = g;
if (tJKeyValueStorage != null) {
tJKeyValueStorage.remove("pref_user_tags");
}
hashSet.clear();
return;
}
List arrayList = new ArrayList(hashSet);
com.tapjoy.internal.m mVar = com.tapjoy.internal.m.e;
if (mVar == null) {
throw new NullPointerException("unknownFields == null");
}
if (arrayList instanceof com.tapjoy.internal.l0) {
arrayList = ((com.tapjoy.internal.l0) arrayList).b;
}
if (arrayList != Collections.emptyList() && !(arrayList instanceof com.tapjoy.internal.t)) {
com.tapjoy.internal.t tVar = new com.tapjoy.internal.t(arrayList);
if (tVar.contains(null)) {
throw new IllegalArgumentException("elements.contains(null)");
}
arrayList = tVar;
}
com.tapjoy.internal.l lVar = new com.tapjoy.internal.l();
try {
com.tapjoy.internal.w0 w0Var = new com.tapjoy.internal.w0(lVar);
com.tapjoy.internal.o0 o0Var = com.tapjoy.internal.u0.f;
com.tapjoy.internal.q0 q0Var = o0Var.b;
if (q0Var == null) {
q0Var = new com.tapjoy.internal.q0(o0Var, 3);
o0Var.b = q0Var;
}
q0Var.a(w0Var, 1, arrayList);
mVar.a(w0Var.a);
try {
String encodeToString = Base64.encodeToString(lVar.a(lVar.b), 2);
TJKeyValueStorage tJKeyValueStorage2 = g;
if (tJKeyValueStorage2 != null) {
tJKeyValueStorage2.setValue("pref_user_tags", encodeToString);
}
} catch (EOFException e2) {
throw new AssertionError(e2);
}
} catch (IOException e3) {
throw new AssertionError(e3);
}
}
public static final void b(TJSetUserIDListener tJSetUserIDListener) {
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDSuccess();
}
}
public static final void c(TJSetUserIDListener tJSetUserIDListener) {
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure("Failed to set userID");
}
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure(-1, "Failed to set userID");
}
}
public static final void d(TJSetUserIDListener tJSetUserIDListener) {
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDSuccess();
}
}
public static final void e(TJSetUserIDListener tJSetUserIDListener) {
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure(TJUserKt.USER_ID_FAILED_ERROR);
}
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure(-1, TJUserKt.USER_ID_FAILED_ERROR);
}
}
public final void checkIfMaxLevelRequired() {
String appVersion = TJAppInfo.INSTANCE.getAppVersion();
if (appVersion != null && c >= 0) {
TJKeyValueStorage tJKeyValueStorage = g;
String str = null;
Integer valueOf = tJKeyValueStorage != null ? Integer.valueOf(tJKeyValueStorage.getInt("pref_max_level_cache", -1)) : null;
TJKeyValueStorage tJKeyValueStorage2 = g;
if (tJKeyValueStorage2 == null || !tJKeyValueStorage2.contains("pref_app_version")) {
TJKeyValueStorage tJKeyValueStorage3 = g;
if (tJKeyValueStorage3 != null) {
tJKeyValueStorage3.setValue("pref_app_version", appVersion);
}
str = appVersion;
} else {
TJKeyValueStorage tJKeyValueStorage4 = g;
if (tJKeyValueStorage4 != null) {
str = tJKeyValueStorage4.getString("pref_app_version", null);
}
}
if (Intrinsics.areEqual(appVersion, str)) {
int i = c;
if (valueOf != null && valueOf.intValue() == i) {
return;
}
}
if (c <= -1 || appVersion.length() <= 0) {
return;
}
TJKeyValueStorage tJKeyValueStorage5 = g;
if (tJKeyValueStorage5 != null) {
tJKeyValueStorage5.setValue("pref_max_level_cache", Integer.valueOf(c));
}
TJKeyValueStorage tJKeyValueStorage6 = g;
if (tJKeyValueStorage6 != null) {
tJKeyValueStorage6.setValue("pref_app_version", appVersion);
}
d = c;
}
}
public final Integer getMaxLevelParam() {
int i = d;
if (i > 0) {
return Integer.valueOf(i);
}
return null;
}
public final String getUserID() {
return a;
}
public final String getUserIdIfNotEmpty() {
CharSequence trim;
String str = a;
if (str == null) {
return null;
}
trim = StringsKt__StringsKt.trim(str);
String obj = trim.toString();
if (obj == null || obj.length() <= 0) {
return null;
}
return a;
}
public final int getUserLevel() {
return b;
}
public final int getUserMaxLevel() {
return c;
}
public final Integer getUserSegmentInt() {
TJSegment tJSegment = e;
if (tJSegment == null || tJSegment == TJSegment.UNKNOWN) {
return null;
}
return Integer.valueOf(tJSegment.getValue());
}
public final String getUserSegmentString() {
TJSegment tJSegment = e;
if (tJSegment == null || tJSegment == TJSegment.UNKNOWN) {
return null;
}
return String.valueOf(tJSegment);
}
public final Set<String> getUserTags() {
return f;
}
public final void setContext(Context context) {
Map mapOf;
TJKeyValueStorage tJKeyValueStorage;
TJKeyValueStorage tJKeyValueStorage2;
TJKeyValueStorage tJKeyValueStorage3;
String string;
if (context != null) {
TJKeyValueStorage tJKeyValueStorage4 = new TJKeyValueStorage(context, TapjoyConstants.TJC_PREFERENCE);
g = tJKeyValueStorage4;
SharedPreferences sharedPreferences = context.getSharedPreferences("fiverocks", 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "getSharedPreferences(...)");
mapOf = MapsKt__MapsKt.mapOf(TuplesKt.to("ui", "pref_user_id"), TuplesKt.to("ul", "pref_user_level"), TuplesKt.to("utags", "pref_user_tags"));
new TJPreferencesMigration(tJKeyValueStorage4, sharedPreferences, mapOf, CollectionsKt__CollectionsKt.emptyList()).migrateAllKeysIfExists();
INSTANCE.getClass();
TJKeyValueStorage tJKeyValueStorage5 = g;
if (tJKeyValueStorage5 != null) {
if (c < 0 && tJKeyValueStorage5.contains("pref_max_level")) {
c = tJKeyValueStorage5.getInt("pref_max_level", -1);
}
if (e == null && tJKeyValueStorage5.contains("pref_user_segment")) {
e = TJSegment.valueOf(tJKeyValueStorage5.getInt("pref_user_segment", TJSegment.UNKNOWN.getValue()));
}
String str = a;
if ((str == null || str.length() == 0) && tJKeyValueStorage5.contains("pref_user_id")) {
a = tJKeyValueStorage5.getString("pref_user_id", null);
}
if (tJKeyValueStorage5.contains("pref_user_level")) {
b = tJKeyValueStorage5.getInt("pref_user_level", -1);
}
HashSet hashSet = f;
if (hashSet.isEmpty() && tJKeyValueStorage5.contains("pref_user_tags") && (string = tJKeyValueStorage5.getString("pref_user_tags", null)) != null && string.length() != 0) {
try {
com.tapjoy.internal.i1 i1Var = (com.tapjoy.internal.i1) com.tapjoy.internal.i1.d.a(Base64.decode(string, 2));
hashSet.clear();
hashSet.addAll(i1Var.c);
} catch (IOException unused) {
tJKeyValueStorage5.remove("pref_user_tags");
} catch (IllegalArgumentException unused2) {
tJKeyValueStorage5.remove("pref_user_tags");
}
}
}
INSTANCE.getClass();
int i = c;
if (i >= -1 && (tJKeyValueStorage3 = g) != null) {
tJKeyValueStorage3.setValue("pref_max_level", Integer.valueOf(i));
}
TJSegment tJSegment = e;
if (tJSegment != null) {
if (tJSegment == TJSegment.UNKNOWN) {
TJKeyValueStorage tJKeyValueStorage6 = g;
if (tJKeyValueStorage6 != null) {
tJKeyValueStorage6.remove("pref_user_segment");
}
} else {
TJKeyValueStorage tJKeyValueStorage7 = g;
if (tJKeyValueStorage7 != null) {
Intrinsics.checkNotNull(tJSegment);
tJKeyValueStorage7.setValue("pref_user_segment", Integer.valueOf(tJSegment.getValue()));
}
}
}
int i2 = b;
if (i2 >= -1 && (tJKeyValueStorage2 = g) != null) {
tJKeyValueStorage2.setValue("pref_user_level", Integer.valueOf(i2));
}
String str2 = a;
if (str2 != null && str2.length() != 0 && (tJKeyValueStorage = g) != null) {
tJKeyValueStorage.setValue("pref_user_id", a);
}
a();
}
}
public final void setUserIdRequest(String str, final TJSetUserIDListener tJSetUserIDListener) {
boolean equals;
Document buildDocument;
String nodeTrimValue;
if (str != null && str.length() > 200) {
setUserId(null);
TapjoyLog.e("TJUser", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, TJUserKt.USER_ID_MAX_LENGTH_ERROR));
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJUser$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TJUser.a(TJSetUserIDListener.this);
}
});
return;
}
if (str != null && str.length() != 0 && Intrinsics.areEqual(str, a)) {
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJUser$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
TJUser.b(TJSetUserIDListener.this);
}
});
return;
}
if (str == null || str.length() == 0) {
setUserId(null);
TapjoyLog.e("TJUser", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "Failed to set userID"));
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJUser$$ExternalSyntheticLambda4
@Override // java.lang.Runnable
public final void run() {
TJUser.c(TJSetUserIDListener.this);
}
});
return;
}
setUserId(str);
TapjoyLog.d("TJUser", "URL parameters: " + TapjoyConnectCore.getInstance().getBaseURLParams());
TapjoyLog.i("TJUser", "Setting userID to " + str);
String hostURL = TapjoyConnectCore.getInstance().getHostURL();
c3 c3Var = (c3) h.getValue();
String str2 = hostURL + TapjoyConstants.TJC_USER_ID_URL_PATH;
Map<String, String> baseURLParams = TapjoyConnectCore.getInstance().getBaseURLParams();
c3Var.getClass();
String str3 = c3.a(str2, baseURLParams).c;
boolean z = false;
if (str3 != null && (buildDocument = TapjoyUtil.buildDocument(str3)) != null && (nodeTrimValue = TapjoyUtil.getNodeTrimValue(buildDocument.getElementsByTagName("Success"))) != null && Intrinsics.areEqual(nodeTrimValue, "true")) {
z = true;
}
if (!z) {
equals = StringsKt__StringsJVMKt.equals(hostURL, TapjoyConnectCore.getInstance().getHostURL(), true);
if (!equals) {
setUserIdRequest(str, tJSetUserIDListener);
return;
}
}
if (z) {
TapjoyLog.i("TJUser", "Set userID is successful");
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJUser$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
TJUser.d(TJSetUserIDListener.this);
}
});
} else {
setUserId(null);
TapjoyLog.e("TJUser", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Failed to set userID"));
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TJUser$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
TJUser.e(TJSetUserIDListener.this);
}
});
}
}
public final void setUserTags(Set<String> set) {
CharSequence trim;
HashSet hashSet = new HashSet();
if (set != null) {
Iterator<T> it = set.iterator();
while (it.hasNext()) {
trim = StringsKt__StringsKt.trim((String) it.next());
String obj = trim.toString();
if (obj.length() > 0 && obj.length() <= 200) {
hashSet.add(obj);
hashSet.size();
}
}
}
HashSet hashSet2 = f;
hashSet2.clear();
hashSet2.addAll(hashSet);
a();
}
public final Integer getUserLevelIfNeeded() {
int i = b;
if (i > -1) {
return Integer.valueOf(i);
}
return null;
}
public final TJSegment getUserSegment() {
TJSegment tJSegment = e;
return tJSegment == null ? TJSegment.UNKNOWN : tJSegment;
}
public final void setUserId(String str) {
CharSequence trim;
TJKeyValueStorage tJKeyValueStorage;
if (str == null) {
a = null;
TJKeyValueStorage tJKeyValueStorage2 = g;
if (tJKeyValueStorage2 != null) {
tJKeyValueStorage2.remove("pref_user_id");
return;
}
return;
}
trim = StringsKt__StringsKt.trim(str);
String obj = trim.toString();
a = obj;
if (obj == null || obj.length() == 0 || (tJKeyValueStorage = g) == null) {
return;
}
tJKeyValueStorage.setValue("pref_user_id", a);
}
public final void setUserLevel(int i) {
TJKeyValueStorage tJKeyValueStorage;
b = i;
if (i >= -1 && (tJKeyValueStorage = g) != null) {
tJKeyValueStorage.setValue("pref_user_level", Integer.valueOf(i));
}
}
public final void setUserMaxLevel(int i) {
TJKeyValueStorage tJKeyValueStorage;
c = i;
if (i >= -1 && (tJKeyValueStorage = g) != null) {
tJKeyValueStorage.setValue("pref_max_level", Integer.valueOf(i));
}
}
public final void setUserSegment(TJSegment tJSegment) {
e = tJSegment;
if (tJSegment == null) {
return;
}
if (tJSegment == TJSegment.UNKNOWN) {
TJKeyValueStorage tJKeyValueStorage = g;
if (tJKeyValueStorage != null) {
tJKeyValueStorage.remove("pref_user_segment");
return;
}
return;
}
TJKeyValueStorage tJKeyValueStorage2 = g;
if (tJKeyValueStorage2 != null) {
Intrinsics.checkNotNull(tJSegment);
tJKeyValueStorage2.setValue("pref_user_segment", Integer.valueOf(tJSegment.getValue()));
}
}
public static final void a(TJSetUserIDListener tJSetUserIDListener) {
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure(TJUserKt.USER_ID_MAX_LENGTH_ERROR);
}
if (tJSetUserIDListener != null) {
tJSetUserIDListener.onSetUserIDFailure(-1, TJUserKt.USER_ID_MAX_LENGTH_ERROR);
}
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJUserKt {
public static final String USER_ID_FAILED_ERROR = "userID http request failed";
public static final int USER_ID_MAX_LENGTH = 200;
public static final String USER_ID_MAX_LENGTH_ERROR = "userID cannot exceed 200 characters";
}

View File

@@ -0,0 +1,68 @@
package com.tapjoy;
import com.facebook.internal.security.CertificateUtil;
import com.tapjoy.TapjoyErrorMessage;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public final class TJVerifier {
public static final TJVerifier INSTANCE = new TJVerifier();
public final Map<String, String> getTapjoyAwardCurrencyVerifierAndTimeStampParams(int i) {
LinkedHashMap linkedHashMap = new LinkedHashMap();
long currentTimeMillis = System.currentTimeMillis() / 1000;
String uuid = UUID.randomUUID().toString();
Intrinsics.checkNotNullExpressionValue(uuid, "toString(...)");
TapjoyUtil.safePut(linkedHashMap, "guid", uuid, true);
TapjoyUtil.safePut(linkedHashMap, "timestamp", String.valueOf(currentTimeMillis), true);
TapjoyUtil.safePut(linkedHashMap, TJVerifierKt.TJC_VERIFIER, a(currentTimeMillis, i, uuid), true);
return linkedHashMap;
}
public final String getVerifier(long j) {
String androidID;
try {
String appID = TapjoyConnectCore.getInstance().getAppID();
TJTracking tJTracking = TJTracking.INSTANCE;
if (tJTracking.isAdvertisingIdPresent()) {
androidID = tJTracking.getAdvertisingID();
} else if ((tJTracking.isLegacyIdFallbackAllowed() || !tJTracking.isGooglePlayServiceIntegrated()) && tJTracking.isAndroidIdPresent()) {
androidID = tJTracking.getAndroidID();
} else {
TapjoyLog.e("TJVerifier", "Error -- no valid device identifier");
androidID = null;
}
String SHA256 = TapjoyUtil.SHA256(appID + CertificateUtil.DELIMITER + androidID + CertificateUtil.DELIMITER + j + CertificateUtil.DELIMITER + TapjoyConnectCore.getInstance().b());
Intrinsics.checkNotNullExpressionValue(SHA256, "SHA256(...)");
return SHA256;
} catch (Exception e) {
TapjoyLog.e("TJVerifier", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Error in computing verifier value -- " + e));
return "";
}
}
public static String a(long j, int i, String str) {
String androidID;
try {
String appID = TapjoyConnectCore.getInstance().getAppID();
TJTracking tJTracking = TJTracking.INSTANCE;
if (tJTracking.isAdvertisingIdPresent()) {
androidID = tJTracking.getAdvertisingID();
} else if ((tJTracking.isLegacyIdFallbackAllowed() || !tJTracking.isGooglePlayServiceIntegrated()) && tJTracking.isAndroidIdPresent()) {
androidID = tJTracking.getAndroidID();
} else {
TapjoyLog.e("TJVerifier", "Error -- no valid device identifier");
androidID = null;
}
String SHA256 = TapjoyUtil.SHA256(appID + CertificateUtil.DELIMITER + androidID + CertificateUtil.DELIMITER + j + CertificateUtil.DELIMITER + TapjoyConnectCore.getInstance().b() + CertificateUtil.DELIMITER + i + CertificateUtil.DELIMITER + str);
Intrinsics.checkNotNullExpressionValue(SHA256, "SHA256(...)");
return SHA256;
} catch (Exception e) {
TapjoyLog.e("TJVerifier", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Error in computing awardCurrencyVerifier -- " + e));
return "";
}
}
}

View File

@@ -0,0 +1,7 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class TJVerifierKt {
public static final String TJC_TIMESTAMP = "timestamp";
public static final String TJC_VERIFIER = "verifier";
}

View File

@@ -0,0 +1,41 @@
package com.tapjoy;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.ViewGroup;
import android.webkit.WebView;
import com.tapjoy.internal.m2;
/* loaded from: classes4.dex */
public class TJWebView extends WebView {
@SuppressLint({"SetJavaScriptEnabled"})
public TJWebView(Context context) {
super(context);
setScrollContainer(false);
setVerticalScrollBarEnabled(false);
setHorizontalScrollBarEnabled(false);
new GestureDetector(new m2());
if (getSettings() != null) {
getSettings().setJavaScriptEnabled(true);
getSettings().setDomStorageEnabled(true);
getSettings().setMediaPlaybackRequiresUserGesture(false);
}
setBackgroundColor(0);
}
@Override // android.webkit.WebView
public void destroy() {
removeAllViews();
ViewGroup viewGroup = (ViewGroup) getParent();
if (viewGroup != null) {
viewGroup.removeView(this);
}
super.destroy();
}
public TJWebView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
}

View File

@@ -0,0 +1,292 @@
package com.tapjoy;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
import android.view.View;
import android.webkit.URLUtil;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.drive.DriveFile;
import com.tapjoy.TJAdUnitConstants;
import com.unity3d.ads.adplayer.AndroidWebViewClient;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class TJWebViewActivity extends TJActivity {
public View e;
public TJWebView f;
public TJAdUnitJSBridge g;
public class BridgeDelegate extends TJJSBridgeDelegate {
public BridgeDelegate() {
}
@Override // com.tapjoy.TJJSBridgeDelegate
public boolean dismiss() {
super.dismiss();
TJWebViewActivity.this.finish();
return true;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public boolean fireContentReady() {
super.fireContentReady();
TJWebViewActivity.this.setProgressSpinnerVisibility(false);
return true;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public Context getContext() {
return TJWebViewActivity.this;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public Map<String, Object> getOrientation() {
HashMap hashMap = new HashMap();
TJDeviceUtils tJDeviceUtils = TJDeviceUtils.INSTANCE;
int screenWidth = tJDeviceUtils.getScreenWidth(TJWebViewActivity.this);
int screenHeight = tJDeviceUtils.getScreenHeight(TJWebViewActivity.this);
hashMap.put("orientation", tJDeviceUtils.getOrientationString(screenWidth, screenHeight));
hashMap.put("width", Integer.valueOf(screenWidth));
hashMap.put("height", Integer.valueOf(screenHeight));
return hashMap;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public int getStatusBarHeight() {
Context context = getContext();
if (context == null) {
return 0;
}
return TJDeviceUtils.INSTANCE.getStatusBarHeight(context);
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void getTextZoom(TJTaskHandler<Float> tJTaskHandler) {
TapjoyUtil.runOnMainThread(new h1(this, tJTaskHandler));
}
@Override // com.tapjoy.TJJSBridgeDelegate
public WebView getWebView() {
return TJWebViewActivity.this.f;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void setBackgroundColor(String str, TJTaskHandler<Boolean> tJTaskHandler) {
TapjoyUtil.runOnMainThread(new e1(this, str, tJTaskHandler));
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void setCloseButtonClickable(boolean z) {
super.setCloseButtonClickable(z);
TapjoyUtil.runOnMainThread(new g1(this, z));
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void setCloseButtonVisible(boolean z) {
super.setCloseButtonVisible(z);
TapjoyUtil.runOnMainThread(new f1(this, z));
}
@Override // com.tapjoy.TJJSBridgeDelegate
public boolean setOrientation(int i) {
TJWebViewActivity.this.setRequestedOrientation(i);
return true;
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void setTextZoom(float f) {
TapjoyUtil.runOnMainThread(new i1(this, f));
}
@Override // com.tapjoy.TJJSBridgeDelegate
public void shouldClose(boolean z) {
if (z) {
TJWebViewActivity.this.finish();
}
}
@Override // com.tapjoy.TJJSBridgeDelegate
public boolean unsetOrientation() {
TJWebViewActivity.this.setRequestedOrientation(-1);
return true;
}
}
@Override // android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(@NonNull Configuration configuration) {
super.onConfigurationChanged(configuration);
if (this.g != null) {
TJDeviceUtils tJDeviceUtils = TJDeviceUtils.INSTANCE;
int screenWidth = tJDeviceUtils.getScreenWidth(this);
int screenHeight = tJDeviceUtils.getScreenHeight(this);
this.g.notifyOrientationChanged(tJDeviceUtils.getOrientationString(screenWidth, screenHeight), screenWidth, screenHeight);
}
}
@Override // com.tapjoy.TJActivity, android.app.Activity
public final void onCreate(Bundle bundle) {
String str;
String str2;
boolean z;
Bundle extras;
super.onCreate(bundle);
setRequestedOrientation(TJDeviceUtils.INSTANCE.getScreenOrientation(this));
Intent intent = getIntent();
if (intent == null || (extras = intent.getExtras()) == null) {
str = null;
str2 = null;
z = false;
} else {
String str3 = extras.containsKey("url") ? (String) intent.getExtras().get("url") : null;
z = extras.containsKey(TJAdUnitConstants.String.REUSE_HTML) ? ((Boolean) intent.getExtras().get(TJAdUnitConstants.String.REUSE_HTML)).booleanValue() : false;
str2 = extras.containsKey(TJAdUnitConstants.String.HTML) ? (String) intent.getExtras().get(TJAdUnitConstants.String.HTML) : null;
str = str3;
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
View view = new View(this);
this.e = view;
view.setBackgroundColor(0);
this.a.addView(this.e, -1, -1);
TJWebView tJWebView = new TJWebView(this);
this.f = tJWebView;
tJWebView.setWebViewClient(new j1(this));
this.g = new TJAdUnitJSBridge(new BridgeDelegate());
if (z) {
this.f.loadDataWithBaseURL(str, str2, "text/html", "UTF-8", null);
} else {
this.f.loadUrl(str);
}
this.a.addView(this.f, -1, -1);
this.a.addView(this.d);
this.a.addView(this.c);
setContentView(this.a, layoutParams);
}
@Override // android.app.Activity
public final void onDestroy() {
this.a.removeAllViews();
TJWebView tJWebView = this.f;
if (tJWebView != null) {
tJWebView.loadUrl(AndroidWebViewClient.BLANK_PAGE);
this.f.destroy();
this.f = null;
}
TJAdUnitJSBridge tJAdUnitJSBridge = this.g;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.destroy();
this.g = null;
}
super.onDestroy();
}
@Override // android.app.Activity
public final void onPause() {
super.onPause();
TJWebView tJWebView = this.f;
if (tJWebView != null) {
tJWebView.onPause();
}
TJAdUnitJSBridge tJAdUnitJSBridge = this.g;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.setEnabled(false);
this.g.pause();
}
}
@Override // android.app.Activity
public final void onResume() {
super.onResume();
TJWebView tJWebView = this.f;
if (tJWebView != null) {
tJWebView.onResume();
}
TJAdUnitJSBridge tJAdUnitJSBridge = this.g;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.setEnabled(true);
this.g.resume();
}
}
@Override // android.app.Activity
public final void onStart() {
super.onStart();
}
@Override // android.app.Activity
public final void onStop() {
super.onStop();
}
@Override // com.tapjoy.TJActivity
public final void a() {
TJAdUnitJSBridge tJAdUnitJSBridge = this.g;
if (tJAdUnitJSBridge == null || tJAdUnitJSBridge.closeRequested) {
return;
}
TapjoyLog.d("TJWebViewActivity", TJAdUnitConstants.String.CLOSE_REQUESTED);
this.g.closeRequested(Boolean.FALSE);
new Handler(getMainLooper()).postDelayed(new d1(this), 1000L);
}
public final boolean a(String str) {
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.isAvailable()) {
if (activeNetworkInfo.isConnected() && URLUtil.isValidUrl(str)) {
try {
String host = new URL(TapjoyConnectCore.getInstance().getHostURL()).getHost();
if ((host != null && str.contains(host)) || str.contains(TapjoyConnectCore.getInstance().getRedirectDomain()) || str.contains(TapjoyUtil.getRedirectDomain(TapjoyConnectCore.getInstance().getPlacementURL()))) {
return false;
}
} catch (MalformedURLException unused) {
}
if (this.g.allowRedirect) {
Uri parse = Uri.parse(str);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(parse);
intent.addFlags(DriveFile.MODE_READ_ONLY);
if (this.f.getContext() != null) {
try {
this.f.getContext().startActivity(intent);
return true;
} catch (Exception e) {
TapjoyLog.e("TJWebViewActivity", "Exception in loading URL. " + e.getMessage());
}
}
} else if (str.startsWith("javascript:")) {
try {
this.f.evaluateJavascript(str.replaceFirst("javascript:", ""), null);
return true;
} catch (Exception e2) {
TapjoyLog.e("TJWebViewActivity", "Exception in evaluateJavascript. Device not supported. " + e2.toString());
}
}
return false;
}
}
} catch (Exception e3) {
TapjoyLog.d("TJWebViewActivity", "Exception getting NetworkInfo: " + e3.getLocalizedMessage());
}
showErrorDialog();
return true;
}
@Override // android.app.Activity
public void onCreate(@Nullable Bundle bundle, @Nullable PersistableBundle persistableBundle) {
super.onCreate(bundle, persistableBundle);
}
}

View File

@@ -0,0 +1,107 @@
package com.tapjoy;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import com.tapjoy.TJAdUnitConstants;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TJWebViewJSInterface {
public final ConcurrentLinkedQueue a = new ConcurrentLinkedQueue();
public WebView b;
public final TJWebViewJSInterfaceListener c;
public boolean d;
public TJWebViewJSInterface(WebView webView, TJWebViewJSInterfaceListener tJWebViewJSInterfaceListener) {
this.b = webView;
this.c = tJWebViewJSInterfaceListener;
}
public void callback(ArrayList<?> arrayList, String str, String str2) {
try {
callbackToJavaScript(new JSONArray((Collection) arrayList), str, str2);
} catch (Exception e) {
e.printStackTrace();
}
}
public void callbackToJavaScript(Object obj, String str, String str2) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put(TJAdUnitConstants.String.ARGUMENTS, obj);
if (str != null && str.length() > 0) {
jSONObject.put("method", str);
}
JSONObject jSONObject2 = new JSONObject();
if (str2 != null && str2.length() > 0) {
jSONObject2.put(TJAdUnitConstants.String.CALLBACK_ID, str2);
}
jSONObject2.put("data", jSONObject);
String str3 = "javascript:if(window.AndroidWebViewJavascriptBridge) AndroidWebViewJavascriptBridge._handleMessageFromAndroid('" + jSONObject2 + "');";
if (!this.d) {
this.a.add(str3);
return;
}
WebView webView = this.b;
if (webView != null) {
TapjoyUtil.runOnMainThread(new k1(webView, str3));
} else {
TapjoyLog.w("TJWebViewJSInterface", "No available webview to execute js");
}
} catch (Exception e) {
TapjoyLog.e("TJWebViewJSInterface", "Exception in callback to JS: " + e.toString());
e.printStackTrace();
}
}
@JavascriptInterface
public void dispatchMethod(String str) {
TapjoyLog.d("TJWebViewJSInterface", "dispatchMethod params: " + str);
try {
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getJSONObject("data").getString("method");
TapjoyLog.d("TJWebViewJSInterface", "method: " + string);
TJWebViewJSInterfaceListener tJWebViewJSInterfaceListener = this.c;
if (tJWebViewJSInterfaceListener == null || this.b == null) {
return;
}
tJWebViewJSInterfaceListener.onDispatchMethod(string, jSONObject);
} catch (Exception e) {
e.printStackTrace();
}
}
public void flushMessageQueue() {
if (this.d) {
return;
}
while (true) {
String str = (String) this.a.poll();
if (str == null) {
this.d = true;
return;
} else {
WebView webView = this.b;
if (webView != null) {
TapjoyUtil.runOnMainThread(new k1(webView, str));
}
}
}
}
public void callback(Map<?, ?> map, String str, String str2) {
try {
JSONArray jSONArray = new JSONArray();
jSONArray.put(new JSONObject(map));
callbackToJavaScript(jSONArray, str, str2);
} catch (Exception e) {
TapjoyLog.e("TJWebViewJSInterface", "Exception in callback to JS: " + e.toString());
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public interface TJWebViewJSInterfaceListener {
void onDispatchMethod(String str, JSONObject jSONObject);
}

View File

@@ -0,0 +1,290 @@
package com.tapjoy;
import android.app.Activity;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.text.TextUtils;
import com.tapjoy.internal.n2;
import com.tapjoy.internal.o2;
import com.tapjoy.internal.p2;
import com.tapjoy.internal.r2;
import csdk.gluads.Consts;
import java.util.Hashtable;
import java.util.Set;
/* loaded from: classes4.dex */
public final class Tapjoy {
@Deprecated
public static void actionComplete(String str) {
}
public static void addUserTag(String str) {
p2.a.getClass();
if (TextUtils.isEmpty(str)) {
return;
}
TJUser tJUser = TJUser.INSTANCE;
Set<String> userTags = tJUser.getUserTags();
if (userTags.add(str)) {
tJUser.setUserTags(userTags);
}
}
public static void awardCurrency(int i, TJAwardCurrencyListener tJAwardCurrencyListener) {
r2 r2Var = p2.a;
r2Var.getClass();
if (!m1.a("awardCurrency")) {
if (tJAwardCurrencyListener != null) {
tJAwardCurrencyListener.onAwardCurrencyResponseFailure("Tapjoy SDK is not connected");
}
} else {
TJCurrency tJCurrency = r2Var.b;
if (tJCurrency != null) {
tJCurrency.awardCurrency(i, tJAwardCurrencyListener);
}
}
}
public static void clearUserTags() {
p2.a.getClass();
TJUser.INSTANCE.setUserTags(null);
}
public static boolean connect(Context context, String str) {
r2 r2Var = p2.a;
r2Var.getClass();
r2Var.d = 0;
return r2Var.e.a(context, str, null, null);
}
public static void endSession() {
p2.a.getClass();
if (m1.a("endSession")) {
com.tapjoy.internal.c.a();
TJSession tJSession = TJSession.INSTANCE;
tJSession.setSemiAutoSessionTrackingStarted(false);
tJSession.endSession();
}
}
public static void getCurrencyBalance(TJGetCurrencyBalanceListener tJGetCurrencyBalanceListener) {
r2 r2Var = p2.a;
r2Var.getClass();
if (!m1.a("getCurrencyBalance")) {
if (tJGetCurrencyBalanceListener != null) {
tJGetCurrencyBalanceListener.onGetCurrencyBalanceResponseFailure("Tapjoy SDK is not connected");
}
} else {
TJCurrency tJCurrency = r2Var.b;
if (tJCurrency != null) {
tJCurrency.getCurrencyBalance(tJGetCurrencyBalanceListener);
}
}
}
public static String getCustomParameter() {
p2.a.getClass();
return TapjoyConnectCore.getInstance().getCustomParameter();
}
public static int getMaxLevel() {
p2.a.getClass();
return TJUser.INSTANCE.getUserMaxLevel();
}
public static TJPlacement getPlacement(String str, TJPlacementListener tJPlacementListener) {
TJPlacement tJPlacement;
p2.a.getClass();
synchronized (TJPlacementManager.a) {
tJPlacement = new TJPlacement(TJPlacementManager.a(str, false), tJPlacementListener);
}
return tJPlacement;
}
public static TJPrivacyPolicy getPrivacyPolicy() {
p2.a.getClass();
return TJPrivacyPolicy.getInstance();
}
public static String getSupportURL() {
p2.a.getClass();
if (m1.a("getSupportURL")) {
return TapjoyConnectCore.getInstance().getSupportURL(null);
}
return null;
}
public static String getUserID() {
p2.a.getClass();
return TJUser.INSTANCE.getUserID();
}
public static int getUserLevel() {
p2.a.getClass();
return TJUser.INSTANCE.getUserLevel();
}
public static TJSegment getUserSegment() {
p2.a.getClass();
return TJUser.INSTANCE.getUserSegment();
}
public static Set<String> getUserTags() {
p2.a.getClass();
return TJUser.INSTANCE.getUserTags();
}
public static String getVersion() {
p2.a.getClass();
return "14.1.0";
}
public static boolean isConnected() {
p2.a.getClass();
return TapjoyConnectCore.getInstance().isConnected();
}
public static void loadSharedLibrary() {
try {
System.loadLibrary(Consts.SDK_TAPJOY);
} catch (UnsatisfiedLinkError unused) {
}
}
public static void onActivityStart(Activity activity) {
TapjoyUtil.runOnMainThread(new n2(activity));
}
public static void onActivityStop(Activity activity) {
TapjoyUtil.runOnMainThread(new o2(activity));
}
public static void optOutAdvertisingID(Context context, boolean z) {
p2.a.getClass();
TJTracking.INSTANCE.optOutAdvertisingID(context, z);
}
public static void removeUserTag(String str) {
p2.a.getClass();
if (TextUtils.isEmpty(str)) {
return;
}
TJUser tJUser = TJUser.INSTANCE;
Set<String> userTags = tJUser.getUserTags();
if (userTags.remove(str)) {
tJUser.setUserTags(userTags);
}
}
@Deprecated
public static void setActivity(Activity activity) {
}
public static void setCustomParameter(String str) {
p2.a.getClass();
TapjoyConnectCore.getInstance().setCustomParameter(str);
}
public static void setDebugEnabled(boolean z) {
p2.a.getClass();
TapjoyLog.setDebugEnabled(z);
}
public static void setEarnedCurrencyListener(TJEarnedCurrencyListener tJEarnedCurrencyListener) {
r2 r2Var = p2.a;
if (r2Var.b == null || !m1.a("setEarnedCurrencyListener")) {
return;
}
r2Var.b.setEarnedCurrencyListener(tJEarnedCurrencyListener);
}
@Deprecated
public static void setGLSurfaceView(GLSurfaceView gLSurfaceView) {
}
public static void setMaxLevel(int i) {
p2.a.getClass();
TJUser.INSTANCE.setUserMaxLevel(i);
}
public static void setUserID(String str, TJSetUserIDListener tJSetUserIDListener) {
p2.a.b(str, tJSetUserIDListener);
}
public static void setUserLevel(int i) {
p2.a.getClass();
TJUser.INSTANCE.setUserLevel(i);
}
public static void setUserSegment(TJSegment tJSegment) {
p2.a.getClass();
TJUser.INSTANCE.setUserSegment(tJSegment);
}
public static void setUserTags(Set<String> set) {
p2.a.getClass();
TJUser.INSTANCE.setUserTags(set);
}
public static void spendCurrency(int i, TJSpendCurrencyListener tJSpendCurrencyListener) {
r2 r2Var = p2.a;
r2Var.getClass();
if (!m1.a("spendCurrency")) {
if (tJSpendCurrencyListener != null) {
tJSpendCurrencyListener.onSpendCurrencyResponseFailure("Tapjoy SDK is not connected");
}
} else {
TJCurrency tJCurrency = r2Var.b;
if (tJCurrency != null) {
tJCurrency.spendCurrency(i, tJSpendCurrencyListener);
}
}
}
public static void startSession() {
p2.a.getClass();
if (m1.a("startSession")) {
com.tapjoy.internal.c.a();
TJSession.INSTANCE.initSession();
}
}
@Deprecated
public static void trackPurchase(String str, String str2, String str3, String str4) {
}
public static void trackPurchase(String str, double d) {
p2.a.getClass();
TJPurchases.INSTANCE.trackPurchase(str, Double.valueOf(d));
}
public static boolean connect(Context context, String str, Hashtable<String, ?> hashtable) {
r2 r2Var = p2.a;
r2Var.d = 0;
return r2Var.e.a(context, str, hashtable, null);
}
public static String getSupportURL(String str) {
p2.a.getClass();
if (m1.a("getSupportURL")) {
return TapjoyConnectCore.getInstance().getSupportURL(str);
}
return null;
}
@Deprecated
public static void trackPurchase(String str, String str2, double d, String str3) {
p2.a.getClass();
TJPurchases.INSTANCE.trackPurchase(str2, Double.valueOf(d));
}
public static synchronized boolean connect(Context context, String str, Hashtable<String, ?> hashtable, TJConnectListener tJConnectListener) {
boolean a;
synchronized (Tapjoy.class) {
r2 r2Var = p2.a;
r2Var.d = 0;
a = r2Var.e.a(context, str, hashtable, tJConnectListener);
}
return a;
}
}

View File

@@ -0,0 +1,104 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public class TapjoyAppSettings {
public static final String TAG = "TapjoyAppSettings";
public static TapjoyAppSettings c;
public final SharedPreferences a;
public String b;
public TapjoyAppSettings(Context context) {
SharedPreferences sharedPreferences = context.getSharedPreferences(TapjoyConstants.TJC_PREFERENCE, 0);
this.a = sharedPreferences;
String string = sharedPreferences.getString(TapjoyConstants.PREF_LOG_LEVEL, null);
this.b = string;
if (TextUtils.isEmpty(string)) {
return;
}
TapjoyLog.d(TAG, "restoreLoggingLevel from sharedPref -- loggingLevel=" + this.b);
TapjoyLog.a(this.b, true);
}
public static TapjoyAppSettings getInstance() {
return c;
}
public static void init(Context context) {
TapjoyLog.d(TAG, "initializing app settings");
c = new TapjoyAppSettings(context);
}
public void clearLoggingLevel() {
SharedPreferences.Editor edit = this.a.edit();
edit.remove(TapjoyConstants.PREF_LOG_LEVEL);
edit.apply();
this.b = null;
boolean isLoggingEnabled = TapjoyLog.isLoggingEnabled();
TapjoyLog.i(TAG, "Tapjoy remote device debugging 'Disabled'. The SDK Debug-setting is: ".concat(isLoggingEnabled ? "'Enabled'" : "'Disabled'"));
TapjoyLog.setDebugEnabled(isLoggingEnabled);
}
public String getConnectResult(String str, long j) {
String string = this.a.getString(TapjoyConstants.PREF_LAST_CONNECT_RESULT, null);
if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(str) && str.equals(this.a.getString(TapjoyConstants.PREF_LAST_CONNECT_PARAMS_HASH, null))) {
long j2 = this.a.getLong(TapjoyConstants.PREF_LAST_CONNECT_RESULT_EXPIRES, -1L);
if (j2 < 0 || j2 >= j) {
return string;
}
}
return null;
}
public void removeConnectResult() {
if (this.a.getString(TapjoyConstants.PREF_LAST_CONNECT_PARAMS_HASH, null) != null) {
SharedPreferences.Editor edit = this.a.edit();
edit.remove(TapjoyConstants.PREF_LAST_CONNECT_RESULT);
edit.remove(TapjoyConstants.PREF_LAST_CONNECT_PARAMS_HASH);
edit.remove(TapjoyConstants.PREF_LAST_CONNECT_RESULT_EXPIRES);
TapjoyLog.i(TAG, "Removed connect result");
edit.apply();
}
}
public void saveConnectResultAndParams(String str, String str2, long j) {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
SharedPreferences.Editor edit = this.a.edit();
edit.putString(TapjoyConstants.PREF_LAST_CONNECT_RESULT, str);
edit.putString(TapjoyConstants.PREF_LAST_CONNECT_PARAMS_HASH, str2);
if (j >= 0) {
edit.putLong(TapjoyConstants.PREF_LAST_CONNECT_RESULT_EXPIRES, j);
} else {
edit.remove(TapjoyConstants.PREF_LAST_CONNECT_RESULT_EXPIRES);
}
TapjoyLog.i(TAG, "Stored connect result");
edit.apply();
}
public void saveLoggingLevel(String str) {
if (TextUtils.isEmpty(str)) {
TapjoyLog.d(TAG, "saveLoggingLevel -- server logging level is NULL or Empty string");
return;
}
String str2 = TAG;
TapjoyLog.d(str2, "saveLoggingLevel -- currentLevel=" + this.b + ";newLevel=" + str);
if (TextUtils.isEmpty(this.b) || !this.b.equals(str)) {
SharedPreferences.Editor edit = this.a.edit();
edit.putString(TapjoyConstants.PREF_LOG_LEVEL, str);
edit.apply();
this.b = str;
TapjoyLog.a(str, true);
}
boolean isLoggingEnabled = TapjoyLog.isLoggingEnabled();
StringBuilder sb = new StringBuilder("Tapjoy remote device debugging set to '");
sb.append(str);
sb.append("'. The SDK Debug-setting is: ");
sb.append(isLoggingEnabled ? "'Enabled'" : "'Disabled'");
TapjoyLog.i(str2, sb.toString());
}
}

View File

@@ -0,0 +1,252 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;
import csdk.gluads.Consts;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TapjoyCache {
public static final String CACHE_DIRECTORY_NAME = "Tapjoy/Cache/";
public static final int CACHE_LIMIT = -1;
public static TapjoyCache f = null;
public static boolean unit_test_mode = false;
public final Context a;
public TapjoyCacheMap b;
public final Vector c;
public final ExecutorService d;
public final File e;
public class CacheAssetThread implements Callable<Boolean> {
public final URL a;
public final String b;
public final long c;
public CacheAssetThread(URL url, String str, long j) {
this.a = url;
this.b = str;
this.c = j;
if (j <= 0) {
this.c = 86400L;
}
TapjoyCache.this.c.add(TapjoyCache.a(url.toString()));
}
/* JADX WARN: Can't rename method to resolve collision */
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:75:0x01e8 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:81:? A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:82:0x01e3 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Type inference failed for: r7v10 */
/* JADX WARN: Type inference failed for: r7v11 */
/* JADX WARN: Type inference failed for: r7v19 */
/* JADX WARN: Type inference failed for: r7v20 */
/* JADX WARN: Type inference failed for: r7v21 */
/* JADX WARN: Type inference failed for: r7v22 */
/* JADX WARN: Type inference failed for: r7v23, types: [java.io.BufferedOutputStream, java.io.OutputStream] */
/* JADX WARN: Type inference failed for: r7v6, types: [java.lang.String] */
/* JADX WARN: Type inference failed for: r7v7 */
@Override // java.util.concurrent.Callable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Boolean call() {
/*
Method dump skipped, instructions count: 502
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.TapjoyCache.CacheAssetThread.call():java.lang.Boolean");
}
}
public TapjoyCache(Context context) {
if (f == null || unit_test_mode) {
f = this;
this.a = context;
this.b = new TapjoyCacheMap(context, -1);
this.c = new Vector();
this.d = Executors.newFixedThreadPool(5);
if (Environment.getExternalStorageDirectory() != null) {
TapjoyUtil.deleteFileOrDirectory(new File(Environment.getExternalStorageDirectory(), Consts.SDK_TAPJOY));
TapjoyUtil.deleteFileOrDirectory(new File(Environment.getExternalStorageDirectory(), "tjcache/tmp/"));
}
File file = new File(context.getFilesDir() + "/Tapjoy/Cache/");
this.e = file;
if (!file.exists()) {
if (file.mkdirs()) {
TapjoyLog.d("TapjoyCache", "Created directory at: " + file.getPath());
} else {
TapjoyLog.e("TapjoyCache", "Error initalizing cache");
f = null;
}
}
SharedPreferences sharedPreferences = context.getSharedPreferences(TapjoyConstants.PREF_TAPJOY_CACHE, 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
for (Map.Entry<String, ?> entry : sharedPreferences.getAll().entrySet()) {
File file2 = new File(entry.getKey());
if (file2.exists() && file2.isFile()) {
TapjoyCachedAssetData fromRawJSONString = TapjoyCachedAssetData.fromRawJSONString(entry.getValue().toString());
if (fromRawJSONString != null) {
TapjoyLog.d("TapjoyCache", "Loaded Asset: " + fromRawJSONString.getAssetURL());
String a = a(fromRawJSONString.getAssetURL());
if (a == null || "".equals(a) || a.length() <= 0) {
TapjoyLog.e("TapjoyCache", "Removing asset because deserialization failed.");
edit.remove(entry.getKey()).apply();
} else if (fromRawJSONString.getTimeOfDeathInSeconds() < System.currentTimeMillis() / 1000) {
TapjoyLog.d("TapjoyCache", "Asset expired, removing from cache: " + fromRawJSONString.getAssetURL());
if (fromRawJSONString.getLocalFilePath() != null && fromRawJSONString.getLocalFilePath().length() > 0) {
TapjoyUtil.deleteFileOrDirectory(new File(fromRawJSONString.getLocalFilePath()));
}
} else {
this.b.put(a, fromRawJSONString);
}
} else {
TapjoyLog.e("TapjoyCache", "Removing asset because deserialization failed.");
edit.remove(entry.getKey()).apply();
}
} else {
TapjoyLog.d("TapjoyCache", "Removing reference to missing asset: " + entry.getKey());
edit.remove(entry.getKey()).apply();
}
}
}
}
public static String a(String str) {
if (str.startsWith("//")) {
str = "http:".concat(str);
}
try {
return new URL(str).getFile();
} catch (MalformedURLException unused) {
TapjoyLog.e("TapjoyCache", "Invalid URL " + str);
return "";
}
}
public static TapjoyCache getInstance() {
return f;
}
public static void setInstance(TapjoyCache tapjoyCache) {
f = tapjoyCache;
}
public Future<Boolean> cacheAssetFromJSONObject(JSONObject jSONObject) {
try {
return cacheAssetFromURL(jSONObject.getString("url"), jSONObject.optString(TapjoyConstants.TJC_PLACEMENT_OFFER_ID), jSONObject.optLong(TapjoyConstants.TJC_TIME_TO_LIVE));
} catch (JSONException unused) {
TapjoyLog.e("TapjoyCache", "Required parameters to cache an asset from JSON is not present");
return null;
}
}
public Future<Boolean> cacheAssetFromURL(String str, String str2, long j) {
try {
URL url = new URL(str);
if (!this.c.contains(a(str))) {
return startCachingThread(url, str2, j);
}
TapjoyLog.d("TapjoyCache", "URL is already in the process of being cached: ".concat(str));
return null;
} catch (MalformedURLException unused) {
TapjoyLog.d("TapjoyCache", "Invalid cache assetURL");
return null;
}
}
public void cacheAssetGroup(JSONArray jSONArray, TJCacheListener tJCacheListener) {
if (jSONArray != null && jSONArray.length() > 0) {
new n1(this, jSONArray, tJCacheListener).start();
} else if (tJCacheListener != null) {
tJCacheListener.onCachingComplete(1);
}
}
public String cachedAssetsToJSON() {
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, TapjoyCachedAssetData> entry : this.b.entrySet()) {
try {
jSONObject.put(entry.getKey().toString(), entry.getValue().toRawJSONString());
} catch (JSONException e) {
e.printStackTrace();
}
}
return jSONObject.toString();
}
public void clearTapjoyCache() {
TapjoyLog.d("TapjoyCache", "Cleaning Tapjoy cache!");
TapjoyUtil.deleteFileOrDirectory(this.e);
if (this.e.mkdirs()) {
TapjoyLog.d("TapjoyCache", "Created new cache directory at: " + this.e.getPath());
}
this.b = new TapjoyCacheMap(this.a, -1);
}
public TapjoyCacheMap getCachedData() {
return this.b;
}
public TapjoyCachedAssetData getCachedDataForURL(String str) {
String a = a(str);
if (a != "") {
return this.b.get(a);
}
return null;
}
public String getPathOfCachedURL(String str) {
String a = a(str);
if (a == "" || !this.b.containsKey(a)) {
return str;
}
TapjoyCachedAssetData tapjoyCachedAssetData = this.b.get(a);
if (new File(tapjoyCachedAssetData.getLocalFilePath()).exists()) {
return tapjoyCachedAssetData.getLocalURL();
}
getInstance().removeAssetFromCache(str);
return str;
}
public boolean isURLCached(String str) {
return this.b.get(a(str)) != null;
}
public void printCacheInformation() {
TapjoyLog.d("TapjoyCache", "------------- Cache Data -------------");
TapjoyLog.d("TapjoyCache", "Number of files in cache: " + this.b.size());
TapjoyLog.d("TapjoyCache", "Cache Size: " + TapjoyUtil.fileOrDirectorySize(this.e));
TapjoyLog.d("TapjoyCache", "--------------------------------------");
}
public boolean removeAssetFromCache(String str) {
String a = a(str);
return (a == "" || this.b.remove((Object) a) == null) ? false : true;
}
public Future<Boolean> startCachingThread(URL url, String str, long j) {
if (url != null) {
return this.d.submit(new CacheAssetThread(url, str, j));
}
return null;
}
public boolean isURLDownloading(String str) {
String a;
return (this.c == null || (a = a(str)) == "" || !this.c.contains(a)) ? false : true;
}
}

View File

@@ -0,0 +1,73 @@
package com.tapjoy;
import android.content.Context;
import android.content.SharedPreferences;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/* loaded from: classes4.dex */
public class TapjoyCacheMap extends ConcurrentHashMap<String, TapjoyCachedAssetData> {
public final Context a;
public final int b;
public TapjoyCacheMap(Context context, int i) {
this.a = context;
this.b = i;
}
@Override // java.util.concurrent.ConcurrentHashMap, java.util.AbstractMap, java.util.Map
public void clear() {
throw new UnsupportedOperationException();
}
@Override // java.util.concurrent.ConcurrentHashMap, java.util.AbstractMap, java.util.Map
public TapjoyCachedAssetData put(String str, TapjoyCachedAssetData tapjoyCachedAssetData) {
TapjoyLog.d("TapjoyCacheMap", "TapjoyCacheMap::put() -- key: " + str + " assetURL: " + tapjoyCachedAssetData.getAssetURL());
if (tapjoyCachedAssetData.getTimeOfDeathInSeconds() <= System.currentTimeMillis() / 1000) {
return null;
}
if (size() == this.b) {
long j = -1;
String str2 = "";
for (Map.Entry<String, TapjoyCachedAssetData> entry : entrySet()) {
long timestampInSeconds = entry.getValue().getTimestampInSeconds();
if (j == 0 || timestampInSeconds < j) {
str2 = entry.getKey();
j = timestampInSeconds;
}
}
remove((Object) str2);
}
SharedPreferences.Editor edit = this.a.getSharedPreferences(TapjoyConstants.PREF_TAPJOY_CACHE, 0).edit();
edit.putString(tapjoyCachedAssetData.getLocalFilePath(), tapjoyCachedAssetData.toRawJSONString());
edit.apply();
return (TapjoyCachedAssetData) super.put((TapjoyCacheMap) str, (String) tapjoyCachedAssetData);
}
@Override // java.util.concurrent.ConcurrentHashMap, java.util.AbstractMap, java.util.Map
public TapjoyCachedAssetData remove(Object obj) {
if (!containsKey(obj)) {
return null;
}
SharedPreferences.Editor edit = this.a.getSharedPreferences(TapjoyConstants.PREF_TAPJOY_CACHE, 0).edit();
edit.remove(get(obj).getLocalFilePath());
edit.apply();
String localFilePath = get(obj).getLocalFilePath();
if (localFilePath != null && localFilePath.length() > 0) {
TapjoyUtil.deleteFileOrDirectory(new File(localFilePath));
}
TapjoyLog.d("TapjoyCacheMap", "TapjoyCacheMap::remove() -- key: " + obj);
return (TapjoyCachedAssetData) super.remove(obj);
}
@Override // java.util.concurrent.ConcurrentHashMap, java.util.Map, java.util.concurrent.ConcurrentMap
public boolean replace(String str, TapjoyCachedAssetData tapjoyCachedAssetData, TapjoyCachedAssetData tapjoyCachedAssetData2) {
throw new UnsupportedOperationException();
}
@Override // java.util.concurrent.ConcurrentHashMap, java.util.Map, java.util.concurrent.ConcurrentMap
public TapjoyCachedAssetData replace(String str, TapjoyCachedAssetData tapjoyCachedAssetData) {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,127 @@
package com.tapjoy;
import com.vungle.ads.internal.model.AdPayload;
import java.io.Serializable;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class TapjoyCachedAssetData implements Serializable {
public final long a;
public long b;
public String c;
public String d;
public String e;
public long f;
public String g;
public String h;
public TapjoyCachedAssetData(String str, String str2, long j) {
this(str, str2, j, System.currentTimeMillis() / 1000);
}
public static TapjoyCachedAssetData fromJSONObject(JSONObject jSONObject) {
TapjoyCachedAssetData tapjoyCachedAssetData;
try {
tapjoyCachedAssetData = new TapjoyCachedAssetData(jSONObject.getString("assetURL"), jSONObject.getString("localFilePath"), jSONObject.getLong(TapjoyConstants.TJC_TIME_TO_LIVE), jSONObject.getLong("timestamp"));
} catch (JSONException unused) {
tapjoyCachedAssetData = null;
}
try {
tapjoyCachedAssetData.setOfferID(jSONObject.optString("offerID"));
} catch (JSONException unused2) {
TapjoyLog.i("TapjoyCachedAssetData", "Can not build TapjoyVideoObject -- not enough data.");
return tapjoyCachedAssetData;
}
return tapjoyCachedAssetData;
}
public static TapjoyCachedAssetData fromRawJSONString(String str) {
try {
return fromJSONObject(new JSONObject(str));
} catch (JSONException unused) {
TapjoyLog.i("TapjoyCachedAssetData", "Can not build TapjoyVideoObject -- error reading json string");
return null;
}
}
public String getAssetURL() {
return this.c;
}
public String getLocalFilePath() {
return this.d;
}
public String getLocalURL() {
return this.e;
}
public String getMimeType() {
return this.g;
}
public String getOfferId() {
return this.h;
}
public long getTimeOfDeathInSeconds() {
return this.f;
}
public long getTimeToLiveInSeconds() {
return this.b;
}
public long getTimestampInSeconds() {
return this.a;
}
public void setOfferID(String str) {
this.h = str;
}
public JSONObject toJSON() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("timestamp", getTimestampInSeconds());
jSONObject.put(TapjoyConstants.TJC_TIME_TO_LIVE, getTimeToLiveInSeconds());
jSONObject.put("assetURL", getAssetURL());
jSONObject.put("localFilePath", getLocalFilePath());
jSONObject.put("offerID", getOfferId());
} catch (JSONException unused) {
}
return jSONObject;
}
public String toRawJSONString() {
return toJSON().toString();
}
public String toString() {
return "\nURL=" + this.e + "\nAssetURL=" + this.c + "\nMimeType=" + this.g + "\nTimestamp=" + getTimestampInSeconds() + "\nTimeOfDeath=" + this.f + "\nTimeToLive=" + this.b + "\n";
}
public TapjoyCachedAssetData(String str, String str2, long j, long j2) {
setAssetURL(str);
setLocalFilePath(str2);
this.b = j;
this.a = j2;
this.f = j2 + j;
}
public void resetTimeToLive(long j) {
this.b = j;
this.f = (System.currentTimeMillis() / 1000) + j;
}
public void setAssetURL(String str) {
this.c = str;
this.g = TapjoyUtil.determineMimeType(str);
}
public void setLocalFilePath(String str) {
this.d = str;
this.e = AdPayload.FILE_SCHEME + str;
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyConfig {
public static final String TJC_CONNECT_SERVICE_URL = "https://connect.tapjoy.com/";
public static final String TJC_PLACEMENT_SERVICE_URL = "https://placements.tapjoy.com/";
public static final String TJC_SERVICE_URL = "https://ws.tapjoyads.com/";
}

View File

@@ -0,0 +1,432 @@
package com.tapjoy;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import com.facebook.gamingservices.cloudgaming.internal.SDKAnalyticsEvents;
import com.ironsource.ad;
import com.ironsource.v8;
import com.tapjoy.TapjoyErrorMessage;
import com.tapjoy.internal.a2;
import com.tapjoy.internal.b2;
import com.tapjoy.internal.c2;
import com.tapjoy.internal.e2;
import com.tapjoy.internal.f2;
import com.tapjoy.internal.h2;
import com.tapjoy.internal.p1;
import com.tapjoy.internal.s2;
import com.tapjoy.internal.t1;
import com.tapjoy.internal.u1;
import com.tapjoy.internal.w1;
import com.tapjoy.internal.z1;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes4.dex */
public class TapjoyConnectCore {
public static TapjoyConnectCore l;
public PackageManager h;
public Context a = null;
public TJConnectListener b = null;
public boolean c = false;
public String d = "";
public String e = "";
public String f = "";
public String g = "";
public Hashtable i = TapjoyConnectFlag.CONNECT_FLAG_DEFAULTS;
public final ConcurrentLinkedQueue j = new ConcurrentLinkedQueue();
public final ExecutorService k = Executors.newSingleThreadExecutor();
public void addConnectFlag(String str, String str2) {
if ((str.equals(TapjoyConnectFlag.SERVICE_URL) || str.equals(TapjoyConnectFlag.PLACEMENT_URL)) && !str2.endsWith("/")) {
str2 = str2.concat("/");
}
this.i.put(str, str2);
}
public final String b() {
return this.f;
}
public final void b(final int i, final String str) {
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TapjoyConnectCore$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TapjoyConnectCore.this.a(i, str);
}
});
}
public final /* synthetic */ void c() {
new w1().a(this.b);
}
public final /* synthetic */ void d() {
new TJAppSetId().fetch(this.a, new TJTaskHandler() { // from class: com.tapjoy.TapjoyConnectCore$$ExternalSyntheticLambda4
@Override // com.tapjoy.TJTaskHandler
public final void onComplete(Object obj) {
TapjoyConnectCore.this.a((String) obj);
}
});
}
public final /* synthetic */ void e() {
TJTracking.INSTANCE.fetchAdvertisingID(this.a);
}
public String getAppID() {
return this.d;
}
public Map<String, String> getBaseURLParams() {
t1 t1Var = new t1();
HashMap params = new HashMap();
e2 e2Var = t1Var.f;
e2Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
Boolean bool = e2Var.a;
String str = "0";
TapjoyUtil.safePut(params, TapjoyConstants.PREF_BELOW_CONSENT_AGE, bool != null ? bool.booleanValue() ? "1" : "0" : null, true);
Boolean bool2 = e2Var.b;
if (bool2 == null) {
str = null;
} else if (bool2.booleanValue()) {
str = "1";
}
TapjoyUtil.safePut(params, TapjoyConstants.PREF_SUBJECT_TO_GDPR, str, true);
TapjoyUtil.safePut(params, TapjoyConstants.PREF_USER_CONSENT, e2Var.c, true);
TapjoyUtil.safePut(params, TapjoyConstants.PREF_US_PRIVACY, e2Var.d, true);
t1Var.g.a(params);
f2 f2Var = t1Var.c;
if (f2Var != null) {
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, TJVerifierKt.TJC_VERIFIER, f2Var.a, true);
Boolean bool3 = f2Var.b;
TapjoyUtil.safePut(params, "debug", bool3 != null ? bool3.toString() : null, true);
TapjoyUtil.safePut(params, "test_id", f2Var.f, true);
TapjoyUtil.safePut(params, "install_id", f2Var.g, true);
TapjoyUtil.safePut(params, ad.E, f2Var.e, true);
TapjoyUtil.safePut(params, "sdk_type", f2Var.c, true);
TapjoyUtil.safePut(params, "library_version", f2Var.h, true);
TapjoyUtil.safePut(params, "library_revision", f2Var.i, true);
TapjoyUtil.safePut(params, "bridge_version", f2Var.j, true);
TapjoyUtil.safePut(params, "installed", f2Var.d);
h2 h2Var = f2Var.k;
h2Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, SDKAnalyticsEvents.PARAMETER_SESSION_ID, h2Var.a, true);
TapjoyUtil.safePut(params, "fq7", h2Var.g);
TapjoyUtil.safePut(params, "fq30", h2Var.h);
TapjoyUtil.safePut(params, "session_total_count", h2Var.d);
TapjoyUtil.safePut(params, "session_total_length", h2Var.e);
TapjoyUtil.safePut(params, "session_last_at", h2Var.c);
TapjoyUtil.safePut(params, "session_last_length", h2Var.b);
TapjoyUtil.safePut(params, "session_duration", h2Var.f);
}
p1 p1Var = t1Var.d;
p1Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "app_id", p1Var.a, true);
TapjoyUtil.safePut(params, "app_version", p1Var.d, true);
TapjoyUtil.safePut(params, "app_group_id", p1Var.h, true);
TapjoyUtil.safePut(params, "pkg_ver", p1Var.f, true);
TapjoyUtil.safePut(params, "pkg_rev", p1Var.g, true);
TapjoyUtil.safePut(params, "pkg_id", p1Var.e, true);
c2 c2Var = p1Var.i;
c2Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "cp", c2Var.a, true);
z1 z1Var = t1Var.e;
z1Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "managed_device_id", z1Var.a, true);
TapjoyUtil.safePut(params, "device_name", z1Var.e, true);
TapjoyUtil.safePut(params, "device_type", z1Var.b, true);
TapjoyUtil.safePut(params, "connection_type", z1Var.c, true);
TapjoyUtil.safePut(params, "connection_subtype", z1Var.d, true);
TapjoyUtil.safePut(params, "volume", z1Var.f);
TapjoyUtil.safePut(params, "brightness", z1Var.h);
TapjoyUtil.safePut(params, "battery", z1Var.g);
TapjoyUtil.safePut(params, "display_w", z1Var.i);
TapjoyUtil.safePut(params, "display_h", z1Var.j);
TapjoyUtil.safePut(params, "display_d", z1Var.k);
TapjoyUtil.safePut(params, "screen_density", z1Var.k);
a2 a2Var = z1Var.l;
a2Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "country_code", a2Var.a, true);
b2 b2Var = z1Var.n;
b2Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "advertising_id", b2Var.e, true);
TapjoyUtil.safePut(params, "platform", b2Var.f, true);
TapjoyUtil.safePut(params, "os_version", b2Var.g, true);
TapjoyUtil.safePut(params, "language_code", b2Var.a, true);
TapjoyUtil.safePut(params, "theme", b2Var.i, true);
TapjoyUtil.safePut(params, "timezone", b2Var.h, true);
TapjoyUtil.safePut(params, v8.h.U, b2Var.b, true);
TapjoyUtil.safePut(params, "store_view", String.valueOf(b2Var.c), true);
TapjoyUtil.safePut(params, "ad_tracking_enabled", String.valueOf(b2Var.d), true);
com.tapjoy.internal.o1 o1Var = b2Var.j;
o1Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "android_id", o1Var.d, true);
TapjoyUtil.safePut(params, "device_manufacturer", o1Var.e, true);
TapjoyUtil.safePut(params, "installer", o1Var.b, true);
TapjoyUtil.safePut(params, "ad_id_check_disabled", String.valueOf(o1Var.i), true);
TapjoyUtil.safePut(params, "legacy_id_fallback_allowed", String.valueOf(o1Var.j), true);
TapjoyUtil.safePut(params, "packaged_gps_version", o1Var.g, true);
TapjoyUtil.safePut(params, "device_gps_version", o1Var.f, true);
TapjoyUtil.safePut(params, "optout_adid", String.valueOf(o1Var.h), true);
TapjoyUtil.safePut(params, "app_set_id", o1Var.c, true);
TapjoyUtil.safePut(params, "pkg_sign", o1Var.k, true);
TapjoyUtil.safePut(params, "screen_layout_size", o1Var.a);
TapjoyUtil.safePut(params, "avail_disk", o1Var.l);
TapjoyUtil.safePut(params, "total_disk", o1Var.m);
u1 u1Var = z1Var.m;
u1Var.getClass();
Intrinsics.checkNotNullParameter(params, "params");
TapjoyUtil.safePut(params, "carrier_name", u1Var.a, true);
TapjoyUtil.safePut(params, "carrier_country_code", u1Var.c, true);
TapjoyUtil.safePut(params, "mobile_network_code", u1Var.e, true);
TapjoyUtil.safePut(params, "mobile_country_code", u1Var.d, true);
TapjoyUtil.safePut(params, "country_sim", u1Var.f, true);
TapjoyUtil.safePut(params, "timestamp", Long.valueOf(t1Var.b));
return params;
}
public String getConnectURL() {
return TapjoyConfig.TJC_CONNECT_SERVICE_URL;
}
public Context getContext() {
return this.a;
}
public String getCustomParameter() {
return this.e;
}
public String getHostURL() {
return getConnectFlagValue(TapjoyConnectFlag.SERVICE_URL);
}
public String getPlacementURL() {
return getConnectFlagValue(TapjoyConnectFlag.PLACEMENT_URL);
}
public String getRedirectDomain() {
return this.g;
}
public boolean isConnected() {
return this.c;
}
public boolean isViewOpen() {
TapjoyLog.d("TapjoyConnect", "isViewOpen: " + this.j.size());
return !this.j.isEmpty();
}
public void requestTapjoyConnect(Context context, String str, Hashtable<String, ?> hashtable, TJConnectListener tJConnectListener) {
try {
com.tapjoy.internal.f fVar = new com.tapjoy.internal.f(str);
if (fVar.c != 1) {
throw new IllegalArgumentException("The given API key was not for Android.");
}
this.d = fVar.d;
this.f = fVar.e;
if (hashtable != null) {
this.i.putAll(hashtable);
com.tapjoy.internal.a1 a1Var = s2.c.a;
a1Var.getClass();
HashMap hashMap = new HashMap();
for (Map.Entry<String, ?> entry : hashtable.entrySet()) {
String str2 = (String) com.tapjoy.internal.a1.f.get(entry.getKey());
if (str2 == null) {
str2 = entry.getKey();
}
a1Var.c.a.remove(str2);
hashMap.put(str2, entry.getValue());
}
a1Var.d.a = hashMap;
a1Var.setChanged();
}
com.tapjoy.internal.s sVar = com.tapjoy.internal.s.b;
synchronized (sVar) {
if (sVar.a == null) {
Context applicationContext = context.getApplicationContext();
sVar.a = applicationContext;
s2.c.a(applicationContext);
com.tapjoy.internal.u.a(applicationContext);
}
}
this.b = tJConnectListener;
try {
a(context);
a();
} catch (TapjoyIntegrationException e) {
TapjoyLog.e("TapjoyConnect", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, e.getMessage()));
b(1, e.getMessage());
com.tapjoy.internal.y.b.notifyObservers(Boolean.FALSE);
} catch (TapjoyException e2) {
TapjoyLog.e("TapjoyConnect", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, e2.getMessage()));
b(2, e2.getMessage());
com.tapjoy.internal.y.b.notifyObservers(Boolean.FALSE);
}
} catch (IllegalArgumentException e3) {
throw new TapjoyIntegrationException(e3.getMessage());
}
}
public void setConnected(boolean z) {
this.c = z;
}
public void setCustomParameter(String str) {
this.e = str;
}
public void viewDidClose(String str) {
TapjoyLog.d("TapjoyConnect", "viewDidClose: " + str);
this.j.remove(str);
com.tapjoy.internal.y.c.notifyObservers();
}
public void viewWillOpen(String str) {
TapjoyLog.d("TapjoyConnect", "viewWillOpen: " + str);
this.j.offer(str);
}
public static TapjoyConnectCore getInstance() {
if (l == null) {
l = new TapjoyConnectCore();
}
return l;
}
public final /* synthetic */ void a(int i, String str) {
TJConnectListener tJConnectListener = this.b;
if (tJConnectListener != null) {
tJConnectListener.onConnectFailure(i, str);
}
}
public final void a() {
this.k.execute(new Runnable() { // from class: com.tapjoy.TapjoyConnectCore$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
TapjoyConnectCore.this.d();
}
});
}
public String getConnectFlagValue(String str) {
Hashtable hashtable = this.i;
return (hashtable == null || hashtable.get(str) == null) ? "" : this.i.get(str).toString();
}
public String getSupportURL(String str) {
if (str == null) {
str = this.d;
}
return getHostURL() + "support_requests/new?currency_id=" + str + "&app_id=" + this.d + "&udid=" + TJAppInfo.INSTANCE.getManagedDeviceID() + "&language_code=" + Locale.getDefault().getLanguage();
}
public void release() {
l = null;
TapjoyLog.d("TapjoyConnect", "Releasing core static instance.");
}
public final /* synthetic */ void a(String str) {
TJTracking.INSTANCE.setAppSetID(str);
this.k.execute(new Runnable() { // from class: com.tapjoy.TapjoyConnectCore$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
TapjoyConnectCore.this.c();
}
});
}
public final void a(Context context) {
this.a = context;
this.h = context.getPackageManager();
TJUser.INSTANCE.setContext(context);
TJSession.INSTANCE.setContext(context);
TJPurchases.INSTANCE.setContext(context);
TJTracking.INSTANCE.setContext(context);
TJDeviceNetwork.INSTANCE.setContext(context);
TJAppInfo.INSTANCE.setContext(context);
TJStore.INSTANCE.setContext(context);
TJPrivacyPolicy.getInstance().a(context);
s2.c.a(context);
this.k.submit(new Runnable() { // from class: com.tapjoy.TapjoyConnectCore$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
TapjoyConnectCore.this.e();
}
});
if (this.i == null) {
this.i = new Hashtable();
}
try {
PackageManager packageManager = this.h;
if (packageManager != null) {
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(this.a.getPackageName(), 128);
if (applicationInfo != null && applicationInfo.metaData != null) {
for (String str : TapjoyConnectFlag.FLAG_ARRAY) {
String string = applicationInfo.metaData.getString("tapjoy." + str);
if (string != null) {
TapjoyLog.d("TapjoyConnect", "Found manifest flag: " + str + ", " + string);
addConnectFlag(str, string);
}
}
TapjoyLog.d("TapjoyConnect", "Metadata successfully loaded");
} else {
TapjoyLog.d("TapjoyConnect", "No metadata present.");
}
}
} catch (Exception e) {
TapjoyLog.e("TapjoyConnect", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Error reading manifest meta-data -- " + e.toString()));
}
int identifier = this.a.getResources().getIdentifier("raw/tapjoy_config", null, this.a.getPackageName());
if (identifier != 0) {
try {
Properties properties = new Properties();
properties.load(this.a.getResources().openRawResource(identifier));
Enumeration keys = properties.keys();
while (keys.hasMoreElements()) {
try {
String str2 = (String) keys.nextElement();
addConnectFlag(str2, (String) properties.get(str2));
} catch (ClassCastException unused) {
TapjoyLog.e("TapjoyConnect", "Error parsing configuration properties in tapjoy_config.txt");
}
}
} catch (Exception unused2) {
}
}
TJIntegrationCheck.INSTANCE.integrationCheck(this.a);
this.g = TapjoyUtil.getRedirectDomain(getConnectFlagValue(TapjoyConnectFlag.SERVICE_URL));
if (this.i != null) {
TapjoyLog.i("TapjoyConnect", "Connect Flags:");
TapjoyLog.i("TapjoyConnect", "--------------------");
for (Map.Entry entry : this.i.entrySet()) {
TapjoyLog.i("TapjoyConnect", "key: " + ((String) entry.getKey()) + ", value: " + Uri.encode(entry.getValue().toString()));
}
TapjoyLog.i("TapjoyConnect", "hostURL: [" + getConnectFlagValue(TapjoyConnectFlag.SERVICE_URL) + v8.i.e);
TapjoyLog.i("TapjoyConnect", "redirectDomain: [" + this.g + v8.i.e);
TapjoyLog.i("TapjoyConnect", "--------------------");
}
new TapjoyCache(context);
}
}

View File

@@ -0,0 +1,21 @@
package com.tapjoy;
import com.tapjoy.internal.a3;
import java.util.Hashtable;
/* loaded from: classes4.dex */
public class TapjoyConnectFlag {
public static final String DISABLE_ADVERTISING_ID = "TJC_OPTION_DISABLE_ADVERTISING_ID";
public static final String DISABLE_AUTOMATIC_SESSION_TRACKING = "TJC_OPTION_DISABLE_AUTOMATIC_SESSION_TRACKING";
@Deprecated
public static final String DISABLE_PERSISTENT_IDS = "TJC_OPTION_DISABLE_PERSISTENT_IDS";
public static final String USER_ID = "TJC_OPTION_USER_ID";
public static final String ENABLE_LOGGING = "TJC_OPTION_ENABLE_LOGGING";
public static final String SERVICE_URL = "TJC_OPTION_SERVICE_URL";
public static final String PLACEMENT_URL = "TJC_OPTION_PLACEMENT_SERVICE_URL";
public static final String DISABLE_ADVERTISING_ID_CHECK = "TJC_OPTION_DISABLE_ADVERTISING_ID_CHECK";
public static final String ALLOW_LEGACY_ID_FALLBACK = "TJC_OPTION_ALLOW_LEGACY_ID_FALLBACK";
public static final String[] FLAG_ARRAY = {USER_ID, ENABLE_LOGGING, SERVICE_URL, PLACEMENT_URL, DISABLE_ADVERTISING_ID_CHECK, ALLOW_LEGACY_ID_FALLBACK};
public static final Hashtable<String, Object> CONNECT_FLAG_DEFAULTS = new a3();
}

View File

@@ -0,0 +1,58 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyConstants {
public static final String LOG_LEVEL_DEBUG_OFF = "debug_off";
public static final String LOG_LEVEL_DEBUG_ON = "debug_on";
public static final String LOG_LEVEL_INTERNAL = "internal";
public static final int PLACEMENT_PRELOAD_STATUS_COMPLETE = 1;
public static final int PLACEMENT_PRELOAD_STATUS_PARTIAL = 2;
public static final String PREF_BELOW_CONSENT_AGE = "below_consent_age";
public static final String PREF_CURRENCY_SELF_MANAGED = "self_managed";
public static final String PREF_INSTALL_ID = "tapjoyInstallId";
public static final String PREF_LAST_CONNECT_PARAMS_HASH = "connectParamsHash";
public static final String PREF_LAST_CONNECT_RESULT = "connectResult";
public static final String PREF_LAST_CONNECT_RESULT_EXPIRES = "connectResultExpires";
public static final String PREF_LOG_LEVEL = "tapjoyLogLevel";
public static final String PREF_OPTOUT_ADVERTISING_ID = "optout_advertising_id";
public static final String PREF_SERVER_CURRENCY_BALANCE = "last_currency_balance";
public static final String PREF_SERVER_CURRENCY_IDS = "server_currency_ids";
public static final String PREF_SERVER_CURRENCY_SELF_MANAGED = "self_managed";
public static final String PREF_SERVER_CURRENCY_TYPE = "currency_type";
public static final String PREF_SERVER_PROVIDED_CONFIGURATIONS = "configurations";
public static final String PREF_SUBJECT_TO_GDPR = "gdpr";
public static final String PREF_TAPJOY_CACHE = "tapjoyCacheData";
public static final String PREF_TEST_ID = "tapjoyTestId";
public static final String PREF_USER_CONSENT = "cgdpr";
public static final String PREF_US_PRIVACY = "us_privacy";
public static final String TAPJOY_CACHE_HEADER = "x-tapjoy-cacheable-assets";
public static final String TAPJOY_DEBUG_HEADER = "X-Tapjoy-Debug";
public static final String TAPJOY_DISABLE_PRELOAD_HEADER = "X-Tapjoy-Disable-Preload";
public static final String TAPJOY_HANDLE_DISMISS_ON_PAUSE_HEADER = "x-tapjoy-handle-dismiss-on-pause";
public static final String TAPJOY_PRERENDER_HEADER = "x-tapjoy-prerender";
public static final String TJC_AWARD_CURRENCY_URL_PATH = "points/award?";
public static final String TJC_BRIDGE_VERSION_NUMBER = "1.2.1";
public static final String TJC_CURRENCY = "tap_points";
public static final String TJC_CURRENCY_AMOUNT_REQUIRED = "currency_amount_required";
public static final String TJC_CURRENCY_BALANCE = "currency_balance";
public static final String TJC_CURRENCY_ID = "currency_id";
public static final String TJC_CURRENCY_ID_BALANCE = "currency_id_balance";
public static final String TJC_CURRENCY_ID_REQUIRED = "currency_id_required";
public static final String TJC_DEVICE_PLATFORM_TYPE = "android";
public static final String TJC_GET_CURRENCY_BALANCE_URL_PATH = "get_vg_store_items/user_account?";
public static final String TJC_LIBRARY_VERSION_NUMBER = "14.1.0";
public static final String TJC_PLACEMENT_CONTENT_PATH = "content?";
public static final String TJC_PLACEMENT_OFFER_ID = "offerId";
public static final String TJC_PLACEMENT_SERVICE_PATH = "v1/apps";
public static final String TJC_PLUGIN_NATIVE = "native";
public static final String TJC_PLUGIN_UNITY = "unity";
public static final String TJC_PREFERENCE = "tjcPrefrences";
public static final String TJC_REDIRECT_URL = "redirect_url";
public static final String TJC_RETRY = "retry";
public static final String TJC_SPEND_CURRENCY_URL_PATH = "points/spend?";
public static final String TJC_THEME_DARK = "dark";
public static final String TJC_THEME_LIGHT = "light";
public static final String TJC_TIME_TO_LIVE = "timeToLive";
public static final String TJC_USER_ID_URL_PATH = "set_publisher_user_id?";
public static final String TJC_VERSION = "14.1.0";
}

View File

@@ -0,0 +1,41 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyErrorMessage {
public static final String API_NOT_AVAILABLE_ERROR = "The interface is no longer operational.";
public static final String ASSET_ERROR = "asset error";
public static final String DEVICE_OS_NOT_SUPPORTED = "Device OS version not supported";
public static final String NETWORK_ERROR = "network error";
public static final int TJC_ERROR_INTEGRATION = 1;
public static final int TJC_ERROR_SDK = 2;
public static final int TJC_ERROR_SERVER = 3;
public final ErrorType a;
public final String b;
public enum ErrorType {
INTERNAL_ERROR,
SDK_ERROR,
SERVER_ERROR,
INTEGRATION_ERROR,
NETWORK_ERROR;
ErrorType() {
}
}
public TapjoyErrorMessage(ErrorType errorType, String str) {
this.a = errorType;
this.b = str;
}
public ErrorType getType() {
return this.a;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Type=" + this.a.toString());
sb.append(";Message=" + this.b);
return sb.toString();
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyException extends Exception {
public TapjoyException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,68 @@
package com.tapjoy;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;
/* loaded from: classes4.dex */
public class TapjoyIcons {
public static final String BACK_DISABLED_1X = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAANCAYAAACUwi84AAAAAXNSR0IArs4c6QAAANVJREFUGBljZMACDh8+LPjjx49NQKkTLOjyR48eFfv+/fsuoLg+IyPjW0ZkBfv375f5+/fvnv///6sDxVcJCgrGwBXs3btXGSgBklQA6pzn7OycCqT/MYFM2Ldvn/a/f/8OQyUnASVTQJIgOSagpDFQ8iCQLcnExNTi4uKSD5T8D5IEASag5EqgTmEgexdQZy1YFIkAamIKB+p4CxRzA7qjGUkOzAQ7EuQGoOt3A0UkgYonAk0qhFlD0BdwBSDz8IYD2EIgAQtJoMNBIbkRxQSYIuS4AACDB3ZwBMHYpwAAAABJRU5ErkJggg==";
public static final String BACK_DISABLED_2X = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAaCAYAAAC+aNwHAAAAAXNSR0IArs4c6QAAAgBJREFUOBGVVT1MwlAQpj/BGGaYWZjZHUgoJSZqZNCY4OAmuoruEGfUUYOTDhqNKGHlbyNxMp00YWKlk4ODSWn9rtLn65Py00Tf9Xv3fe/u3l2RQgs+7XZ7xXGcO9DqmUymKC3Cb7VaOsh1cCLEkySpqswr0Ol0Nm3bfoH/sseBgCp7L9NWhJ0HuQafJc7vAwLrM1MAeR/kKxDZYSC+hcPh1VQqZTKQU2Ymci6CXBXIPUVRNCKTo8q8BQMnl0Aui3A0Gs0lk8kvD5+YAk6uoNrHntN4bcTj8Z1EIvHN474IQJJx8iXWAu8E+15V1T2QLQEPsQi63a5qWdYNHHYFp2td1w9ROFvA3Ve3iP1+f2k0Gj2JZFmWL7LZbCGITAqSYRgR0zTrCFt3Jcf/QDrFySUem2Srw+HwGRsi+QTks0kEEaMUHBFc5F2OxWJbCLfFk5BOpdlslnksyHZvgYo4GAweQMzxjlREGlkeE233Fqg50J7b2KQ5Zw868QiRVCEc2PKsD4hFjtMaKZ1O/2sknzLdN6p/gPWchfFr5NFkNUpVwP86UdwIGiYUffYweWI0zkjL1w+IrgdsDR36SX6+GnhEfkUkUz8oMwVIDCJ5nHqLP35633HN2bkESIQ+qhi4R5iskEjH8N0COQY9mqY1QNjAPvsawX6dOwJPGOn4flh+AOGr3nt9vEAFAAAAAElFTkSuQmCC";
public static final String BACK_DISABLED_3X = "iVBORw0KGgoAAAANSUhEUgAAABgAAAAnCAYAAAAVW4iAAAAAAXNSR0IArs4c6QAAA15JREFUSA21l01oE0EUx92NBpFUGpRCQMihtB4ELwbMwba2Ta1aEHpQ/MSPU/HgR1s9KV68iAU9KYIigl9YFUFFaZq2ph5yaA8eKigUPAhBQSoSBItJ/L2QCZvJbrKb2oFl5r037/9/783szK6x4j+28fHxIeDO5vP50VgsNmwYRtb4X/iAXwH4vMID/FkoFDq4ZAJADcBvADygwFUPyahPCfX0gPsSicQ9fE/Y+UOwvu4M5ubm/Ol0+jEk/Q7gGfR76iKYmZlZs7Cw8ByAXgfwnz6fb1dnZ2fKM0EqlVqbyWReEXmbHTi674Dv6Orq+iB2TwQs5jqA3+IXEWe9UfOvpmnGAP+kbKYa1OqTyWSIOe94nMDnibzNCi6YrjJgp4SJPMHTLE56I/KPfr8/1t7entZtNTOgLK25XG66CvgskXfYgQvZSp3RKgO+GeA4uiar3jJ+HwgE+qLR6C+LrmzomMHExMRWZk7x2IJTlngwGOytBi5MtmsQj8e3A/CS6AMySW/YXoTD4f0tLS1/dJsuV2QAeB8Ab6qAP6Dme92AC1lZBpRlHwt6H/BVeiSFyYZxq7u7+yQB5OzsdrpSBmzF49ls9qETOM4jnPEDXsCFsEDAbjkF8B1k29MV0Es9PT3nxMFrM4h8mLJctXMEOM8zSFmu29nd6EzALzhNJKtHSwEXXM4m87ITAdEfIMMzTnY3epMIRwA6LeXQHcjAIMNrrNFF3eZWLm1T2UWA3caxtLM0kJF6FrpEIGDL8R6UEQhJ8U1+SnlWi6w3Silv8jGuw7+6zU6uKAdleM3E3QDJpV3RID7ECzkql36F0UZRkYGaI6cpayJnUlDptH6M07Q/Eon81vRloiOBzHJzHzQ0NFS9D6oSFEla6eW63CCy3ijlLLpezqkfuk3kijXQJ+H4GZBtPPO6TWSIt9DxTVD4KKiYUjMD5SEAi4uLcQA3KZ21lwDYXTF21xervmYGanLxUu8olkSpSz3EzeyuaTbHxpKSgesMlJPXLzvXGSgCueQbGxt3Io8pndY3sb2nJicno6L3nIECW9ava0VC3X28K3eRjyidtWe9vnkukQaQZRsfRXfTqreMk0siECCizHN+yZdG2bWLLP9oh+teA0uUpSHlGqJsgyiekFnhL/MfqZJlyb8tPW8AAAAASUVORK5CYII=";
public static final String BACK_ENABLED_1X = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAANCAYAAACUwi84AAAAAXNSR0IArs4c6QAAAHlJREFUGBljZsAOBIHCu4FYC5u0GFDwAhD/B+IN6ApkgAI3oJIrgTQrsgJlIOc+VHIukGZCltQGcp5BJScCaUZkSWMg5w1UshlZAsa+A5XcCRNApwmaANKA7IYJQD6KG2Am4vUFTBHecIApQglJrHYBVYLiYhMQnwAAeiYfS1LRd+4AAAAASUVORK5CYII=";
public static final String BACK_ENABLED_2X = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAaCAYAAAC+aNwHAAAAAXNSR0IArs4c6QAAAPZJREFUOBFjYCAdWAG1PADiCUDMBMQkAReg6i9A/B+KZ5Ki2w+o+AeSZpAhF4g1IBKo8Dea5utAvjQxBqQCFf1F03wOyBclRnMRmkaQs48CsQAxmuuxaN4DFOMmRnMPFs0bgWLshDSD4hUUNbBogtHLgGIshDSDFCzFonkWUIxgggE5bQMWzX1AMYIAFCi7gRjmXBjdSFAnVMFOLJqLidUM8hvIRooALi80kGIqRYEIs4iiaIQZQlFCghkConuBGBadMJqopIxsSD0WQ4jOTDCDcGVnfpgCYmiKChSYBdiKtGtASaKKNJghFBWqMEMoKtZhhqBULADcM3nkekaNxwAAAABJRU5ErkJggg==";
public static final String BACK_ENABLED_3X = "iVBORw0KGgoAAAANSUhEUgAAABgAAAAnCAYAAAAVW4iAAAAAAXNSR0IArs4c6QAAAdVJREFUSA21V7tKA1EU3KgoWKTRxipW2kgstdTGxt7eHxAhttqrRTq19tGEEFu11EbQUjsrH6CNDywE8TUDXhgCexPO2Xtg2MmePTN3795XsqzYqEHuHqgDvcVKZ9k6BH8FTfD+IkxKENkWYTVpeA3YDXs54jR69Bjw9VsR8XfkZq0Ggyg8ioi/IDdtFS+j8DQi/oTcpFV8CIUXEfE75Mat4iMovIqI3yA3CpiigioK6BBUfo0cG2CKMVTdAiqo/BK5YZMyiqoAP5oKKj9Djh/dFFOoegZUUPkJchyupphBFSeKCio/RG4AMMU8qj4AFVS+j1yfSRlFC8AnoILKd5DrAUyxiKovQAWVb5pU/4uWcP2JiK95xFciwjRd9oiz9hXQrlB+4BXnhsF+n8sRmsD9N+A8J9/17U7fYLVrpciDHEXfgHaRctcoCr5J50EwSTqTgwk3605rkfvM02k1PUYjzKtpeJMqSLL9IJhwR+NmriNKOXc0HgZcUUF1sj05tCzpqSKYsCvYJdpFyl3nomBSBkl2sgsmHJ4cptp65a6zaTDhRGtFTDhROWFdweV+F9DWK3f9PwgtK4Fs5Zg0wkNFXDfaTJr47V6v2htWw40HoA6w+7I/GK4XQGwjqjkAAAAASUVORK5CYII=";
public static final String CLOSE_1X = "iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAHtJREFUKBWVkksKwCAMREOh99+3y97GU3iTdp6tRcUoBgbJfEgCmpkF4RA2YVTo+PDbKdzCJXhBeHR8BJMxE71gGah0T/B4hqVqDbvY0QZfrF41ip3d+geZkAO89MMqV4xyTieVAW6Z3tQG6CmP94U319dXfwT+pb9HIDwrxDUcBOiFBQAAAABJRU5ErkJggg==";
public static final String CLOSE_2X = "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAQZJREFUSA3NlmEKwyAMRmV/d8werFdxZ9lBtu+TBaKNabLKmBBsNXlPLUJLKWVDPBE74o5Y1cgik2w62sMLPeOBWCEjgyzhUtasMsC+Iq7IRgmZO6JBtf2KzJJ0p2Ql1M8iuJhIsxidRCBWYsUkx8+aVWtKBJQuQOE3Nc2XKczkyma6PgKI5HTQ2YsH8uZmPHd8Bhyvg/vhXYOatGS8axJLJOKbycKSm5D+oeduKkKOauzDu/I2Yx0ZwQwtvCSbSTjuzXkLP8xFQJGcA1gPZACZXO346kjSsnSBWmK4Npyo4OPjKeM0YSQ67y5rR+GyOwGWJaPjd79b/LnjfxetXM2qRhaZZG9vKwfPPlaIrEQAAAAASUVORK5CYII=";
public static final String CLOSE_3X = "iVBORw0KGgoAAAANSUhEUgAAACcAAAAnCAYAAACMo1E1AAAAAXNSR0IArs4c6QAAAYpJREFUWAnNmOttxSAMRjPG7d+u0M07QcYoc9wBWp9UvkJpcDAYqCUHxOPziY0SiW3btnfxXfwp/in+EF9hxCU+HLs4XEfnW1r1JP03JiYa8YirDLS7+EGaD9KfCXgFBgMZPFJ5hpsFWAIjPiU+ztg5pQr7JfMIjDALjLivs3+3MBrQHc+9oTGdVpwkmsxfmrUxosSWvgmmtJZAD6ClWwU2CjAMLBowHKwGsKYUw8B6AYeDtQJOA/MCTgerBfyQhXxu9PeXt0nGAR9qVmZymLw/BUzf2gM4FcwDuARMATljefnOfeaXGKUtHX6F7PkXN79UDdgSQA/YVEALLEkdrO/c0BLfgTGP1a77XR3w9Ab0rm9GbA3Uuq8atDdA7/4iaJRwlM4LNFowTA+hJK7fqLxlnPkWY1/pj1KliwALcyDtVwncUKPfBDgaTLndgLPA3IAP2ZHEtXx5yzjgIwxdq8RwLb+fKwEe93NPAcyzRX9kxkhIbmSQeGcGuP7cCfMmbJhpV4A7AP/2Nv0HnzzhcY3M7cIAAAAASUVORK5CYII=";
public static final String CLOSE_CIRCULAR_1X = "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1MkQxQ0FBNzNBOUQxMUUzOTMxMENBMjk4MUFBRDY3NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1MkQxQ0FBODNBOUQxMUUzOTMxMENBMjk4MUFBRDY3NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjUyRDFDQUE1M0E5RDExRTM5MzEwQ0EyOTgxQUFENjc1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjUyRDFDQUE2M0E5RDExRTM5MzEwQ0EyOTgxQUFENjc1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+PlnJTwAABFhJREFUeNpi/P//P8NwAEwMwwSMemTUI6MeGfXIqEcGBLBQ2Tx+IC4GYi8gVgRiPiQ7fgPxWyC+CMTLgHg1EH9PjI3Hadj8xQuJtpiRSjW7GhBPAWKnnz9//rp/797Hq1evfrl7687Pjx8//mFiZmKQlpFl0dBUZ9fU1OQRExfnZ2RkBKWGxUBcDfTMq8HgkXlAHPfm9evPSxcveX7h/IVvhDSwsbExBIUEczm5OEuysrKyA4XKgZ6ZPFAeYQPiE3///tUBeuDB/r37PpFsANBDaZkZfMYmxgpA7iFQkgR66Bc9PQLyxOWvX79K19fW3X37+s1vSqLU3MKCNS0zXZmJiek2iAvzDCkeIbfUOv7t2zfpsuKSW5R6AgROnjjxu72l9da/f/9Ugdyd9Cp+ZwOTk25DTd3db1+//aNWcXfn9p1/kydMugtkWgNjoopU/aQmLWkgfrh00ZJ7e3bv/sRAA5CYksRnZ28vA2SC8s0rWsXI7Hdv332mlSdAYMHc+Z++f//+E8icTKukxQ3EbiuWLX+OS4GomCibiZkpHyGDQGpAarHJgVLIhrXrQXYEAjEnLTxS8AsITp86hbOekFdQ4EhNT1O2sLIUwKUGJAdSA1KLS82unTu//QECIDOFFk0U34cPHn7Ep+DMqdOfWFhY7icmJ4GaJ/dPHDv+Ad0TILn5c+fdB6nFZ9bjR48/KiophhGbxEjxiOq1q1ffEVIEdTyGZ5A9ge5BbODqlStfgB7RoEWM8N28cfM5MQrRPQMujUjwBAhcv379p4+frwAtPMLy6tXLP8QqhnkmOTUF5BmGubPnEO0JEHj54sUfUtw3Ivsjf8TExFnevnlLVKzA8gQoJmBJC1sBgAuIS0iA3PaHFh75pK6hzn792rUfxHoCLU/cJ8UzwH4LqHn/gRZJ67aWtjYPmZ4A5xmQGEgOXz0DA9o6OiC7btAiRjbLK8hXA+mn+GpsfKUTcmkGrO/u4qtLZOVkQd3mVcQ6jrmhoYFYteeYmZlrnj199unZ06dYm+6/f//+f/fu3c+nTpzEWXE+efzkx4sXL749fPDgB7D1/BebGjd3dy59A30RIDOM2HxCaut3G7DRaFlcUHiXVqUPsC/PMHXmdGVOTs5dQG44rYrfVCFhIV5nVxc+WnkkITmRD+gJUEbPpWXHCpQ/5kdGRymIioqyUtsTBoaGrMC+CKgf0oJrZIWaFWIqMK9cbmhpUubi5qJahaqsosKUW5CnDGQeBXqijV4jjZZcXFxPu3p71IRFRSiOGTNzM9aq2mo1JiamO0CuO7367CAAGuXQ5ebmvtXZ3aXp6OxEVp4BDQdl5+XwZeZkawI9cQLkJ+ThIFr22YflAB0ywBgyvXb12pfbt279/PTx0x9GJiYGGVkZFi1tLXYtLS0eYRGRQTlkigzQB7FBfGZYfQnEb0AVKxCvAOK1DINwEHvAwehEz6hHRj0y6pFRj4x6ZNQjw8kjAAEGAG3QB833yd52AAAAAElFTkSuQmCC";
public static final String CLOSE_CIRCULAR_2X = "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCMzkzQ0FBNjNBOUIxMUUzOTMxMENBMjk4MUFBRDY3NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1MkQxQ0FBNDNBOUQxMUUzOTMxMENBMjk4MUFBRDY3NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkIzOTNDQUE0M0E5QjExRTM5MzEwQ0EyOTgxQUFENjc1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkIzOTNDQUE1M0E5QjExRTM5MzEwQ0EyOTgxQUFENjc1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+zKDHdQAACCFJREFUeNrsnHlMFHcUx3+7C+y64C6LnAUBwVTTilYak6oph0c01sRU2/9E/MujNrXGCqJpelirYNXaerS29azpf73SGI0WRRONxqNeKI2usLiCgAgruywou31v/Y0dtVqY3Rlm5H2Tl8zOso9585nfPb+n8/v9jKQe6QgIASEREAJCIiAEhERACAiJgBAQugsEhERACAiJgBAQEgEhICQC8t+KBssDywYbwi0RLAoskv+NG6wNrB6sitsZsMNgLQQkeA0EKwCbDjYSTC/Rjw/sLNjPYLvBaglIzzQZrIiXCJ1wshPU1NjYVldX76111Hpv3nR2uFpbfe3t7V1Gk4nF2GyG2Lg4fWpaqjElJcUEx6aIiAgT/NQs8u3nJaYMbB8BebamgK3g1VJALpfLffLEyeaKQ4dbb9TWdvTUYUJiAsvJyTG+NnaMNSYmBqu2GNHXWJ19CLaXgDyqNLANYNMCjzCo6kpV00979jQ4ahzeUP2TpBeS2LTpb5pGjRoVr9frEYyBf/Ub2EKwGgLC2GywzWD98MPlysrGbd/9UNfU1HRPrn9osVjY9LdmhOfk5SbpdLpYXi16wBaA7eirQMwcRCGvmjxbNm2uuVJ52aPUBcQnJLA58+aaMwdnYg8uiZ/eCfYOB9RngGB18QfYaPxw+tSpW99s2uK8f/9+r1xMXn6+bmZhQbLBYEjgp46DTQVr7gtAUsD2g73k9/l827dttx+tONLa2/UmNv5FJUux4U+FjxFglWCTwG48z0CwZBxFGF1dXffXrVl7tfLSJbdaejj9zP3YkuLiyEEZgwbywSZCeV3JkqIkEGwzDmI1hTA++/jTqurqai9TmfQGA1u0eJFpWFZWOoeC1dcEpdoUvYKxYgM+Gh4A35dr111VI4zAkL6ri61fu94L3W4czXfydm6zYg+Egl3bQG9q5/Yd9osXLrqZioVQvigtczudTgc/VchjeC6A4KBvEx6c++vcLRxxMw0IenysdOWqVq/Xe4uf2sRj0TwQHIGb29raPBs3fOVkGtLdu3fZmlWlTqhmPbwN3KB1IFOE6ZCtW76t6a1xRjCy2+3+IxUVOKXi57FM0TIQnChk165ea7xw/ryHaVS7d+zytHs8TeKYtAgEp9Bx1ta/dcs3dUzDgm46271zN8bg4zFN1iKQIl7kmxoaGiRPFMJgLWTXGIyv48eO3XO5XLfFsWkJCI508/Bgz64fGyQ3QFPfiFtdVvpyckqKMdgLQh/oC31K9fH7L78KseTxGDUDBJdddR6Px22/ds0r9WmeNHlSosVqjSgqKR4SDBT8LfpAX+hTakkp/7PcCx0THEPpeIyaAYJr4Ozs6bOS54DaPe2+stVlf0M1cc9isYRLhfIQBvhAX+gTfUu5JpxmqrpypVkcoxaA4NoCvpDADh44ENQg0HnjRkfZqtIqqVCegAG+0Gcw11R+sFyIaSSPVfVAsH7VQ9HurL5+vSNYZ1KhyAEDdeb06Q6fz9fJ712eFoAEXlC43XS7LVQOewpFLhiC7jTfaRPHqnYg+AIbq6+vC+lsbnehyA0DBd14rzhWTQBx1NSEfHr9/6AoAQNV8+/SgSaAJAaAOGo7ZPD9VChKwUBVX6/uEMcaSoXJcL34ri1rudPiYzJJgCIAKFm+LPCkRkZFyg4D1dzc7BPHqvYSEnjxubWlpUvO+SUBirvNfQ9BoOGx3DAePGx3usSxamUu67mVIcwgm285gASWZ63R0QY5b4rQZgglQygpwU6zdGvkG20ziGNVO5BAHz3aFq2XG4bQgK9a+XkVWrDTLN0VPGx6caxqB4KbZVhq6kCjEjCENiPYaZaeKD09zSiOVe1AqgJA0tJMSsEI1dxXd5WWnm4Sx6oJIImJSSYlYSgJJT4+XlNAcBMMGxA7IEppGEpBscXYosSxqh3IYTBfWFhYRPqgQUalYcgNJTs726jX6/FlbB+PVfVAcLcrbrBkEyZOsPYGDDmhjJs4XojpLJNhZ69cXVPc7cpGvpodI9UBLrMWLS16Mdi5qSeggE+pS7g6nY4NGTo0RhyjVoDg1mO/2WyOzMjMlNS44zLr/n37612trZ3BToc8hAK+0KfUJdxx48eZoCrG6RI/jzHkknM7QjlYvt1ub1zx0SeOYEqK1BsYal8bNn6darFa8K2VQ8hHSyUEhfvAWUZGRmxcfHy4VCehghGsr9Fjx4QDjAHi2LQGZB/vFurmzp+XxDQsg8HACmYVJPH7dYbJmHBA7tle3JTPMgdnxmUNH27WKpCZhbPM/czmWHFMWgWCGRJwUz6bM39uGjSIOq3BgCpXl5uXi/tCdDyWvVoGgsIMCZ6oqCjzuwvfS9YSjP79+7MlJcXJ0N3F0u3hsTCtA8G9FZghgY14ZURC/rh8qxZgQGlmxctLrCaTSdi7voApkHpDqRXDHexBhgRWMLswY1jWsEg1w9Dr9eyDoiWRycnJqfzUTqZQyg3aFv04DOhRvb94kSmrl7ZFU+KARweOfSpxgKBHUmvgNumKwxWqSK1RvKzEarPZ+lRqDXFJoeQzKgIitCmUnklFQATNZo8lMNv+/ba6xsZGeROYvT0jPCeXEpg9TZTiT2VABD2RBPOuy+U+EUQSTKyWcnJzjKMfJMHEtXCb6GtKgtlNPTNNbH1dvdfhqPE6nTc7AFggTWyE0cjghhviKE2srKJEyioWzoHlM2mpxnGFTxNZiCgZPwEhERACQiIgBIREQAgIiYAQEAJCQEgEhICQCAgBIREQAkIiIASEREBIBISAkHqufwQYADYiG6ZfnYoWAAAAAElFTkSuQmCC";
public static final String FORWARD_DISABLED_1X = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAANCAYAAACUwi84AAAAAXNSR0IArs4c6QAAAQZJREFUGBlj3L17dzcDA4MFBweHn62t7XsgGwUwMTIyqgJFbH7+/Ln/6NGjYiiyQA6TgIBAKJBe9f//f/3v378f2r9/vwyyIkYQByjJtHfv3tlAOglo4gMgdnF2dr4LkmMCEUCBf0CBFCA9CahI4d+/f4f37dunDZYDEcgAaFIzUEENUPFbJiYmd7AVyApAbKDPdgIpN6Ciu2ArkBWATIBKgkwIZ4ZJAu1mBIbDRCBdChR7zszM7AQEF1lACoCCGL4ASoJ9wXjmzBnW9+/fLwGqCwPaeROo08XR0fEJSCMIsHz48GE1kPYHSl7k5OR0s7a2fgWWgRJMQONvA9lH2NnZHdElQWoAIf5qWl4Zy0sAAAAASUVORK5CYII=";
public static final String FORWARD_DISABLED_2X = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAaCAYAAAC+aNwHAAAAAXNSR0IArs4c6QAAAg9JREFUOBGlVT9IAmEU9zsPHByadGlwcmhsaWgQPHUqQhCKHHIqayybQ/f+TEHZ1lAQORgVyJ0KDg1tboGLs80Nynn2e4cfvPPuSvBAvvfv997vve+PYjKZKM1m8zIQCGSFEPlUKvUBee5P6LpeRfT+FPGDJNl0Om3Mm0EBYI0Fh8HotdVqbTHbnyIl2EDEF4sKWZZVQ1u7zOYrCvJ0Op3IaDRqoPoqi7QURTnETO6YzSUqZEkkEt/BYFADGz5ABUyqhmGcuFDMYDOQerfbDQ8Ggzr0lLTRCiZlMKlwm5QdCcjY6/VC/X7/CaJjkGB3gd05lUC52i1IhdZ4PD5UVTUH8ZHbMZ8S2rmlc8PtLgbSSYEA3ECXZ0S6HlCgkEwmTTI4sskIWkHZymQyB+j/itsh58fj8TO1asfNOD1VMKmA0Rl3ooARiUSyvi3wYJKRpIQk5zP2hm8LM4G+6lwJcOHKs9WphWg0mvu3BbrqOJHHnALA9VgstmNvOXdwWW4jwK5txLEvAGxvoyeDdrutmqZ5j4SOG4nKVRzpI6yWLOaaAe0vwDUPMB3lIgdTEgeDhS4TJr2E7O/ofV3SsysIUUJlejM9vyBZ6UHBsAyA+fNGD0oR4GtP5NQosE3LAOvQV2QgmJj47WFgjhsp/XxVUfWNgyEPUXlb07QXHugnK0jwyZz0rG/OCyacQIKF/lh+Ad6p1jUc5HZEAAAAAElFTkSuQmCC";
public static final String FORWARD_DISABLED_3X = "iVBORw0KGgoAAAANSUhEUgAAABgAAAAnCAYAAAAVW4iAAAAAAXNSR0IArs4c6QAAA4dJREFUSA21l01oE0EUx5tNjSBBUhAh4EEoVbAHDwbMoWmxbfAb/KqoLUhBsHhQD1ZP4sWT/brZkyhKq1hEEaTapF/ppUK8CDlo8RAQAoJYbRFNSeLvBWaZbHbTbVoXljfvPzP//3tvJjMbTw1PoVDwxuPxfo/H04E71N7ePiD4RjyeVCrly2Qyo4icVoQI3UPklvLXYw3IR3RyIcO/GYvFhrGe9ZDLXIM34kDSMzk5+RgRr0O/K1gEzlOSZbvRkHchMiZltOt3gxVLMD09Hc7lcuMQBhwmvaurqzsVCoV+O/Q7wmaNp6am9iIywcjtdqPJcs7v9x8Lh8O/7PqdMFNABiCyO5/Px8lkh8OEJEKH2GHfHfrLYFkD82ltbf3k9XojkHwxwdJGCHc2kUgES2FnryQDNUwIstmsZLJHYbqVAHjbeNI6btcuyUANaG5uzpBJCyQfFKZbhOsp5Ry//l06bte2zUANnJ+f37q0tPQGv0lhFvuNIKKsyUcLbrq2Gahe2TFsz4OQxBRmsbLjZtgc+y246VbMQI1aWFjYnE6nn1GaEwrTLQEs03c8Go3O6Li0K2agBjc0NPxlTTogGlGYbiH30zfO+XVUx6XtKgM1CSKDo+M+9rLCdIvIimEYXWz35wp3lYEaDEGeBe3B71eYbhHexGkwShDdCl+TgJpErXsRu6N8i/Ui9IAtfFXwNZXIQlRDpNchG+S15aFcvbYdVqJKPgsrC3/BYczPqkqkyCSDCuQ1ZHC3agFqfJvjYkiJ6Zb1KfBe46zqr6pElKUPwhs6qdbOE/klyB8Ktqb7lsU0IpHIMPOKO0QjLTaJeoUfZCfk5g/SdQZcq7Xs8UeIdFqJxYf8D31n2MJyOJqPqzWQswjysQrk8tFwxEouKqtmkEwmtywuLr6CPGqGpTWI/Ac1P8zx8F6DzWZFgY24DxwFqPk2yvKWyPeZ4WgNIv+K28bZ9FmDy5q2ayB3MuSzFcjlTm5ajVzUyjIg8p2Qy4VfXxaOTPB4Uj6fLyr3tl2/FSvJQL6LIJ+rQC4fAS1uyUXMzOB/fdnVior6NqXp9G06EQgETlb1bcqhdQDi15TFL2LWh5q/DAaD5xobG7PWPje+ZPDUiZy+J5wr3Yjk3JDZjZFFTth1gA2zDS+uh1x4DdLvguSFLoLfx7lyBVvQ8WraxV1EiYr/MiE4C+kgkQ9UQ2Y35x9yzXLgAH1NFAAAAABJRU5ErkJggg==";
public static final String FORWARD_ENABLED_1X = "iVBORw0KGgoAAAANSUhEUgAAAAgAAAANCAYAAACUwi84AAAAAXNSR0IArs4c6QAAAHpJREFUGBmF0DEOQEAUhOGHOIBGpVMqXcK9lCoHcACdVu0CSoVEp+IK+F8p+6xJvmYy2eyuiEiDCQnMDLQ3ZqTWIqbsoaMFGZyENB10tCGHk4CmhY52FDBT0+roQGkuKEfoaLUGnyd47+B9xe8/eH8y4pb6lAsVTrzyAG/RII+JIhYrAAAAAElFTkSuQmCC";
public static final String FORWARD_ENABLED_2X = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAaCAYAAAC+aNwHAAAAAXNSR0IArs4c6QAAAPJJREFUOBGllTEKAjEQRYMIFhbaWHkTa2t7D+AF9ABqL7Kt9lprJ2hrK1ba7iEsBBF9Aw6EJcIkGXiMG35+NtnJ6JxzNSighB5Ex5oZnx8Pcj/W4eoZiNETBjEmXcR30LeQ/IIhmKOD8gK+yZvnkdkBYRvO4JvI7zGYo4nyBFWTqdkBYQP2AZNFjEkd8TZgsmJM6sYUIvRrRLe1YVwWMMcSpU7WvGNMtmqOOUqdrPnImBy6OSYodbLmg/lAzMv8Ec4Cq5u3kHyIWZ8xq5CySjnrMrU46eTrnNVQpKXdKt85qqVlN1X/yia1dSmYAkqI/mP5AqOFeOWKij/DAAAAAElFTkSuQmCC";
public static final String FORWARD_ENABLED_3X = "iVBORw0KGgoAAAANSUhEUgAAABgAAAAnCAYAAAAVW4iAAAAAAXNSR0IArs4c6QAAAbJJREFUSA21l7svBFEUh2cREoWGRmUrOkpKW4no9f4Bkax29Si2Q+3RILToUFLSqTwSGo+ISMTrO9mM/LJhRu6Ze5Jv58w9e37n5s7jnkmShrVyqMM1VBtDxf22I7UNX8J8cfJJsiXCWmSZ8VIRhW7/KGDF1sCWz2UVsp9BZ6/+DjFbRpeNkP0AKqz+HrFOVwWSh+AOVFj9I2Jd4LIBsq9AhdU/IdbtqkByGS5AhdU/I9YLLjOBc1Bh9W0Cfa4KJPfAKaiw+pfE+sFldlGPQYXVt5ti0FWBZLs9D0CF1b8nNgwu6yB7F1RYfXtQR8FlbWSvgwqr/0pswlWB5BZYARVW/43YJLhtEQUVVv+d2JS7AgJzGUU+iU1bEc+r+JD8JxiDEqjZ+Ti86GCov0GiLpH6j6Giad5MhrgVmk3/GHKsZYj/XIMQYcvJuos+iAffRVGfg6hP8n/eRZXQ9Y76No26H+TtaNYcBO9oUffkMjOL1lXk9UXWBAT3RVE7u7zedJ+ZB/em9oBE7a6zvg9WKe7ZlEhPkk3QTSL1lxi3ncltv32jLbhVmwRsGepwA9WmmOv0G/O5F1exz8AAAAAAAElFTkSuQmCC";
public static final String OUTLINK_1X = "iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAQhJREFUKBWFkj1uwkAQhd9YdhMfg4uk5wyEjiSmiFBElT+hIKpIqRxSBlJzAwqq1FyAJndwGiRP3kNayRY2jLTa8eh945mdsd7c71FiAiDlOZgZ/paZpVe5Zw7kIR7uWABFG3NsQtAde/lRgh/fYyzfDTeMd+THPKmAxdDeFKja18C2/N725z71Eh0m3wmMqqImv/fhr2WJBximTP4pzUlIAByPAr4zewpJW6EmwBKsDRiqpyNrAiQKPR5Bajr0UC1JEEdwx1JntfIIjNoAQSwt4etd1P7kEVbKsri1d4narAYtr+2XwpOAEgkqOO3Lfs6FOWPScQRFzEm9cNoTIt0zDHcJBbfi+R8ArmkcWE7RygAAAABJRU5ErkJggg==";
public static final String OUTLINK_2X = "iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAWpJREFUSA29ljFSw0AMRSWPhxMk0FNyCOAigRpoU8DQ0DChoA09oeMWHIKChgMk4QqI/w1iHIdde70etrBmrZXeSivLqzfPtvO+llsxOTWRsUSGiqwWF7rrSyYP9gq7A5/HZEmImUxji4bQlYyEjrDbT1NZx5wi4qb+A4bLLRuT36hdp5M54uGAwdO57rmirzyZ2wwOL5v2RfNFzjwEoc/BQE0IjuKuntZBQH9BUJ1X9exkg7pAslPXFZIFSoEQVPKROhIgbyiI6ttLBiVABN/loQeRVAwpEAe47AzKgRDWKXV9Iezuat9/hFZQX8hPykboe9WvJ5q6TIgfTyWDIIR9VO/C7F3NtrLhqWUSBKE0X7SQql/lQriHIIjKxZmyAx/nREI/HFEQFzAyytzRCsoFuP2/gRQlvGSt48BbLye+uwQ5xuVH4XtV4rAfMZkCVkBu3V4SnIaXglHsj+QayHtSwyv7aeiTvsn4AsmQmKnJPOu5AAAAAElFTkSuQmCC";
public static final String OUTLINK_3X = "iVBORw0KGgoAAAANSUhEUgAAACcAAAAnCAYAAACMo1E1AAAAAXNSR0IArs4c6QAAAh1JREFUWAnt2D9LAzEUAPD3zigdBD+CfzYVVxcHLTg7OLjZCqKCXVVcCh1Fxa2KRQTr5jcQhOLgF1Ck4KC4CI6Ck7SN79VeLz1oe7m7pB0MXO8lzSU/XsIRDoFKriTFWxn2pYQViTAFEga4XaO8X2dwTO2/diYXqjUoqW26sWDYaxnuCDZff1jqDmGuv9PI2B/M3DyhRnZ4KUM9aeEh0dhj3lQIBUfCg9fQPaoBfPt7CQFl+QNpf7tapx20R9e02qbGuJqn3CnFAUhfZbCoNBkJU6fyiGbe6TQ4WeyXIDBWWce1gyHAsz9NVnFtYQjHhDvsGa4TrLiNu34Y161kLgzMCi4szDguCswoLirMGC4OmBFcXDDGCf6Jq0SBDQ7BbaUCSdUSGy4KjEEXG/hJN76aJZb3XFRYU+MLIuNMwdgZCWcSxrjQey5uGJ0rl8lzwii3hMLFDWMMLeEwnahHXVijTa12j03A2s2qtedswrQyZxsWGLd5LkfoK8CSP/1IJ9h2B0V/3zD1QMta2MIvkYAkHaVf3ElMw3ieQDjueLmOHy7QBkwL5wITAmZNLiXP45bAmXMf4CV2Y9N3bZxpkDr+P07Nhk4sAKGqfsmsIcyl8y3fdnTGC92X5yWHV8iFqbx8pLYZr7U/InqnPjn0zrrpD06rgl3O+CQcUHDf+ldva+xhl5NLYmViEhYdhCynsr4He2HjPVZfSsiyh12//6P3ArVQ5C4AAAAASUVORK5CYII=";
public static Bitmap getBackDisabledImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? BACK_DISABLED_3X : BACK_DISABLED_2X : BACK_DISABLED_1X);
}
public static Bitmap getBackEnabledImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? BACK_ENABLED_3X : BACK_ENABLED_2X : BACK_ENABLED_1X);
}
public static Bitmap getCloseCircularImage(float f) {
return getImageBitmap(Math.round(f) != 1 ? CLOSE_CIRCULAR_2X : CLOSE_CIRCULAR_1X);
}
public static Bitmap getCloseImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? CLOSE_3X : CLOSE_2X : CLOSE_1X);
}
public static Bitmap getForwardDisabledImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? FORWARD_DISABLED_3X : FORWARD_DISABLED_2X : FORWARD_DISABLED_1X);
}
public static Bitmap getForwardEnabledImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? FORWARD_ENABLED_3X : FORWARD_ENABLED_2X : FORWARD_ENABLED_1X);
}
public static Bitmap getImageBitmap(String str) {
byte[] decode = Base64.decode(str.getBytes(), 0);
return BitmapFactory.decodeByteArray(decode, 0, decode.length);
}
public static Bitmap getOpenBrowserImage(float f) {
int round = Math.round(f);
return getImageBitmap(round != 1 ? round != 2 ? OUTLINK_3X : OUTLINK_2X : OUTLINK_1X);
}
}

View File

@@ -0,0 +1,8 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyIntegrationException extends TapjoyException {
public TapjoyIntegrationException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,98 @@
package com.tapjoy;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.tapjoy.TapjoyErrorMessage;
/* loaded from: classes4.dex */
public class TapjoyLog {
public static boolean a = false;
public static int b = 6;
public static void a(String str, boolean z) {
if (!z && TapjoyAppSettings.getInstance() != null && TapjoyAppSettings.getInstance().b != null) {
d("TapjoyLog", "setLoggingLevel -- log setting already persisted");
return;
}
if (str.equals(TapjoyConstants.LOG_LEVEL_INTERNAL)) {
b = 2;
new Handler(Looper.getMainLooper()).post(new o1());
} else if (str.equals(TapjoyConstants.LOG_LEVEL_DEBUG_ON)) {
b = 4;
} else if (str.equals(TapjoyConstants.LOG_LEVEL_DEBUG_OFF)) {
b = 6;
} else {
d("TapjoyLog", "unrecognized loggingLevel: ".concat(str));
b = 6;
}
d("TapjoyLog", "logThreshold=" + b);
}
public static void d(String str, String str2) {
a(3, str, str2);
}
public static void e(String str, String str2) {
e(str, new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTERNAL_ERROR, str2));
}
public static void i(String str, String str2) {
a(4, str, str2);
}
public static boolean isLoggingEnabled() {
return a;
}
public static void setInternalLogging(boolean z) {
if (z) {
a(TapjoyConstants.LOG_LEVEL_INTERNAL, true);
}
}
public static void v(String str, String str2) {
a(2, str, str2);
}
public static void w(String str, String str2) {
a(5, str, str2);
}
public static void e(String str, TapjoyErrorMessage tapjoyErrorMessage) {
if (tapjoyErrorMessage != null) {
if (b == 2 || tapjoyErrorMessage.getType() != TapjoyErrorMessage.ErrorType.INTERNAL_ERROR) {
a(6, str, tapjoyErrorMessage.toString());
}
}
}
public static void setDebugEnabled(boolean z) {
a = z;
if (z) {
a(TapjoyConstants.LOG_LEVEL_DEBUG_ON, false);
} else {
a(TapjoyConstants.LOG_LEVEL_DEBUG_OFF, false);
}
}
public static void a(int i, String str, String str2) {
String str3 = "TapjoyLog:" + str;
if (b <= i) {
if (str2.length() > 4096) {
int i2 = 0;
while (i2 <= str2.length() / 4096) {
int i3 = i2 * 4096;
i2++;
int i4 = i2 * 4096;
if (i4 > str2.length()) {
i4 = str2.length();
}
Log.println(i, str3, str2.substring(i3, i4));
}
return;
}
Log.println(i, str3, str2);
}
}
}

View File

@@ -0,0 +1,135 @@
package com.tapjoy;
import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.ViewGroup;
import android.widget.PopupWindow;
import androidx.core.view.GravityCompat;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes4.dex */
public class TapjoyPluginAPI {
public static TJOfferwallDiscoverView a = null;
public static PopupWindow b = null;
public static float c = -1.0f;
public static float d = -1.0f;
public static String e = "native";
public static PopupWindow CreatePopupWindow(Activity activity, ViewGroup viewGroup, int i, int i2) {
PopupWindow popupWindow = new PopupWindow(viewGroup, i, i2);
popupWindow.getContentView().setSystemUiVisibility(activity.getWindow().getAttributes().flags);
try {
Method declaredMethod = PopupWindow.class.getDeclaredMethod("setWindowLayoutType", Integer.TYPE);
declaredMethod.setAccessible(true);
declaredMethod.invoke(popupWindow, 1002);
} catch (IllegalAccessException e2) {
TapjoyLog.d("TapjoyPluginAPI", "Unable to set popUpWindow window layout type: " + e2.getLocalizedMessage());
} catch (NoSuchMethodException e3) {
TapjoyLog.d("TapjoyPluginAPI", "Unable to set popUpWindow window layout type: " + e3.getLocalizedMessage());
} catch (InvocationTargetException e4) {
TapjoyLog.d("TapjoyPluginAPI", "Unable to set popUpWindow window layout type: " + e4.getLocalizedMessage());
}
return popupWindow;
}
public static void DestroyOWDiscover() {
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TapjoyPluginAPI$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
TapjoyPluginAPI.a();
}
});
}
public static void RequestOWDiscover(Activity activity, String str, float f, TJOfferwallDiscoverListener tJOfferwallDiscoverListener) {
RequestOWDiscover(activity, str, -1.0f, -1.0f, -1.0f, f, tJOfferwallDiscoverListener);
}
public static void ShowOWDiscover(final Activity activity) {
final DisplayMetrics displayMetrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TapjoyPluginAPI$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
TapjoyPluginAPI.a(activity, displayMetrics);
}
});
}
public static /* synthetic */ void a(Activity activity, TJOfferwallDiscoverListener tJOfferwallDiscoverListener, String str, float f, float f2, float f3, float f4) {
DestroyOWDiscover();
TJOfferwallDiscoverView tJOfferwallDiscoverView = new TJOfferwallDiscoverView(activity);
a = tJOfferwallDiscoverView;
tJOfferwallDiscoverView.setListener(tJOfferwallDiscoverListener);
a.requestContent(activity, str);
float density = TJDeviceUtils.INSTANCE.getDensity(activity);
activity.getWindowManager().getDefaultDisplay().getMetrics(new DisplayMetrics());
TJOfferwallDiscoverView tJOfferwallDiscoverView2 = a;
if (f != -1.0f) {
f *= density;
}
PopupWindow CreatePopupWindow = CreatePopupWindow(activity, tJOfferwallDiscoverView2, (int) f, (int) (f2 * density));
b = CreatePopupWindow;
CreatePopupWindow.setInputMethodMode(1);
if (f3 != -1.0f) {
f3 *= density;
}
d = f3;
if (f4 != -1.0f) {
f4 *= density;
}
c = f4;
}
public static String getPlugin() {
return e;
}
public static void setPlugin(String str) {
e = str;
}
public static void RequestOWDiscover(final Activity activity, final String str, final float f, final float f2, final float f3, final float f4, final TJOfferwallDiscoverListener tJOfferwallDiscoverListener) {
TapjoyUtil.runOnMainThread(new Runnable() { // from class: com.tapjoy.TapjoyPluginAPI$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
TapjoyPluginAPI.a(activity, tJOfferwallDiscoverListener, str, f3, f4, f, f2);
}
});
}
public static /* synthetic */ void a(Activity activity, DisplayMetrics displayMetrics) {
PopupWindow popupWindow = b;
if (popupWindow == null || popupWindow.isShowing() || activity.isFinishing()) {
return;
}
float f = d;
if (f == -1.0f) {
f = 0.0f;
}
float f2 = c;
if (f2 == -1.0f) {
f2 = displayMetrics.heightPixels - b.getHeight();
}
if (activity.isDestroyed()) {
return;
}
b.showAtLocation(activity.getWindow().getDecorView().getRootView(), c != -1.0f ? 8388659 : GravityCompat.END, (int) f, (int) f2);
c = -1.0f;
d = -1.0f;
}
public static /* synthetic */ void a() {
if (b == null || !b.isAttachedInDecor()) {
return;
}
b.dismiss();
b = null;
TJOfferwallDiscoverView tJOfferwallDiscoverView = a;
if (tJOfferwallDiscoverView != null) {
tJOfferwallDiscoverView.clearContent();
a = null;
}
}
}

View File

@@ -0,0 +1,6 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public class TapjoyRevision {
public static final String GIT_REVISION = "fc9283a";
}

View File

@@ -0,0 +1,14 @@
package com.tapjoy;
import android.net.Uri;
/* loaded from: classes4.dex */
public class TapjoyUrlFormatter {
public static String getDomain(String str) {
String host = Uri.parse(str).getHost();
if (host != null) {
str = host;
}
return str.replace("www.", "");
}
}

View File

@@ -0,0 +1,305 @@
package com.tapjoy;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import com.applovin.exoplayer2.common.base.Ascii;
import com.ironsource.v8;
import com.tapjoy.TJAdUnitConstants;
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
import csdk.gluads.Consts;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.parsers.DocumentBuilderFactory;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/* loaded from: classes4.dex */
public class TapjoyUtil {
public static final AtomicInteger a = new AtomicInteger(1);
public static Document buildDocument(String str) {
try {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(str.getBytes("UTF-8")));
} catch (Exception e) {
TapjoyLog.e("TapjoyUtil", "buildDocument exception: " + e.toString());
return null;
}
}
public static String convertToHex(byte[] bArr) {
StringBuffer stringBuffer = new StringBuffer();
for (int i = 0; i < bArr.length; i++) {
int i2 = (bArr[i] >>> 4) & 15;
int i3 = 0;
while (true) {
if (i2 < 0 || i2 > 9) {
stringBuffer.append((char) (i2 + 87));
} else {
stringBuffer.append((char) (i2 + 48));
}
i2 = bArr[i] & Ascii.SI;
int i4 = i3 + 1;
if (i3 >= 1) {
break;
}
i3 = i4;
}
}
return stringBuffer.toString();
}
public static Bitmap createBitmapFromView(View view) {
Bitmap bitmap = null;
if (view == null || view.getLayoutParams().width <= 0 || view.getLayoutParams().height <= 0) {
return null;
}
try {
bitmap = Bitmap.createBitmap(view.getLayoutParams().width, view.getLayoutParams().height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(canvas);
return bitmap;
} catch (Exception e) {
TapjoyLog.d("TapjoyUtil", "error creating bitmap: " + e.toString());
return bitmap;
}
}
public static void deleteFileOrDirectory(File file) {
File[] listFiles;
if (file == null) {
return;
}
if (file.isDirectory() && (listFiles = file.listFiles()) != null && listFiles.length > 0) {
for (File file2 : listFiles) {
deleteFileOrDirectory(file2);
}
}
TapjoyLog.d("TapjoyUtil", "****************************************");
TapjoyLog.d("TapjoyUtil", "deleteFileOrDirectory: " + file.getAbsolutePath());
TapjoyLog.d("TapjoyUtil", "****************************************");
file.delete();
}
public static long fileOrDirectorySize(File file) {
long j = 0;
for (File file2 : file.listFiles()) {
j = (file2.isFile() ? file2.length() : fileOrDirectorySize(file2)) + j;
}
return j;
}
public static int generateViewId() {
AtomicInteger atomicInteger;
int i;
int i2;
do {
atomicInteger = a;
i = atomicInteger.get();
i2 = i + 1;
if (i2 > 16777215) {
i2 = 1;
}
} while (!atomicInteger.compareAndSet(i, i2));
return i;
}
public static String getFileContents(File file) {
boolean z;
FileInputStream fileInputStream = new FileInputStream(file);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
StringBuilder sb = new StringBuilder();
do {
String readLine = bufferedReader.readLine();
z = readLine == null;
if (readLine != null) {
sb.append(readLine);
}
} while (!z);
bufferedReader.close();
fileInputStream.close();
return sb.toString();
}
public static String getNodeTrimValue(NodeList nodeList) {
Element element = (Element) nodeList.item(0);
if (element != null) {
NodeList childNodes = element.getChildNodes();
int length = childNodes.getLength();
String str = "";
for (int i = 0; i < length; i++) {
Node item = childNodes.item(i);
if (item != null) {
str = str + item.getNodeValue();
}
}
if (str != null && !str.equals("")) {
return str.trim();
}
}
return null;
}
public static Map<String, String> jsonToStringMap(JSONObject jSONObject) {
return jSONObject != JSONObject.NULL ? toStringMap(jSONObject) : new HashMap();
}
public static void runOnMainThread(Runnable runnable) {
if (Looper.myLooper() == Looper.getMainLooper()) {
runnable.run();
} else {
new Handler(Looper.getMainLooper()).post(runnable);
}
}
public static void safePut(Map<String, String> map, String str, String str2, boolean z) {
if (str == null || str.length() <= 0 || str2 == null || str2.length() <= 0) {
return;
}
if (z) {
map.put(Uri.encode(str), Uri.encode(str2));
} else {
map.put(str, str2);
}
}
public static View scaleDisplayAd(View view, int i) {
int i2 = view.getLayoutParams().width;
int i3 = view.getLayoutParams().height;
TapjoyLog.d("TapjoyUtil", "wxh: " + i2 + "x" + i3);
if (i2 > i) {
int intValue = Double.valueOf((i / i2) * 100.0d).intValue();
WebView webView = (WebView) view;
webView.getSettings().setSupportZoom(true);
webView.setPadding(0, 0, 0, 0);
webView.setVerticalScrollBarEnabled(false);
webView.setHorizontalScrollBarEnabled(false);
webView.setInitialScale(intValue);
view.setLayoutParams(new ViewGroup.LayoutParams(i, (i3 * i) / i2));
}
return view;
}
public static Map<String, String> toStringMap(JSONObject jSONObject) {
HashMap hashMap = new HashMap();
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
hashMap.put(next, jSONObject.get(next).toString());
}
return hashMap;
}
public static String SHA1(String str) {
MessageDigest messageDigest = MessageDigest.getInstance(AndroidStaticDeviceInfoDataSource.ALGORITHM_SHA1);
messageDigest.update(str.getBytes("iso-8859-1"), 0, str.length());
return convertToHex(messageDigest.digest());
}
public static String SHA256(String str) {
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("iso-8859-1"), 0, str.length());
return convertToHex(messageDigest.digest());
}
public static void writeFileToDevice(BufferedInputStream bufferedInputStream, OutputStream outputStream) {
byte[] bArr = new byte[1024];
while (true) {
int read = bufferedInputStream.read(bArr);
if (read == -1) {
return;
} else {
outputStream.write(bArr, 0, read);
}
}
}
public static String convertURLParams(Map<String, String> map, boolean z) {
String str = "";
for (Map.Entry<String, String> entry : map.entrySet()) {
if (str.length() > 0) {
str = str.concat(v8.i.c);
}
str = z ? str + Uri.encode(entry.getKey()) + v8.i.b + Uri.encode(entry.getValue()) : str + entry.getKey() + v8.i.b + entry.getValue();
}
return str;
}
public static String getRedirectDomain(String str) {
return str != null ? str.substring(str.indexOf("//") + 2, str.lastIndexOf("/")) : "";
}
public static String determineMimeType(String str) {
if (str.endsWith(Consts.STRING_PERIOD)) {
str = str.substring(0, str.length() - 1);
}
String substring = str.lastIndexOf(46) != -1 ? str.substring(str.lastIndexOf(46) + 1) : "";
return substring.equals("css") ? "text/css" : substring.equals("js") ? "text/javascript" : substring.equals(TJAdUnitConstants.String.HTML) ? "text/html" : "application/octet-stream";
}
public static void safePut(Map<String, String> map, String str, Number number) {
if (str == null || str.length() <= 0 || number == null) {
return;
}
map.put(str, number.toString());
}
public static Map<String, String> convertURLParams(String str, boolean z) {
HashMap hashMap = new HashMap();
boolean z2 = false;
String str2 = "";
String str3 = str2;
for (int i = 0; i < str.length() && i != -1; i++) {
char charAt = str.charAt(i);
if (z2) {
if (z2) {
if (charAt == '&') {
if (z) {
str2 = Uri.decode(str2);
}
hashMap.put(str3, str2);
z2 = false;
str2 = "";
} else {
str2 = str2 + charAt;
}
}
} else if (charAt == '=') {
if (z) {
str2 = Uri.decode(str2);
}
str3 = str2;
z2 = true;
str2 = "";
} else {
str2 = str2 + charAt;
}
}
if (z2 && str2.length() > 0) {
if (z) {
str2 = Uri.decode(str2);
}
hashMap.put(str3, str2);
}
return hashMap;
}
}

View File

@@ -0,0 +1,21 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class a implements Runnable {
public final /* synthetic */ boolean a;
public final /* synthetic */ TJActivity b;
public a(TJActivity tJActivity, boolean z) {
this.b = tJActivity;
this.a = z;
}
@Override // java.lang.Runnable
public final void run() {
if (this.a) {
this.b.d.setVisibility(0);
} else {
this.b.d.setVisibility(4);
}
}
}

View File

@@ -0,0 +1,40 @@
package com.tapjoy;
import com.tapjoy.TJAdUnit;
/* loaded from: classes4.dex */
public final class a0 implements TJAdUnit.TJAdUnitWebViewListener {
public final /* synthetic */ TJCorePlacement a;
public a0(TJCorePlacement tJCorePlacement) {
this.a = tJCorePlacement;
}
@Override // com.tapjoy.TJAdUnit.TJAdUnitWebViewListener
public final void onClosed() {
if (this.a.i) {
TJPlacementManager.decrementPlacementCacheCount();
this.a.i = false;
}
if (this.a.j) {
TJPlacementManager.decrementPlacementPreRenderCount();
this.a.j = false;
}
}
@Override // com.tapjoy.TJAdUnit.TJAdUnitWebViewListener
public final void onContentReady() {
this.a.a();
}
@Override // com.tapjoy.TJAdUnit.TJAdUnitWebViewListener
public final void onClick() {
TJCorePlacement tJCorePlacement = this.a;
TJPlacement a = tJCorePlacement.a("SHOW");
TapjoyLog.i("TJCorePlacement", "Handle onClick for placement " + tJCorePlacement.d.getPlacementName());
if (a == null || a.getListener() == null) {
return;
}
a.getListener().onClick(a);
}
}

View File

@@ -0,0 +1,20 @@
package com.tapjoy;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public final class a1 {
public final double a;
public final double b;
public final double c;
public final double d;
public final float e;
public a1(JSONObject jSONObject) {
this.a = jSONObject.optDouble("width", 0.0d);
this.b = jSONObject.optDouble("height", 0.0d);
this.c = jSONObject.optDouble("left", 0.0d);
this.d = jSONObject.optDouble("top", 0.0d);
this.e = (float) jSONObject.optDouble("cornerRadius", 0.0d);
}
}

View File

@@ -0,0 +1,18 @@
package com.tapjoy;
import android.content.DialogInterface;
/* loaded from: classes4.dex */
public final class b implements DialogInterface.OnClickListener {
public final /* synthetic */ TJActivity a;
public b(TJActivity tJActivity) {
this.a = tJActivity;
}
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.a.a();
dialogInterface.cancel();
}
}

View File

@@ -0,0 +1,18 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class b0 implements TJCacheListener {
public final /* synthetic */ c0 a;
public b0(c0 c0Var) {
this.a = c0Var;
}
@Override // com.tapjoy.TJCacheListener
public final void onCachingComplete(int i) {
TJCorePlacement tJCorePlacement = this.a.e;
TJAdUnit adUnit = tJCorePlacement.getAdUnit();
TJCorePlacement tJCorePlacement2 = this.a.e;
tJCorePlacement.j = adUnit.preload(tJCorePlacement2.d, tJCorePlacement2.b);
}
}

View File

@@ -0,0 +1,114 @@
package com.tapjoy;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.view.ViewGroup;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.tapjoy.TapjoyErrorMessage;
import java.util.HashSet;
/* loaded from: classes4.dex */
public final class b1 extends WebViewClient {
public final /* synthetic */ TJSplitWebView a;
public b1(TJSplitWebView tJSplitWebView) {
this.a = tJSplitWebView;
}
@Override // android.webkit.WebViewClient
public final void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
if (this.a.l.booleanValue()) {
ProgressBar progressBar = this.a.p;
if (progressBar != null) {
progressBar.setProgress(0);
this.a.p.setVisibility(8);
}
this.a.isFirstOrLastPage();
}
}
@Override // android.webkit.WebViewClient
public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
if (this.a.l.booleanValue()) {
this.a.q.setText(TapjoyUrlFormatter.getDomain(str));
this.a.p.setVisibility(0);
}
TapjoyLog.d("TJSplitWebView", "onPageStarted: " + str);
}
@Override // android.webkit.WebViewClient
public final void onReceivedError(WebView webView, int i, String str, String str2) {
TapjoyLog.d("TJSplitWebView", "onReceivedError: " + str2 + " firstUrl:" + this.a.d);
TJSplitWebView tJSplitWebView = this.a;
if (tJSplitWebView.u) {
tJSplitWebView.showErrorDialog();
} else if (str2.equals(tJSplitWebView.d)) {
this.a.j.dismissSplitView(null, null);
}
}
@Override // android.webkit.WebViewClient
public final boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
TJWebView tJWebView = this.a.a;
if (tJWebView != null) {
ViewGroup viewGroup = (ViewGroup) tJWebView.getParent();
if (viewGroup != null) {
viewGroup.removeView(this.a.a);
viewGroup.removeAllViews();
}
this.a.a.destroy();
this.a.a = null;
}
TJAdUnitJSBridge tJAdUnitJSBridge = this.a.j;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.cleanUpJSBridge();
this.a.j = null;
}
TapjoyLog.e("TJSplitWebView", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "WebView rendering process exited while instantiating a WebViewClient unexpectedly"));
return true;
}
@Override // android.webkit.WebViewClient
public final WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
TJSplitWebView tJSplitWebView = this.a;
String str2 = tJSplitWebView.f;
Uri uri = tJSplitWebView.g;
if (str2 != null && uri != null && str != null && str.startsWith(str2)) {
this.a.k.startActivity(new Intent("android.intent.action.VIEW", uri));
this.a.j.dismissSplitView(null, null);
}
return super.shouldInterceptRequest(webView, str);
}
@Override // android.webkit.WebViewClient
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
HashSet hashSet;
TapjoyLog.d("TJSplitWebView", "shouldOverrideUrlLoading: " + str);
Uri parse = Uri.parse(str);
if (parse != null) {
String host = parse.getHost();
String scheme = parse.getScheme();
if (scheme != null && host != null && ((scheme.equals("http") || scheme.equals("https")) && ((hashSet = this.a.h) == null || !hashSet.contains(host)))) {
this.a.e = str;
return false;
}
}
try {
this.a.k.startActivity(new Intent("android.intent.action.VIEW", parse));
if (this.a.l.booleanValue()) {
return true;
}
this.a.j.dismissSplitView(null, null);
return true;
} catch (Exception e) {
TapjoyLog.e("TJSplitWebView", e.getMessage());
return true;
}
}
}

View File

@@ -0,0 +1,71 @@
package com.tapjoy;
import android.content.Context;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import com.ironsource.nb;
import com.tapjoy.TapjoyErrorMessage;
/* loaded from: classes4.dex */
public final class c implements Runnable {
public final /* synthetic */ Context a;
public final /* synthetic */ TJPlacementData b;
public final /* synthetic */ boolean c;
public final /* synthetic */ TJAdUnit d;
public c(TJAdUnit tJAdUnit, Context context, TJPlacementData tJPlacementData, boolean z) {
this.d = tJAdUnit;
this.a = context;
this.b = tJPlacementData;
this.c = z;
}
@Override // java.lang.Runnable
public final void run() {
TJAdUnit tJAdUnit = this.d;
Context context = this.a;
tJAdUnit.getClass();
if (Looper.myLooper() == Looper.getMainLooper() && !tJAdUnit.i && context != null) {
TapjoyLog.d("TJAdUnit", "Constructing ad unit");
tJAdUnit.i = true;
try {
tJAdUnit.d = new View(context);
TJWebView tJWebView = new TJWebView(context);
tJAdUnit.e = tJWebView;
tJWebView.setWebViewClient(tJAdUnit.l);
tJAdUnit.e.setWebChromeClient(tJAdUnit.m);
tJAdUnit.c = new TJAdUnitJSBridge(new k(tJAdUnit));
if (context instanceof TJAdUnitActivity) {
tJAdUnit.setAdUnitActivity((TJAdUnitActivity) context);
}
} catch (Exception e) {
TapjoyLog.w("TJAdUnit", e.getMessage());
return;
}
}
if (tJAdUnit.i) {
TapjoyLog.i("TJAdUnit", "Loading ad unit content");
this.d.g = true;
try {
if (TextUtils.isEmpty(this.b.getRedirectURL())) {
if (this.b.getBaseURL() == null || this.b.getHttpResponse() == null) {
TapjoyLog.e("TJAdUnit", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Error loading ad unit content"));
this.d.g = false;
} else {
this.d.e.loadDataWithBaseURL(this.b.getBaseURL(), this.b.getHttpResponse(), "text/html", nb.N, null);
}
} else if (this.b.isPreloadDisabled()) {
this.d.e.postUrl(this.b.getRedirectURL(), null);
} else {
this.d.e.loadUrl(this.b.getRedirectURL());
}
} catch (Exception unused) {
TapjoyLog.e("TJAdUnit", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "Error loading ad unit content"));
this.d.g = false;
}
TJAdUnit tJAdUnit2 = this.d;
tJAdUnit2.h = tJAdUnit2.g && this.c;
}
}
}

View File

@@ -0,0 +1,37 @@
package com.tapjoy;
import com.tapjoy.internal.d3;
/* loaded from: classes4.dex */
public final class c0 extends Thread {
public final /* synthetic */ String a;
public final /* synthetic */ TJPlacement b;
public final /* synthetic */ d3 c;
public final /* synthetic */ com.tapjoy.internal.k d;
public final /* synthetic */ TJCorePlacement e;
public c0(TJCorePlacement tJCorePlacement, String str, TJPlacement tJPlacement, d3 d3Var, com.tapjoy.internal.k kVar) {
this.e = tJCorePlacement;
this.a = str;
this.b = tJPlacement;
this.c = d3Var;
this.d = kVar;
}
/* JADX WARN: Code restructure failed: missing block: B:49:0x0209, code lost:
if (r9 > r11) goto L58;
*/
@Override // java.lang.Thread, java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
Method dump skipped, instructions count: 584
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.tapjoy.c0.run():void");
}
}

View File

@@ -0,0 +1,19 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public abstract /* synthetic */ class c1 {
public static final /* synthetic */ int[] a;
static {
int[] iArr = new int[TJStatus.values().length];
a = iArr;
try {
iArr[TJStatus.FALSE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[TJStatus.TRUE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}

View File

@@ -0,0 +1,207 @@
package com.tapjoy;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.URLUtil;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.google.android.gms.drive.DriveFile;
import com.tapjoy.TapjoyErrorMessage;
import java.io.FileInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
/* loaded from: classes4.dex */
public final class d extends WebViewClient {
public final /* synthetic */ TJAdUnit a;
public d(TJAdUnit tJAdUnit) {
this.a = tJAdUnit;
}
public final boolean a(String str) {
NetworkInfo activeNetworkInfo;
TJAdUnit tJAdUnit = this.a;
tJAdUnit.getClass();
try {
if (tJAdUnit.e.getContext() != null && (activeNetworkInfo = ((ConnectivityManager) tJAdUnit.e.getContext().getSystemService("connectivity")).getActiveNetworkInfo()) != null && activeNetworkInfo.isAvailable()) {
if (activeNetworkInfo.isConnected() && URLUtil.isValidUrl(str)) {
this.a.getClass();
try {
String host = new URL(TapjoyConnectCore.getInstance().getHostURL()).getHost();
if ((host != null && str.contains(host)) || str.contains(TapjoyConnectCore.getInstance().getRedirectDomain()) || str.contains(TapjoyUtil.getRedirectDomain(TapjoyConnectCore.getInstance().getPlacementURL()))) {
return false;
}
} catch (MalformedURLException unused) {
}
if (this.a.c.allowRedirect) {
Uri parse = Uri.parse(str);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(parse);
intent.addFlags(DriveFile.MODE_READ_ONLY);
if (this.a.e.getContext() != null) {
try {
this.a.e.getContext().startActivity(intent);
return true;
} catch (Exception e) {
TapjoyLog.e("TJAdUnit", "Exception in loading URL. " + e.getMessage());
}
}
} else if (str.startsWith("javascript:")) {
try {
this.a.e.evaluateJavascript(str.replaceFirst("javascript:", ""), null);
return true;
} catch (Exception e2) {
TapjoyLog.e("TJAdUnit", "Exception in evaluateJavascript. Device not supported. " + e2.toString());
}
}
return false;
}
}
} catch (Exception e3) {
TapjoyLog.d("TJAdUnit", "Exception getting NetworkInfo: " + e3.getLocalizedMessage());
}
TJAdUnitActivity tJAdUnitActivity = this.a.b;
if (tJAdUnitActivity != null) {
tJAdUnitActivity.showErrorDialog();
}
return true;
}
@Override // android.webkit.WebViewClient
public final void onLoadResource(WebView webView, String str) {
}
@Override // android.webkit.WebViewClient
public final void onPageFinished(WebView webView, String str) {
TJAdUnitJSBridge tJAdUnitJSBridge;
TapjoyLog.d("TJAdUnit", "onPageFinished: " + str);
TJAdUnit tJAdUnit = this.a;
if (tJAdUnit.j) {
return;
}
TJAdUnitActivity tJAdUnitActivity = tJAdUnit.b;
if (tJAdUnitActivity != null) {
tJAdUnitActivity.setProgressSpinnerVisibility(false);
}
TJAdUnit tJAdUnit2 = this.a;
tJAdUnit2.j = true;
if (tJAdUnit2.f && (tJAdUnitJSBridge = tJAdUnit2.c) != null) {
tJAdUnitJSBridge.display();
}
TJAdUnitJSBridge tJAdUnitJSBridge2 = this.a.c;
if (tJAdUnitJSBridge2 != null) {
tJAdUnitJSBridge2.flushMessageQueue();
}
}
@Override // android.webkit.WebViewClient
public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
TapjoyLog.d("TJAdUnit", "onPageStarted: " + str);
TJAdUnitJSBridge tJAdUnitJSBridge = this.a.c;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.allowRedirect = true;
tJAdUnitJSBridge.customClose = false;
tJAdUnitJSBridge.closeRequested = false;
}
}
@Override // android.webkit.WebViewClient
public final void onReceivedError(WebView webView, int i, String str, String str2) {
TapjoyLog.d("TJAdUnit", "error:" + str);
TJAdUnitActivity tJAdUnitActivity = this.a.b;
if (tJAdUnitActivity != null) {
tJAdUnitActivity.showErrorDialog();
}
if (this.a.getSdkBeacon() != null) {
com.tapjoy.internal.z0 sdkBeacon = this.a.getSdkBeacon();
if (!TextUtils.isEmpty(sdkBeacon.d)) {
HashMap hashMap = new HashMap(sdkBeacon.b);
hashMap.put("error", "loadFailure");
new com.tapjoy.internal.y0(sdkBeacon, hashMap).start();
}
}
super.onReceivedError(webView, i, str, str2);
}
@Override // android.webkit.WebViewClient
public final boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
TapjoyLog.e("TJAdUnit", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.SDK_ERROR, "WebView rendering process exited while instantiating a WebViewClient unexpectedly"));
if (this.a.getSdkBeacon() != null) {
com.tapjoy.internal.z0 sdkBeacon = this.a.getSdkBeacon();
if (!TextUtils.isEmpty(sdkBeacon.d)) {
HashMap hashMap = new HashMap(sdkBeacon.b);
hashMap.put("error", "terminated");
new com.tapjoy.internal.y0(sdkBeacon, hashMap).start();
}
}
View view = this.a.d;
if (view != null) {
ViewGroup viewGroup = (ViewGroup) view.getParent();
if (viewGroup != null) {
viewGroup.removeView(this.a.d);
}
this.a.d = null;
}
TJWebView tJWebView = this.a.e;
if (tJWebView != null) {
ViewGroup viewGroup2 = (ViewGroup) tJWebView.getParent();
if (viewGroup2 != null) {
viewGroup2.removeView(this.a.e);
}
this.a.e.removeAllViews();
this.a.e.destroy();
this.a.e = null;
}
TJAdUnitJSBridge tJAdUnitJSBridge = this.a.c;
if (tJAdUnitJSBridge != null) {
tJAdUnitJSBridge.cleanUpJSBridge();
this.a.c = null;
}
TJAdUnitActivity tJAdUnitActivity = this.a.b;
if (tJAdUnitActivity == null) {
return true;
}
tJAdUnitActivity.finish();
return true;
}
@Override // android.webkit.WebViewClient
public final WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
TapjoyCachedAssetData cachedDataForURL;
WebResourceResponse webResourceResponse;
if (TapjoyCache.getInstance() != null && (cachedDataForURL = TapjoyCache.getInstance().getCachedDataForURL(str)) != null) {
try {
webResourceResponse = new WebResourceResponse(cachedDataForURL.getMimeType(), "UTF-8", new FileInputStream(cachedDataForURL.getLocalFilePath()));
} catch (Exception unused) {
webResourceResponse = null;
}
if (webResourceResponse != null) {
TapjoyLog.d("TJAdUnit", "Reading request for " + str + " from cache -- localPath: " + cachedDataForURL.getLocalFilePath());
return webResourceResponse;
}
}
return super.shouldInterceptRequest(webView, str);
}
@Override // android.webkit.WebViewClient
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
return a(str);
}
@Override // android.webkit.WebViewClient
public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
return a(webResourceRequest.getUrl().toString());
}
}

View File

@@ -0,0 +1,19 @@
package com.tapjoy;
import android.content.Intent;
/* loaded from: classes4.dex */
public final class d0 implements Runnable {
public final /* synthetic */ Intent a;
public final /* synthetic */ TJCorePlacement b;
public d0(TJCorePlacement tJCorePlacement, Intent intent) {
this.b = tJCorePlacement;
this.a = intent;
}
@Override // java.lang.Runnable
public final void run() {
this.b.b.startActivity(this.a);
}
}

View File

@@ -0,0 +1,20 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class d1 implements Runnable {
public final /* synthetic */ TJWebViewActivity a;
public d1(TJWebViewActivity tJWebViewActivity) {
this.a = tJWebViewActivity;
}
@Override // java.lang.Runnable
public final void run() {
TJAdUnitJSBridge tJAdUnitJSBridge = this.a.g;
if (tJAdUnitJSBridge == null || !tJAdUnitJSBridge.closeRequested) {
return;
}
TapjoyLog.d("TJWebViewActivity", "Did not receive callback from content. Closing ad.");
this.a.finish();
}
}

View File

@@ -0,0 +1,41 @@
package com.tapjoy;
import android.webkit.ConsoleMessage;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
/* loaded from: classes4.dex */
public final class e extends WebChromeClient {
public final /* synthetic */ TJAdUnit a;
public e(TJAdUnit tJAdUnit) {
this.a = tJAdUnit;
}
@Override // android.webkit.WebChromeClient
public final boolean onConsoleMessage(ConsoleMessage consoleMessage) {
TJAdUnit tJAdUnit = this.a;
TJAdUnitJSBridge tJAdUnitJSBridge = tJAdUnit.c;
if (tJAdUnitJSBridge == null || !tJAdUnitJSBridge.closeRequested) {
return true;
}
String[] strArr = {"Uncaught", "uncaught", "Error", "error", "not defined"};
if (tJAdUnit.b == null) {
return true;
}
for (int i = 0; i < 5; i++) {
if (consoleMessage.message().contains(strArr[i])) {
this.a.b.a(false);
return true;
}
}
return true;
}
@Override // android.webkit.WebChromeClient
public final boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
TapjoyLog.d("TJAdUnit", str2);
return false;
}
}

View File

@@ -0,0 +1,15 @@
package com.tapjoy;
/* loaded from: classes4.dex */
public final class e0 implements TJCacheListener {
public final /* synthetic */ b0 a;
public e0(b0 b0Var) {
this.a = b0Var;
}
@Override // com.tapjoy.TJCacheListener
public final void onCachingComplete(int i) {
this.a.onCachingComplete(i);
}
}

View File

@@ -0,0 +1,23 @@
package com.tapjoy;
import android.graphics.Color;
import com.tapjoy.TJWebViewActivity;
/* loaded from: classes4.dex */
public final class e1 implements Runnable {
public final /* synthetic */ String a;
public final /* synthetic */ TJTaskHandler b;
public final /* synthetic */ TJWebViewActivity.BridgeDelegate c;
public e1(TJWebViewActivity.BridgeDelegate bridgeDelegate, String str, TJTaskHandler tJTaskHandler) {
this.c = bridgeDelegate;
this.a = str;
this.b = tJTaskHandler;
}
@Override // java.lang.Runnable
public final void run() {
TJWebViewActivity.this.e.setBackgroundColor(Color.parseColor(this.a));
this.b.onComplete(Boolean.TRUE);
}
}

Some files were not shown because too many files have changed in this diff Show More