288 lines
7 KiB
Smali
288 lines
7 KiB
Smali
|
.class Landroidx/core/graphics/TypefaceCompatApi21Impl;
|
||
|
.super Landroidx/core/graphics/TypefaceCompatBaseImpl;
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation build Landroidx/annotation/RequiresApi;
|
||
|
value = 0x15
|
||
|
.end annotation
|
||
|
|
||
|
.annotation build Landroidx/annotation/RestrictTo;
|
||
|
value = {
|
||
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field private static final TAG:Ljava/lang/String; = "TypefaceCompatApi21Impl"
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method constructor <init>()V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatBaseImpl;-><init>()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private getFile(Landroid/os/ParcelFileDescriptor;)Ljava/io/File;
|
||
|
.locals 3
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
:try_start_0
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
const-string v2, "/proc/self/fd/"
|
||
|
|
||
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->getFd()I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-static {p1}, Landroid/system/Os;->readlink(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-static {p1}, Landroid/system/Os;->stat(Ljava/lang/String;)Landroid/system/StructStat;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iget v1, v1, Landroid/system/StructStat;->st_mode:I
|
||
|
|
||
|
invoke-static {v1}, Landroid/system/OsConstants;->S_ISREG(I)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
new-instance v1, Ljava/io/File;
|
||
|
|
||
|
invoke-direct {v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
||
|
:try_end_0
|
||
|
.catch Landroid/system/ErrnoException; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:catch_0
|
||
|
:cond_0
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public createFromFontInfo(Landroid/content/Context;Landroid/os/CancellationSignal;[Landroidx/core/provider/FontsContractCompat$FontInfo;I)Landroid/graphics/Typeface;
|
||
|
.locals 3
|
||
|
.param p3 # [Landroidx/core/provider/FontsContractCompat$FontInfo;
|
||
|
.annotation build Landroidx/annotation/NonNull;
|
||
|
.end annotation
|
||
|
.end param
|
||
|
|
||
|
array-length v0, p3
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
if-gtz v0, :cond_0
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:cond_0
|
||
|
invoke-virtual {p0, p3, p4}, Landroidx/core/graphics/TypefaceCompatApi21Impl;->findBestInfo([Landroidx/core/provider/FontsContractCompat$FontInfo;I)Landroidx/core/provider/FontsContractCompat$FontInfo;
|
||
|
|
||
|
move-result-object p3
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object p4
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-virtual {p3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getUri()Landroid/net/Uri;
|
||
|
|
||
|
move-result-object p3
|
||
|
|
||
|
const-string v0, "r"
|
||
|
|
||
|
invoke-virtual {p4, p3, v0, p2}, Landroid/content/ContentResolver;->openFileDescriptor(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;
|
||
|
|
||
|
move-result-object p2
|
||
|
:try_end_0
|
||
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_4
|
||
|
|
||
|
:try_start_1
|
||
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi21Impl;->getFile(Landroid/os/ParcelFileDescriptor;)Ljava/io/File;
|
||
|
|
||
|
move-result-object p3
|
||
|
|
||
|
if-eqz p3, :cond_3
|
||
|
|
||
|
invoke-virtual {p3}, Ljava/io/File;->canRead()Z
|
||
|
|
||
|
move-result p4
|
||
|
|
||
|
if-nez p4, :cond_1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_1
|
||
|
invoke-static {p3}, Landroid/graphics/Typeface;->createFromFile(Ljava/io/File;)Landroid/graphics/Typeface;
|
||
|
|
||
|
move-result-object p1
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_2
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_2
|
||
|
|
||
|
if-eqz p2, :cond_2
|
||
|
|
||
|
:try_start_2
|
||
|
invoke-virtual {p2}, Landroid/os/ParcelFileDescriptor;->close()V
|
||
|
:try_end_2
|
||
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_4
|
||
|
|
||
|
:cond_2
|
||
|
return-object p1
|
||
|
|
||
|
:cond_3
|
||
|
:goto_0
|
||
|
:try_start_3
|
||
|
new-instance p3, Ljava/io/FileInputStream;
|
||
|
|
||
|
invoke-virtual {p2}, Landroid/os/ParcelFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;
|
||
|
|
||
|
move-result-object p4
|
||
|
|
||
|
invoke-direct {p3, p4}, Ljava/io/FileInputStream;-><init>(Ljava/io/FileDescriptor;)V
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_2
|
||
|
.catchall {:try_start_3 .. :try_end_3} :catchall_2
|
||
|
|
||
|
:try_start_4
|
||
|
invoke-super {p0, p1, p3}, Landroidx/core/graphics/TypefaceCompatBaseImpl;->createFromInputStream(Landroid/content/Context;Ljava/io/InputStream;)Landroid/graphics/Typeface;
|
||
|
|
||
|
move-result-object p1
|
||
|
:try_end_4
|
||
|
.catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_4} :catch_0
|
||
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
||
|
|
||
|
:try_start_5
|
||
|
invoke-virtual {p3}, Ljava/io/FileInputStream;->close()V
|
||
|
:try_end_5
|
||
|
.catch Ljava/lang/Throwable; {:try_start_5 .. :try_end_5} :catch_2
|
||
|
.catchall {:try_start_5 .. :try_end_5} :catchall_2
|
||
|
|
||
|
if-eqz p2, :cond_4
|
||
|
|
||
|
:try_start_6
|
||
|
invoke-virtual {p2}, Landroid/os/ParcelFileDescriptor;->close()V
|
||
|
:try_end_6
|
||
|
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_4
|
||
|
|
||
|
:cond_4
|
||
|
return-object p1
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception p1
|
||
|
|
||
|
move-object p4, v1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:catch_0
|
||
|
move-exception p1
|
||
|
|
||
|
:try_start_7
|
||
|
throw p1
|
||
|
:try_end_7
|
||
|
.catchall {:try_start_7 .. :try_end_7} :catchall_1
|
||
|
|
||
|
:catchall_1
|
||
|
move-exception p4
|
||
|
|
||
|
move-object v2, p4
|
||
|
|
||
|
move-object p4, p1
|
||
|
|
||
|
move-object p1, v2
|
||
|
|
||
|
:goto_1
|
||
|
if-eqz p4, :cond_5
|
||
|
|
||
|
:try_start_8
|
||
|
invoke-virtual {p3}, Ljava/io/FileInputStream;->close()V
|
||
|
:try_end_8
|
||
|
.catch Ljava/lang/Throwable; {:try_start_8 .. :try_end_8} :catch_1
|
||
|
.catchall {:try_start_8 .. :try_end_8} :catchall_2
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
:cond_5
|
||
|
:try_start_9
|
||
|
invoke-virtual {p3}, Ljava/io/FileInputStream;->close()V
|
||
|
|
||
|
:catch_1
|
||
|
:goto_2
|
||
|
throw p1
|
||
|
:try_end_9
|
||
|
.catch Ljava/lang/Throwable; {:try_start_9 .. :try_end_9} :catch_2
|
||
|
.catchall {:try_start_9 .. :try_end_9} :catchall_2
|
||
|
|
||
|
:catchall_2
|
||
|
move-exception p1
|
||
|
|
||
|
move-object p3, v1
|
||
|
|
||
|
goto :goto_3
|
||
|
|
||
|
:catch_2
|
||
|
move-exception p1
|
||
|
|
||
|
:try_start_a
|
||
|
throw p1
|
||
|
:try_end_a
|
||
|
.catchall {:try_start_a .. :try_end_a} :catchall_3
|
||
|
|
||
|
:catchall_3
|
||
|
move-exception p3
|
||
|
|
||
|
move-object v2, p3
|
||
|
|
||
|
move-object p3, p1
|
||
|
|
||
|
move-object p1, v2
|
||
|
|
||
|
:goto_3
|
||
|
if-eqz p2, :cond_7
|
||
|
|
||
|
if-eqz p3, :cond_6
|
||
|
|
||
|
:try_start_b
|
||
|
invoke-virtual {p2}, Landroid/os/ParcelFileDescriptor;->close()V
|
||
|
:try_end_b
|
||
|
.catch Ljava/lang/Throwable; {:try_start_b .. :try_end_b} :catch_3
|
||
|
.catch Ljava/io/IOException; {:try_start_b .. :try_end_b} :catch_4
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
:cond_6
|
||
|
:try_start_c
|
||
|
invoke-virtual {p2}, Landroid/os/ParcelFileDescriptor;->close()V
|
||
|
|
||
|
:catch_3
|
||
|
:cond_7
|
||
|
:goto_4
|
||
|
throw p1
|
||
|
:try_end_c
|
||
|
.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_4
|
||
|
|
||
|
:catch_4
|
||
|
return-object v1
|
||
|
.end method
|