导航菜单

页面标题

页面副标题

OLX India v19.42.007 - SmartLockSaveCredentialsActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 SmartLockSaveCredentialsActivity.java JAVA 源代码文件

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


package com.olxgroup.panamera.app.users.auth.activities;

import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.os.Parcelable;
import com.google.android.gms.auth.api.credentials.Credential;
import com.google.android.gms.auth.api.credentials.Credentials;
import com.google.android.gms.auth.api.credentials.CredentialsClient;
import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.olxgroup.panamera.app.common.infra.m2;
import com.olxgroup.panamera.domain.users.auth.presentation_contract.SmartLockSaveCredentialsContract;
import com.olxgroup.panamera.domain.users.auth.presentation_impl.SmartLockSaveCredentialsPresenter;

public class SmartLockSaveCredentialsActivity extends g implements SmartLockSaveCredentialsContract.IView {
    SmartLockSaveCredentialsPresenter U;
    private boolean V = false;
    private CredentialsClient W;

    class a implements OnCompleteListener {
        a() {
        }

        public void onComplete(Task task) {
            if (task.isSuccessful()) {
                SmartLockSaveCredentialsActivity.this.showNextActivity(-1);
            }
            ResolvableApiException exception = task.getException();
            if (!(exception instanceof ResolvableApiException)) {
                SmartLockSaveCredentialsActivity.this.U.savedCredentialsError("Smartlock disabled", 0);
            } else {
                SmartLockSaveCredentialsActivity.this.q2(exception, 1);
            }
        }
    }

    public static Intent o2(Credential credential) {
        Intent intent = new Intent((Context) m2.b, (Class<?>) SmartLockSaveCredentialsActivity.class);
        intent.putExtra("save_credentials", (Parcelable) credential);
        return intent;
    }

    private Credential p2() {
        return (Credential) getIntent().getExtras().get("save_credentials");
    }

    public void q2(ResolvableApiException resolvableApiException, int i) {
        if (this.V) {
            return;
        }
        try {
            resolvableApiException.startResolutionForResult(this, i);
            this.V = true;
        } catch (IntentSender.SendIntentException unused) {
            this.U.savedCredentialsError("Failed to send resolution [save]", 0);
        }
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        super/*androidx.fragment.app.r*/.onActivityResult(i, i2, intent);
        if (i == 1) {
            if (i2 == -1) {
                this.U.savedCredentials(-1);
            } else {
                this.U.saveCredentialsDismissed(0, "save_flow");
            }
            this.V = false;
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(com.olx.southasia.k.activity_smart_lock);
        this.U.setView(this);
        if (bundle != null) {
            this.V = bundle.getBoolean("is_resolving");
        }
        this.W = Credentials.getClient(this);
        if (this.V) {
            return;
        }
        this.U.start();
    }

    protected void onSaveInstanceState(Bundle bundle) {
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
        bundle.putBoolean("is_resolving", this.V);
    }

    @Override
    public void saveCredentials() {
        this.W.save(p2()).addOnCompleteListener(new a());
    }

    @Override
    public void showNextActivity(int i) {
        setResult(i);
        finish();
    }
}