导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - m.java 源代码

正在查看: Clash Legends v0.0.1 应用的 m.java JAVA 源代码文件

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


package com.paypal.android.sdk.payments;

import android.R;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.text.Html;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.style.BulletSpan;
import android.text.style.URLSpan;
import android.util.Log;
import com.paypal.android.sdk.fc;
import com.paypal.android.sdk.fk;
import com.paypal.android.sdk.fu;
import com.paypal.android.sdk.fw;
import com.paypal.android.sdk.fx;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

abstract class m extends Activity {
    private static final String d = m.class.getSimpleName();
    private static final Map l = new o();
    protected PayPalService a;
    protected PayPalOAuthScopes b;
    protected fx c;
    private boolean e;
    private j f;
    private boolean g;
    private boolean h;
    private boolean i;
    private du j;
    private final ServiceConnection k = new u(this);

    m() {
    }

    private void a(int i, PayPalAuthorization payPalAuthorization) {
        Intent intent = new Intent();
        intent.putExtra("com.paypal.android.sdk.authorization", payPalAuthorization);
        setResult(i, intent);
    }

    private void a(int i, String str, String str2, ag agVar) {
        SpannableString spannableString = new SpannableString(Html.fromHtml(str2 + str));
        if (agVar != null) {
            URLSpan[] uRLSpanArr = (URLSpan[]) spannableString.getSpans(0, spannableString.length(), URLSpan.class);
            if (uRLSpanArr.length > 0) {
                URLSpan uRLSpan = uRLSpanArr[0];
                spannableString.setSpan(new b(uRLSpan, this, FuturePaymentInfoActivity.class, new n(this), agVar), spannableString.getSpanStart(uRLSpan), spannableString.getSpanEnd(uRLSpan), 33);
                spannableString.removeSpan(uRLSpan);
            }
        } else {
            a(spannableString);
        }
        spannableString.setSpan(new BulletSpan(15), 0, spannableString.length(), 0);
        this.c.c[i].setVisibility(0);
        this.c.c[i].setFocusable(true);
        int i2 = i + 100;
        this.c.c[i].setNextFocusLeftId(i2 - 1);
        this.c.c[i].setNextFocusRightId(i2 + 1);
        this.c.c[i].setText(spannableString);
    }

    private void a(SpannableString spannableString) {
        for (URLSpan uRLSpan : (URLSpan[]) spannableString.getSpans(0, spannableString.length(), URLSpan.class)) {
            spannableString.setSpan(new eb(uRLSpan, new p(this)), spannableString.getSpanStart(uRLSpan), spannableString.getSpanEnd(uRLSpan), 33);
            spannableString.removeSpan(uRLSpan);
        }
    }

    private void a(j jVar) {
        this.a.c().i = jVar.a;
        this.a.c().e = jVar.b;
        this.a.c().c = jVar.c;
        j();
    }

    static void a(m mVar, fk fkVar) {
        mVar.j = new du(fkVar);
        mVar.getIntent().putExtra("com.paypal.android.sdk.payments.ppAppInfo", mVar.j);
        mVar.f();
        mVar.k();
    }

    private void b(SpannableString spannableString) {
        for (URLSpan uRLSpan : (URLSpan[]) spannableString.getSpans(0, spannableString.length(), URLSpan.class)) {
            spannableString.setSpan(new eb(uRLSpan, new q(this)), spannableString.getSpanStart(uRLSpan), spannableString.getSpanEnd(uRLSpan), 33);
            spannableString.removeSpan(uRLSpan);
        }
    }

    private void c() {
        if (this.a != null) {
            showDialog(2);
            if (this.a.i()) {
                this.a.p();
            } else {
                new StringBuilder("token is expired, get new one. AccessToken: ").append(this.a.c().b);
                this.a.a((ce) new r(this), true);
            }
        }
    }

    private void d() {
        this.e = bindService(d.b(this), this.k, 1);
    }

    static void d(m mVar) {
        boolean z;
        StringBuilder sb = new StringBuilder();
        String str = d;
        sb.append(str).append(".postBindSetup()");
        new StringBuilder().append(str).append(".startLoginIfNeeded (access token: ").append(mVar.a.c().g).append(")");
        if (mVar.a.j() || mVar.h) {
            z = false;
        } else {
            new StringBuilder().append(str).append(" -- doing the login...");
            mVar.h = true;
            mVar.e();
            z = true;
        }
        fx fxVar = mVar.c;
        if (mVar.i) {
            mVar.i = false;
            mVar.j();
        }
        if (!mVar.g) {
            mVar.g = true;
            mVar.a.a(fc.ConsentWindow);
        }
        d.a(fxVar.f.b, mVar.a.e());
        mVar.a.b(new s(mVar));
        mVar.f();
        if (z || mVar.j != null) {
            return;
        }
        mVar.c();
    }

    public void e() {
        new StringBuilder().append(d).append(".doLogin");
        if (!k.a(this, this.a)) {
            LoginActivity.a(this, 1, null, true, false, this.b.b(), this.a.d());
            return;
        }
        Intent a = new com.paypal.android.sdk.dq().a(this.a.d().k(), com.paypal.android.sdk.dr.PROMPT_LOGIN, com.paypal.android.sdk.ds.code, this.a.b().d().e());
        new StringBuilder("startActivityForResult(").append(a).append(", 2").append(")");
        Log.w("paypal.sdk", "requesting code with scope=null from Authenticator.");
        startActivityForResult(a, 2);
    }

    static void e(m mVar) {
        mVar.a.a(fc.ConsentCancel);
        mVar.finish();
    }

    private void f() {
        PayPalService payPalService;
        int i;
        if (this.b == null || this.j == null || (payPalService = this.a) == null) {
            return;
        }
        String l2 = payPalService.d().l();
        if (this.j.d() != null) {
            l2 = this.j.d();
        }
        String uri = this.a.d().m().toString();
        if (this.j.b() != null) {
            uri = this.j.b();
        }
        String uri2 = this.a.d().n().toString();
        if (this.j.c() != null) {
            uri2 = this.j.c();
        }
        String format = String.format(fu.a(fw.CONSENT_AGREEMENT_INTRO), "<b>" + l2 + "</b>");
        String str = fu.a ? "\u200f" : "";
        this.c.c[0].setText(Html.fromHtml(str + format));
        if (fu.a) {
            this.c.c[0].setGravity(5);
        }
        this.c.c[0].setVisibility(0);
        List a = this.b.a();
        if (a.contains(com.paypal.android.sdk.ak.FUTURE_PAYMENTS.a()) || a.contains(com.paypal.android.sdk.dj.PAYMENT_CODE.a()) || a.contains(com.paypal.android.sdk.dj.MIS_CUSTOMER.a())) {
            a(1, String.format(fu.a(fw.CONSENT_AGREEMENT_FUTURE_PAYMENTS), "future-payment-consent", "<b>" + l2 + "</b>", "<b>" + l2 + "</b>"), str, ag.FUTURE_PAYMENTS);
            i = 2;
        } else {
            i = 1;
        }
        if (a.contains(com.paypal.android.sdk.dj.GET_FUNDING_OPTIONS.a())) {
            a(i, fu.a(fw.CONSENT_AGREEMENT_FUNDING_OPTIONS), str, null);
            i++;
        }
        if (a.contains(com.paypal.android.sdk.dj.FINANCIAL_INSTRUMENTS.a())) {
            a(i, fu.a(fw.CONSENT_AGREEMENT_FINANCIAL_INSTRUMENTS), str, ag.FINANCIAL_INSTRUMENTS);
            i++;
        }
        if (a.contains(com.paypal.android.sdk.dj.SEND_MONEY.a())) {
            a(i, String.format(fu.a(fw.CONSENT_AGREEMENT_SEND_MONEY), "", l2), str, ag.SEND_MONEY);
            i++;
        }
        if (a.contains(com.paypal.android.sdk.dj.REQUEST_MONEY.a())) {
            a(i, String.format(fu.a(fw.CONSENT_AGREEMENT_REQUEST_MONEY), "", l2), str, ag.REQUEST_MONEY);
            i++;
        }
        if (a.contains(com.paypal.android.sdk.dj.LOYALTY.a())) {
            a(i, fu.a(fw.CONSENT_AGREEMENT_LOYALTY_CARD), str, null);
            i++;
        }
        if (a.contains(com.paypal.android.sdk.dj.EXPRESS_CHECKOUT.a())) {
            a(i, fu.a(fw.CONSENT_AGREEMENT_EXPRESS_CHECKOUT), str, null);
            i++;
        }
        if (!Collections.disjoint(a, com.paypal.android.sdk.ak.h)) {
            if (g().size() > 0) {
                a(i, String.format(fu.a(fw.CONSENT_AGREEMENT_ATTRIBUTES), h()), str, null);
                i++;
            }
        }
        a(i, String.format(fu.a(fw.CONSENT_AGREEMENT_MERCHANT_PRIVACY_POLICY), "<b>" + l2 + "</b>", uri, uri2), str, null);
        this.c.c[i].setNextFocusRightId(2);
        int i2 = i + 1;
        String a2 = fu.a(fw.PRIVACY);
        Object[] objArr = new Object[1];
        String lowerCase = Locale.getDefault().getCountry().toLowerCase(Locale.US);
        if (com.paypal.android.sdk.d.a((CharSequence) lowerCase)) {
            lowerCase = "us";
        }
        objArr[0] = String.format("https://www.paypal.com/%s/cgi-bin/webscr?cmd=p/gen/ua/policy_privacy-outside", lowerCase);
        SpannableString spannableString = new SpannableString(Html.fromHtml(str + String.format(a2, objArr)));
        b(spannableString);
        this.c.d.setText(spannableString);
        this.c.d.setMovementMethod(LinkMovementMethod.getInstance());
        this.c.d.setNextFocusLeftId((i2 + 100) - 1);
        this.c.d.setNextFocusRightId(1);
        SpannableString b = com.paypal.android.sdk.d.b(this.a.d().a());
        if (b != null) {
            this.c.e.setText(b);
            this.c.e.setVisibility(0);
        }
        this.c.i.setText(fu.a(fw.CONSENT_AGREEMENT_AGREE));
        this.c.g.setOnClickListener(new w(this));
        this.c.h.setOnClickListener(new x(this));
        this.c.h.setEnabled(true);
        j jVar = this.f;
        if (jVar != null) {
            a(jVar);
            this.f = null;
        }
    }

    static void f(m mVar) {
        mVar.a.a(fc.ConsentAgree);
        if (mVar.a.k()) {
            mVar.showDialog(2);
            mVar.a.a(mVar.b.a());
        } else {
            new StringBuilder("code/nonce invalid.  code:").append(mVar.a.c().e).append(", nonce:").append(mVar.a.c().i);
            d.a(mVar, fu.a(fw.SESSION_EXPIRED_MESSAGE), 4);
        }
    }

    private Set g() {
        fw fwVar;
        String name;
        List a = this.b.a();
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        for (y yVar : y.values()) {
            if (this.j.a().contains(yVar.name()) && a.contains(((com.paypal.android.sdk.ak) l.get(yVar)).a())) {
                if (yVar == y.openid_connect) {
                    name = null;
                } else {
                    if (yVar == y.oauth_account_creation_date) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_ACCOUNT_CREATION_DATE;
                    } else if (yVar == y.oauth_account_verified) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_ACCOUNT_STATUS;
                    } else if (yVar == y.oauth_account_type) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_ACCOUNT_TYPE;
                    } else if (yVar == y.oauth_street_address1 || yVar == y.oauth_street_address2 || yVar == y.oauth_city || yVar == y.oauth_state || yVar == y.oauth_country || yVar == y.oauth_zip) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_ADDRESS;
                    } else if (yVar == y.oauth_age_range) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_AGE_RANGE;
                    } else if (yVar == y.oauth_date_of_birth) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_DATE_OF_BIRTH;
                    } else if (yVar == y.oauth_email) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_EMAIL_ADDRESS;
                    } else if (yVar == y.oauth_fullname) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_FULL_NAME;
                    } else if (yVar == y.oauth_gender) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_GENDER;
                    } else if (yVar == y.oauth_language) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_LANGUAGE;
                    } else if (yVar == y.oauth_locale) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_LOCALE;
                    } else if (yVar == y.oauth_phone_number) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_PHONE;
                    } else if (yVar == y.oauth_timezone) {
                        fwVar = fw.CONSENT_AGREEMENT_ATTRIBUTE_TIME_ZONE;
                    } else {
                        name = yVar.name();
                    }
                    name = fu.a(fwVar);
                }
                if (name != null) {
                    linkedHashSet.add(name);
                }
            }
        }
        return linkedHashSet;
    }

    private String h() {
        StringBuilder sb = new StringBuilder();
        boolean z = true;
        for (String str : g()) {
            if (z) {
                z = false;
            } else {
                sb.append(", ");
            }
            sb.append(str);
        }
        return sb.toString();
    }

    public void i() {
        a(-1, new PayPalAuthorization(this.a.e(), this.a.c().e.a(), this.a.c().c));
        finish();
    }

    private void j() {
        String b = this.a.c().e.b();
        if (b == null || !Arrays.asList(b.split(" ")).containsAll(this.b.a())) {
            c();
        } else {
            i();
        }
    }

    public void k() {
        try {
            dismissDialog(2);
        } catch (IllegalArgumentException e) {
        }
    }

    protected abstract void a();

    @Override
    public void finish() {
        super.finish();
        new StringBuilder().append(d).append(".finish");
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        StringBuilder sb = new StringBuilder();
        String str = d;
        sb.append(str).append(".onActivityResult(").append(i).append(",").append(i2).append(",").append(intent).append(")");
        switch (i) {
            case 1:
                if (i2 != -1) {
                    a(i2, (PayPalAuthorization) null);
                    finish();
                    break;
                } else if (this.a != null) {
                    j();
                    break;
                } else {
                    this.i = true;
                    break;
                }
            case 2:
                if (i2 == -1 && intent != null && intent.getExtras() != null) {
                    j a = l.a(intent.getExtras());
                    if (this.a != null) {
                        a(a);
                        break;
                    } else {
                        this.f = a;
                        break;
                    }
                } else {
                    a(i2, (PayPalAuthorization) null);
                    finish();
                    break;
                }
            default:
                Log.e(str, "unhandled requestCode " + i);
                break;
        }
    }

    @Override
    public void onBackPressed() {
        this.a.a(fc.ConsentCancel);
        super.onBackPressed();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        new StringBuilder().append(d).append(".onCreate");
        if (bundle == null) {
            if (!d.a(this)) {
                finish();
            }
            this.g = false;
        } else {
            this.g = bundle.getBoolean("pageTrackingSent");
            this.h = bundle.getBoolean("isLoginActivityStarted");
        }
        a();
        this.j = (du) getIntent().getParcelableExtra("com.paypal.android.sdk.payments.ppAppInfo");
        d();
        setTheme(R.style.Theme.Holo.Light);
        requestWindowFeature(8);
        fx fxVar = new fx(this);
        this.c = fxVar;
        setContentView(fxVar.a);
        d.a(this, this.c.b, (fw) null);
        this.c.g.setText(fu.a(fw.CANCEL));
        this.c.g.setVisibility(0);
        f();
    }

    @Override
    protected Dialog onCreateDialog(int i, Bundle bundle) {
        switch (i) {
            case 1:
                return d.a(this, fw.CONSENT_FAILED_ALERT_TITLE, bundle);
            case 2:
                return d.a(this, fw.PROCESSING, fw.ONE_MOMENT);
            case 3:
                return d.a(this, fw.INTERNAL_ERROR, bundle, i);
            case 4:
                return d.a(this, fw.SESSION_EXPIRED_TITLE, bundle, new t(this));
            default:
                return null;
        }
    }

    @Override
    protected void onDestroy() {
        new StringBuilder().append(d).append(".onDestroy");
        PayPalService payPalService = this.a;
        if (payPalService != null) {
            payPalService.m();
        }
        if (this.e) {
            unbindService(this.k);
            this.e = false;
        }
        super.onDestroy();
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        d();
    }

    @Override
    protected void onResume() {
        super.onResume();
        new StringBuilder().append(d).append(".onResume");
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putBoolean("pageTrackingSent", this.g);
        bundle.putBoolean("isLoginActivityStarted", this.h);
    }
}