366 lines
10 KiB
Smali
366 lines
10 KiB
Smali
.class public final Lcom/discord/utilities/images/MGImagesConfig;
|
|
.super Ljava/lang/Object;
|
|
.source "MGImagesConfig.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/images/MGImagesConfig$CustomImageFormat;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final CACHE_DIR:Ljava/lang/String; = "app_images_cache"
|
|
|
|
.field public static final CACHE_DIR_SMALL:Ljava/lang/String; = "app_images_cache_small"
|
|
|
|
.field public static final CUSTOM_IMAGE_FACTORIES:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map<",
|
|
"Lcom/discord/utilities/images/MGImagesConfig$CustomImageFormat;",
|
|
"Lcom/discord/utilities/apng/ApngDrawableFactory;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final INSTANCE:Lcom/discord/utilities/images/MGImagesConfig;
|
|
|
|
.field public static final MAX_BITMAP_MEM_CACHE_SIZE_RATIO:I = 0x3
|
|
|
|
.field public static final MAX_DISK_CACHE_SIZE:J = 0x2800000L
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
new-instance v0, Lcom/discord/utilities/images/MGImagesConfig;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/images/MGImagesConfig;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/images/MGImagesConfig;->INSTANCE:Lcom/discord/utilities/images/MGImagesConfig;
|
|
|
|
sget-object v0, Lcom/discord/utilities/images/MGImagesConfig$CustomImageFormat;->APNG:Lcom/discord/utilities/images/MGImagesConfig$CustomImageFormat;
|
|
|
|
new-instance v1, Lcom/discord/utilities/apng/ApngDrawableFactory;
|
|
|
|
invoke-direct {v1}, Lcom/discord/utilities/apng/ApngDrawableFactory;-><init>()V
|
|
|
|
new-instance v2, Lkotlin/Pair;
|
|
|
|
invoke-direct {v2, v0, v1}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
invoke-static {v2}, Lf/n/a/k/a;->mapOf(Lkotlin/Pair;)Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/discord/utilities/images/MGImagesConfig;->CUSTOM_IMAGE_FACTORIES:Ljava/util/Map;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getAppBitmapMemoryCacheParamsSupplier(Landroid/content/Context;)Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;
|
|
.locals 1
|
|
|
|
const-string v0, "activity"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
check-cast p1, Landroid/app/ActivityManager;
|
|
|
|
new-instance v0, Lcom/discord/utilities/images/MGImagesConfig$getAppBitmapMemoryCacheParamsSupplier$1;
|
|
|
|
invoke-direct {v0, p1, p1}, Lcom/discord/utilities/images/MGImagesConfig$getAppBitmapMemoryCacheParamsSupplier$1;-><init>(Landroid/app/ActivityManager;Landroid/app/ActivityManager;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.app.ActivityManager"
|
|
|
|
invoke-direct {p1, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final newDiskCacheConfig(Landroid/content/Context;Ljava/lang/String;)Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/facebook/cache/disk/DiskCacheConfig$b;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, p1, v1}, Lcom/facebook/cache/disk/DiskCacheConfig$b;-><init>(Landroid/content/Context;Lcom/facebook/cache/disk/DiskCacheConfig$a;)V
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v1, Lf/g/d/d/i;
|
|
|
|
invoke-direct {v1, p1}, Lf/g/d/d/i;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object v1, v0, Lcom/facebook/cache/disk/DiskCacheConfig$b;->c:Lcom/facebook/common/internal/Supplier;
|
|
|
|
iput-object p2, v0, Lcom/facebook/cache/disk/DiskCacheConfig$b;->b:Ljava/lang/String;
|
|
|
|
const-wide/32 p1, 0x2800000
|
|
|
|
iput-wide p1, v0, Lcom/facebook/cache/disk/DiskCacheConfig$b;->d:J
|
|
|
|
invoke-virtual {v0}, Lcom/facebook/cache/disk/DiskCacheConfig$b;->a()Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "DiskCacheConfig\n \u2026HE_SIZE)\n .build()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getCUSTOM_IMAGE_FACTORIES()Ljava/util/Map;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Map<",
|
|
"Lcom/discord/utilities/images/MGImagesConfig$CustomImageFormat;",
|
|
"Lcom/discord/utilities/apng/ApngDrawableFactory;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/utilities/images/MGImagesConfig;->CUSTOM_IMAGE_FACTORIES:Ljava/util/Map;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final init(Landroid/app/Application;)V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
new-instance v1, Lf/g/j/h/c$b;
|
|
|
|
invoke-direct {v1}, Lf/g/j/h/c$b;-><init>()V
|
|
|
|
sget-object v2, Lf/g/i/b;->b:Lf/g/i/c;
|
|
|
|
new-instance v3, Lcom/discord/utilities/apng/ApngDecoder;
|
|
|
|
invoke-direct {v3}, Lcom/discord/utilities/apng/ApngDecoder;-><init>()V
|
|
|
|
iget-object v4, v1, Lf/g/j/h/c$b;->a:Ljava/util/Map;
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
new-instance v4, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v4}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v4, v1, Lf/g/j/h/c$b;->a:Ljava/util/Map;
|
|
|
|
:cond_0
|
|
iget-object v4, v1, Lf/g/j/h/c$b;->a:Ljava/util/Map;
|
|
|
|
invoke-interface {v4, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
new-instance v2, Lf/g/j/h/c;
|
|
|
|
invoke-direct {v2, v1, v0}, Lf/g/j/h/c;-><init>(Lf/g/j/h/c$b;Lf/g/j/h/c$a;)V
|
|
|
|
new-instance v1, Lf/g/j/e/k$a;
|
|
|
|
invoke-direct {v1, p1, v0}, Lf/g/j/e/k$a;-><init>(Landroid/content/Context;Lf/g/j/e/j;)V
|
|
|
|
const/4 v3, 0x1
|
|
|
|
iput-boolean v3, v1, Lf/g/j/e/k$a;->c:Z
|
|
|
|
const-string v4, "app_images_cache"
|
|
|
|
invoke-direct {p0, p1, v4}, Lcom/discord/utilities/images/MGImagesConfig;->newDiskCacheConfig(Landroid/content/Context;Ljava/lang/String;)Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
|
|
move-result-object v4
|
|
|
|
iput-object v4, v1, Lf/g/j/e/k$a;->e:Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
|
|
const-string v4, "app_images_cache_small"
|
|
|
|
invoke-direct {p0, p1, v4}, Lcom/discord/utilities/images/MGImagesConfig;->newDiskCacheConfig(Landroid/content/Context;Ljava/lang/String;)Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
|
|
move-result-object v4
|
|
|
|
iput-object v4, v1, Lf/g/j/e/k$a;->h:Lcom/facebook/cache/disk/DiskCacheConfig;
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/images/MGImagesConfig;->getAppBitmapMemoryCacheParamsSupplier(Landroid/content/Context;)Lcom/facebook/imagepipeline/cache/DefaultBitmapMemoryCacheParamsSupplier;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
iput-object v4, v1, Lf/g/j/e/k$a;->a:Lcom/facebook/common/internal/Supplier;
|
|
|
|
iget-object v1, v1, Lf/g/j/e/k$a;->k:Lf/g/j/e/l$b;
|
|
|
|
iput-boolean v3, v1, Lf/g/j/e/l$b;->l:Z
|
|
|
|
iget-object v1, v1, Lf/g/j/e/l$b;->a:Lf/g/j/e/k$a;
|
|
|
|
iput-object v2, v1, Lf/g/j/e/k$a;->i:Lf/g/j/h/c;
|
|
|
|
new-instance v2, Lf/g/j/e/k;
|
|
|
|
invoke-direct {v2, v1, v0}, Lf/g/j/e/k;-><init>(Lf/g/j/e/k$a;Lf/g/j/e/j;)V
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
sget-boolean v0, Lf/g/g/a/a/b;->c:Z
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
sget-object v0, Lf/g/g/a/a/b;->a:Ljava/lang/Class;
|
|
|
|
const-string v1, "Fresco has already been initialized! `Fresco.initialize(...)` should only be called 1 single time to avoid memory leaks!"
|
|
|
|
invoke-static {v0, v1}, Lf/g/d/e/a;->m(Ljava/lang/Class;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sput-boolean v3, Lf/g/g/a/a/b;->c:Z
|
|
|
|
:goto_0
|
|
:try_start_0
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p1, v0}, Lcom/facebook/soloader/SoLoader;->c(Landroid/content/Context;I)V
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {v2}, Lf/g/j/e/m;->k(Lf/g/j/e/k;)V
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
new-instance v0, Lf/g/g/a/a/e;
|
|
|
|
invoke-direct {v0, p1}, Lf/g/g/a/a/e;-><init>(Landroid/content/Context;)V
|
|
|
|
sput-object v0, Lf/g/g/a/a/b;->b:Lf/g/g/a/a/e;
|
|
|
|
invoke-static {v0}, Lcom/facebook/drawee/view/SimpleDraweeView;->initialize(Lcom/facebook/common/internal/Supplier;)V
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-static {}, Lf/g/j/r/b;->b()Z
|
|
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
const-string v1, "Could not initialize SoLoader"
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final onTrimMemory(I)V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x5
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 v0, 0xa
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 v0, 0xf
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 v0, 0x28
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 v0, 0x3c
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/16 v0, 0x50
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {}, Lf/g/j/e/m;->f()Lf/g/j/e/m;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lf/g/j/e/m;->e()Lf/g/j/e/i;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lf/g/j/e/h;
|
|
|
|
invoke-direct {v0, p1}, Lf/g/j/e/h;-><init>(Lf/g/j/e/i;)V
|
|
|
|
iget-object v1, p1, Lf/g/j/e/i;->c:Lf/g/j/c/s;
|
|
|
|
invoke-interface {v1, v0}, Lf/g/j/c/s;->b(Lf/g/d/d/h;)I
|
|
|
|
iget-object p1, p1, Lf/g/j/e/i;->d:Lf/g/j/c/s;
|
|
|
|
invoke-interface {p1, v0}, Lf/g/j/c/s;->b(Lf/g/d/d/h;)I
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|