299 lines
7 KiB
Smali
299 lines
7 KiB
Smali
.class public Lf/d/a/v/b;
|
|
.super Ljava/lang/Object;
|
|
.source "NetworkCache.java"
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Landroid/content/Context;
|
|
|
|
.field public final b:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lf/d/a/v/b;->a:Landroid/content/Context;
|
|
|
|
iput-object p2, p0, Lf/d/a/v/b;->b:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Ljava/lang/String;Lf/d/a/v/a;Z)Ljava/lang/String;
|
|
.locals 3
|
|
|
|
const-string v0, "lottie_cache_"
|
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "\\W+"
|
|
|
|
const-string v2, ""
|
|
|
|
invoke-virtual {p0, v1, v2}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p1}, Lf/d/a/v/a;->a()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p0, p1, Lf/d/a/v/a;->extension:Ljava/lang/String;
|
|
|
|
:goto_0
|
|
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 a()Landroidx/core/util/Pair;
|
|
.locals 6
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/WorkerThread;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Landroidx/core/util/Pair<",
|
|
"Lf/d/a/v/a;",
|
|
"Ljava/io/InputStream;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lf/d/a/v/b;->b:Ljava/lang/String;
|
|
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v3, p0, Lf/d/a/v/b;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v4, Lf/d/a/v/a;->d:Lf/d/a/v/a;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {v1, v4, v5}, Lf/d/a/v/b;->a(Ljava/lang/String;Lf/d/a/v/a;Z)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v2, v3, v4}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v3, p0, Lf/d/a/v/b;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v4, Lf/d/a/v/a;->e:Lf/d/a/v/a;
|
|
|
|
invoke-static {v1, v4, v5}, Lf/d/a/v/b;->a(Ljava/lang/String;Lf/d/a/v/a;Z)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v2, v3, v1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v2, v0
|
|
|
|
:goto_0
|
|
if-nez v2, :cond_2
|
|
|
|
return-object v0
|
|
|
|
:cond_2
|
|
new-instance v1, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, ".zip"
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
sget-object v0, Lf/d/a/v/a;->e:Lf/d/a/v/a;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
sget-object v0, Lf/d/a/v/a;->d:Lf/d/a/v/a;
|
|
|
|
:goto_1
|
|
const-string v3, "Cache hit for "
|
|
|
|
invoke-static {v3}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, p0, Lf/d/a/v/b;->b:Ljava/lang/String;
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v4, " at "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Lf/d/a/x/c;->a(Ljava/lang/String;)V
|
|
|
|
new-instance v2, Landroidx/core/util/Pair;
|
|
|
|
invoke-direct {v2, v0, v1}, Landroidx/core/util/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
return-object v2
|
|
|
|
:catch_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public a(Ljava/io/InputStream;Lf/d/a/v/a;)Ljava/io/File;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lf/d/a/v/b;->b:Ljava/lang/String;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-static {v0, p2, v1}, Lf/d/a/v/b;->a(Ljava/lang/String;Lf/d/a/v/a;Z)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lf/d/a/v/b;->a:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1, p2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
:try_start_0
|
|
new-instance p2, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {p2, v0}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
const/16 v1, 0x400
|
|
|
|
:try_start_1
|
|
new-array v1, v1, [B
|
|
|
|
:goto_0
|
|
invoke-virtual {p1, v1}, Ljava/io/InputStream;->read([B)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-eq v2, v3, :cond_0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {p2, v1, v3, v2}, Ljava/io/OutputStream;->write([BII)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p2}, Ljava/io/OutputStream;->flush()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-virtual {p2}, Ljava/io/OutputStream;->close()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
:try_start_3
|
|
invoke-virtual {p2}, Ljava/io/OutputStream;->close()V
|
|
|
|
throw v0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p2
|
|
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
|
|
throw p2
|
|
.end method
|