205 lines
4.8 KiB
Smali
205 lines
4.8 KiB
Smali
.class final Lcom/crashlytics/android/answers/d;
|
|
.super Ljava/lang/Object;
|
|
.source "AnswersEventValidator.java"
|
|
|
|
|
|
# instance fields
|
|
.field final nx:I
|
|
|
|
.field final ny:I
|
|
|
|
.field nz:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Z)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/16 v0, 0x14
|
|
|
|
iput v0, p0, Lcom/crashlytics/android/answers/d;->nx:I
|
|
|
|
const/16 v0, 0x64
|
|
|
|
iput v0, p0, Lcom/crashlytics/android/answers/d;->ny:I
|
|
|
|
iput-boolean p1, p0, Lcom/crashlytics/android/answers/d;->nz:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/RuntimeException;)V
|
|
.locals 3
|
|
|
|
iget-boolean v0, p0, Lcom/crashlytics/android/answers/d;->nz:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-static {}, Lio/fabric/sdk/android/c;->wz()Lio/fabric/sdk/android/l;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Answers"
|
|
|
|
const-string v2, "Invalid user input detected"
|
|
|
|
invoke-interface {v0, v1, v2, p1}, Lio/fabric/sdk/android/l;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final C(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 5
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lcom/crashlytics/android/answers/d;->ny:I
|
|
|
|
if-le v0, v1, :cond_0
|
|
|
|
sget-object v0, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
const-string v1, "String is too long, truncating to %d characters"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
iget v3, p0, Lcom/crashlytics/android/answers/d;->ny:I
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aput-object v3, v2, v4
|
|
|
|
invoke-static {v0, v1, v2}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v1}, Lcom/crashlytics/android/answers/d;->a(Ljava/lang/RuntimeException;)V
|
|
|
|
iget v0, p0, Lcom/crashlytics/android/answers/d;->ny:I
|
|
|
|
invoke-virtual {p1, v4, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final a(Ljava/lang/Object;Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p2, " must not be null"
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/crashlytics/android/answers/d;->a(Ljava/lang/RuntimeException;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final a(Ljava/util/Map;Ljava/lang/String;)Z
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Object;",
|
|
">;",
|
|
"Ljava/lang/String;",
|
|
")Z"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->size()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lcom/crashlytics/android/answers/d;->nx:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-interface {p1, p2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
sget-object p1, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
const-string p2, "Limit of %d attributes reached, skipping attribute"
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v1, v0, [Ljava/lang/Object;
|
|
|
|
iget v3, p0, Lcom/crashlytics/android/answers/d;->nx:I
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
invoke-static {p1, p2, v1}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p2}, Lcom/crashlytics/android/answers/d;->a(Ljava/lang/RuntimeException;)V
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
return v2
|
|
.end method
|