Add Discord APKTool decompilation (Smali source for modding)

- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3
- APKTool decompilation (Smali bytecode) for modding and rebuilding APK
- Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures
- Includes full Smali source, resources, and native libraries
- Ready to rebuild APK after modifications with apktool b command
- Added comprehensive README-apktool.md with modding guide

This branch complements the JADX branches:
- Use JADX (main/discord-community) to UNDERSTAND code (readable Java)
- Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali)

Total: 44,417 files, 538.51 MB Smali source code
This commit is contained in:
2026-02-18 16:13:44 -08:00
parent c080f0d97f
commit f3960ee359
44288 changed files with 10998761 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
.class public Lcom/github/anrwatchdog/ANRError$$$_Thread;
.super Ljava/lang/Throwable;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRError$$;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = "_Thread"
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/github/anrwatchdog/ANRError$$;
# direct methods
.method public constructor <init>(Lcom/github/anrwatchdog/ANRError$$;Lcom/github/anrwatchdog/ANRError$$$_Thread;)V
.locals 0
iput-object p1, p0, Lcom/github/anrwatchdog/ANRError$$$_Thread;->this$0:Lcom/github/anrwatchdog/ANRError$$;
.line 26
invoke-static {p1}, Lcom/github/anrwatchdog/ANRError$$;->access$000(Lcom/github/anrwatchdog/ANRError$$;)Ljava/lang/String;
move-result-object p1
invoke-direct {p0, p1, p2}, Ljava/lang/Throwable;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
return-void
.end method
.method public synthetic constructor <init>(Lcom/github/anrwatchdog/ANRError$$;Lcom/github/anrwatchdog/ANRError$$$_Thread;Lcom/github/anrwatchdog/ANRError$1;)V
.locals 0
.line 24
invoke-direct {p0, p1, p2}, Lcom/github/anrwatchdog/ANRError$$$_Thread;-><init>(Lcom/github/anrwatchdog/ANRError$$;Lcom/github/anrwatchdog/ANRError$$$_Thread;)V
return-void
.end method
# virtual methods
.method public fillInStackTrace()Ljava/lang/Throwable;
.locals 1
iget-object v0, p0, Lcom/github/anrwatchdog/ANRError$$$_Thread;->this$0:Lcom/github/anrwatchdog/ANRError$$;
.line 31
invoke-static {v0}, Lcom/github/anrwatchdog/ANRError$$;->access$100(Lcom/github/anrwatchdog/ANRError$$;)[Ljava/lang/StackTraceElement;
move-result-object v0
invoke-virtual {p0, v0}, Ljava/lang/Throwable;->setStackTrace([Ljava/lang/StackTraceElement;)V
return-object p0
.end method

View File

@@ -0,0 +1,71 @@
.class public Lcom/github/anrwatchdog/ANRError$$;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/io/Serializable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRError;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "$"
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/github/anrwatchdog/ANRError$$$_Thread;
}
.end annotation
# instance fields
.field public final _name:Ljava/lang/String;
.field public final _stackTrace:[Ljava/lang/StackTraceElement;
# direct methods
.method public constructor <init>(Ljava/lang/String;[Ljava/lang/StackTraceElement;)V
.locals 0
.line 36
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/github/anrwatchdog/ANRError$$;->_name:Ljava/lang/String;
iput-object p2, p0, Lcom/github/anrwatchdog/ANRError$$;->_stackTrace:[Ljava/lang/StackTraceElement;
return-void
.end method
.method public synthetic constructor <init>(Ljava/lang/String;[Ljava/lang/StackTraceElement;Lcom/github/anrwatchdog/ANRError$1;)V
.locals 0
.line 20
invoke-direct {p0, p1, p2}, Lcom/github/anrwatchdog/ANRError$$;-><init>(Ljava/lang/String;[Ljava/lang/StackTraceElement;)V
return-void
.end method
.method public static synthetic access$000(Lcom/github/anrwatchdog/ANRError$$;)Ljava/lang/String;
.locals 0
.line 20
iget-object p0, p0, Lcom/github/anrwatchdog/ANRError$$;->_name:Ljava/lang/String;
return-object p0
.end method
.method public static synthetic access$100(Lcom/github/anrwatchdog/ANRError$$;)[Ljava/lang/StackTraceElement;
.locals 0
.line 20
iget-object p0, p0, Lcom/github/anrwatchdog/ANRError$$;->_stackTrace:[Ljava/lang/StackTraceElement;
return-object p0
.end method

View File

@@ -0,0 +1,93 @@
.class public final Lcom/github/anrwatchdog/ANRError$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/util/Comparator;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/github/anrwatchdog/ANRError;->New(JLjava/lang/String;Z)Lcom/github/anrwatchdog/ANRError;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = null
.end annotation
# instance fields
.field public final synthetic val$mainThread:Ljava/lang/Thread;
# direct methods
.method public constructor <init>(Ljava/lang/Thread;)V
.locals 0
iput-object p1, p0, Lcom/github/anrwatchdog/ANRError$1;->val$mainThread:Ljava/lang/Thread;
.line 64
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public bridge synthetic compare(Ljava/lang/Object;Ljava/lang/Object;)I
.locals 0
.line 64
check-cast p1, Ljava/lang/Thread;
check-cast p2, Ljava/lang/Thread;
invoke-virtual {p0, p1, p2}, Lcom/github/anrwatchdog/ANRError$1;->compare(Ljava/lang/Thread;Ljava/lang/Thread;)I
move-result p1
return p1
.end method
.method public compare(Ljava/lang/Thread;Ljava/lang/Thread;)I
.locals 1
if-ne p1, p2, :cond_0
const/4 p1, 0x0
return p1
:cond_0
iget-object v0, p0, Lcom/github/anrwatchdog/ANRError$1;->val$mainThread:Ljava/lang/Thread;
if-ne p1, v0, :cond_1
const/4 p1, 0x1
return p1
:cond_1
if-ne p2, v0, :cond_2
const/4 p1, -0x1
return p1
.line 73
:cond_2
invoke-virtual {p2}, Ljava/lang/Thread;->getName()Ljava/lang/String;
move-result-object p2
invoke-virtual {p1}, Ljava/lang/Thread;->getName()Ljava/lang/String;
move-result-object p1
invoke-virtual {p2, p1}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I
move-result p1
return p1
.end method

View File

@@ -0,0 +1,318 @@
.class public Lcom/github/anrwatchdog/ANRError;
.super Ljava/lang/Error;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/github/anrwatchdog/ANRError$$;
}
.end annotation
# static fields
.field private static final serialVersionUID:J = 0x1L
# instance fields
.field public final duration:J
# direct methods
.method public constructor <init>(Lcom/github/anrwatchdog/ANRError$$$_Thread;J)V
.locals 2
.line 51
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Application Not Responding for at least "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, " ms."
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0, p1}, Ljava/lang/Error;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
iput-wide p2, p0, Lcom/github/anrwatchdog/ANRError;->duration:J
return-void
.end method
.method public static New(JLjava/lang/String;Z)Lcom/github/anrwatchdog/ANRError;
.locals 5
.line 62
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v0
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
move-result-object v0
.line 64
new-instance v1, Ljava/util/TreeMap;
new-instance v2, Lcom/github/anrwatchdog/ANRError$1;
invoke-direct {v2, v0}, Lcom/github/anrwatchdog/ANRError$1;-><init>(Ljava/lang/Thread;)V
invoke-direct {v1, v2}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V
.line 77
invoke-static {}, Ljava/lang/Thread;->getAllStackTraces()Ljava/util/Map;
move-result-object v2
invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object v2
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_0
:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_2
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/util/Map$Entry;
.line 79
invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v4
if-eq v4, v0, :cond_1
.line 81
invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v4
check-cast v4, Ljava/lang/Thread;
invoke-virtual {v4}, Ljava/lang/Thread;->getName()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4, p2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_0
if-nez p3, :cond_1
.line 85
invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v4
check-cast v4, [Ljava/lang/StackTraceElement;
array-length v4, v4
if-lez v4, :cond_0
.line 89
:cond_1
invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v4
invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v3
invoke-interface {v1, v4, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_0
.line 92
:cond_2
invoke-interface {v1, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result p2
if-nez p2, :cond_3
.line 93
invoke-virtual {v0}, Ljava/lang/Thread;->getStackTrace()[Ljava/lang/StackTraceElement;
move-result-object p2
invoke-interface {v1, v0, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 97
:cond_3
invoke-interface {v1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object p2
invoke-interface {p2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object p2
const/4 p3, 0x0
move-object v0, p3
:goto_1
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_4
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/util/Map$Entry;
.line 98
new-instance v2, Lcom/github/anrwatchdog/ANRError$$$_Thread;
new-instance v3, Lcom/github/anrwatchdog/ANRError$$;
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v4
check-cast v4, Ljava/lang/Thread;
invoke-static {v4}, Lcom/github/anrwatchdog/ANRError;->getThreadTitle(Ljava/lang/Thread;)Ljava/lang/String;
move-result-object v4
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v1
check-cast v1, [Ljava/lang/StackTraceElement;
invoke-direct {v3, v4, v1, p3}, Lcom/github/anrwatchdog/ANRError$$;-><init>(Ljava/lang/String;[Ljava/lang/StackTraceElement;Lcom/github/anrwatchdog/ANRError$1;)V
invoke-direct {v2, v3, v0, p3}, Lcom/github/anrwatchdog/ANRError$$$_Thread;-><init>(Lcom/github/anrwatchdog/ANRError$$;Lcom/github/anrwatchdog/ANRError$$$_Thread;Lcom/github/anrwatchdog/ANRError$1;)V
move-object v0, v2
goto :goto_1
.line 100
:cond_4
new-instance p2, Lcom/github/anrwatchdog/ANRError;
invoke-direct {p2, v0, p0, p1}, Lcom/github/anrwatchdog/ANRError;-><init>(Lcom/github/anrwatchdog/ANRError$$$_Thread;J)V
return-object p2
.end method
.method public static NewMainOnly(J)Lcom/github/anrwatchdog/ANRError;
.locals 6
.line 104
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v0
invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;
move-result-object v0
.line 105
invoke-virtual {v0}, Ljava/lang/Thread;->getStackTrace()[Ljava/lang/StackTraceElement;
move-result-object v1
.line 107
new-instance v2, Lcom/github/anrwatchdog/ANRError;
new-instance v3, Lcom/github/anrwatchdog/ANRError$$$_Thread;
new-instance v4, Lcom/github/anrwatchdog/ANRError$$;
invoke-static {v0}, Lcom/github/anrwatchdog/ANRError;->getThreadTitle(Ljava/lang/Thread;)Ljava/lang/String;
move-result-object v0
const/4 v5, 0x0
invoke-direct {v4, v0, v1, v5}, Lcom/github/anrwatchdog/ANRError$$;-><init>(Ljava/lang/String;[Ljava/lang/StackTraceElement;Lcom/github/anrwatchdog/ANRError$1;)V
invoke-direct {v3, v4, v5, v5}, Lcom/github/anrwatchdog/ANRError$$$_Thread;-><init>(Lcom/github/anrwatchdog/ANRError$$;Lcom/github/anrwatchdog/ANRError$$$_Thread;Lcom/github/anrwatchdog/ANRError$1;)V
invoke-direct {v2, v3, p0, p1}, Lcom/github/anrwatchdog/ANRError;-><init>(Lcom/github/anrwatchdog/ANRError$$$_Thread;J)V
return-object v2
.end method
.method public static getThreadTitle(Ljava/lang/Thread;)Ljava/lang/String;
.locals 2
.line 111
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Ljava/lang/Thread;->getName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, " (state = "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p0}, Ljava/lang/Thread;->getState()Ljava/lang/Thread$State;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string p0, ")"
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
# virtual methods
.method public fillInStackTrace()Ljava/lang/Throwable;
.locals 1
const/4 v0, 0x0
new-array v0, v0, [Ljava/lang/StackTraceElement;
.line 57
invoke-virtual {p0, v0}, Ljava/lang/Throwable;->setStackTrace([Ljava/lang/StackTraceElement;)V
return-object p0
.end method

View File

@@ -0,0 +1,37 @@
.class public final Lcom/github/anrwatchdog/ANRWatchDog$1;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = null
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.line 62
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public onAppNotResponding(Lcom/github/anrwatchdog/ANRError;)V
.locals 0
.line 64
throw p1
.end method

View File

@@ -0,0 +1,38 @@
.class public final Lcom/github/anrwatchdog/ANRWatchDog$2;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = null
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.line 68
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public intercept(J)J
.locals 0
const-wide/16 p1, 0x0
return-wide p1
.end method

View File

@@ -0,0 +1,59 @@
.class public final Lcom/github/anrwatchdog/ANRWatchDog$3;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = null
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.line 74
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public onInterrupted(Ljava/lang/InterruptedException;)V
.locals 2
.line 76
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Interrupted: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
const-string v0, "ANRWatchdog"
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method

View File

@@ -0,0 +1,56 @@
.class public Lcom/github/anrwatchdog/ANRWatchDog$4;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Ljava/lang/Runnable;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = null
.end annotation
# instance fields
.field public final synthetic this$0:Lcom/github/anrwatchdog/ANRWatchDog;
# direct methods
.method public constructor <init>(Lcom/github/anrwatchdog/ANRWatchDog;)V
.locals 0
iput-object p1, p0, Lcom/github/anrwatchdog/ANRWatchDog$4;->this$0:Lcom/github/anrwatchdog/ANRWatchDog;
.line 94
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public run()V
.locals 3
iget-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog$4;->this$0:Lcom/github/anrwatchdog/ANRWatchDog;
const-wide/16 v1, 0x0
.line 96
invoke-static {v0, v1, v2}, Lcom/github/anrwatchdog/ANRWatchDog;->access$002(Lcom/github/anrwatchdog/ANRWatchDog;J)J
iget-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog$4;->this$0:Lcom/github/anrwatchdog/ANRWatchDog;
const/4 v1, 0x0
.line 97
invoke-static {v0, v1}, Lcom/github/anrwatchdog/ANRWatchDog;->access$102(Lcom/github/anrwatchdog/ANRWatchDog;Z)Z
return-void
.end method

View File

@@ -0,0 +1,19 @@
.class public interface abstract Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x609
name = "ANRInterceptor"
.end annotation
# virtual methods
.method public abstract intercept(J)J
.end method

View File

@@ -0,0 +1,19 @@
.class public interface abstract Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x609
name = "ANRListener"
.end annotation
# virtual methods
.method public abstract onAppNotResponding(Lcom/github/anrwatchdog/ANRError;)V
.end method

View File

@@ -0,0 +1,19 @@
.class public interface abstract Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/github/anrwatchdog/ANRWatchDog;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x609
name = "InterruptionListener"
.end annotation
# virtual methods
.method public abstract onInterrupted(Ljava/lang/InterruptedException;)V
.end method

View File

@@ -0,0 +1,356 @@
.class public Lcom/github/anrwatchdog/ANRWatchDog;
.super Ljava/lang/Thread;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;,
Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;,
Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
}
.end annotation
# static fields
.field public static final DEFAULT_ANR_INTERCEPTOR:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
.field public static final DEFAULT_ANR_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
.field public static final DEFAULT_INTERRUPTION_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
# instance fields
.field public _anrInterceptor:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
.field public _anrListener:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
.field public _ignoreDebugger:Z
.field public _interruptionListener:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
.field public _logThreadsWithoutStackTrace:Z
.field public _namePrefix:Ljava/lang/String;
.field public volatile _reported:Z
.field public volatile _tick:J
.field public final _ticker:Ljava/lang/Runnable;
.field public final _timeoutInterval:I
.field public final _uiHandler:Landroid/os/Handler;
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 62
new-instance v0, Lcom/github/anrwatchdog/ANRWatchDog$1;
invoke-direct {v0}, Lcom/github/anrwatchdog/ANRWatchDog$1;-><init>()V
sput-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_ANR_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
.line 68
new-instance v0, Lcom/github/anrwatchdog/ANRWatchDog$2;
invoke-direct {v0}, Lcom/github/anrwatchdog/ANRWatchDog$2;-><init>()V
sput-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_ANR_INTERCEPTOR:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
.line 74
new-instance v0, Lcom/github/anrwatchdog/ANRWatchDog$3;
invoke-direct {v0}, Lcom/github/anrwatchdog/ANRWatchDog$3;-><init>()V
sput-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_INTERRUPTION_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
return-void
.end method
.method public constructor <init>()V
.locals 1
const/16 v0, 0x1388
.line 105
invoke-direct {p0, v0}, Lcom/github/anrwatchdog/ANRWatchDog;-><init>(I)V
return-void
.end method
.method public constructor <init>(I)V
.locals 3
.line 115
invoke-direct {p0}, Ljava/lang/Thread;-><init>()V
sget-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_ANR_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrListener:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
sget-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_ANR_INTERCEPTOR:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrInterceptor:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
sget-object v0, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_INTERRUPTION_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_interruptionListener:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
.line 84
new-instance v0, Landroid/os/Handler;
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v1
invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_uiHandler:Landroid/os/Handler;
const-string v0, ""
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_namePrefix:Ljava/lang/String;
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_logThreadsWithoutStackTrace:Z
iput-boolean v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_ignoreDebugger:Z
const-wide/16 v1, 0x0
iput-wide v1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
iput-boolean v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_reported:Z
.line 94
new-instance v0, Lcom/github/anrwatchdog/ANRWatchDog$4;
invoke-direct {v0, p0}, Lcom/github/anrwatchdog/ANRWatchDog$4;-><init>(Lcom/github/anrwatchdog/ANRWatchDog;)V
iput-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_ticker:Ljava/lang/Runnable;
iput p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_timeoutInterval:I
return-void
.end method
.method public static synthetic access$002(Lcom/github/anrwatchdog/ANRWatchDog;J)J
.locals 0
.line 35
iput-wide p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
return-wide p1
.end method
.method public static synthetic access$102(Lcom/github/anrwatchdog/ANRWatchDog;Z)Z
.locals 0
.line 35
iput-boolean p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_reported:Z
return p1
.end method
# virtual methods
.method public run()V
.locals 8
const-string v0, "|ANR-WatchDog|"
.line 240
invoke-virtual {p0, v0}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V
iget v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_timeoutInterval:I
int-to-long v0, v0
.line 243
:cond_0
:goto_0
invoke-virtual {p0}, Ljava/lang/Thread;->isInterrupted()Z
move-result v2
if-nez v2, :cond_7
iget-wide v2, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
const-wide/16 v4, 0x0
cmp-long v2, v2, v4
const/4 v3, 0x1
if-nez v2, :cond_1
move v2, v3
goto :goto_1
:cond_1
const/4 v2, 0x0
:goto_1
iget-wide v6, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
add-long/2addr v6, v0
iput-wide v6, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
if-eqz v2, :cond_2
iget-object v2, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_uiHandler:Landroid/os/Handler;
iget-object v6, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_ticker:Ljava/lang/Runnable;
.line 247
invoke-virtual {v2, v6}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
.line 251
:cond_2
:try_start_0
invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
iget-wide v6, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
cmp-long v2, v6, v4
if-eqz v2, :cond_0
iget-boolean v2, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_reported:Z
if-nez v2, :cond_0
iget-boolean v2, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_ignoreDebugger:Z
if-nez v2, :cond_4
.line 260
invoke-static {}, Landroid/os/Debug;->isDebuggerConnected()Z
move-result v2
if-nez v2, :cond_3
invoke-static {}, Landroid/os/Debug;->waitingForDebugger()Z
move-result v2
if-eqz v2, :cond_4
:cond_3
const-string v2, "ANRWatchdog"
const-string v4, "An ANR was detected but ignored because the debugger is connected (you can prevent this with setIgnoreDebugger(true))"
.line 261
invoke-static {v2, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
iput-boolean v3, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_reported:Z
goto :goto_0
:cond_4
iget-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrInterceptor:Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;
iget-wide v1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
.line 266
invoke-interface {v0, v1, v2}, Lcom/github/anrwatchdog/ANRWatchDog$ANRInterceptor;->intercept(J)J
move-result-wide v0
cmp-long v2, v0, v4
if-lez v2, :cond_5
goto :goto_0
:cond_5
iget-object v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_namePrefix:Ljava/lang/String;
if-eqz v0, :cond_6
iget-wide v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
iget-object v2, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_namePrefix:Ljava/lang/String;
iget-boolean v4, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_logThreadsWithoutStackTrace:Z
.line 273
invoke-static {v0, v1, v2, v4}, Lcom/github/anrwatchdog/ANRError;->New(JLjava/lang/String;Z)Lcom/github/anrwatchdog/ANRError;
move-result-object v0
goto :goto_2
:cond_6
iget-wide v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_tick:J
.line 275
invoke-static {v0, v1}, Lcom/github/anrwatchdog/ANRError;->NewMainOnly(J)Lcom/github/anrwatchdog/ANRError;
move-result-object v0
:goto_2
iget-object v1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrListener:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
.line 277
invoke-interface {v1, v0}, Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;->onAppNotResponding(Lcom/github/anrwatchdog/ANRError;)V
iget v0, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_timeoutInterval:I
int-to-long v0, v0
iput-boolean v3, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_reported:Z
goto :goto_0
:catch_0
move-exception v0
iget-object v1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_interruptionListener:Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;
.line 253
invoke-interface {v1, v0}, Lcom/github/anrwatchdog/ANRWatchDog$InterruptionListener;->onInterrupted(Ljava/lang/InterruptedException;)V
:cond_7
return-void
.end method
.method public setANRListener(Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;)Lcom/github/anrwatchdog/ANRWatchDog;
.locals 0
if-nez p1, :cond_0
sget-object p1, Lcom/github/anrwatchdog/ANRWatchDog;->DEFAULT_ANR_LISTENER:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
iput-object p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrListener:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
goto :goto_0
:cond_0
iput-object p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_anrListener:Lcom/github/anrwatchdog/ANRWatchDog$ANRListener;
:goto_0
return-object p0
.end method
.method public setIgnoreDebugger(Z)Lcom/github/anrwatchdog/ANRWatchDog;
.locals 0
iput-boolean p1, p0, Lcom/github/anrwatchdog/ANRWatchDog;->_ignoreDebugger:Z
return-object p0
.end method