2019-07-24 11:27:29 +00:00
|
|
|
.class public final Lcom/discord/utilities/attachments/AttachmentUtilsKt;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "AttachmentUtils.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final REGEX_FILE_NAME_PATTERN$delegate:Lkotlin/Lazy;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final STRIP_ACCENTS_REGEX:Lkotlin/text/Regex;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final UTF_8_RANGE_END_EXCLUSIVE:I = 0x7e
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final UTF_8_RANGE_EXCLUSIVE:Lkotlin/ranges/IntRange;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final UTF_8_RANGE_START_EXCLUSIVE:I = 0x20
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static constructor <clinit>()V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 5
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
new-instance v1, Lt/u/b/s;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-class v2, Lcom/discord/utilities/attachments/AttachmentUtilsKt;
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
sget-object v3, Lt/u/b/w;->a:Lt/u/b/x;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v4, "app_productionDiscordExternalRelease"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-virtual {v3, v2, v4}, Lt/u/b/x;->getOrCreateKotlinPackage(Ljava/lang/Class;Ljava/lang/String;)Lkotlin/reflect/KDeclarationContainer;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
const-string v3, "REGEX_FILE_NAME_PATTERN"
|
|
|
|
|
|
|
|
const-string v4, "getREGEX_FILE_NAME_PATTERN()Ljava/util/regex/Pattern;"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-direct {v1, v2, v3, v4}, Lt/u/b/s;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
sget-object v2, Lt/u/b/w;->a:Lt/u/b/x;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-virtual {v2, v1}, Lt/u/b/x;->property0(Lt/u/b/r;)Lkotlin/reflect/KProperty0;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt$REGEX_FILE_NAME_PATTERN$2;->INSTANCE:Lcom/discord/utilities/attachments/AttachmentUtilsKt$REGEX_FILE_NAME_PATTERN$2;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v0}, Le/k/a/b/e/p/g;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->REGEX_FILE_NAME_PATTERN$delegate:Lkotlin/Lazy;
|
|
|
|
|
|
|
|
new-instance v0, Lkotlin/text/Regex;
|
|
|
|
|
|
|
|
const-string v1, "[\\p{InCombiningDiacriticalMarks}]"
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->STRIP_ACCENTS_REGEX:Lkotlin/text/Regex;
|
|
|
|
|
|
|
|
new-instance v0, Lkotlin/ranges/IntRange;
|
|
|
|
|
|
|
|
const/16 v1, 0x20
|
|
|
|
|
|
|
|
const/16 v2, 0x7e
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v2}, Lkotlin/ranges/IntRange;-><init>(II)V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->UTF_8_RANGE_EXCLUSIVE:Lkotlin/ranges/IntRange;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getREGEX_FILE_NAME_PATTERN$p()Ljava/util/regex/Pattern;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-static {}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getREGEX_FILE_NAME_PATTERN()Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static final getExtension(Landroid/graphics/Bitmap$CompressFormat;)Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 2
|
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt$WhenMappings;->$EnumSwitchMapping$1:[I
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Bitmap$CompressFormat;->ordinal()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
aget p0, v0, p0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v1, "jpg"
|
|
|
|
|
|
|
|
if-eq p0, v0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eq p0, v0, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v1, "webp"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_1
|
|
|
|
const-string v1, "png"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
|
|
|
return-object v1
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final getMimeType(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p1, :cond_4
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
if-eqz p0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/content/ContentResolver;->getType(Landroid/net/Uri;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object p0, v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
sget-object p0, Lcom/discord/utilities/attachments/AttachmentUtilsKt$getMimeType$1;->INSTANCE:Lcom/discord/utilities/attachments/AttachmentUtilsKt$getMimeType$1;
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/utilities/attachments/AttachmentUtilsKt$getMimeType$1;->invoke(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
move-object v0, p1
|
|
|
|
|
|
|
|
goto :goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/utilities/attachments/AttachmentUtilsKt$getMimeType$1;->invoke(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:catch_0
|
2019-08-30 20:04:20 +00:00
|
|
|
nop
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
:goto_1
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_3
|
2019-12-06 03:29:40 +00:00
|
|
|
const-string v0, "application/octet-stream"
|
|
|
|
|
|
|
|
:goto_2
|
2019-07-24 11:27:29 +00:00
|
|
|
return-object v0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_4
|
|
|
|
const-string p0, "uri"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-static {p0}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final getMimeType(Lcom/lytefast/flexinput/model/Attachment;Landroid/content/ContentResolver;)Ljava/lang/String;
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/lytefast/flexinput/model/Attachment<",
|
|
|
|
"*>;",
|
|
|
|
"Landroid/content/ContentResolver;",
|
|
|
|
")",
|
|
|
|
"Ljava/lang/String;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/lytefast/flexinput/model/Attachment;->getData()Ljava/lang/Object;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
instance-of v2, v1, Landroidx/core/view/inputmethod/InputContentInfoCompat;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-nez v2, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-object v1, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
2019-12-06 03:29:40 +00:00
|
|
|
check-cast v1, Landroidx/core/view/inputmethod/InputContentInfoCompat;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v1, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v1}, Landroidx/core/view/inputmethod/InputContentInfoCompat;->getDescription()Landroid/content/ClipDescription;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v1, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v1, v0}, Landroid/content/ClipDescription;->getMimeType(I)Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_1
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-virtual {p0}, Lcom/lytefast/flexinput/model/Attachment;->getUri()Landroid/net/Uri;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/lytefast/flexinput/model/Attachment;->getDisplayName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
invoke-static {p1, v0, p0}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getMimeType(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result-object v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p0, "$this$getMimeType"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-static {p0}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic getMimeType$default(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
and-int/lit8 p3, p3, 0x4
|
|
|
|
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
|
|
|
|
const/4 p2, 0x0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-static {p0, p1, p2}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getMimeType(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static final getREGEX_FILE_NAME_PATTERN()Ljava/util/regex/Pattern;
|
|
|
|
.locals 3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->REGEX_FILE_NAME_PATTERN$delegate:Lkotlin/Lazy;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
sget-object v1, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final getSanitizedFileName(Ljava/lang/String;Landroid/graphics/Bitmap$CompressFormat;)Ljava/lang/String;
|
|
|
|
.locals 2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-static {}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getREGEX_FILE_NAME_PATTERN()Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v0, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
const/4 p0, 0x1
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getExtension(Landroid/graphics/Bitmap$CompressFormat;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const/16 p0, 0x2e
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-static {p0}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->stripAccents(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
invoke-static {p0}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->toHumanReadableAscii(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p0, "fileName"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-static {p0}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final stripAccents(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
.locals 2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
sget-object v0, Ljava/text/Normalizer$Form;->NFKD:Ljava/text/Normalizer$Form;
|
|
|
|
|
|
|
|
invoke-static {p0, v0}, Ljava/text/Normalizer;->normalize(Ljava/lang/CharSequence;Ljava/text/Normalizer$Form;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const-string v0, "normalizedString"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-static {p0, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->STRIP_ACCENTS_REGEX:Lkotlin/text/Regex;
|
|
|
|
|
|
|
|
const-string v1, ""
|
|
|
|
|
2019-10-09 23:16:36 +00:00
|
|
|
invoke-virtual {v0, p0, v1}, Lkotlin/text/Regex;->replace(Ljava/lang/CharSequence;Ljava/lang/String;)Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p0, "$this$stripAccents"
|
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-static {p0}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static final toHumanReadableAscii(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
.locals 4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-ge v1, v2, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->codePointAt(I)I
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
sget-object v3, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->UTF_8_RANGE_EXCLUSIVE:Lkotlin/ranges/IntRange;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v3, v2}, Lkotlin/ranges/IntRange;->contains(I)Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v3, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v2}, Ljava/lang/Character;->charCount(I)I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
add-int/2addr v1, v2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2019-12-21 01:41:59 +00:00
|
|
|
new-instance v2, Ly/e;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-direct {v2}, Ly/e;-><init>()V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-virtual {v2, p0, v0, v1}, Ly/e;->a(Ljava/lang/String;II)Ly/e;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-ge v1, v0, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->codePointAt(I)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
sget-object v3, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->UTF_8_RANGE_EXCLUSIVE:Lkotlin/ranges/IntRange;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {v3, v0}, Lkotlin/ranges/IntRange;->contains(I)Z
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v3, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move v3, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_1
|
2019-12-06 03:29:40 +00:00
|
|
|
const/16 v3, 0x3f
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:goto_2
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-virtual {v2, v3}, Ly/e;->b(I)Ly/e;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/Character;->charCount(I)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
add-int/2addr v1, v0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
2019-12-21 01:41:59 +00:00
|
|
|
invoke-virtual {v2}, Ly/e;->d()Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
return-object p0
|
|
|
|
.end method
|