导航菜单

页面标题

页面副标题

Perplexity v2.48.1 - AssistantActivity.java 源代码

正在查看: Perplexity v2.48.1 应用的 AssistantActivity.java JAVA 源代码文件

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


package ai.perplexity.app.android.assistant;

import B5.e;
import D3.s;
import E3.h;
import Ec.i;
import J3.C0296m;
import Jk.b;
import K.j;
import Lk.c;
import O9.t;
import Rc.a;
import ai.perplexity.app.android.assistant.AssistantActivity;
import ai.perplexity.app.android.assistant.action.KeyguardDismissActivity;
import ai.perplexity.app.android.assistant.partner.dt.IntroActivity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.k0;
import androidx.lifecycle.r0;
import bl.g;
import c.d;
import c.o;
import c4.AbstractC1640c;
import d.C1804n;
import d.C1810q;
import i.C2555C;
import i.C2569b;
import i.V;
import i.W;
import i.Y;
import k.AbstractC2943c;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import l0.C3198q0;
import om.F;
import om.H;
import t.C4067d;
import t5.C4115d0;
import t5.C4116e;
import t5.C4129k0;

@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0002\b\u0007\u0018\u0000B\u0007¢\u0006\u0004\b\u0001\u0010\u0002¨\u0006\u0005²\u0006\f\u0010\u0004\u001a\u00020\u00038\nX\u008a\u0084\u0002"}, d2 = {"Lai/perplexity/app/android/assistant/AssistantActivity;", "<init>", "()V", "", "contentAlpha", "assistant_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
@SourceDebugExtension
public final class AssistantActivity extends ComponentActivity implements c {

    public static AssistantActivity f19465z0;

    public C2555C f19467Y;

    public V f19468Z;

    public C3198q0 f19469r0;

    public C1804n f19470s0;

    public Y f19471t0;

    public C1810q f19472u0;

    public C4067d f19473v0;

    public j f19474w0;

    public i f19475x;

    public final C4129k0 f19476x0;

    public volatile b f19477y;

    public boolean f19478y0;

    public final Object f19479z = new Object();

    public boolean f19466X = false;

    public AssistantActivity() {
        addOnContextAvailableListener(new C0296m(this, 2));
        this.f19476x0 = C4116e.C(Boolean.FALSE, C4115d0.f41758e);
    }

    public final Object a() {
        return e().a();
    }

    public final b e() {
        if (this.f19477y == null) {
            synchronized (this.f19479z) {
                try {
                    if (this.f19477y == null) {
                        this.f19477y = new b(this);
                    }
                } finally {
                }
            }
        }
        return this.f19477y;
    }

    public final C2555C f() {
        C2555C c2555c = this.f19467Y;
        if (c2555c != null) {
            return c2555c;
        }
        Intrinsics.n("assistantViewModel");
        throw null;
    }

    public final void g(Bundle bundle) {
        super.onCreate(bundle);
        if (getApplication() instanceof Lk.b) {
            i c10 = e().c();
            this.f19475x = c10;
            if (c10.u()) {
                this.f19475x.w = getDefaultViewModelCreationExtras();
            }
        }
    }

    @Override
    public final r0 getDefaultViewModelProviderFactory() {
        return t.x(this, super.getDefaultViewModelProviderFactory());
    }

    public final void h() {
        super.onDestroy();
        i iVar = this.f19475x;
        if (iVar != null) {
            iVar.w = null;
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        Uri data;
        Intent intent = getIntent();
        if (intent != null && (data = intent.getData()) != null) {
            Intent intent2 = getIntent();
            if (Intrinsics.c(intent2 != null ? intent2.getAction() : null, "android.intent.action.VIEW") && Intrinsics.c(data.getScheme(), "perplexity-app") && Intrinsics.c(data.getHost(), "assistant") && Intrinsics.c(data.getPath(), "/gcal-login-callback")) {
                try {
                    Intent intent3 = new Intent();
                    intent3.setComponent(new ComponentName("ai.perplexity.app.android", "ai.perplexity.app.android.ui.main.MainActivity"));
                    intent3.setFlags(268533760);
                    startActivity(intent3);
                    Intent intent4 = new Intent(this, (Class<?>) AssistantActivity.class);
                    intent4.setFlags(196608);
                    startActivity(intent4);
                } catch (Exception e10) {
                    Jn.c.a.j(e10, "Could not maybeStartMainActivityBehind: %s", new Object[]{e10.getLocalizedMessage()});
                }
            }
        }
        s.a(this);
        g(bundle);
        f19465z0 = this;
        getWindow().addFlags(128);
        if (Build.VERSION.SDK_INT >= 27) {
            a.d(this);
            a.f(this);
        } else {
            Window window = getWindow();
            window.addFlags(524288);
            window.addFlags(2097152);
        }
        boolean z10 = AbstractC2943c.f33482a;
        j jVar = this.f19474w0;
        if (jVar == null) {
            Intrinsics.n("remoteThreadRequests");
            throw null;
        }
        AbstractC2943c.f33482a = ((Boolean) jVar.f5980r.invoke()).booleanValue();
        if (AbstractC2943c.a() && !getSharedPreferences("deutsche_telekom_assistant", 0).getBoolean("deutsche_telekom_accepted_terms_conditions", false)) {
            startActivity(new Intent(this, (Class<?>) IntroActivity.class));
            finish();
        }
        f().s(true);
        h.a(this, new e(new d(this, 2), true, -990849480));
        H.o(k0.h(this), (CoroutineContext) null, (F) null, new c.b(this, null), 3);
        V v2 = this.f19468Z;
        if (v2 == null) {
            Intrinsics.n("contacts");
            throw null;
        }
        if (!v2.f31458f) {
            v2.b();
        }
        C3198q0 c3198q0 = this.f19469r0;
        if (c3198q0 == null) {
            Intrinsics.n("userLocationRefresher");
            throw null;
        }
        c3198q0.a();
        C1804n c1804n = this.f19470s0;
        if (c1804n == null) {
            Intrinsics.n("appsRetriever");
            throw null;
        }
        c1804n.a();
        Y y8 = this.f19471t0;
        if (y8 == null) {
            Intrinsics.n("prefetchedUploadData");
            throw null;
        }
        y8.a();
        C4067d c4067d = this.f19473v0;
        if (c4067d != null) {
            c4067d.f41402l.f42910a.c("assistant start", g.w);
        } else {
            Intrinsics.n("analytics");
            throw null;
        }
    }

    @Override
    public final void onDestroy() {
        o oVar;
        h();
        if (isChangingConfigurations()) {
            return;
        }
        f().p();
        C2555C f4 = f();
        H.g(f4.f31361E0.w);
        f4.p();
        f().s(false);
        if (Intrinsics.c(Build.MANUFACTURER, "samsung") && Build.VERSION.SDK_INT <= 34 && (oVar = o.f22680y) != null) {
            oVar.finish();
        }
        f19465z0 = null;
        KeyguardDismissActivity.f19500Y = false;
        KeyguardDismissActivity keyguardDismissActivity = KeyguardDismissActivity.f19501y;
        if (keyguardDismissActivity != null) {
            keyguardDismissActivity.finish();
        }
    }

    @Override
    public final void onNewIntent(Intent intent) {
        Intrinsics.h(intent, "intent");
        super.onNewIntent(intent);
        f().g();
    }

    @Override
    public final void onPause() {
        super.onPause();
        if (this.f19478y0) {
            this.f19478y0 = false;
        } else {
            this.f19476x0.setValue(Boolean.TRUE);
        }
    }

    @Override
    public final void onResume() {
        super.onResume();
        this.f19476x0.setValue(Boolean.FALSE);
        this.f19478y0 = false;
    }

    @Override
    public final void onStart() {
        super.onStart();
        if (checkSelfPermission("android.permission.RECORD_AUDIO") == 0) {
            if (((C2569b) f().f31364H0.getValue()).f31490b != W.f31460w || ((C2569b) f().f31364H0.getValue()).f31491c) {
                return;
            }
            f().u();
            return;
        }
        C1810q c1810q = this.f19472u0;
        if (c1810q == null) {
            Intrinsics.n("assistantStrings");
            throw null;
        }
        String f4 = c1810q.f(2132018960);
        C1810q c1810q2 = this.f19472u0;
        if (c1810q2 == null) {
            Intrinsics.n("assistantStrings");
            throw null;
        }
        String f10 = c1810q2.f(2132018961);
        final int i10 = 0;
        Function0 function0 = new Function0(this) {

            public final AssistantActivity f22648x;

            {
                this.f22648x = this;
            }

            public final Object invoke() {
                AssistantActivity assistantActivity = this.f22648x;
                switch (i10) {
                    case 0:
                        AssistantActivity assistantActivity2 = AssistantActivity.f19465z0;
                        assistantActivity.f().u();
                        break;
                    default:
                        AssistantActivity assistantActivity3 = AssistantActivity.f19465z0;
                        assistantActivity.finish();
                        break;
                }
                return Unit.a;
            }
        };
        final int i11 = 1;
        AbstractC1640c.J(this, "android.permission.RECORD_AUDIO", f4, f10, function0, new Function0(this) {

            public final AssistantActivity f22648x;

            {
                this.f22648x = this;
            }

            public final Object invoke() {
                AssistantActivity assistantActivity = this.f22648x;
                switch (i11) {
                    case 0:
                        AssistantActivity assistantActivity2 = AssistantActivity.f19465z0;
                        assistantActivity.f().u();
                        break;
                    default:
                        AssistantActivity assistantActivity3 = AssistantActivity.f19465z0;
                        assistantActivity.finish();
                        break;
                }
                return Unit.a;
            }
        }, true);
    }
}