导航菜单

页面标题

页面副标题

Housing v14.7.8 - MoEActivity.java 源代码

正在查看: Housing v14.7.8 应用的 MoEActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.moe.pushlibrary.activities;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.fragment.app.u;
import com.moengage.core.MoEConstants;
import com.moengage.core.R;
import com.moengage.core.internal.CoreConstants;
import com.moengage.core.internal.global.GlobalCache;
import com.moengage.core.internal.logger.Logger;
import com.moengage.core.internal.rest.RestConstantsKt;
import com.moengage.core.internal.utils.CoreUtils;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import kotlin.Metadata;
import kotlin.jvm.internal.r;
import kotlin.text.q;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0019\u0010\u0007\u001a\u00020\u00062\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0015¢\u0006\u0004\b\u0007\u0010\bR\u0014\u0010\n\u001a\u00020\t8\u0002X\u0082D¢\u0006\u0006\n\u0004\b\n\u0010\u000b¨\u0006\f"}, d2 = {"Lcom/moe/pushlibrary/activities/MoEActivity;", "Landroidx/fragment/app/u;", "<init>", "()V", "Landroid/os/Bundle;", "savedInstanceState", "Lzp/j0;", "onCreate", "(Landroid/os/Bundle;)V", "", "tag", "Ljava/lang/String;", "core_defaultRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
@Instrumented
public final class MoEActivity extends u implements TraceFieldInterface {
    public Trace _nr_trace;

    @NotNull
    private final String tag = "Core_MoEActivity";

    @SuppressLint({"SetJavaScriptEnabled"})
    public void onCreate(@Nullable Bundle savedInstanceState) {
        Context applicationContext;
        TraceMachine.startTracing("MoEActivity");
        try {
            TraceMachine.enterMethod(this._nr_trace, "MoEActivity#onCreate", null);
        } catch (NoSuchFieldError unused) {
            TraceMachine.enterMethod(null, "MoEActivity#onCreate", null);
        }
        super.onCreate(savedInstanceState);
        try {
            applicationContext = getApplicationContext();
            r.j(applicationContext, "getApplicationContext(...)");
        } catch (Throwable th) {
            Logger.Companion companion = Logger.INSTANCE;
            Logger.Companion.print$default(companion, 1, th, null, new MoEActivity$onCreate$5(this), 4, null);
            Logger.Companion.print$default(companion, 0, null, null, new MoEActivity$onCreate$6(this), 7, null);
            finish();
        }
        if (!CoreUtils.canUseWebView(applicationContext)) {
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new MoEActivity$onCreate$1(this), 7, null);
            finish();
            TraceMachine.exitMethod();
            return;
        }
        setContentView(R.layout.activity_moe_rich_landing);
        WebView webView = (WebView) findViewById(R.id.moeRichLandingWebView);
        Bundle extras = getIntent().getExtras();
        if (extras != null && extras.containsKey(MoEConstants.PUSH_NOTIFICATION_NAVIGATION_DEEPLINK_LEGACY)) {
            String string = extras.getString(MoEConstants.PUSH_NOTIFICATION_NAVIGATION_DEEPLINK_LEGACY);
            if (string != null && !q.D(string)) {
                final boolean z = extras.getBoolean(CoreConstants.EXTRA_IS_EMBEDDED_WEB_VIEW, false);
                Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new MoEActivity$onCreate$3(this, z), 7, null);
                webView.loadUrl(string);
                webView.getSettings().setJavaScriptEnabled(GlobalCache.INSTANCE.getJsConfig().getIsJavaScriptEnabled());
                webView.getSettings().setBuiltInZoomControls(true);
                webView.setWebViewClient(new WebViewClient() {
                    @Override
                    public boolean shouldOverrideUrlLoading(@NotNull WebView view, @NotNull String url) {
                        r.k(view, "view");
                        r.k(url, "url");
                        try {
                            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new MoEActivity$onCreate$4$shouldOverrideUrlLoading$1(this, url), 7, null);
                            Uri parse = Uri.parse(url);
                            String scheme = parse.getScheme();
                            if (!z || (!RestConstantsKt.SCHEME_HTTP.equals(scheme) && !RestConstantsKt.SCHEME_HTTPS.equals(scheme))) {
                                this.startActivity(new Intent("android.intent.action.VIEW", parse));
                                return true;
                            }
                            return false;
                        } catch (Throwable th2) {
                            Logger.Companion.print$default(Logger.INSTANCE, 1, th2, null, new MoEActivity$onCreate$4$shouldOverrideUrlLoading$2(this), 4, null);
                            return false;
                        }
                    }
                });
                TraceMachine.exitMethod();
                return;
            }
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new MoEActivity$onCreate$2(this), 7, null);
            finish();
            TraceMachine.exitMethod();
            return;
        }
        finish();
        TraceMachine.exitMethod();
    }

    public void onStart() {
        super.onStart();
        ApplicationStateMonitor.getInstance().activityStarted();
    }

    public void onStop() {
        super.onStop();
        ApplicationStateMonitor.getInstance().activityStopped();
    }
}