165 lines
5.3 KiB
Java
165 lines
5.3 KiB
Java
package com.huawei.hms.hatool;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import com.google.android.gms.measurement.api.AppMeasurementSdk;
|
|
import java.util.LinkedHashMap;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class z0 {
|
|
private String a;
|
|
public l1 b;
|
|
|
|
public void b(s0 s0Var) {
|
|
StringBuilder sb = new StringBuilder("HiAnalyticsInstanceImpl.setOperConf() is executed.TAG: ");
|
|
sb.append(this.a);
|
|
v.c("hmsSdk", sb.toString());
|
|
if (s0Var != null) {
|
|
this.b.b(s0Var);
|
|
} else {
|
|
this.b.b(null);
|
|
v.e("hmsSdk", "HiAnalyticsInstanceImpl.setOperConf(): config for oper is null!");
|
|
}
|
|
}
|
|
|
|
public void b(int i, String str, LinkedHashMap<String, String> linkedHashMap) {
|
|
StringBuilder sb = new StringBuilder("onStreamEvent. TAG: ");
|
|
sb.append(this.a);
|
|
sb.append(", TYPE: ");
|
|
sb.append(i);
|
|
sb.append(", eventId : ");
|
|
sb.append(str);
|
|
v.d("hmsSdk", sb.toString());
|
|
if (e1.a(str) || !c(i)) {
|
|
StringBuilder sb2 = new StringBuilder("onStreamEvent() parameters check fail. Nothing will be recorded.TAG: ");
|
|
sb2.append(this.a);
|
|
sb2.append(", TYPE: ");
|
|
sb2.append(i);
|
|
v.e("hmsSdk", sb2.toString());
|
|
return;
|
|
}
|
|
if (!e1.a(linkedHashMap)) {
|
|
StringBuilder sb3 = new StringBuilder("onStreamEvent() parameter mapValue will be cleared.TAG: ");
|
|
sb3.append(this.a);
|
|
sb3.append(", TYPE: ");
|
|
sb3.append(i);
|
|
v.e("hmsSdk", sb3.toString());
|
|
linkedHashMap = null;
|
|
}
|
|
g0.a().b(this.a, i, str, linkedHashMap);
|
|
}
|
|
|
|
public void a(s0 s0Var) {
|
|
StringBuilder sb = new StringBuilder("HiAnalyticsInstanceImpl.setMaintConf() is executed.TAG : ");
|
|
sb.append(this.a);
|
|
v.c("hmsSdk", sb.toString());
|
|
if (s0Var != null) {
|
|
this.b.a(s0Var);
|
|
} else {
|
|
v.e("hmsSdk", "HiAnalyticsInstanceImpl.setMaintConf(): config for maint is null!");
|
|
this.b.a((s0) null);
|
|
}
|
|
}
|
|
|
|
public void a(Context context, String str, String str2) {
|
|
StringBuilder sb = new StringBuilder("onEvent(context). TAG: ");
|
|
sb.append(this.a);
|
|
sb.append(", eventId : ");
|
|
sb.append(str);
|
|
v.d("hmsSdk", sb.toString());
|
|
if (context == null) {
|
|
v.e("hmsSdk", "context is null in onevent ");
|
|
return;
|
|
}
|
|
if (e1.a(str) || !c(0)) {
|
|
StringBuilder sb2 = new StringBuilder("onEvent() parameters check fail. Nothing will be recorded.TAG: ");
|
|
sb2.append(this.a);
|
|
v.e("hmsSdk", sb2.toString());
|
|
} else {
|
|
if (!e1.a(AppMeasurementSdk.ConditionalUserProperty.VALUE, str2, 65536)) {
|
|
StringBuilder sb3 = new StringBuilder("onEvent() parameter VALUE is overlong, content will be cleared.TAG: ");
|
|
sb3.append(this.a);
|
|
v.e("hmsSdk", sb3.toString());
|
|
str2 = "";
|
|
}
|
|
g0.a().a(this.a, context, str, str2);
|
|
}
|
|
}
|
|
|
|
public void a(int i, String str, LinkedHashMap<String, String> linkedHashMap) {
|
|
StringBuilder sb = new StringBuilder("onEvent. TAG: ");
|
|
sb.append(this.a);
|
|
sb.append(", TYPE: ");
|
|
sb.append(i);
|
|
sb.append(", eventId : ");
|
|
sb.append(str);
|
|
v.d("hmsSdk", sb.toString());
|
|
if (e1.a(str) || !c(i)) {
|
|
StringBuilder sb2 = new StringBuilder("onEvent() parameters check fail. Nothing will be recorded.TAG: ");
|
|
sb2.append(this.a);
|
|
sb2.append(", TYPE: ");
|
|
sb2.append(i);
|
|
v.e("hmsSdk", sb2.toString());
|
|
return;
|
|
}
|
|
if (!e1.a(linkedHashMap)) {
|
|
StringBuilder sb3 = new StringBuilder("onEvent() parameter mapValue will be cleared.TAG: ");
|
|
sb3.append(this.a);
|
|
sb3.append(", TYPE: ");
|
|
sb3.append(i);
|
|
v.e("hmsSdk", sb3.toString());
|
|
linkedHashMap = null;
|
|
}
|
|
g0.a().a(this.a, i, str, linkedHashMap);
|
|
}
|
|
|
|
public void a(int i) {
|
|
StringBuilder sb = new StringBuilder("onReport. TAG: ");
|
|
sb.append(this.a);
|
|
sb.append(", TYPE: ");
|
|
sb.append(i);
|
|
v.d("hmsSdk", sb.toString());
|
|
g0.a().a(this.a, i);
|
|
}
|
|
|
|
private boolean c(int i) {
|
|
String concat;
|
|
if (i != 2) {
|
|
s0 b = b(i);
|
|
if (b != null && !TextUtils.isEmpty(b.h())) {
|
|
return true;
|
|
}
|
|
concat = "verifyURL(): URL check failed. type: ".concat(String.valueOf(i));
|
|
} else {
|
|
if ("_default_config_tag".equals(this.a)) {
|
|
return true;
|
|
}
|
|
concat = "verifyURL(): type: preins. Only default config can report Pre-install data.";
|
|
}
|
|
v.e("hmsSdk", concat);
|
|
return false;
|
|
}
|
|
|
|
private s0 b(int i) {
|
|
if (i == 0) {
|
|
return this.b.c();
|
|
}
|
|
if (i == 1) {
|
|
return this.b.b();
|
|
}
|
|
if (i == 2) {
|
|
return this.b.d();
|
|
}
|
|
if (i != 3) {
|
|
return null;
|
|
}
|
|
return this.b.a();
|
|
}
|
|
|
|
public z0(String str) {
|
|
this.a = str;
|
|
this.b = new l1(str);
|
|
s.c().a(this.a, this.b);
|
|
}
|
|
}
|