导航菜单

页面标题

页面副标题

Bhakti v5.4.0 - N.java 源代码

正在查看: Bhakti v5.4.0 应用的 N.java JAVA 源代码文件

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


package T8;

import Ab.r;
import Ai.o;
import Ai.p;
import Gj.a;
import I8.c;
import I8.d;
import I8.e;
import I8.f;
import J8.b;
import L8.k0;
import L8.o0;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.credentials.playservices.controllers.BeginSignIn.CredentialProviderBeginSignInController$;
import androidx.fragment.app.y;
import com.facebook.FacebookActivity;
import hn.gqQ.FxGMxMBbSc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Metadata;
import kotlin.collections.S;
import kotlin.jvm.internal.Intrinsics;
import lk.JZ.XbbGto;
import org.json.JSONException;
import org.json.JSONObject;
import p8.A;
import p8.J;
import p8.L;
import p8.M;
import p8.g;
import p8.x;

@Metadata
public class n extends y {
    public static final j Companion = new j();
    private static final String DEVICE_LOGIN_ENDPOINT = "device/login";
    private static final String DEVICE_LOGIN_STATUS_ENDPOINT = "device/login_status";
    private static final int LOGIN_ERROR_SUBCODE_AUTHORIZATION_DECLINED = 1349173;
    private static final int LOGIN_ERROR_SUBCODE_AUTHORIZATION_PENDING = 1349174;
    private static final int LOGIN_ERROR_SUBCODE_CODE_EXPIRED = 1349152;
    private static final int LOGIN_ERROR_SUBCODE_EXCESSIVE_POLLING = 1349172;
    private static final String REQUEST_STATE_KEY = "request_state";
    private final AtomicBoolean completed = new AtomicBoolean();
    private TextView confirmationCode;
    private volatile J currentGraphRequestPoll;
    private volatile l currentRequestState;
    private o deviceAuthMethodHandler;
    private TextView instructions;
    private boolean isBeingDestroyed;
    private boolean isRetry;
    private View progressBar;
    private w request;
    private volatile ScheduledFuture<?> scheduledPoll;

    public static final void _get_pollRequest_$lambda$5(n nVar, L l) {
        p8.t tVar;
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        Intrinsics.checkNotNullParameter(l, "response");
        if (nVar.completed.get()) {
            return;
        }
        x xVar = l.c;
        if (xVar == null) {
            try {
                JSONObject jSONObject = l.b;
                if (jSONObject == null) {
                    jSONObject = new JSONObject();
                }
                String string = jSONObject.getString("access_token");
                Intrinsics.checkNotNullExpressionValue(string, "resultObject.getString(\"access_token\")");
                nVar.onSuccess(string, jSONObject.getLong("expires_in"), Long.valueOf(jSONObject.optLong("data_access_expiration_time")));
                return;
            } catch (JSONException e) {
                nVar.onError(new p8.t(e));
                return;
            }
        }
        int i = xVar.c;
        if (i == LOGIN_ERROR_SUBCODE_AUTHORIZATION_PENDING || i == LOGIN_ERROR_SUBCODE_EXCESSIVE_POLLING) {
            nVar.schedulePoll();
            return;
        }
        if (i != LOGIN_ERROR_SUBCODE_CODE_EXPIRED) {
            if (i == LOGIN_ERROR_SUBCODE_AUTHORIZATION_DECLINED) {
                nVar.onCancel();
                return;
            }
            if (xVar == null || (tVar = xVar.i) == null) {
                tVar = new p8.t();
            }
            nVar.onError(tVar);
            return;
        }
        l lVar = nVar.currentRequestState;
        if (lVar != null) {
            b.a(lVar.b);
        }
        w wVar = nVar.request;
        if (wVar != null) {
            nVar.startLogin(wVar);
        } else {
            nVar.onCancel();
        }
    }

    private final void completeLogin(String str, k kVar, String str2, Date date, Date date2) {
        o oVar = this.deviceAuthMethodHandler;
        if (oVar != null) {
            String b2 = A.b();
            ArrayList arrayList = kVar.a;
            ArrayList arrayList2 = kVar.b;
            ArrayList arrayList3 = kVar.c;
            g gVar = g.DEVICE_AUTH;
            Intrinsics.checkNotNullParameter(str2, "accessToken");
            Intrinsics.checkNotNullParameter(b2, "applicationId");
            Intrinsics.checkNotNullParameter(str, "userId");
            p8.b bVar = new p8.b(str2, b2, str, arrayList, arrayList2, arrayList3, gVar, date, (Date) null, date2);
            w wVar = oVar.d().g;
            Intrinsics.checkNotNullParameter(bVar, "token");
            oVar.d().d(new y(wVar, x.SUCCESS, bVar, (String) null, (String) null));
        }
        Dialog dialog = getDialog();
        if (dialog != null) {
            dialog.dismiss();
        }
    }

    private final p8.I getPollRequest() {
        Bundle bundle = new Bundle();
        l lVar = this.currentRequestState;
        bundle.putString("code", lVar != null ? lVar.c : null);
        bundle.putString("access_token", getApplicationAccessToken());
        String str = p8.I.j;
        return new p8.I((p8.b) null, DEVICE_LOGIN_STATUS_ENDPOINT, bundle, M.POST, new i(this, 0));
    }

    public static final void initializeContentView$lambda$2(n nVar, View view) {
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        nVar.onCancel();
    }

    private final void onSuccess(String str, long j, Long l) {
        Date date;
        Bundle m = CredentialProviderBeginSignInController$.ExternalSyntheticOutline0.m("fields", "id,permissions,name");
        Date date2 = null;
        if (j != 0) {
            date = new Date((j * 1000) + new Date().getTime());
        } else {
            date = null;
        }
        if ((l == null || l.longValue() != 0) && l != null) {
            date2 = new Date(l.longValue() * 1000);
        }
        p8.b bVar = new p8.b(str, A.b(), "0", (Collection) null, (Collection) null, (Collection) null, (g) null, date, (Date) null, date2);
        String str2 = p8.I.j;
        p8.I L3 = p.L(bVar, "me", new h(this, str, date, date2, 0));
        L3.k(M.GET);
        Intrinsics.checkNotNullParameter(m, "<set-?>");
        L3.d = m;
        L3.d();
    }

    public static final void onSuccess$lambda$10(n nVar, String str, Date date, Date date2, L l) {
        EnumSet enumSet;
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        Intrinsics.checkNotNullParameter(str, "$accessToken");
        Intrinsics.checkNotNullParameter(l, "response");
        if (nVar.completed.get()) {
            return;
        }
        x xVar = l.c;
        if (xVar != null) {
            p8.t tVar = xVar.i;
            if (tVar == null) {
                tVar = new p8.t();
            }
            nVar.onError(tVar);
            return;
        }
        try {
            JSONObject jSONObject = l.b;
            if (jSONObject == null) {
                jSONObject = new JSONObject();
            }
            String string = jSONObject.getString("id");
            Intrinsics.checkNotNullExpressionValue(string, "jsonObject.getString(\"id\")");
            k a2 = j.a(Companion, jSONObject);
            String string2 = jSONObject.getString("name");
            Intrinsics.checkNotNullExpressionValue(string2, "jsonObject.getString(\"name\")");
            l lVar = nVar.currentRequestState;
            if (lVar != null) {
                b.a(lVar.b);
            }
            L8.G b2 = L8.J.b(A.b());
            if (!Intrinsics.c((b2 == null || (enumSet = b2.e) == null) ? null : Boolean.valueOf(enumSet.contains(k0.RequireConfirm)), Boolean.TRUE) || nVar.isRetry) {
                nVar.completeLogin(string, a2, str, date, date2);
            } else {
                nVar.isRetry = true;
                nVar.presentConfirmation(string, a2, str, string2, date, date2);
            }
        } catch (JSONException e) {
            nVar.onError(new p8.t(e));
        }
    }

    private final void poll() {
        l lVar = this.currentRequestState;
        if (lVar != null) {
            lVar.e = new Date().getTime();
        }
        this.currentGraphRequestPoll = getPollRequest().d();
    }

    private final void presentConfirmation(String str, k kVar, String str2, String str3, Date date, Date date2) {
        String string = getResources().getString(e.com_facebook_smart_login_confirmation_title);
        Intrinsics.checkNotNullExpressionValue(string, "resources.getString(R.st…login_confirmation_title)");
        String string2 = getResources().getString(e.com_facebook_smart_login_confirmation_continue_as);
        Intrinsics.checkNotNullExpressionValue(string2, "resources.getString(R.st…confirmation_continue_as)");
        String string3 = getResources().getString(e.com_facebook_smart_login_confirmation_cancel);
        Intrinsics.checkNotNullExpressionValue(string3, "resources.getString(R.st…ogin_confirmation_cancel)");
        String u = o.u(new Object[]{str3}, 1, string2, "format(format, *args)");
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        builder.setMessage(string).setCancelable(true).setNegativeButton((CharSequence) u, (DialogInterface.OnClickListener) new f(this, str, kVar, str2, date, date2)).setPositiveButton((CharSequence) string3, (DialogInterface.OnClickListener) new g(this, 0));
        builder.create().show();
    }

    public static final void presentConfirmation$lambda$6(n nVar, String str, k kVar, String str2, Date date, Date date2, DialogInterface dialogInterface, int i) {
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        Intrinsics.checkNotNullParameter(str, "$userId");
        Intrinsics.checkNotNullParameter(kVar, "$permissions");
        Intrinsics.checkNotNullParameter(str2, "$accessToken");
        nVar.completeLogin(str, kVar, str2, date, date2);
    }

    public static final void presentConfirmation$lambda$8(n nVar, DialogInterface dialogInterface, int i) {
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        View initializeContentView = nVar.initializeContentView(false);
        Dialog dialog = nVar.getDialog();
        if (dialog != null) {
            dialog.setContentView(initializeContentView);
        }
        w wVar = nVar.request;
        if (wVar != null) {
            nVar.startLogin(wVar);
        }
    }

    public static final void schedulePoll$lambda$3(n nVar) {
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        nVar.poll();
    }

    private final void setCurrentRequestState(T8.l r19) {
        throw new UnsupportedOperationException("Method not decompiled: T8.n.setCurrentRequestState(T8.l):void");
    }

    public static final void startLogin$lambda$1(n nVar, L l) {
        p8.t tVar;
        Intrinsics.checkNotNullParameter(nVar, "this$0");
        Intrinsics.checkNotNullParameter(l, "response");
        if (nVar.isBeingDestroyed) {
            return;
        }
        x xVar = l.c;
        if (xVar != null) {
            if (xVar == null || (tVar = xVar.i) == null) {
                tVar = new p8.t();
            }
            nVar.onError(tVar);
            return;
        }
        JSONObject jSONObject = l.b;
        if (jSONObject == null) {
            jSONObject = new JSONObject();
        }
        l lVar = new l();
        try {
            String string = jSONObject.getString(XbbGto.TDhQNpqzqjG);
            lVar.b = string;
            String format = String.format(Locale.ENGLISH, "https://facebook.com/device?user_code=%1$s&qr=1", Arrays.copyOf(new Object[]{string}, 1));
            Intrinsics.checkNotNullExpressionValue(format, "format(locale, format, *args)");
            lVar.a = format;
            lVar.c = jSONObject.getString("code");
            lVar.d = jSONObject.getLong("interval");
            nVar.setCurrentRequestState(lVar);
        } catch (JSONException e) {
            nVar.onError(new p8.t(e));
        }
    }

    public Map<String, String> additionalDeviceInfo() {
        return null;
    }

    public String getApplicationAccessToken() {
        return A.b() + '|' + A.c();
    }

    public int getLayoutResId(boolean z) {
        return z ? d.com_facebook_smart_device_dialog_fragment : d.com_facebook_device_auth_dialog_fragment;
    }

    public View initializeContentView(boolean z) {
        LayoutInflater layoutInflater = requireActivity().getLayoutInflater();
        Intrinsics.checkNotNullExpressionValue(layoutInflater, "requireActivity().layoutInflater");
        View inflate = layoutInflater.inflate(getLayoutResId(z), (ViewGroup) null);
        Intrinsics.checkNotNullExpressionValue(inflate, "inflater.inflate(getLayo…esId(isSmartLogin), null)");
        View findViewById = inflate.findViewById(c.progress_bar);
        Intrinsics.checkNotNullExpressionValue(findViewById, "view.findViewById(R.id.progress_bar)");
        this.progressBar = findViewById;
        View findViewById2 = inflate.findViewById(c.confirmation_code);
        Intrinsics.f(findViewById2, "null cannot be cast to non-null type android.widget.TextView");
        this.confirmationCode = (TextView) findViewById2;
        View findViewById3 = inflate.findViewById(c.cancel_button);
        Intrinsics.f(findViewById3, "null cannot be cast to non-null type android.widget.Button");
        ((Button) findViewById3).setOnClickListener(new a(this, 9));
        View findViewById4 = inflate.findViewById(c.com_facebook_device_auth_instructions);
        Intrinsics.f(findViewById4, "null cannot be cast to non-null type android.widget.TextView");
        TextView textView = (TextView) findViewById4;
        this.instructions = textView;
        textView.setText(Html.fromHtml(getString(e.com_facebook_device_auth_instructions)));
        return inflate;
    }

    public boolean onBackButtonPressed() {
        return true;
    }

    public void onCancel() {
        if (this.completed.compareAndSet(false, true)) {
            l lVar = this.currentRequestState;
            if (lVar != null) {
                b.a(lVar.b);
            }
            o oVar = this.deviceAuthMethodHandler;
            if (oVar != null) {
                oVar.d().d(new y(oVar.d().g, x.CANCEL, (p8.b) null, "User canceled log in.", (String) null));
            }
            Dialog dialog = getDialog();
            if (dialog != null) {
                dialog.dismiss();
            }
        }
    }

    public Dialog onCreateDialog(Bundle bundle) {
        m mVar = new m(this, requireActivity(), f.com_facebook_auth_dialog);
        mVar.setContentView(initializeContentView(b.b() && !this.isRetry));
        return mVar;
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        l lVar;
        z loginClient;
        Intrinsics.checkNotNullParameter(layoutInflater, "inflater");
        View onCreateView = super/*androidx.fragment.app.Fragment*/.onCreateView(layoutInflater, viewGroup, bundle);
        FacebookActivity requireActivity = requireActivity();
        Intrinsics.f(requireActivity, "null cannot be cast to non-null type com.facebook.FacebookActivity");
        B currentFragment = requireActivity.getCurrentFragment();
        this.deviceAuthMethodHandler = (o) ((currentFragment == null || (loginClient = currentFragment.getLoginClient()) == null) ? null : loginClient.f());
        if (bundle != null && (lVar = (l) bundle.getParcelable(REQUEST_STATE_KEY)) != null) {
            setCurrentRequestState(lVar);
        }
        return onCreateView;
    }

    public void onDestroyView() {
        this.isBeingDestroyed = true;
        this.completed.set(true);
        super.onDestroyView();
        J j = this.currentGraphRequestPoll;
        if (j != null) {
            j.cancel(true);
        }
        ScheduledFuture<?> scheduledFuture = this.scheduledPoll;
        if (scheduledFuture != null) {
            scheduledFuture.cancel(true);
        }
    }

    public void onDismiss(DialogInterface dialogInterface) {
        Intrinsics.checkNotNullParameter(dialogInterface, "dialog");
        super.onDismiss(dialogInterface);
        if (this.isBeingDestroyed) {
            return;
        }
        onCancel();
    }

    public void onError(p8.t tVar) {
        Intrinsics.checkNotNullParameter(tVar, "ex");
        if (this.completed.compareAndSet(false, true)) {
            l lVar = this.currentRequestState;
            if (lVar != null) {
                b.a(lVar.b);
            }
            o oVar = this.deviceAuthMethodHandler;
            if (oVar != null) {
                Intrinsics.checkNotNullParameter(tVar, "ex");
                w wVar = oVar.d().g;
                String message = tVar.getMessage();
                ArrayList arrayList = new ArrayList();
                if (message != null) {
                    arrayList.add(message);
                }
                oVar.d().d(new y(wVar, x.ERROR, (p8.b) null, TextUtils.join(": ", arrayList), (String) null));
            }
            Dialog dialog = getDialog();
            if (dialog != null) {
                dialog.dismiss();
            }
        }
    }

    public void onSaveInstanceState(Bundle bundle) {
        Intrinsics.checkNotNullParameter(bundle, "outState");
        super.onSaveInstanceState(bundle);
        if (this.currentRequestState != null) {
            bundle.putParcelable(REQUEST_STATE_KEY, this.currentRequestState);
        }
    }

    public void startLogin(w wVar) {
        Intrinsics.checkNotNullParameter(wVar, "request");
        this.request = wVar;
        Bundle bundle = new Bundle();
        bundle.putString("scope", TextUtils.join(",", wVar.b));
        o0.e0(bundle, "redirect_uri", wVar.g);
        o0.e0(bundle, "target_user_id", wVar.i);
        bundle.putString("access_token", getApplicationAccessToken());
        Map<String, String> additionalDeviceInfo = additionalDeviceInfo();
        String str = null;
        HashMap m = additionalDeviceInfo != null ? S.m(additionalDeviceInfo) : null;
        b bVar = b.a;
        if (!Q8.a.b(b.class)) {
            if (m == null) {
                try {
                    m = new HashMap();
                } catch (Throwable th) {
                    Q8.a.a(b.class, th);
                }
            }
            String str2 = Build.DEVICE;
            Intrinsics.checkNotNullExpressionValue(str2, "DEVICE");
            m.put("device", str2);
            String str3 = Build.MODEL;
            Intrinsics.checkNotNullExpressionValue(str3, "MODEL");
            m.put("model", str3);
            String jSONObject = new JSONObject(m).toString();
            Intrinsics.checkNotNullExpressionValue(jSONObject, "JSONObject(deviceInfo as Map<*, *>).toString()");
            str = jSONObject;
        }
        bundle.putString("device_info", str);
        String str4 = p8.I.j;
        new p8.I((p8.b) null, DEVICE_LOGIN_ENDPOINT, bundle, M.POST, new i(this, 1)).d();
    }

    private final void schedulePoll() {
        ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
        l lVar = this.currentRequestState;
        Long valueOf = lVar != null ? Long.valueOf(lVar.d) : null;
        if (valueOf != null) {
            synchronized (o.d) {
                try {
                    if (o.e == null) {
                        o.e = new ScheduledThreadPoolExecutor(1);
                    }
                    scheduledThreadPoolExecutor = o.e;
                    if (scheduledThreadPoolExecutor == null) {
                        Intrinsics.m(FxGMxMBbSc.hwOkm);
                        throw null;
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
            this.scheduledPoll = scheduledThreadPoolExecutor.schedule((Runnable) new r(this, 25), valueOf.longValue(), TimeUnit.SECONDS);
        }
    }
}