136 lines
3.5 KiB
Smali
136 lines
3.5 KiB
Smali
.class public final Lcom/discord/utilities/file/FileUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "FileUtils.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/file/FileUtils$DownloadState;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/file/FileUtils;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/file/FileUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/file/FileUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/file/FileUtils;->INSTANCE:Lcom/discord/utilities/file/FileUtils;
|
|
|
|
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 downloadFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Lrx/Observable;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/RequiresPermission;
|
|
conditional = true
|
|
value = "android.permission.WRITE_EXTERNAL_STORAGE"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/io/File;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/utilities/file/FileUtils$DownloadState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
new-instance p0, Lcom/discord/utilities/file/FileUtils$downloadFile$1;
|
|
|
|
invoke-direct {p0, p1, p3, p2}, Lcom/discord/utilities/file/FileUtils$downloadFile$1;-><init>(Ljava/lang/String;Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
sget-object p1, Lrx/Emitter$BackpressureMode;->f:Lrx/Emitter$BackpressureMode;
|
|
|
|
invoke-static {p0, p1}, Lrx/Observable;->n(Lrx/functions/Action1;Lrx/Emitter$BackpressureMode;)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "Observable.create({ emit\u2026.BackpressureMode.BUFFER)"
|
|
|
|
invoke-static {p0, p1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "downloadDirectory"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p0, "fileName"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p0, "fileUrl"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p0, "context"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static synthetic downloadFile$default(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;ILjava/lang/Object;)Lrx/Observable;
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x8
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object p3
|
|
|
|
const-string p4, "context.cacheDir"
|
|
|
|
invoke-static {p3, p4}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
invoke-static {p0, p1, p2, p3}, Lcom/discord/utilities/file/FileUtils;->downloadFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|