导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - k.java 源代码

正在查看: Hopscotch v9.7.2 应用的 k.java JAVA 源代码文件

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


package in.hopscotch.android.fragment;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.fragment.app.Fragment;
import in.hopscotch.android.activity.OTPVerificationActivity;
import in.hopscotch.android.api.factory.CustomerInfoApiFactory;
import in.hopscotch.android.api.response.AccountDeleteWebLink;
import in.hopscotch.android.api.rest.HSRetrofitCallback;
import in.hopscotch.android.components.button.CustomButton;
import in.hopscotch.android.components.progress.DotLoader;
import in.hopscotch.android.databinding.y5;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import retrofit2.Response;

@Metadata
public final class k extends Fragment implements View.OnClickListener {
    private y5 binding;

    @NotNull
    private String nameValue = "";

    public static final class a extends HSRetrofitCallback<AccountDeleteWebLink> {
        public a() {
        }

        public final void onFailure(Throwable th) {
            k.this.B(false);
            Log.i("TAG", String.valueOf(th));
        }

        public final void onResponse(Response<AccountDeleteWebLink> response) {
            AccountDeleteWebLink body;
            String webViewLink;
            k kVar = k.this;
            kVar.B(false);
            if (response == null || !response.isSuccessful()) {
                return;
            }
            y5 y5Var = kVar.binding;
            if (y5Var == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                y5Var = null;
            }
            AccountDeleteWebLink body2 = response.body();
            if (TextUtils.isEmpty(body2 != null ? body2.getWebViewLink() : null) || (body = response.body()) == null || (webViewLink = body.getWebViewLink()) == null || webViewLink.length() <= 0) {
                return;
            }
            y5Var.i.loadUrl("https://www.hopscotch.in/delete-policy");
        }
    }

    public final void B(boolean z) {
        DotLoader dotLoader;
        int i;
        y5 y5Var = this.binding;
        if (y5Var == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            y5Var = null;
        }
        if (z) {
            dotLoader = y5Var.h;
            i = 0;
        } else {
            dotLoader = y5Var.h;
            i = 8;
        }
        dotLoader.setVisibility(i);
    }

    @Override
    public final void onClick(View view) {
        Integer valueOf = view != null ? Integer.valueOf(view.getId()) : null;
        if (valueOf != null && valueOf.intValue() == 2131362186) {
            requireActivity().finish();
            return;
        }
        if (valueOf != null && valueOf.intValue() == 2131361976) {
            OTPVerificationActivity.a aVar = OTPVerificationActivity.p;
            Context context = requireContext();
            String loginId = this.nameValue;
            Intrinsics.checkNotNull(context);
            aVar.getClass();
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(loginId, "loginId");
            Intrinsics.checkNotNullParameter("DELETE_ACCOUNT", "otpReason");
            context.startActivity(OTPVerificationActivity.a.a(context, loginId, "DELETE_ACCOUNT", (Integer) null, (String) null, (Integer) null));
        }
    }

    @NotNull
    public final View onCreateView(@NotNull LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
        Intrinsics.checkNotNullParameter(inflater, "inflater");
        LayoutInflater layoutInflater = getLayoutInflater();
        int i = y5.j;
        androidx.databinding.p pVar = (y5) androidx.databinding.p.M(layoutInflater, 2131558686, viewGroup, false, androidx.databinding.g.e());
        Intrinsics.checkNotNullExpressionValue(pVar, "inflate(...)");
        this.binding = pVar;
        if (pVar == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            pVar = null;
        }
        View E = pVar.E();
        Intrinsics.checkNotNullExpressionValue(E, "getRoot(...)");
        return E;
    }

    @SuppressLint({"NewApi"})
    public final void onViewCreated(@NotNull View view, Bundle bundle) {
        Intrinsics.checkNotNullParameter(view, "view");
        super.onViewCreated(view, bundle);
        B(true);
        Bundle arguments = getArguments();
        y5 y5Var = null;
        String string = arguments != null ? arguments.getString("INTENT_EXTRA_VALUE", "") : null;
        this.nameValue = string != null ? string : "";
        int i = Build.VERSION.SDK_INT;
        if (i >= 26) {
            y5 y5Var2 = this.binding;
            if (y5Var2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                y5Var2 = null;
            }
            y5Var2.i.setRendererPriorityPolicy(1, true);
        }
        y5 y5Var3 = this.binding;
        if (y5Var3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            y5Var3 = null;
        }
        WebSettings settings = y5Var3.i.getSettings();
        settings.setDomStorageEnabled(true);
        settings.setJavaScriptEnabled(true);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setSupportZoom(false);
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
        settings.setGeolocationEnabled(false);
        if (i >= 26) {
            settings.setSafeBrowsingEnabled(true);
        }
        if (i >= 27) {
            WebView.startSafeBrowsing(requireActivity(), null);
        }
        y5 y5Var4 = this.binding;
        if (y5Var4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            y5Var4 = null;
        }
        y5Var4.i.setWebViewClient(new WebViewClient());
        y5 y5Var5 = this.binding;
        if (y5Var5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            y5Var = y5Var5;
        }
        y5Var.e.setOnClickListener(this);
        y5Var.f.setOnClickListener(this);
        CustomButton customButton = y5Var.d;
        customButton.setOnClickListener(this);
        customButton.setEnabled(false);
        customButton.setClickable(false);
        y5Var.e.setOnClickListener(new androidx.media3.ui.j(y5Var, 22));
        CustomerInfoApiFactory.getInstance().checkDeleteEligibility(new a());
    }
}