2019-07-24 11:27:29 +00:00
|
|
|
.class public Landroidx/core/graphics/TypefaceCompatApi26Impl;
|
|
|
|
.super Landroidx/core/graphics/TypefaceCompatApi21Impl;
|
|
|
|
.source "TypefaceCompatApi26Impl.java"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
|
|
value = 0x1a
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
2019-07-31 00:08:31 +00:00
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
2019-07-24 11:27:29 +00:00
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field private static final ABORT_CREATION_METHOD:Ljava/lang/String; = "abortCreation"
|
|
|
|
|
|
|
|
.field private static final ADD_FONT_FROM_ASSET_MANAGER_METHOD:Ljava/lang/String; = "addFontFromAssetManager"
|
|
|
|
|
|
|
|
.field private static final ADD_FONT_FROM_BUFFER_METHOD:Ljava/lang/String; = "addFontFromBuffer"
|
|
|
|
|
|
|
|
.field private static final CREATE_FROM_FAMILIES_WITH_DEFAULT_METHOD:Ljava/lang/String; = "createFromFamiliesWithDefault"
|
|
|
|
|
|
|
|
.field private static final FONT_FAMILY_CLASS:Ljava/lang/String; = "android.graphics.FontFamily"
|
|
|
|
|
|
|
|
.field private static final FREEZE_METHOD:Ljava/lang/String; = "freeze"
|
|
|
|
|
|
|
|
.field private static final RESOLVE_BY_FONT_TABLE:I = -0x1
|
|
|
|
|
|
|
|
.field private static final TAG:Ljava/lang/String; = "TypefaceCompatApi26Impl"
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field protected final mAbortCreation:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
.field protected final mAddFontFromAssetManager:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
.field protected final mAddFontFromBuffer:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
.field protected final mCreateFromFamiliesWithDefault:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
.field protected final mFontFamily:Ljava/lang/Class;
|
|
|
|
|
|
|
|
.field protected final mFontFamilyCtor:Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
.field protected final mFreeze:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>()V
|
|
|
|
.locals 8
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi21Impl;-><init>()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-virtual {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainFontFamily()Ljava/lang/Class;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainFontFamilyCtor(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainAddFontFromAssetManagerMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainAddFontFromBufferMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainFreezeMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainAbortCreationMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->obtainCreateFromFamiliesWithDefaultMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
move-object v7, v1
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
move-object v0, v7
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:catch_1
|
|
|
|
move-exception v1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v3, "Unable to collect necessary methods for class "
|
|
|
|
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
const-string v3, "TypefaceCompatApi26Impl"
|
|
|
|
|
|
|
|
invoke-static {v3, v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
move-object v2, v1
|
|
|
|
|
|
|
|
move-object v3, v2
|
|
|
|
|
|
|
|
move-object v4, v3
|
|
|
|
|
|
|
|
move-object v5, v4
|
|
|
|
|
|
|
|
move-object v6, v5
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
iput-object v0, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFontFamily:Ljava/lang/Class;
|
|
|
|
|
|
|
|
iput-object v2, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFontFamilyCtor:Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
iput-object v3, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromAssetManager:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
iput-object v4, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromBuffer:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
iput-object v5, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFreeze:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
iput-object v6, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAbortCreation:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
iput-object v1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mCreateFromFamiliesWithDefault:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private abortCreation(Ljava/lang/Object;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
iget-object v0, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAbortCreation:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
2019-07-29 20:14:17 +00:00
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
return-void
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private addFontFromAssetManager(Landroid/content/Context;Ljava/lang/Object;Ljava/lang/String;III[Landroid/graphics/fonts/FontVariationAxis;)Z
|
|
|
|
.locals 3
|
|
|
|
.param p7 # [Landroid/graphics/fonts/FontVariationAxis;
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v0, 0x0
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
:try_start_0
|
2019-07-31 00:08:31 +00:00
|
|
|
iget-object v1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromAssetManager:Ljava/lang/reflect/Method;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/16 v2, 0x8
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p1, v2, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x3
|
|
|
|
|
|
|
|
sget-object p3, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x4
|
|
|
|
|
|
|
|
invoke-static {p4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x5
|
|
|
|
|
|
|
|
invoke-static {p5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x6
|
|
|
|
|
|
|
|
invoke-static {p6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x7
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p7, v2, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-virtual {v1, p2, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
return v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private addFontFromBuffer(Ljava/lang/Object;Ljava/nio/ByteBuffer;III)Z
|
|
|
|
.locals 3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:try_start_0
|
|
|
|
iget-object v1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromBuffer:Ljava/lang/reflect/Method;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v2, 0x5
|
2019-07-26 06:05:06 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
2019-07-29 20:14:17 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p2, v2, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p2, 0x1
|
|
|
|
|
|
|
|
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p2, 0x2
|
|
|
|
|
|
|
|
const/4 p3, 0x0
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p2, 0x3
|
|
|
|
|
|
|
|
invoke-static {p4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p2, 0x4
|
|
|
|
|
|
|
|
invoke-static {p5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object p3, v2, p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-virtual {v1, p1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
return v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private freeze(Ljava/lang/Object;)Z
|
2019-07-31 00:08:31 +00:00
|
|
|
.locals 3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:try_start_0
|
|
|
|
iget-object v1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFreeze:Ljava/lang/reflect/Method;
|
2019-07-26 06:05:06 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
new-array v2, v0, [Ljava/lang/Object;
|
2019-07-29 20:14:17 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-virtual {v1, p1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
return v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private isFontFamilyPrivateAPIAvailable()Z
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromAssetManager:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const-string v0, "TypefaceCompatApi26Impl"
|
|
|
|
|
|
|
|
const-string v1, "Unable to collect necessary private methods. Fallback to legacy implementation."
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mAddFontFromAssetManager:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
return v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private newFamily()Ljava/lang/Object;
|
|
|
|
.locals 2
|
2019-07-31 00:08:31 +00:00
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
iget-object v0, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFontFamilyCtor:Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-29 20:14:17 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
return-object v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method protected createFromFamiliesWithDefault(Ljava/lang/Object;)Landroid/graphics/Typeface;
|
|
|
|
.locals 5
|
2019-07-31 00:08:31 +00:00
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:try_start_0
|
2019-07-31 00:08:31 +00:00
|
|
|
iget-object v1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mFontFamily:Ljava/lang/Class;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v2, 0x1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
move-result-object v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v3, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-static {v1, v3, p1}, Ljava/lang/reflect/Array;->set(Ljava/lang/Object;ILjava/lang/Object;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/core/graphics/TypefaceCompatApi26Impl;->mCreateFromFamiliesWithDefault:Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
const/4 v4, 0x3
|
|
|
|
|
|
|
|
new-array v4, v4, [Ljava/lang/Object;
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object v1, v4, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v1, -0x1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
move-result-object v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object v3, v4, v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 v2, 0x2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
move-result-object v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aput-object v1, v4, v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
invoke-virtual {p1, v0, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Landroid/graphics/Typeface;
|
|
|
|
:try_end_0
|
2019-07-31 00:08:31 +00:00
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
2019-07-24 11:27:29 +00:00
|
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:catch_0
|
2019-07-31 00:08:31 +00:00
|
|
|
return-object v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public createFromFontFamilyFilesResourceEntry(Landroid/content/Context;Landroidx/core/content/res/FontResourcesParserCompat$FontFamilyFilesResourceEntry;Landroid/content/res/Resources;I)Landroid/graphics/Typeface;
|
|
|
|
.locals 10
|
2019-07-31 00:08:31 +00:00
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->isFontFamilyPrivateAPIAvailable()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-super {p0, p1, p2, p3, p4}, Landroidx/core/graphics/TypefaceCompatApi21Impl;->createFromFontFamilyFilesResourceEntry(Landroid/content/Context;Landroidx/core/content/res/FontResourcesParserCompat$FontFamilyFilesResourceEntry;Landroid/content/res/Resources;I)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->newFamily()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 p4, 0x0
|
|
|
|
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
|
|
|
|
return-object p4
|
|
|
|
|
|
|
|
:cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-virtual {p2}, Landroidx/core/content/res/FontResourcesParserCompat$FontFamilyFilesResourceEntry;->getEntries()[Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
array-length v8, p2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
2019-07-29 20:14:17 +00:00
|
|
|
const/4 v9, 0x0
|
2019-07-26 06:05:06 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:goto_0
|
|
|
|
if-ge v9, v8, :cond_3
|
2019-07-29 20:14:17 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
aget-object v0, p2, v9
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;->getFileName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;->getTtcIndex()I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;->getWeight()I
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;->isItalic()Z
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroidx/core/content/res/FontResourcesParserCompat$FontFileResourceEntry;->getVariationSettings()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroid/graphics/fonts/FontVariationAxis;->fromFontVariationSettings(Ljava/lang/String;)[Landroid/graphics/fonts/FontVariationAxis;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
move-object v1, p1
|
|
|
|
|
|
|
|
move-object v2, p3
|
|
|
|
|
|
|
|
invoke-direct/range {v0 .. v7}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->addFontFromAssetManager(Landroid/content/Context;Ljava/lang/Object;Ljava/lang/String;III[Landroid/graphics/fonts/FontVariationAxis;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p3}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->abortCreation(Ljava/lang/Object;)V
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
return-object p4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_2
|
|
|
|
add-int/lit8 v9, v9, 0x1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-direct {p0, p3}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->freeze(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p1, :cond_4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
return-object p4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_4
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-virtual {p0, p3}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->createFromFamiliesWithDefault(Ljava/lang/Object;)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public createFromFontInfo(Landroid/content/Context;Landroid/os/CancellationSignal;[Landroidx/core/provider/FontsContractCompat$FontInfo;I)Landroid/graphics/Typeface;
|
|
|
|
.locals 10
|
|
|
|
.param p2 # Landroid/os/CancellationSignal;
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p3 # [Landroidx/core/provider/FontsContractCompat$FontInfo;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
2019-07-31 00:08:31 +00:00
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
array-length v0, p3
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
if-gtz v0, :cond_0
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->isFontFamilyPrivateAPIAvailable()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
|
|
|
|
invoke-virtual {p0, p3, p4}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->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 p1
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-virtual {p3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getUri()Landroid/net/Uri;
|
|
|
|
|
|
|
|
move-result-object p4
|
|
|
|
|
|
|
|
const-string v0, "r"
|
|
|
|
|
|
|
|
invoke-virtual {p1, p4, v0, p2}, Landroid/content/ContentResolver;->openFileDescriptor(Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
:try_start_1
|
|
|
|
new-instance p2, Landroid/graphics/Typeface$Builder;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;
|
|
|
|
|
|
|
|
move-result-object p4
|
|
|
|
|
|
|
|
invoke-direct {p2, p4}, Landroid/graphics/Typeface$Builder;-><init>(Ljava/io/FileDescriptor;)V
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getWeight()I
|
|
|
|
|
|
|
|
move-result p4
|
|
|
|
|
|
|
|
invoke-virtual {p2, p4}, Landroid/graphics/Typeface$Builder;->setWeight(I)Landroid/graphics/Typeface$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->isItalic()Z
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3}, Landroid/graphics/Typeface$Builder;->setItalic(Z)Landroid/graphics/Typeface$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Landroid/graphics/Typeface$Builder;->build()Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
:try_end_1
|
|
|
|
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
|
|
|
|
:try_start_2
|
|
|
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
|
|
|
|
:try_end_2
|
|
|
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
return-object p2
|
|
|
|
|
|
|
|
:catchall_0
|
|
|
|
move-exception p2
|
|
|
|
|
|
|
|
move-object p3, v1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception p2
|
|
|
|
|
|
|
|
:try_start_3
|
|
|
|
throw p2
|
|
|
|
:try_end_3
|
|
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
|
|
|
|
:catchall_1
|
|
|
|
move-exception p3
|
|
|
|
|
|
|
|
move-object v9, p3
|
|
|
|
|
|
|
|
move-object p3, p2
|
|
|
|
|
|
|
|
move-object p2, v9
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
|
|
|
|
if-eqz p3, :cond_4
|
|
|
|
|
|
|
|
:try_start_4
|
|
|
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
|
|
|
|
:try_end_4
|
|
|
|
.catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_4} :catch_1
|
|
|
|
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_2
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
:try_start_5
|
|
|
|
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
|
|
|
|
|
|
|
|
:catch_1
|
|
|
|
:cond_5
|
|
|
|
:goto_1
|
|
|
|
throw p2
|
|
|
|
:try_end_5
|
|
|
|
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2
|
|
|
|
|
|
|
|
:catch_2
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
invoke-static {p1, p3, p2}, Landroidx/core/provider/FontsContractCompat;->prepareFontData(Landroid/content/Context;[Landroidx/core/provider/FontsContractCompat$FontInfo;Landroid/os/CancellationSignal;)Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->newFamily()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p2, :cond_7
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_7
|
2019-07-24 11:27:29 +00:00
|
|
|
array-length v0, p3
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
:goto_2
|
2019-07-31 00:08:31 +00:00
|
|
|
if-ge v8, v0, :cond_a
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
aget-object v3, p3, v8
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getUri()Landroid/net/Uri;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-interface {p1, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
check-cast v4, Ljava/nio/ByteBuffer;
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-eqz v4, :cond_9
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getTtcIndex()I
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->getWeight()I
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroidx/core/provider/FontsContractCompat$FontInfo;->isItalic()Z
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
move-object v2, p0
|
|
|
|
|
|
|
|
move-object v3, p2
|
|
|
|
|
|
|
|
invoke-direct/range {v2 .. v7}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->addFontFromBuffer(Ljava/lang/Object;Ljava/nio/ByteBuffer;III)Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez v2, :cond_8
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->abortCreation(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_8
|
2019-07-24 11:27:29 +00:00
|
|
|
const/4 v2, 0x1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_9
|
2019-07-24 11:27:29 +00:00
|
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_a
|
|
|
|
if-nez v2, :cond_b
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->abortCreation(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_b
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->freeze(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p1, :cond_c
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_c
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-virtual {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->createFromFamiliesWithDefault(Ljava/lang/Object;)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p1, :cond_d
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_d
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-static {p1, p4}, Landroid/graphics/Typeface;->create(Landroid/graphics/Typeface;I)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public createFromResourcesFontFile(Landroid/content/Context;Landroid/content/res/Resources;ILjava/lang/String;I)Landroid/graphics/Typeface;
|
|
|
|
.locals 8
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->isFontFamilyPrivateAPIAvailable()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-super/range {p0 .. p5}, Landroidx/core/graphics/TypefaceCompatApi21Impl;->createFromResourcesFontFile(Landroid/content/Context;Landroid/content/res/Resources;ILjava/lang/String;I)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->newFamily()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
const/4 p3, 0x0
|
|
|
|
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
|
|
|
|
return-object p3
|
|
|
|
|
|
|
|
:cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/4 v5, -0x1
|
|
|
|
|
|
|
|
const/4 v6, -0x1
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
move-object v1, p1
|
|
|
|
|
|
|
|
move-object v2, p2
|
|
|
|
|
|
|
|
move-object v3, p4
|
|
|
|
|
|
|
|
invoke-direct/range {v0 .. v7}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->addFontFromAssetManager(Landroid/content/Context;Ljava/lang/Object;Ljava/lang/String;III[Landroid/graphics/fonts/FontVariationAxis;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p1, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->abortCreation(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-direct {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->freeze(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
if-nez p1, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-object p3
|
|
|
|
|
2019-07-31 00:08:31 +00:00
|
|
|
:cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-virtual {p0, p2}, Landroidx/core/graphics/TypefaceCompatApi26Impl;->createFromFamiliesWithDefault(Ljava/lang/Object;)Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainAbortCreationMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-string v1, "abortCreation"
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainAddFontFromAssetManagerMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/16 v0, 0x8
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-class v1, Landroid/content/res/AssetManager;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
const-class v1, Ljava/lang/String;
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x3
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x4
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x5
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x6
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
const-class v1, [Landroid/graphics/fonts/FontVariationAxis;
|
|
|
|
|
|
|
|
const/4 v2, 0x7
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
const-string v1, "addFontFromAssetManager"
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainAddFontFromBufferMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x5
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-class v1, Ljava/nio/ByteBuffer;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
const-class v1, [Landroid/graphics/fonts/FontVariationAxis;
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x3
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v2, 0x4
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
const-string v1, "addFontFromBuffer"
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainCreateFromFamiliesWithDefaultMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 4
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-class v1, Landroid/graphics/Typeface;
|
|
|
|
|
|
|
|
const/4 v2, 0x3
|
|
|
|
|
|
|
|
new-array v2, v2, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
aput-object p1, v2, v3
|
|
|
|
|
|
|
|
sget-object p1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
aput-object p1, v2, v0
|
|
|
|
|
|
|
|
sget-object p1, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const/4 v3, 0x2
|
|
|
|
|
|
|
|
aput-object p1, v2, v3
|
|
|
|
|
|
|
|
const-string p1, "createFromFamiliesWithDefault"
|
|
|
|
|
|
|
|
invoke-virtual {v1, p1, v2}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/reflect/Method;->setAccessible(Z)V
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainFontFamily()Ljava/lang/Class;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/ClassNotFoundException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "android.graphics.FontFamily"
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainFontFamilyCtor(Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected obtainFreezeMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/NoSuchMethodException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-string v1, "freeze"
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|