347 lines
8.1 KiB
Smali
347 lines
8.1 KiB
Smali
.class public final Lcom/lytefast/flexinput/utils/a;
|
|
.super Ljava/lang/Object;
|
|
.source "FileUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final aWn:Lcom/lytefast/flexinput/utils/a;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/utils/a;
|
|
|
|
invoke-direct {v0}, Lcom/lytefast/flexinput/utils/a;-><init>()V
|
|
|
|
sput-object v0, Lcom/lytefast/flexinput/utils/a;->aWn:Lcom/lytefast/flexinput/utils/a;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final a(Landroid/net/Uri;Landroid/content/ContentResolver;)Ljava/lang/String;
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/IllegalArgumentException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "receiver$0"
|
|
|
|
invoke-static {p0, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "contentResolver"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "this.lastPathSegment"
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v2
|
|
|
|
const v3, 0x2ff57c
|
|
|
|
if-eq v2, v3, :cond_5
|
|
|
|
const v3, 0x38b73479
|
|
|
|
if-eq v2, v3, :cond_1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
const-string v2, "content"
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object v2, p1
|
|
|
|
move-object v3, p0
|
|
|
|
invoke-virtual/range {v2 .. v7}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
check-cast p1, Ljava/io/Closeable;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
move-object v2, p1
|
|
|
|
check-cast v2, Landroid/database/Cursor;
|
|
|
|
invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
const-string v3, "_display_name"
|
|
|
|
invoke-interface {v2, v3}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v3
|
|
|
|
if-ltz v3, :cond_3
|
|
|
|
invoke-interface {v2, v3}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getLastPathSegment()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_2
|
|
invoke-static {p1, v0}, Lkotlin/d/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
return-object v2
|
|
|
|
:cond_3
|
|
:try_start_1
|
|
sget-object v2, Lkotlin/Unit;->beN:Lkotlin/Unit;
|
|
:try_end_1
|
|
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
invoke-static {p1, v0}, Lkotlin/d/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
move-object v0, p0
|
|
|
|
:try_start_2
|
|
throw v0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
:goto_0
|
|
invoke-static {p1, v0}, Lkotlin/d/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw p0
|
|
|
|
:cond_4
|
|
:goto_1
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getLastPathSegment()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_5
|
|
const-string p1, "file"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
new-instance p1, Ljava/io/File;
|
|
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "file.name"
|
|
|
|
invoke-static {p0, p1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_6
|
|
:goto_2
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getLastPathSegment()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final w(Ljava/io/File;)Lcom/lytefast/flexinput/model/Attachment;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/io/File;",
|
|
")",
|
|
"Lcom/lytefast/flexinput/model/Attachment<",
|
|
"Ljava/io/File;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "receiver$0"
|
|
|
|
invoke-static {p0, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->hashCode()I
|
|
|
|
move-result v1
|
|
|
|
int-to-long v2, v1
|
|
|
|
invoke-static {p0}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v1, "Uri.fromFile(this)"
|
|
|
|
invoke-static {v4, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const-string v1, "this.name"
|
|
|
|
invoke-static {v5, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object v1, v0
|
|
|
|
move-object v6, p0
|
|
|
|
invoke-direct/range {v1 .. v6}, Lcom/lytefast/flexinput/model/Attachment;-><init>(JLandroid/net/Uri;Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final x(Ljava/io/File;)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
const-string v0, "receiver$0"
|
|
|
|
invoke-static {p0, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->length()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x400
|
|
|
|
div-long/2addr v0, v2
|
|
|
|
cmp-long p0, v0, v2
|
|
|
|
if-gez p0, :cond_0
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " KB"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
div-long/2addr v0, v2
|
|
|
|
cmp-long p0, v0, v2
|
|
|
|
if-gez p0, :cond_1
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " MB"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
div-long/2addr v0, v2
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " GB"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|