正在查看: BAM Crawford v6.14.1 应用的 s.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: BAM Crawford v6.14.1 应用的 s.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package wd;
import android.content.Context;
import android.database.sqlite.SQLiteException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
final class s extends f {
private long A;
private boolean B;
private boolean r;
private final p s;
private final y0 t;
private final x0 u;
private final k v;
private long w;
private final h0 x;
private final h0 y;
private final j1 z;
protected s(h hVar, j jVar) {
super(hVar);
ed.r.j(jVar);
this.w = Long.MIN_VALUE;
this.u = new x0(hVar);
this.s = new p(hVar);
this.t = new y0(hVar);
this.v = new k(hVar);
this.z = new j1(P());
this.x = new t(this, hVar);
this.y = new u(this, hVar);
}
private final void A1() {
k0 e0 = e0();
if (e0.q1() && !e0.p1()) {
long t1 = t1();
if (t1 == 0 || Math.abs(P().a() - t1) > ((Long) n0.n.a()).longValue()) {
return;
}
l("Dispatch alarm scheduled (ms)", Long.valueOf(f0.e()));
e0.r1();
}
}
private final void B1() {
if (this.x.g()) {
y0("All hits dispatched or no network/service. Going to power save mode");
}
this.x.a();
k0 e0 = e0();
if (e0.p1()) {
e0.m1();
}
}
private final long C1() {
long j = this.w;
if (j != Long.MIN_VALUE) {
return j;
}
long longValue = ((Long) n0.i.a()).longValue();
l1 f0 = f0();
f0.l1();
if (!f0.u) {
return longValue;
}
f0().l1();
return r0.v * 1000;
}
private final void D1() {
l1();
lc.i.d();
this.B = true;
this.v.o1();
z1();
}
private final boolean E1(String str) {
return ld.e.a(c()).a(str) == 0;
}
private final long t1() {
lc.i.d();
l1();
try {
return this.s.x1();
} catch (SQLiteException e) {
r0("Failed to get min/max hit times from local store", e);
return 0L;
}
}
public final void v1() {
r1(new w(this));
}
public final void w1() {
try {
this.s.w1();
z1();
} catch (SQLiteException e) {
h0("Failed to delete stale hits", e);
}
this.y.h(86400000L);
}
private final void x1() {
if (this.B || !f0.b() || this.v.p1()) {
return;
}
if (this.z.c(((Long) n0.O.a()).longValue())) {
this.z.b();
y0("Connecting to service");
if (this.v.m1()) {
y0("Connected to service");
this.z.a();
m1();
}
}
}
private final boolean y1() {
lc.i.d();
l1();
y0("Dispatching a batch of local hits");
boolean z = !this.v.p1();
boolean z2 = !this.t.x1();
if (z && z2) {
y0("No network or service available. Will retry later");
return false;
}
long max = Math.max(f0.f(), f0.g());
ArrayList arrayList = new ArrayList();
long j = 0;
while (true) {
try {
try {
this.s.C();
arrayList.clear();
try {
List u1 = this.s.u1(max);
if (u1.isEmpty()) {
y0("Store is empty, nothing to dispatch");
B1();
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e) {
r0("Failed to commit local dispatch transaction", e);
B1();
return false;
}
}
l("Hits loaded from store. count", Integer.valueOf(u1.size()));
Iterator it = u1.iterator();
while (it.hasNext()) {
if (((s0) it.next()).f() == j) {
k0("Database contains successfully uploaded hit", Long.valueOf(j), Integer.valueOf(u1.size()));
B1();
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e2) {
r0("Failed to commit local dispatch transaction", e2);
B1();
return false;
}
}
}
if (this.v.p1()) {
y0("Service connected, sending hits to the service");
while (!u1.isEmpty()) {
s0 s0Var = (s0) u1.get(0);
if (!this.v.w1(s0Var)) {
break;
}
j = Math.max(j, s0Var.f());
u1.remove(s0Var);
t("Hit sent do device AnalyticsService for delivery", s0Var);
try {
this.s.A1(s0Var.f());
arrayList.add(Long.valueOf(s0Var.f()));
} catch (SQLiteException e3) {
r0("Failed to remove hit that was send for delivery", e3);
B1();
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e4) {
r0("Failed to commit local dispatch transaction", e4);
B1();
return false;
}
}
}
}
if (this.t.x1()) {
List v1 = this.t.v1(u1);
Iterator it2 = v1.iterator();
while (it2.hasNext()) {
j = Math.max(j, ((Long) it2.next()).longValue());
}
try {
this.s.s1(v1);
arrayList.addAll(v1);
} catch (SQLiteException e5) {
r0("Failed to remove successfully uploaded hits", e5);
B1();
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e6) {
r0("Failed to commit local dispatch transaction", e6);
B1();
return false;
}
}
}
if (arrayList.isEmpty()) {
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e7) {
r0("Failed to commit local dispatch transaction", e7);
B1();
return false;
}
}
try {
this.s.o0();
this.s.F0();
} catch (SQLiteException e8) {
r0("Failed to commit local dispatch transaction", e8);
B1();
return false;
}
} catch (SQLiteException e9) {
h0("Failed to read hits from persisted store", e9);
B1();
try {
this.s.o0();
this.s.F0();
return false;
} catch (SQLiteException e10) {
r0("Failed to commit local dispatch transaction", e10);
B1();
return false;
}
}
} catch (Throwable th2) {
this.s.o0();
this.s.F0();
throw th2;
}
this.s.o0();
this.s.F0();
throw th2;
} catch (SQLiteException e11) {
r0("Failed to commit local dispatch transaction", e11);
B1();
return false;
}
}
}
@Override
protected final void i1() {
this.s.a1();
this.t.a1();
this.v.a1();
}
protected final void m1() {
lc.i.d();
lc.i.d();
l1();
if (!f0.b()) {
R0("Service client disabled. Can't dispatch local hits to device AnalyticsService");
}
if (!this.v.p1()) {
y0("Service not connected");
return;
}
if (this.s.o1()) {
return;
}
y0("Dispatching local hits to device AnalyticsService");
while (true) {
try {
List u1 = this.s.u1(f0.f());
if (u1.isEmpty()) {
z1();
return;
}
while (!u1.isEmpty()) {
s0 s0Var = (s0) u1.get(0);
if (!this.v.w1(s0Var)) {
z1();
return;
}
u1.remove(s0Var);
try {
this.s.A1(s0Var.f());
} catch (SQLiteException e) {
r0("Failed to remove hit that was send for delivery", e);
B1();
return;
}
}
} catch (SQLiteException e2) {
r0("Failed to read hits from store", e2);
B1();
return;
}
}
}
final void o1() {
l1();
ed.r.n(!this.r, "Analytics backend already started");
this.r = true;
X().a(new v(this));
}
public final void r1(l0 l0Var) {
long j = this.A;
lc.i.d();
l1();
long p1 = g0().p1();
t("Dispatching local hits. Elapsed time since last dispatch (ms)", Long.valueOf(p1 != 0 ? Math.abs(P().a() - p1) : -1L));
x1();
try {
y1();
g0().q1();
z1();
if (l0Var != null) {
l0Var.a(null);
}
if (this.A != j) {
this.u.e();
}
} catch (Exception e) {
r0("Local dispatch failed", e);
g0().q1();
z1();
if (l0Var != null) {
l0Var.a(e);
}
}
}
final void s1() {
lc.i.d();
this.A = P().a();
}
protected final void u1() {
l1();
lc.i.d();
Context a = I().a();
if (!d1.b(a)) {
R0("AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.");
} else if (!e1.i(a)) {
W0("AnalyticsService is not registered or is disabled. Analytics service at risk of not starting. See http://goo.gl/8Rd3yj for instructions.");
}
if (!lc.a.a(a)) {
R0("CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.");
}
g0().o1();
if (!E1("android.permission.ACCESS_NETWORK_STATE")) {
W0("Missing required android.permission.ACCESS_NETWORK_STATE. Google Analytics disabled. See http://goo.gl/8Rd3yj for instructions");
D1();
}
if (!E1("android.permission.INTERNET")) {
W0("Missing required android.permission.INTERNET. Google Analytics disabled. See http://goo.gl/8Rd3yj for instructions");
D1();
}
if (e1.i(c())) {
y0("AnalyticsService registered in the app manifest and enabled");
} else {
R0("AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.");
}
if (!this.B && !this.s.o1()) {
x1();
}
z1();
}
public final void z1() {
long min;
lc.i.d();
l1();
boolean z = true;
if (!(!this.B && C1() > 0)) {
this.u.b();
B1();
return;
}
if (this.s.o1()) {
this.u.b();
B1();
return;
}
if (!((Boolean) n0.J.a()).booleanValue()) {
this.u.c();
z = this.u.a();
}
if (!z) {
B1();
A1();
return;
}
A1();
long C1 = C1();
long p1 = g0().p1();
if (p1 != 0) {
min = C1 - Math.abs(P().a() - p1);
if (min <= 0) {
min = Math.min(f0.d(), C1);
}
} else {
min = Math.min(f0.d(), C1);
}
l("Dispatch scheduled (ms)", Long.valueOf(min));
if (this.x.g()) {
this.x.i(Math.max(1L, min + this.x.f()));
} else {
this.x.h(min);
}
}
}