2020-08-10 21:02:22 +00:00
|
|
|
.class public final Lcom/discord/utilities/file/DownloadUtils;
|
2020-07-08 16:44:49 +00:00
|
|
|
.super Ljava/lang/Object;
|
2020-08-10 21:02:22 +00:00
|
|
|
.source "DownloadUtils.kt"
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
2020-08-10 21:02:22 +00:00
|
|
|
Lcom/discord/utilities/file/DownloadUtils$DownloadState;
|
2020-07-08 16:44:49 +00:00
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2020-08-10 21:02:22 +00:00
|
|
|
.field public static final INSTANCE:Lcom/discord/utilities/file/DownloadUtils;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
2020-08-10 21:02:22 +00:00
|
|
|
new-instance v0, Lcom/discord/utilities/file/DownloadUtils;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-08-10 21:02:22 +00:00
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/file/DownloadUtils;-><init>()V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-08-10 21:02:22 +00:00
|
|
|
sput-object v0, Lcom/discord/utilities/file/DownloadUtils;->INSTANCE:Lcom/discord/utilities/file/DownloadUtils;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
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<",
|
2020-08-10 21:02:22 +00:00
|
|
|
"Lcom/discord/utilities/file/DownloadUtils$DownloadState;",
|
2020-07-08 16:44:49 +00:00
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "context"
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p0, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string p0, "fileUrl"
|
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p1, p0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-09-16 23:45:23 +00:00
|
|
|
|
|
|
|
const-string p0, "fileName"
|
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p2, p0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string p0, "downloadDirectory"
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p3, p0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-08-10 21:02:22 +00:00
|
|
|
new-instance p0, Lcom/discord/utilities/file/DownloadUtils$downloadFile$1;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-08-10 21:02:22 +00:00
|
|
|
invoke-direct {p0, p1, p3, p2}, Lcom/discord/utilities/file/DownloadUtils$downloadFile$1;-><init>(Ljava/lang/String;Ljava/io/File;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
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)"
|
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p0, p1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.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"
|
|
|
|
|
2020-11-05 20:51:11 +00:00
|
|
|
invoke-static {p3, p4}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
:cond_0
|
2020-08-10 21:02:22 +00:00
|
|
|
invoke-static {p0, p1, p2, p3}, Lcom/discord/utilities/file/DownloadUtils;->downloadFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Lrx/Observable;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|