apkfuckery/com.discord/smali/androidx/browser/browseractions/BrowserServiceFileProvider.smali
2020-09-09 19:21:20 +00:00

327 lines
9.8 KiB
Smali

.class public final Landroidx/browser/browseractions/BrowserServiceFileProvider;
.super Landroidx/core/content/FileProvider;
.source "BrowserServiceFileProvider.java"
# annotations
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/browser/browseractions/BrowserServiceFileProvider$FileSaveTask;,
Landroidx/browser/browseractions/BrowserServiceFileProvider$FileCleanupTask;
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
# static fields
.field public static final AUTHORITY_SUFFIX:Ljava/lang/String; = ".image_provider"
.field public static final CLIP_DATA_LABEL:Ljava/lang/String; = "image_provider_uris"
.field public static final CONTENT_SCHEME:Ljava/lang/String; = "content"
.field public static final FILE_EXTENSION:Ljava/lang/String; = ".png"
.field public static final FILE_SUB_DIR:Ljava/lang/String; = "image_provider"
.field public static final FILE_SUB_DIR_NAME:Ljava/lang/String; = "image_provider_images/"
.field public static final LAST_CLEANUP_TIME_KEY:Ljava/lang/String; = "last_cleanup_time"
.field public static final TAG:Ljava/lang/String; = "BrowserServiceFP"
.field public static sFileCleanupLock:Ljava/lang/Object;
# direct methods
.method public static constructor <clinit>()V
.locals 1
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Landroidx/browser/browseractions/BrowserServiceFileProvider;->sFileCleanupLock:Ljava/lang/Object;
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Landroidx/core/content/FileProvider;-><init>()V
return-void
.end method
.method public static generateUri(Landroid/content/Context;Ljava/lang/String;)Landroid/net/Uri;
.locals 2
const-string v0, "image_provider_images/"
const-string v1, ".png"
invoke-static {v0, p1, v1}, Lf/e/b/a/a;->r(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
new-instance v0, Landroid/net/Uri$Builder;
invoke-direct {v0}, Landroid/net/Uri$Builder;-><init>()V
const-string v1, "content"
invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->scheme(Ljava/lang/String;)Landroid/net/Uri$Builder;
move-result-object v0
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, ".image_provider"
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Landroid/net/Uri$Builder;->authority(Ljava/lang/String;)Landroid/net/Uri$Builder;
move-result-object p0
invoke-virtual {p0, p1}, Landroid/net/Uri$Builder;->path(Ljava/lang/String;)Landroid/net/Uri$Builder;
move-result-object p0
invoke-virtual {p0}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;
move-result-object p0
return-object p0
.end method
.method public static grantReadPermission(Landroid/content/Intent;Ljava/util/List;Landroid/content/Context;)V
.locals 3
.param p0 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/util/List;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.param p2 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Intent;",
"Ljava/util/List<",
"Landroid/net/Uri;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
if-eqz p1, :cond_2
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_0
goto :goto_1
:cond_0
invoke-virtual {p2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object p2
const/4 v0, 0x1
invoke-virtual {p0, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
const/4 v1, 0x0
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/net/Uri;
const-string v2, "image_provider_uris"
invoke-static {p2, v2, v1}, Landroid/content/ClipData;->newUri(Landroid/content/ContentResolver;Ljava/lang/CharSequence;Landroid/net/Uri;)Landroid/content/ClipData;
move-result-object p2
:goto_0
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v1
if-ge v0, v1, :cond_1
new-instance v1, Landroid/content/ClipData$Item;
invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/net/Uri;
invoke-direct {v1, v2}, Landroid/content/ClipData$Item;-><init>(Landroid/net/Uri;)V
invoke-virtual {p2, v1}, Landroid/content/ClipData;->addItem(Landroid/content/ClipData$Item;)V
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
invoke-virtual {p0, p2}, Landroid/content/Intent;->setClipData(Landroid/content/ClipData;)V
:cond_2
:goto_1
return-void
.end method
.method public static loadBitmap(Landroid/content/ContentResolver;Landroid/net/Uri;)Lf/h/b/a/a/a;
.locals 3
.param p0 # Landroid/content/ContentResolver;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroid/net/Uri;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/ContentResolver;",
"Landroid/net/Uri;",
")",
"Lf/h/b/a/a/a<",
"Landroid/graphics/Bitmap;",
">;"
}
.end annotation
invoke-static {}, Landroidx/concurrent/futures/ResolvableFuture;->create()Landroidx/concurrent/futures/ResolvableFuture;
move-result-object v0
sget-object v1, Landroid/os/AsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;
new-instance v2, Landroidx/browser/browseractions/BrowserServiceFileProvider$1;
invoke-direct {v2, p0, p1, v0}, Landroidx/browser/browseractions/BrowserServiceFileProvider$1;-><init>(Landroid/content/ContentResolver;Landroid/net/Uri;Landroidx/concurrent/futures/ResolvableFuture;)V
invoke-interface {v1, v2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
return-object v0
.end method
.method public static saveBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;Ljava/lang/String;I)Landroidx/concurrent/futures/ResolvableFuture;
.locals 6
.param p0 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroid/graphics/Bitmap;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation build Landroidx/annotation/UiThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Landroid/graphics/Bitmap;",
"Ljava/lang/String;",
"I)",
"Landroidx/concurrent/futures/ResolvableFuture<",
"Landroid/net/Uri;",
">;"
}
.end annotation
const-string v0, "_"
invoke-static {p2, v0}, Lf/e/b/a/a;->J(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
invoke-static {p3}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {p0, v2}, Landroidx/browser/browseractions/BrowserServiceFileProvider;->generateUri(Landroid/content/Context;Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
invoke-static {}, Landroidx/concurrent/futures/ResolvableFuture;->create()Landroidx/concurrent/futures/ResolvableFuture;
move-result-object p2
new-instance p3, Landroidx/browser/browseractions/BrowserServiceFileProvider$FileSaveTask;
move-object v0, p3
move-object v1, p0
move-object v3, p1
move-object v5, p2
invoke-direct/range {v0 .. v5}, Landroidx/browser/browseractions/BrowserServiceFileProvider$FileSaveTask;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/graphics/Bitmap;Landroid/net/Uri;Landroidx/concurrent/futures/ResolvableFuture;)V
sget-object p0, Landroid/os/AsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;
const/4 p1, 0x0
new-array p1, p1, [Ljava/lang/String;
invoke-virtual {p3, p0, p1}, Landroid/os/AsyncTask;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/os/AsyncTask;
return-object p2
.end method