导航菜单

页面标题

页面副标题

Housing v14.7.8 - TransactionActivity.java 源代码

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

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


package com.chuckerteam.chucker.internal.ui.transaction;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.f0;
import androidx.lifecycle.x0;
import androidx.lifecycle.z0;
import androidx.viewpager.widget.ViewPager;
import com.chuckerteam.chucker.internal.data.entity.HttpTransaction;
import com.chuckerteam.chucker.internal.support.p0;
import com.chuckerteam.chucker.internal.support.r0;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.tabs.TabLayout;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.jvm.internal.n0;
import kotlinx.coroutines.l0;
import org.jetbrains.annotations.NotNull;

@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0000\u0018\u0000 \r2\u00020\u0001:\u0001\u000eB\u0007¢\u0006\u0004\b\u0002\u0010\u0003R\u001b\u0010\t\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0005\u0010\u0006\u001a\u0004\b\u0007\u0010\bR\u0016\u0010\u000b\u001a\u00020\n8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b\u000b\u0010\f¨\u0006\u000f"}, d2 = {"Lcom/chuckerteam/chucker/internal/ui/transaction/TransactionActivity;", "Lcom/chuckerteam/chucker/internal/ui/a;", "<init>", "()V", "Lcom/chuckerteam/chucker/internal/ui/transaction/x;", "viewModel$delegate", "Lkotlin/Lazy;", "r", "()Lcom/chuckerteam/chucker/internal/ui/transaction/x;", "viewModel", "Lj5/b;", "transactionBinding", "Lj5/b;", "Companion", "a", "com.github.ChuckerTeam.Chucker.library"}, k = 1, mv = {2, 0, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nTransactionActivity.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TransactionActivity.kt\ncom/chuckerteam/chucker/internal/ui/transaction/TransactionActivity\n+ 2 ActivityViewModelLazy.kt\nandroidx/activity/ActivityViewModelLazyKt\n*L\n1#1,187:1\n75#2,13:188\n*S KotlinDebug\n*F\n+ 1 TransactionActivity.kt\ncom/chuckerteam/chucker/internal/ui/transaction/TransactionActivity\n*L\n29#1:188,13\n*E\n"})
public final class TransactionActivity extends com.chuckerteam.chucker.internal.ui.a {

    @NotNull
    public static final Companion INSTANCE = new Companion(null);

    @NotNull
    private static final String EXPORT_HAR_FILE_NAME = "transaction.har";

    @NotNull
    private static final String EXPORT_TXT_FILE_NAME = "transaction.txt";

    @NotNull
    private static final String EXTRA_TRANSACTION_ID = "transaction_id";
    private static int selectedTabPosition;
    private j5.b transactionBinding;

    @NotNull
    private final Lazy viewModel = new x0(n0.b(x.class), new b(this), new d(this, 0), new c(null, this));

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004R\u0014\u0010\u0005\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0005\u0010\u0004R\u0014\u0010\u0006\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0006\u0010\u0004R\u0016\u0010\b\u001a\u00020\u00078\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\b\u0010\t¨\u0006\n"}, d2 = {"Lcom/chuckerteam/chucker/internal/ui/transaction/TransactionActivity$a;", "", "", "EXPORT_TXT_FILE_NAME", "Ljava/lang/String;", "EXPORT_HAR_FILE_NAME", "EXTRA_TRANSACTION_ID", "", "selectedTabPosition", "I", "com.github.ChuckerTeam.Chucker.library"}, k = 1, mv = {2, 0, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/v0;", "VM", "Landroidx/lifecycle/z0;", "invoke", "()Landroidx/lifecycle/z0;", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class b extends kotlin.jvm.internal.s implements kq.a<z0> {
        final androidx.activity.h $this_viewModels;

        public b(androidx.activity.h hVar) {
            super(0);
            this.$this_viewModels = hVar;
        }

        @NotNull
        public final z0 m13invoke() {
            return this.$this_viewModels.getViewModelStore();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/v0;", "VM", "Ln2/a;", "invoke", "()Ln2/a;", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class c extends kotlin.jvm.internal.s implements kq.a<n2.a> {
        final kq.a $extrasProducer;
        final androidx.activity.h $this_viewModels;

        public c(kq.a aVar, androidx.activity.h hVar) {
            super(0);
            this.$extrasProducer = aVar;
            this.$this_viewModels = hVar;
        }

        @NotNull
        public final n2.a invoke() {
            n2.a aVar;
            kq.a aVar2 = this.$extrasProducer;
            return (aVar2 == null || (aVar = (n2.a) aVar2.invoke()) == null) ? this.$this_viewModels.getDefaultViewModelCreationExtras() : aVar;
        }
    }

    public static void p(TransactionActivity transactionActivity, String str) {
        j5.b bVar = transactionActivity.transactionBinding;
        if (bVar != null) {
            bVar.toolbarTitle.setText(str);
        } else {
            kotlin.jvm.internal.r.o("transactionBinding");
            throw null;
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        MaterialToolbar a;
        ViewPager a2;
        super.onCreate(bundle);
        CoordinatorLayout inflate = getLayoutInflater().inflate(i5.e.chucker_activity_transaction, (ViewGroup) null, false);
        int i = i5.d.tabLayout;
        TabLayout a3 = d4.a.a(i, inflate);
        if (a3 != null && (a = d4.a.a((i = i5.d.toolbar), inflate)) != null) {
            i = i5.d.toolbarTitle;
            TextView textView = (TextView) d4.a.a(i, inflate);
            if (textView != null && (a2 = d4.a.a((i = i5.d.viewPager), inflate)) != null) {
                j5.b bVar = new j5.b(inflate, a3, a, textView, a2);
                this.transactionBinding = bVar;
                setContentView(bVar.a());
                setSupportActionBar(bVar.toolbar);
                ViewPager viewPager = bVar.viewPager;
                kotlin.jvm.internal.r.j(viewPager, "viewPager");
                f0 supportFragmentManager = getSupportFragmentManager();
                kotlin.jvm.internal.r.j(supportFragmentManager, "getSupportFragmentManager(...)");
                viewPager.setAdapter(new m(this, supportFragmentManager));
                viewPager.c(new g());
                viewPager.setCurrentItem(selectedTabPosition);
                bVar.tabLayout.setupWithViewPager(bVar.viewPager);
                ActionBar supportActionBar = getSupportActionBar();
                if (supportActionBar != null) {
                    supportActionBar.m(true);
                }
                r().getTransactionTitle().i(this, new n(this, 1));
                return;
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
    }

    public final boolean onCreateOptionsMenu(Menu menu) {
        kotlin.jvm.internal.r.k(menu, "menu");
        getMenuInflater().inflate(i5.f.chucker_transaction, menu);
        MenuItem findItem = menu.findItem(i5.d.encode_url);
        findItem.setOnMenuItemClickListener(new com.chuckerteam.chucker.internal.ui.transaction.c(this, 0));
        r().getEncodeUrl().i(this, new n(findItem, 2));
        return super/*android.app.Activity*/.onCreateOptionsMenu(menu);
    }

    public final boolean onOptionsItemSelected(MenuItem menuItem) {
        kotlin.jvm.internal.r.k(menuItem, "item");
        int itemId = menuItem.getItemId();
        if (itemId == i5.d.share_text) {
            HttpTransaction httpTransaction = (HttpTransaction) r().getTransaction().e();
            if (httpTransaction == null) {
                String string = getString(i5.h.chucker_request_not_ready);
                kotlin.jvm.internal.r.j(string, "getString(...)");
                com.chuckerteam.chucker.internal.ui.a.o(this, string);
                return true;
            }
            Object e = r().getEncodeUrl().e();
            kotlin.jvm.internal.r.h(e);
            kotlinx.coroutines.k.c(androidx.lifecycle.t.a(this), (kotlin.coroutines.f) null, (l0) null, new i(new r0(httpTransaction, ((Boolean) e).booleanValue()), this, null), 3);
            return true;
        }
        if (itemId == i5.d.share_curl) {
            HttpTransaction httpTransaction2 = (HttpTransaction) r().getTransaction().e();
            if (httpTransaction2 != null) {
                kotlinx.coroutines.k.c(androidx.lifecycle.t.a(this), (kotlin.coroutines.f) null, (l0) null, new i(new p0(httpTransaction2), this, null), 3);
                return true;
            }
            String string2 = getString(i5.h.chucker_request_not_ready);
            kotlin.jvm.internal.r.j(string2, "getString(...)");
            com.chuckerteam.chucker.internal.ui.a.o(this, string2);
            return true;
        }
        if (itemId == i5.d.share_file) {
            kotlinx.coroutines.k.c(androidx.lifecycle.t.a(this), (kotlin.coroutines.f) null, (l0) null, new h(this, new e(this, null), EXPORT_TXT_FILE_NAME, null), 3);
            return true;
        }
        if (itemId != i5.d.share_har) {
            return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
        }
        kotlinx.coroutines.k.c(androidx.lifecycle.t.a(this), (kotlin.coroutines.f) null, (l0) null, new h(this, new f(this, null), EXPORT_HAR_FILE_NAME, null), 3);
        return true;
    }

    public final x r() {
        return (x) this.viewModel.getValue();
    }
}