tmap/smali_classes3/com/google/common/base/FinalizableReferenceQueue$DecoupledLoader.smali
2022-06-10 21:38:30 +09:00

228 lines
5.7 KiB
Smali

.class Lcom/google/common/base/FinalizableReferenceQueue$DecoupledLoader;
.super Ljava/lang/Object;
.source "FinalizableReferenceQueue.java"
# interfaces
.implements Lcom/google/common/base/FinalizableReferenceQueue$FinalizerLoader;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/common/base/FinalizableReferenceQueue;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "DecoupledLoader"
.end annotation
# static fields
.field private static final LOADING_ERROR:Ljava/lang/String; = "Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Guava to your system class path."
# direct methods
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public getBaseUrl()Ljava/net/URL;
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "com.google.common.base.internal.Finalizer"
const/16 v1, 0x2e
const/16 v2, 0x2f
.line 1
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(CC)Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
const-string v1, ".class"
invoke-virtual {v0, v1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 2
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object v1
invoke-virtual {v1, v0}, Ljava/lang/ClassLoader;->getResource(Ljava/lang/String;)Ljava/net/URL;
move-result-object v1
if-eqz v1, :cond_2
.line 3
invoke-virtual {v1}, Ljava/net/URL;->toString()Ljava/lang/String;
move-result-object v2
.line 4
invoke-virtual {v2, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v3
if-nez v3, :cond_1
.line 5
new-instance v0, Ljava/io/IOException;
const-string v1, "Unsupported path style: "
invoke-virtual {v2}, Ljava/lang/String;->length()I
move-result v3
if-eqz v3, :cond_0
invoke-virtual {v1, v2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
goto :goto_0
:cond_0
new-instance v2, Ljava/lang/String;
invoke-direct {v2, v1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
move-object v1, v2
:goto_0
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
const/4 v3, 0x0
.line 6
invoke-virtual {v2}, Ljava/lang/String;->length()I
move-result v4
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v0
sub-int/2addr v4, v0
invoke-virtual {v2, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v0
.line 7
new-instance v2, Ljava/net/URL;
invoke-direct {v2, v1, v0}, Ljava/net/URL;-><init>(Ljava/net/URL;Ljava/lang/String;)V
return-object v2
.line 8
:cond_2
new-instance v1, Ljava/io/FileNotFoundException;
invoke-direct {v1, v0}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V
throw v1
.end method
.method public loadFinalizer()Ljava/lang/Class;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/lang/Class<",
"*>;"
}
.end annotation
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.line 1
:try_start_0
invoke-virtual {p0}, Lcom/google/common/base/FinalizableReferenceQueue$DecoupledLoader;->getBaseUrl()Ljava/net/URL;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/google/common/base/FinalizableReferenceQueue$DecoupledLoader;->newLoader(Ljava/net/URL;)Ljava/net/URLClassLoader;
move-result-object v0
const-string v1, "com.google.common.base.internal.Finalizer"
.line 2
invoke-virtual {v0, v1}, Ljava/lang/ClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
.line 3
invoke-static {}, Lcom/google/common/base/FinalizableReferenceQueue;->access$000()Ljava/util/logging/Logger;
move-result-object v1
sget-object v2, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
const-string v3, "Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Guava to your system class path."
invoke-virtual {v1, v2, v3, v0}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 v0, 0x0
return-object v0
.end method
.method public newLoader(Ljava/net/URL;)Ljava/net/URLClassLoader;
.locals 3
.line 1
new-instance v0, Ljava/net/URLClassLoader;
const/4 v1, 0x1
new-array v1, v1, [Ljava/net/URL;
const/4 v2, 0x0
aput-object p1, v1, v2
const/4 p1, 0x0
invoke-direct {v0, v1, p1}, Ljava/net/URLClassLoader;-><init>([Ljava/net/URL;Ljava/lang/ClassLoader;)V
return-object v0
.end method