177 lines
4.1 KiB
Smali
177 lines
4.1 KiB
Smali
.class public Le/b/a/c/b;
|
|
.super Ljava/lang/Object;
|
|
.source "SimpleFileManager.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/lytefast/flexinput/managers/FileManager;
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Ljava/lang/String;
|
|
|
|
.field public final b:Ljava/lang/String;
|
|
|
|
.field public final c:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method public synthetic constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
const-string p3, "JPEG_"
|
|
|
|
:cond_0
|
|
const/4 p4, 0x0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Le/b/a/c/b;->a:Ljava/lang/String;
|
|
|
|
iput-object p2, p0, Le/b/a/c/b;->b:Ljava/lang/String;
|
|
|
|
iput-object p3, p0, Le/b/a/c/b;->c:Ljava/lang/String;
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "imagePrefix"
|
|
|
|
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw p4
|
|
|
|
:cond_2
|
|
const-string p1, "imageDirName"
|
|
|
|
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw p4
|
|
|
|
:cond_3
|
|
const-string p1, "providerAuthority"
|
|
|
|
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw p4
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Landroid/content/Context;Ljava/io/File;)Landroid/net/Uri;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object v0, p0, Le/b/a/c/b;->a:Ljava/lang/String;
|
|
|
|
invoke-static {p1, v0, p2}, Landroidx/core/content/FileProvider;->getUriForFile(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;)Landroid/net/Uri;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "FileProvider.getUriForFi\u2026 providerAuthority, file)"
|
|
|
|
invoke-static {p1, p2}, Ls/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "file"
|
|
|
|
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public a()Ljava/io/File;
|
|
.locals 5
|
|
|
|
new-instance v0, Ljava/text/SimpleDateFormat;
|
|
|
|
const-string v1, "yyyyMMdd_HHmmss"
|
|
|
|
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v1, Ljava/util/Date;
|
|
|
|
invoke-direct {v1}, Ljava/util/Date;-><init>()V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v2, p0, Le/b/a/c/b;->c:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ".jpg"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
sget-object v3, Landroid/os/Environment;->DIRECTORY_PICTURES:Ljava/lang/String;
|
|
|
|
invoke-static {v3}, Landroid/os/Environment;->getExternalStoragePublicDirectory(Ljava/lang/String;)Ljava/io/File;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, p0, Le/b/a/c/b;->b:Ljava/lang/String;
|
|
|
|
invoke-direct {v2, v3, v4}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->mkdirs()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
const-string v3, "e.b.a.c.b"
|
|
|
|
const-string v4, "Directory not created"
|
|
|
|
invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_0
|
|
invoke-direct {v1, v2, v0}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
return-object v1
|
|
.end method
|