254 lines
6 KiB
Smali
254 lines
6 KiB
Smali
.class public final Landroidx/core/text/ICUCompat;
|
|
.super Ljava/lang/Object;
|
|
.source "ICUCompat.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "ICUCompat"
|
|
|
|
.field public static sAddLikelySubtagsMethod:Ljava/lang/reflect/Method;
|
|
|
|
.field public static sGetScriptMethod:Ljava/lang/reflect/Method;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
:try_start_0
|
|
const-string v0, "libcore.icu.ICU"
|
|
|
|
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "addLikelySubtags"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v2, v2, [Ljava/lang/Class;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const-class v4, Ljava/util/Locale;
|
|
|
|
aput-object v4, v2, v3
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/core/text/ICUCompat;->sAddLikelySubtagsMethod:Ljava/lang/reflect/Method;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
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 addLikelySubtags(Ljava/util/Locale;)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
const-string v0, "ICUCompat"
|
|
|
|
invoke-virtual {p0}, Ljava/util/Locale;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
:try_start_0
|
|
sget-object v1, Landroidx/core/text/ICUCompat;->sAddLikelySubtagsMethod:Ljava/lang/reflect/Method;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object p0, v1, v2
|
|
|
|
sget-object v2, Landroidx/core/text/ICUCompat;->sAddLikelySubtagsMethod:Ljava/lang/reflect/Method;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v2, v3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object v1
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception v1
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getScript(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
const-string v0, "ICUCompat"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
sget-object v2, Landroidx/core/text/ICUCompat;->sGetScriptMethod:Ljava/lang/reflect/Method;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
aput-object p0, v2, v3
|
|
|
|
sget-object p0, Landroidx/core/text/ICUCompat;->sGetScriptMethod:Ljava/lang/reflect/Method;
|
|
|
|
invoke-virtual {p0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/lang/String;
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public static maximizeAndGetScript(Ljava/util/Locale;)Ljava/lang/String;
|
|
.locals 4
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const-string v0, "ICUCompat"
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x18
|
|
|
|
if-lt v1, v2, :cond_0
|
|
|
|
invoke-static {p0}, Landroid/icu/util/ULocale;->forLocale(Ljava/util/Locale;)Landroid/icu/util/ULocale;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Landroid/icu/util/ULocale;->addLikelySubtags(Landroid/icu/util/ULocale;)Landroid/icu/util/ULocale;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Landroid/icu/util/ULocale;->getScript()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x1
|
|
|
|
:try_start_0
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object p0, v1, v2
|
|
|
|
sget-object v2, Landroidx/core/text/ICUCompat;->sAddLikelySubtagsMethod:Ljava/lang/reflect/Method;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v2, v3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Locale;
|
|
|
|
invoke-virtual {v1}, Ljava/util/Locale;->getScript()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception v1
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/util/Locale;->getScript()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|