apkfuckery/com.discord/smali/com/bugsnag/android/Stacktrace.smali
2019-02-04 21:05:16 +01:00

191 lines
5.3 KiB
Smali

.class Lcom/bugsnag/android/Stacktrace;
.super Ljava/lang/Object;
.source "Stacktrace.java"
# interfaces
.implements Lcom/bugsnag/android/JsonStream$Streamable;
# instance fields
.field final config:Lcom/bugsnag/android/Configuration;
.field final stacktrace:[Ljava/lang/StackTraceElement;
# direct methods
.method constructor <init>(Lcom/bugsnag/android/Configuration;[Ljava/lang/StackTraceElement;)V
.locals 0
.param p1, "config" # Lcom/bugsnag/android/Configuration;
.param p2, "stacktrace" # [Ljava/lang/StackTraceElement;
.prologue
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/bugsnag/android/Stacktrace;->config:Lcom/bugsnag/android/Configuration;
iput-object p2, p0, Lcom/bugsnag/android/Stacktrace;->stacktrace:[Ljava/lang/StackTraceElement;
return-void
.end method
# virtual methods
.method public toStream(Lcom/bugsnag/android/JsonStream;)V
.locals 8
.param p1, "writer" # Lcom/bugsnag/android/JsonStream;
.annotation build Landroid/support/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->beginArray()Lcom/bugsnag/android/JsonWriter;
iget-object v4, p0, Lcom/bugsnag/android/Stacktrace;->stacktrace:[Ljava/lang/StackTraceElement;
array-length v5, v4
const/4 v2, 0x0
move v3, v2
:goto_0
if-ge v3, v5, :cond_2
aget-object v0, v4, v3
.local v0, "el":Ljava/lang/StackTraceElement;
:try_start_0
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->beginObject()Lcom/bugsnag/android/JsonWriter;
const-string v2, "method"
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->name(Ljava/lang/String;)Lcom/bugsnag/android/JsonStream;
move-result-object v2
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getClassName()Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, "."
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getMethodName()Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-virtual {v2, v6}, Lcom/bugsnag/android/JsonStream;->value(Ljava/lang/String;)Lcom/bugsnag/android/JsonWriter;
const-string v2, "file"
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->name(Ljava/lang/String;)Lcom/bugsnag/android/JsonStream;
move-result-object v6
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getFileName()Ljava/lang/String;
move-result-object v2
if-nez v2, :cond_1
const-string v2, "Unknown"
:goto_1
invoke-virtual {v6, v2}, Lcom/bugsnag/android/JsonStream;->value(Ljava/lang/String;)Lcom/bugsnag/android/JsonWriter;
const-string v2, "lineNumber"
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->name(Ljava/lang/String;)Lcom/bugsnag/android/JsonStream;
move-result-object v2
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getLineNumber()I
move-result v6
int-to-long v6, v6
invoke-virtual {v2, v6, v7}, Lcom/bugsnag/android/JsonStream;->value(J)Lcom/bugsnag/android/JsonWriter;
iget-object v2, p0, Lcom/bugsnag/android/Stacktrace;->config:Lcom/bugsnag/android/Configuration;
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getClassName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v2, v6}, Lcom/bugsnag/android/Configuration;->inProject(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_0
const-string v2, "inProject"
invoke-virtual {p1, v2}, Lcom/bugsnag/android/JsonStream;->name(Ljava/lang/String;)Lcom/bugsnag/android/JsonStream;
move-result-object v2
const/4 v6, 0x1
invoke-virtual {v2, v6}, Lcom/bugsnag/android/JsonStream;->value(Z)Lcom/bugsnag/android/JsonWriter;
:cond_0
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->endObject()Lcom/bugsnag/android/JsonWriter;
:goto_2
add-int/lit8 v2, v3, 0x1
move v3, v2
goto :goto_0
:cond_1
invoke-virtual {v0}, Ljava/lang/StackTraceElement;->getFileName()Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v2
goto :goto_1
:catch_0
move-exception v1
.local v1, "lineEx":Ljava/lang/Exception;
sget-object v2, Ljava/lang/System;->err:Ljava/io/PrintStream;
invoke-virtual {v1, v2}, Ljava/lang/Exception;->printStackTrace(Ljava/io/PrintStream;)V
goto :goto_2
.end local v0 # "el":Ljava/lang/StackTraceElement;
.end local v1 # "lineEx":Ljava/lang/Exception;
:cond_2
invoke-virtual {p1}, Lcom/bugsnag/android/JsonStream;->endArray()Lcom/bugsnag/android/JsonWriter;
return-void
.end method