正在查看: Clash Legends v0.0.1 应用的 PayPalService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Clash Legends v0.0.1 应用的 PayPalService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.paypal.android.sdk.payments;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import com.paypal.android.sdk.Cdo;
import com.paypal.android.sdk.ef;
import com.paypal.android.sdk.eh;
import com.paypal.android.sdk.em;
import com.paypal.android.sdk.ep;
import com.paypal.android.sdk.er;
import com.paypal.android.sdk.fa;
import com.paypal.android.sdk.fc;
import com.paypal.android.sdk.fd;
import com.paypal.android.sdk.ff;
import com.paypal.android.sdk.fg;
import com.paypal.android.sdk.fh;
import com.paypal.android.sdk.fi;
import com.paypal.android.sdk.fj;
import com.paypal.android.sdk.fk;
import com.paypal.android.sdk.fl;
import com.paypal.android.sdk.fm;
import com.paypal.android.sdk.fo;
import com.paypal.android.sdk.fr;
import com.paypal.android.sdk.ft;
import com.paypal.android.sdk.fu;
import com.paypal.android.sdk.gs;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import org.json.JSONObject;
public final class PayPalService extends Service {
public static final String EXTRA_PAYPAL_CONFIGURATION = "com.paypal.android.sdk.paypalConfiguration";
private static Intent t;
com.paypal.android.sdk.dt b;
private com.paypal.android.sdk.b d;
private com.paypal.android.sdk.dg e;
private PayPalConfiguration f;
private boolean g;
private String k;
private com.paypal.android.sdk.bt l;
private ce m;
private String n;
private com.paypal.android.sdk.a o;
private com.paypal.android.sdk.dl p;
private static final String c = PayPalService.class.getSimpleName();
static final ExecutorService a = com.paypal.android.sdk.db.a();
private a h = new a();
private a i = new a();
private i j = new h(this);
private List q = new ArrayList();
private boolean r = true;
private boolean s = true;
private final BroadcastReceiver u = new ca(this);
private final IBinder v = new cd(this);
private boolean A() {
return (this.f == null || this.e == null) ? false : true;
}
private static com.paypal.android.sdk.dg B() {
return new com.paypal.android.sdk.dg();
}
private void C() {
a((ce) new cb(this), false);
}
private static com.paypal.android.sdk.bs a(String str, String str2) {
com.paypal.android.sdk.bs bsVar = new com.paypal.android.sdk.bs(str, str2);
if (str2 != null) {
if (!str2.startsWith("https://")) {
throw new RuntimeException(str2 + " does not start with 'https://', ignoring " + str);
}
if (!str2.endsWith("/")) {
new StringBuilder().append(str2).append(" does not end with a slash, adding one.");
str2 = str2 + "/";
}
for (com.paypal.android.sdk.cu cuVar : com.paypal.android.sdk.dc.d()) {
bsVar.c().put(cuVar.a(), str2 + cuVar.c());
}
}
return bsVar;
}
static ce a(PayPalService payPalService, ce ceVar) {
payPalService.m = null;
return null;
}
private void a(Intent intent) {
String stringExtra;
t = intent;
new StringBuilder("init:").append(b(intent));
if (this.f == null) {
PayPalConfiguration payPalConfiguration = (PayPalConfiguration) intent.getParcelableExtra(EXTRA_PAYPAL_CONFIGURATION);
this.f = payPalConfiguration;
if (payPalConfiguration == null) {
throw new RuntimeException("Missing EXTRA_PAYPAL_CONFIGURATION. To avoid this error, set EXTRA_PAYPAL_CONFIGURATION in both PayPalService, and the initializing activity.");
}
}
if (!this.f.o()) {
throw new RuntimeException("Service extras invalid. Please check the docs.");
}
if (this.f.i() && !d.d()) {
throw new RuntimeException("Credit Cards cannot be accepted without card.io dependency. Please check the docs.");
}
String b = this.f.b();
if (com.paypal.android.sdk.br.c(b)) {
stringExtra = "https://api-m.paypal.com/v1/";
} else if (com.paypal.android.sdk.br.b(b)) {
stringExtra = "https://api-m.sandbox.paypal.com/v1/";
} else if (com.paypal.android.sdk.br.a(b)) {
stringExtra = null;
} else {
if (!z() || !intent.hasExtra("com.paypal.android.sdk.baseEnvironmentUrl")) {
throw new RuntimeException("Invalid environment selected:" + b);
}
stringExtra = intent.getStringExtra("com.paypal.android.sdk.baseEnvironmentUrl");
}
this.p = new com.paypal.android.sdk.dl(this.o, this.f.b());
com.paypal.android.sdk.bs a2 = a(b, stringExtra);
if (this.l == null) {
int i = 500;
if (z() && intent.hasExtra("com.paypal.android.sdk.mockNetworkDelay")) {
i = intent.getIntExtra("com.paypal.android.sdk.mockNetworkDelay", 500);
}
byte b2 = 0;
boolean booleanExtra = (z() && intent.hasExtra("com.paypal.android.sdk.mockEnable2fa")) ? intent.getBooleanExtra("com.paypal.android.sdk.mockEnable2fa", false) : false;
boolean z = true;
int intExtra = (z() && intent.hasExtra("com.paypal.android.sdk.mock2faPhoneNumberCount")) ? intent.getIntExtra("com.paypal.android.sdk.mock2faPhoneNumberCount", 1) : 1;
this.r = true;
if (z() && intent.hasExtra("com.paypal.android.sdk.enableAuthenticator")) {
this.r = intent.getBooleanExtra("com.paypal.android.sdk.enableAuthenticator", true);
}
if (z() && intent.hasExtra("com.paypal.android.sdk.enableAuthenticatorSecurity")) {
this.s = intent.getBooleanExtra("com.paypal.android.sdk.enableAuthenticatorSecurity", true);
}
if (z() && intent.hasExtra("com.paypal.android.sdk.enableStageSsl")) {
z = intent.getBooleanExtra("com.paypal.android.sdk.enableStageSsl", true);
}
boolean z2 = z;
com.paypal.android.sdk.bt btVar = new com.paypal.android.sdk.bt(this.o, a2, a());
this.l = btVar;
btVar.a(new ef(new cg(this, b2)));
this.l.a(new com.paypal.android.sdk.cs(this.l, com.paypal.android.sdk.br.a(this.f.b()) ? new ft(this.l, i, booleanExtra, intExtra) : new com.paypal.android.sdk.cm(this.o, this.f.b(), a(), this.l, 90, z2, Collections.singletonList(new com.paypal.android.sdk.dh(a().c())))));
}
fu.b(this.f.a());
if (this.e == null) {
this.e = B();
}
if (!this.f.j()) {
clearAllUserData(this.o.f());
}
this.k = intent.getComponent().getPackageName();
a(fc.PreConnect);
C();
}
private void a(com.paypal.android.sdk.cw cwVar) {
this.l.b(cwVar);
}
public void a(fc fcVar, boolean z, String str, String str2, String str3) {
this.j.a(fcVar, z, str, str2, str3);
}
static void a(PayPalService payPalService, com.paypal.android.sdk.cw cwVar) {
payPalService.e.b = null;
new StringBuilder().append(cwVar.n()).append(" request error");
String b = cwVar.p().b();
Log.e("paypal.sdk", b);
payPalService.b(fc.DeviceCheck, b, cwVar.j());
ce ceVar = payPalService.m;
if (ceVar != null) {
ceVar.a(payPalService.b(cwVar));
payPalService.m = null;
}
payPalService.g = false;
}
private static boolean a(com.paypal.android.sdk.dw dwVar) {
return dwVar != null && dwVar.b();
}
static boolean a(PayPalService payPalService, boolean z) {
payPalService.g = false;
return false;
}
private fo[] a(PayPalItem[] payPalItemArr) {
if (payPalItemArr == null) {
return null;
}
fo[] foVarArr = new fo[payPalItemArr.length];
int length = payPalItemArr.length;
int i = 0;
int i2 = 0;
while (i < length) {
PayPalItem payPalItem = payPalItemArr[i];
foVarArr[i2] = new fo(payPalItem.getName(), payPalItem.getQuantity(), payPalItem.getPrice(), payPalItem.getCurrency(), payPalItem.getSku());
i++;
i2++;
}
return foVarArr;
}
public cf b(com.paypal.android.sdk.cw cwVar) {
return new cf(this, cwVar.p().b(), cwVar.r(), cwVar.p().a());
}
private static String b(Intent intent) {
if (intent == null) {
return "Intent = null";
}
StringBuilder sb = new StringBuilder();
sb.append("Intent{");
sb.append("action:" + intent.getAction());
sb.append(", cmp:" + intent.getComponent() + ", ");
if (intent.getExtras() == null) {
sb.append("null extras");
} else {
sb.append("extras:");
for (String str : intent.getExtras().keySet()) {
sb.append("(" + str + ":" + intent.getExtras().get(str) + ")");
}
}
sb.append("}");
return sb.toString();
}
private void b(fc fcVar, String str, String str2) {
a(fcVar, false, str, str2, (String) null);
}
static void c(PayPalService payPalService, com.paypal.android.sdk.cw cwVar) {
String b = cwVar.p().b();
Log.e("paypal.sdk", b);
payPalService.b(fc.ConfirmPayment, b, cwVar.j());
payPalService.i.a(payPalService.b(cwVar));
}
public static void clearAllUserData(Context context) {
Log.w("paypal.sdk", "clearing user data");
a.submit(new by(context));
}
private static boolean z() {
return "partner".equals(BuildConfig.FLAVOR);
}
final com.paypal.android.sdk.b a() {
if (this.d == null) {
this.d = new d();
}
return this.d;
}
final String a(String str) {
return this.o.c(str);
}
final void a(int i) {
this.l.b(new fl(this.l, a(), this.l.c(), this.f.k(), this.e.i, (String) new ArrayList(this.e.f.a.keySet()).get(i)));
}
final void a(ep epVar, String str, boolean z, String str2, boolean z2, String str3) {
this.l.b(new fm(this.l, a(), this.l.c(), this.f.k(), epVar, str, this.e.i, z, str2, z2, str3));
}
final void a(ep epVar, boolean z, String str, boolean z2, String str2) {
this.l.b(new fm(this.l, a(), this.l.c(), this.f.k(), epVar, z, str, z2, str2));
}
final void a(er erVar, Map map, PayPalItem[] payPalItemArr, String str, boolean z, String str2, String str3, boolean z2, String str4, String str5, String str6, boolean z3, String str7) {
this.l.b(new fg(this.l, a(), this.e.g.c(), this.e.b(), null, erVar, map, a(payPalItemArr), str, z, str2, this.n, str3, z2).d(str4).e(str5).f(str6).a(z3).g(str7));
}
public final void a(fc fcVar) {
a(fcVar, false, (String) null, (String) null, (String) null);
}
final void a(fc fcVar, Boolean bool) {
a(fcVar, bool.booleanValue(), (String) null, (String) null, (String) null);
}
final void a(fc fcVar, Boolean bool, String str) {
a(fcVar, bool.booleanValue(), (String) null, str, (String) null);
}
final void a(fc fcVar, String str) {
a(fcVar, false, (String) null, str, (String) null);
}
final void a(fc fcVar, String str, String str2) {
a(fcVar, false, (String) null, str, str2);
}
final void a(cc ccVar) {
this.h.a(ccVar);
}
final void a(ce ceVar, boolean z) {
if (z) {
this.e.b = null;
}
this.m = ceVar;
if (this.g || this.e.c()) {
return;
}
this.g = true;
a(fc.DeviceCheck);
this.l.b(new fr(this.f.b(), this.l, a(), this.f.k()));
}
final void a(String str, String str2, er erVar, Map map, PayPalItem[] payPalItemArr, String str3, boolean z, String str4, String str5, String str6, String str7, String str8, String str9) {
this.l.b(new fh(this.l, a(), this.e.b.c(), str, str2, str4, erVar, map, a(payPalItemArr), str3, z, str5, this.n, str6).d(str7).e(str8).f(str9));
}
final void a(String str, String str2, String str3, String str4, int i, int i2, er erVar, Map map, PayPalItem[] payPalItemArr, String str5, boolean z, String str6, String str7, String str8, String str9, String str10) {
this.l.b(new fh(this.l, a(), this.e.b.c(), str, str2, (str3.equalsIgnoreCase("4111111111111111") && com.paypal.android.sdk.br.b(this.f.b())) ? "4444333322221111" : str3, str4, i, i2, null, erVar, map, a(payPalItemArr), str5, z, str6, this.n, str7).d(str8).e(str9).f(str10));
}
final void a(List list) {
this.l.b(new ff(this.l, a(), this.l.c(), this.f.k(), this.e.e.a(), this.e.i, list));
}
final void a(boolean z, String str, String str2, JSONObject jSONObject, JSONObject jSONObject2, String str3) {
this.l.b(new fd(this.l, a(), this.e.g.c(), this.e.b(), z, str3, this.n, str, str2, jSONObject, jSONObject2));
}
protected final boolean a(ch chVar) {
if (A()) {
return true;
}
this.q.add(chVar);
return false;
}
protected final com.paypal.android.sdk.bt b() {
return this.l;
}
final void b(cc ccVar) {
this.i.a(ccVar);
}
protected final com.paypal.android.sdk.dg c() {
return this.e;
}
final PayPalConfiguration d() {
return this.f;
}
public final void doDeleteTokenizedCreditCard(String str, String str2) {
a(new fi(this.l, a(), str, str2));
}
public final void doTrackingRequest(com.paypal.android.sdk.bw bwVar) {
a(new fj(this.l, a(), fa.a(bwVar)));
}
protected final String e() {
return this.f.b();
}
protected final String f() {
return this.f.k();
}
final void g() {
t();
h();
this.p.b();
u();
}
final void h() {
this.e.g = null;
com.paypal.android.sdk.di.b(this.f.b());
this.e.d = null;
this.e.c = null;
}
final boolean i() {
return this.e.c();
}
final boolean j() {
com.paypal.android.sdk.dg dgVar = this.e;
return dgVar.g != null && dgVar.g.b();
}
final boolean k() {
return (this.e.e == null || this.e.i == null) ? false : true;
}
final void l() {
com.paypal.android.sdk.dm a2 = this.p.a();
if (a2 == null) {
h();
return;
}
com.paypal.android.sdk.dw dwVar = this.e.g;
com.paypal.android.sdk.dw a3 = com.paypal.android.sdk.di.a(this.f.b());
if (!a(dwVar) && a(a3)) {
this.e.g = a3;
}
this.e.c = a2.d() ? a2.c().equals(Cdo.EMAIL) ? a2.b() : a2.a().a(com.paypal.android.sdk.de.a()) : null;
}
final void m() {
this.i.b();
}
final void n() {
this.h.b();
}
final void o() {
this.m = null;
}
@Override
public final IBinder onBind(Intent intent) {
new StringBuilder("onBind(").append(b(intent)).append(")");
if (!A()) {
Intent intent2 = t;
if (intent2 == null) {
a(intent);
} else {
a(intent2);
}
}
return this.v;
}
@Override
public final void onCreate() {
Log.w("paypal.sdk", PayPalService.class.getSimpleName() + " created. API:" + Build.VERSION.SDK_INT + " " + a().b());
new d();
com.paypal.android.sdk.a aVar = new com.paypal.android.sdk.a(this, "AndroidBasePrefs", new com.paypal.android.sdk.d());
this.o = aVar;
eh.a(aVar);
em.a(this.o);
this.n = com.paypal.android.sdk.e.a(a, this, this.o.e(), "2.16.0", null);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("com.paypal.android.sdk.clearAllUserData");
aa.a(this).a(this.u, intentFilter);
}
@Override
public final void onDestroy() {
com.paypal.android.sdk.bt btVar = this.l;
if (btVar != null) {
btVar.a();
this.l.b();
this.l = null;
}
try {
aa.a(this).a(this.u);
} catch (Throwable th) {
new StringBuilder("ignoring:").append(th.getMessage());
}
new StringBuilder("service destroyed: ").append(this);
}
@Override
public final void onRebind(Intent intent) {
super.onRebind(intent);
new StringBuilder("onRebind(").append(b(intent)).append(")");
}
@Override
public final int onStartCommand(Intent intent, int i, int i2) {
new StringBuilder("onStartCommand(").append(b(intent)).append(", ").append(i).append(", ").append(i2).append(")");
if (!A()) {
new gs(this).a();
if (intent == null || intent.getExtras() == null) {
throw new RuntimeException("Service extras required. Please see the docs.");
}
a(intent);
}
if (this.q.size() <= 0) {
return 3;
}
Iterator it = this.q.iterator();
while (it.hasNext()) {
((ch) it.next()).a();
}
this.q.clear();
return 3;
}
@Override
public final boolean onUnbind(Intent intent) {
new StringBuilder("onUnbind(").append(b(intent)).append(")");
return true;
}
final void p() {
this.l.b(new fk(this.l, a(), this.l.c(), this.e.b.c(), this.f.k()));
}
final com.paypal.android.sdk.dm q() {
return this.p.a();
}
final String r() {
return this.e.c;
}
final com.paypal.android.sdk.dt s() {
return this.p.a(this.f.k());
}
final void t() {
this.b = s();
this.p.c();
if (this.b == null || this.e.b == null) {
return;
}
doDeleteTokenizedCreditCard(this.e.b.c(), this.b.e());
this.b = null;
}
final void u() {
PayPalConfiguration payPalConfiguration = this.f;
if (payPalConfiguration == null || !payPalConfiguration.o()) {
return;
}
this.e = B();
C();
}
protected final String v() {
return this.k;
}
final boolean w() {
return this.r;
}
final boolean x() {
return this.s;
}
}