829 lines
22 KiB
Smali
829 lines
22 KiB
Smali
.class public final Lcom/discord/utilities/SystemLogUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "SystemLogUtils.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/SystemLogUtils$Tombstone;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/SystemLogUtils;
|
|
|
|
.field public static final maxLogSize:I = 0x2625a0
|
|
|
|
.field public static final regexExtractTombstone:Lkotlin/text/Regex;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
new-instance v0, Lcom/discord/utilities/SystemLogUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/SystemLogUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/SystemLogUtils;->INSTANCE:Lcom/discord/utilities/SystemLogUtils;
|
|
|
|
new-instance v0, Lkotlin/text/Regex;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "(?:^(?:[^\\s]+\\s+){4}F\\s+DEBUG\\s+:\\s(.+))|(^.+(\\["
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "libdiscord_version"
|
|
|
|
const-string v3, "literal"
|
|
|
|
invoke-static {v2, v3}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v2}, Ljava/util/regex/Pattern;->quote(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "Pattern.quote(literal)"
|
|
|
|
invoke-static {v2, v3}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "\\].+))"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V
|
|
|
|
sput-object v0, Lcom/discord/utilities/SystemLogUtils;->regexExtractTombstone:Lkotlin/text/Regex;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$waitFor(Lcom/discord/utilities/SystemLogUtils;Ljava/lang/Process;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/SystemLogUtils;->waitFor(Ljava/lang/Process;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final fetch(Lkotlin/text/Regex;)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/text/Regex;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/LinkedList<",
|
|
"Ljava/lang/String;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/LinkedList;
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
|
|
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
const-string v2, "/system/bin/logcat"
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const-string p1, "Unable to locate \'/system/bin/logcat\'"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
new-instance p1, Lk0/l/e/j;
|
|
|
|
invoke-direct {p1, v0}, Lk0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string v0, "Observable.just(output)"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
new-instance v1, Lcom/discord/utilities/SystemLogUtils$fetch$2;
|
|
|
|
invoke-direct {v1, v2, v0, p1}, Lcom/discord/utilities/SystemLogUtils$fetch$2;-><init>(Ljava/lang/String;Ljava/util/LinkedList;Lkotlin/text/Regex;)V
|
|
|
|
new-instance p1, Lk0/l/a/s;
|
|
|
|
invoke-direct {p1, v1}, Lk0/l/a/s;-><init>(Ljava/util/concurrent/Callable;)V
|
|
|
|
invoke-static {p1}, Lrx/Observable;->e0(Lrx/Observable$a;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {}, Lk0/p/a;->c()Lk0/p/a;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v0, v0, Lk0/p/a;->c:Lrx/Scheduler;
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->U(Lrx/Scheduler;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "Observable.fromCallable \u2026n(Schedulers.newThread())"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final hashString(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 9
|
|
|
|
const-string v0, "SHA-1"
|
|
|
|
invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lb0/t/a;->a:Ljava/nio/charset/Charset;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "(this as java.lang.String).getBytes(charset)"
|
|
|
|
invoke-static {p1, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/security/MessageDigest;->digest([B)[B
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "bytes"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/utilities/SystemLogUtils$hashString$1;->INSTANCE:Lcom/discord/utilities/SystemLogUtils$hashString$1;
|
|
|
|
const-string v1, "..."
|
|
|
|
const-string v2, "$this$joinToString"
|
|
|
|
invoke-static {p1, v2}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "separator"
|
|
|
|
const-string v3, ""
|
|
|
|
invoke-static {v3, v2}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v4, "prefix"
|
|
|
|
invoke-static {v3, v4}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v5, "postfix"
|
|
|
|
invoke-static {v3, v5}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v6, "truncated"
|
|
|
|
invoke-static {v1, v6}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v7, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v8, "$this$joinTo"
|
|
|
|
invoke-static {p1, v8}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v8, "buffer"
|
|
|
|
invoke-static {v7, v8}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v3, v2}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v3, v4}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v3, v5}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1, v6}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
|
|
|
|
array-length v1, p1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-byte v5, p1, v2
|
|
|
|
const/4 v6, 0x1
|
|
|
|
add-int/2addr v4, v6
|
|
|
|
if-le v4, v6, :cond_0
|
|
|
|
invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
|
|
|
|
:cond_0
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-static {v5}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-interface {v0, v5}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/CharSequence;
|
|
|
|
invoke-virtual {v7, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-static {v5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v7, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
|
|
|
|
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "joinTo(StringBuilder(), \u2026ed, transform).toString()"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v0, "null cannot be cast to non-null type java.lang.String"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final waitFor(Ljava/lang/Process;)V
|
|
.locals 5
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
move-result-wide v0
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v3, 0xf
|
|
|
|
invoke-virtual {v2, v3, v4}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
|
|
|
|
move-result-wide v2
|
|
|
|
add-long/2addr v2, v0
|
|
|
|
:cond_0
|
|
:try_start_0
|
|
invoke-virtual {p1}, Ljava/lang/Process;->exitValue()I
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalThreadStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
const-wide/16 v0, 0x64
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
|
|
|
|
invoke-static {}, Ljava/lang/System;->nanoTime()J
|
|
|
|
move-result-wide v0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-ltz v4, :cond_0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final fetch()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/SystemLogUtils;->fetch(Lkotlin/text/Regex;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/utilities/SystemLogUtils$fetch$1;->INSTANCE:Lcom/discord/utilities/SystemLogUtils$fetch$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->E(Lk0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "fetch(null).map { it.joinToString(\"\\n\") }"
|
|
|
|
invoke-static {v0, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final fetchLastTombstone()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/utilities/SystemLogUtils$Tombstone;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/utilities/SystemLogUtils;->regexExtractTombstone:Lkotlin/text/Regex;
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/utilities/SystemLogUtils;->fetch(Lkotlin/text/Regex;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$1;->INSTANCE:Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->x(Lk0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "fetch(regexExtractTombst\u2026ble.just(tombstone)\n }"
|
|
|
|
invoke-static {v0, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final fetchLastTombstone$app_productionDiscordExternalRelease(Ljava/util/Collection;)Lcom/discord/utilities/SystemLogUtils$Tombstone;
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"Ljava/lang/String;",
|
|
">;)",
|
|
"Lcom/discord/utilities/SystemLogUtils$Tombstone;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "crashes"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
new-instance v0, Lkotlin/jvm/internal/Ref$ObjectRef;
|
|
|
|
invoke-direct {v0}, Lkotlin/jvm/internal/Ref$ObjectRef;-><init>()V
|
|
|
|
iput-object v1, v0, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
new-instance v2, Lkotlin/jvm/internal/Ref$ObjectRef;
|
|
|
|
invoke-direct {v2}, Lkotlin/jvm/internal/Ref$ObjectRef;-><init>()V
|
|
|
|
iput-object v1, v2, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
new-instance v3, Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$text$1;
|
|
|
|
invoke-direct {v3, p1, v0, v2}, Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$text$1;-><init>(Ljava/util/Collection;Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$ObjectRef;)V
|
|
|
|
invoke-interface {v3}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const-string/jumbo v0, "{\n val sb = StringB\u2026 sb.toString()\n }()"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
invoke-static {p1}, Lb0/t/k;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
return-object v1
|
|
|
|
:cond_1
|
|
new-instance v0, Lkotlin/text/Regex;
|
|
|
|
sget-object v1, Lb0/t/d;->e:Lb0/t/d;
|
|
|
|
const-string v2, "^\\s+#\\d+ pc .+/(.+? .+?)\\+?[+)]"
|
|
|
|
invoke-direct {v0, v2, v1}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;Lb0/t/d;)V
|
|
|
|
new-instance v1, Lkotlin/text/Regex;
|
|
|
|
const-string v2, "classes\\d+.dex"
|
|
|
|
invoke-direct {v1, v2}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, p1, v2}, Lkotlin/text/Regex;->findAll(Ljava/lang/CharSequence;I)Lkotlin/sequences/Sequence;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v2, Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$extractedGroups$1;
|
|
|
|
invoke-direct {v2, v1}, Lcom/discord/utilities/SystemLogUtils$fetchLastTombstone$extractedGroups$1;-><init>(Lkotlin/text/Regex;)V
|
|
|
|
invoke-static {v0, v2}, Lb0/j/a;->map(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v0, "libc.so (abort"
|
|
|
|
const-string v1, "libart.so (art::Runtime::Abort(char const*"
|
|
|
|
const-string v2, "libbase.so (android::base::LogMessage::~LogMessage("
|
|
|
|
filled-new-array {v0, v1, v2}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lf/h/a/f/e/n/f;->hashSetOf([Ljava/lang/Object;)Ljava/util/HashSet;
|
|
|
|
move-result-object v0
|
|
|
|
:try_start_0
|
|
move-object v1, v3
|
|
|
|
check-cast v1, Lb0/s/u;
|
|
|
|
iget-object v2, v1, Lb0/s/u;->a:Lkotlin/sequences/Sequence;
|
|
|
|
invoke-interface {v2}, Lkotlin/sequences/Sequence;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_2
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
iget-object v4, v1, Lb0/s/u;->b:Lkotlin/jvm/functions/Function1;
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-interface {v4, v5}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
move-object v5, v4
|
|
|
|
check-cast v5, Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v5}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v5
|
|
|
|
xor-int/lit8 v5, v5, 0x1
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
check-cast v4, Ljava/lang/String;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
new-instance v0, Ljava/util/NoSuchElementException;
|
|
|
|
const-string v1, "Sequence contains no element matching the predicate."
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/NoSuchElementException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
:try_end_0
|
|
.catch Ljava/util/NoSuchElementException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
const-string v4, "Unknown"
|
|
|
|
:goto_0
|
|
move-object v0, v4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/16 v10, 0x3e
|
|
|
|
const-string v4, "\n"
|
|
|
|
invoke-static/range {v3 .. v10}, Lb0/j/a;->joinToString$default(Lkotlin/sequences/Sequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Lcom/discord/utilities/SystemLogUtils$Tombstone;
|
|
|
|
invoke-direct {p0, v1}, Lcom/discord/utilities/SystemLogUtils;->hashString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v2, p1, v1, v0, v3}, Lcom/discord/utilities/SystemLogUtils$Tombstone;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-object v2
|
|
.end method
|
|
|
|
.method public final getRegexExtractTombstone$app_productionDiscordExternalRelease()Lkotlin/text/Regex;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/SystemLogUtils;->regexExtractTombstone:Lkotlin/text/Regex;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final processLogs$app_productionDiscordExternalRelease(Ljava/io/BufferedReader;Ljava/util/LinkedList;Lkotlin/text/Regex;)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/io/BufferedReader;",
|
|
"Ljava/util/LinkedList<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Lkotlin/text/Regex;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "reader"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "output"
|
|
|
|
invoke-static {p2, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
const v2, 0x2625a0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_8
|
|
|
|
const/4 v4, 0x1
|
|
|
|
if-eqz p3, :cond_4
|
|
|
|
invoke-virtual {p3, v3, v0}, Lkotlin/text/Regex;->find(Ljava/lang/CharSequence;I)Lkotlin/text/MatchResult;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-interface {v3}, Lkotlin/text/MatchResult;->getGroupValues()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->size()I
|
|
|
|
move-result v5
|
|
|
|
invoke-interface {v3, v5}, Ljava/util/List;->listIterator(I)Ljava/util/ListIterator;
|
|
|
|
move-result-object v3
|
|
|
|
:cond_1
|
|
invoke-interface {v3}, Ljava/util/ListIterator;->hasPrevious()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
invoke-interface {v3}, Ljava/util/ListIterator;->previous()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
move-object v6, v5
|
|
|
|
check-cast v6, Ljava/lang/String;
|
|
|
|
invoke-virtual {v6}, Ljava/lang/String;->length()I
|
|
|
|
move-result v6
|
|
|
|
if-lez v6, :cond_2
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v6, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v6, :cond_1
|
|
|
|
move-object v3, v5
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/util/NoSuchElementException;
|
|
|
|
const-string v0, "List contains no element matching the predicate."
|
|
|
|
invoke-direct {p1, v0}, Ljava/util/NoSuchElementException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
:goto_2
|
|
invoke-static {v3}, Lb0/t/k;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
const-string v5, "Accessing hidden method"
|
|
|
|
const/4 v6, 0x2
|
|
|
|
invoke-static {v3, v5, v0, v6}, Lb0/t/p;->contains$default(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZI)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_6
|
|
|
|
goto :goto_0
|
|
|
|
:cond_6
|
|
invoke-virtual {v3}, Ljava/lang/String;->length()I
|
|
|
|
move-result v5
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
add-int/2addr v5, v4
|
|
|
|
add-int/2addr v5, v1
|
|
|
|
:try_start_1
|
|
invoke-virtual {p2, v3}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
if-le v5, v2, :cond_7
|
|
|
|
invoke-virtual {p2}, Ljava/util/LinkedList;->pop()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
sub-int/2addr v1, v4
|
|
|
|
sub-int/2addr v5, v1
|
|
|
|
:cond_7
|
|
move v1, v5
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
move v1, v5
|
|
|
|
goto :goto_3
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
:goto_3
|
|
invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V
|
|
|
|
if-nez p3, :cond_8
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "IOException: "
|
|
|
|
invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2, p1}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_8
|
|
if-le v1, v2, :cond_9
|
|
|
|
invoke-virtual {p2}, Ljava/util/LinkedList;->pop()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
:cond_9
|
|
return-void
|
|
.end method
|