401 lines
10 KiB
Smali
401 lines
10 KiB
Smali
.class public final Lv/a/a/b;
|
|
.super Lx/j/h/a/g;
|
|
.source "Compressor.kt"
|
|
|
|
# interfaces
|
|
.implements Lkotlin/jvm/functions/Function2;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lx/j/h/a/g;",
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"Lkotlinx/coroutines/CoroutineScope;",
|
|
"Lkotlin/coroutines/Continuation<",
|
|
"-",
|
|
"Ljava/io/File;",
|
|
">;",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Lx/j/h/a/d;
|
|
c = "id.zelory.compressor.Compressor$compress$3"
|
|
f = "Compressor.kt"
|
|
l = {}
|
|
m = "invokeSuspend"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final synthetic $compressionPatch:Lkotlin/jvm/functions/Function1;
|
|
|
|
.field public final synthetic $context:Landroid/content/Context;
|
|
|
|
.field public final synthetic $imageFile:Ljava/io/File;
|
|
|
|
.field public label:I
|
|
|
|
.field private p$:Lkotlinx/coroutines/CoroutineScope;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lkotlin/jvm/functions/Function1;Landroid/content/Context;Ljava/io/File;Lkotlin/coroutines/Continuation;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lv/a/a/b;->$compressionPatch:Lkotlin/jvm/functions/Function1;
|
|
|
|
iput-object p2, p0, Lv/a/a/b;->$context:Landroid/content/Context;
|
|
|
|
iput-object p3, p0, Lv/a/a/b;->$imageFile:Ljava/io/File;
|
|
|
|
const/4 p1, 0x2
|
|
|
|
invoke-direct {p0, p1, p4}, Lx/j/h/a/g;-><init>(ILkotlin/coroutines/Continuation;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Object;",
|
|
"Lkotlin/coroutines/Continuation<",
|
|
"*>;)",
|
|
"Lkotlin/coroutines/Continuation<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "completion"
|
|
|
|
invoke-static {p2, v0}, Lx/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lv/a/a/b;
|
|
|
|
iget-object v1, p0, Lv/a/a/b;->$compressionPatch:Lkotlin/jvm/functions/Function1;
|
|
|
|
iget-object v2, p0, Lv/a/a/b;->$context:Landroid/content/Context;
|
|
|
|
iget-object v3, p0, Lv/a/a/b;->$imageFile:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1, v2, v3, p2}, Lv/a/a/b;-><init>(Lkotlin/jvm/functions/Function1;Landroid/content/Context;Ljava/io/File;Lkotlin/coroutines/Continuation;)V
|
|
|
|
check-cast p1, Lkotlinx/coroutines/CoroutineScope;
|
|
|
|
iput-object p1, v0, Lv/a/a/b;->p$:Lkotlinx/coroutines/CoroutineScope;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 4
|
|
|
|
check-cast p2, Lkotlin/coroutines/Continuation;
|
|
|
|
const-string v0, "completion"
|
|
|
|
invoke-static {p2, v0}, Lx/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lv/a/a/b;
|
|
|
|
iget-object v1, p0, Lv/a/a/b;->$compressionPatch:Lkotlin/jvm/functions/Function1;
|
|
|
|
iget-object v2, p0, Lv/a/a/b;->$context:Landroid/content/Context;
|
|
|
|
iget-object v3, p0, Lv/a/a/b;->$imageFile:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1, v2, v3, p2}, Lv/a/a/b;-><init>(Lkotlin/jvm/functions/Function1;Landroid/content/Context;Ljava/io/File;Lkotlin/coroutines/Continuation;)V
|
|
|
|
check-cast p1, Lkotlinx/coroutines/CoroutineScope;
|
|
|
|
iput-object p1, v0, Lv/a/a/b;->p$:Lkotlinx/coroutines/CoroutineScope;
|
|
|
|
sget-object p1, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
|
|
invoke-virtual {v0, p1}, Lv/a/a/b;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 6
|
|
|
|
iget v0, p0, Lv/a/a/b;->label:I
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
invoke-static {p1}, Lf/h/a/f/f/n/g;->throwOnFailure(Ljava/lang/Object;)V
|
|
|
|
new-instance p1, Lv/a/a/e/a;
|
|
|
|
invoke-direct {p1}, Lv/a/a/e/a;-><init>()V
|
|
|
|
iget-object v0, p0, Lv/a/a/b;->$compressionPatch:Lkotlin/jvm/functions/Function1;
|
|
|
|
invoke-interface {v0, p1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object v0, p0, Lv/a/a/b;->$context:Landroid/content/Context;
|
|
|
|
iget-object v1, p0, Lv/a/a/b;->$imageFile:Ljava/io/File;
|
|
|
|
sget-object v2, Lv/a/a/d;->a:Ljava/lang/String;
|
|
|
|
const-string v2, "context"
|
|
|
|
invoke-static {v0, v2}, Lx/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "imageFile"
|
|
|
|
invoke-static {v1, v2}, Lx/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
new-instance v4, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v5, "context.cacheDir"
|
|
|
|
invoke-static {v0, v5}, Lx/m/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
sget-object v0, Lv/a/a/d;->a:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v5, "compressor"
|
|
|
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0x2000
|
|
|
|
const-string v3, "$this$copyTo"
|
|
|
|
invoke-static {v1, v3}, Lx/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v3, "target"
|
|
|
|
invoke-static {v2, v3}, Lx/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
if-eqz v3, :cond_7
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->delete()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Lkotlin/io/FileAlreadyExistsException;
|
|
|
|
const-string v0, "Tried to overwrite the destination, but failed to delete it."
|
|
|
|
invoke-direct {p1, v1, v2, v0}, Lkotlin/io/FileAlreadyExistsException;-><init>(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-virtual {v2}, Ljava/io/File;->mkdirs()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance p1, Lkotlin/io/FileSystemException;
|
|
|
|
const-string v0, "Failed to create target directory."
|
|
|
|
invoke-direct {p1, v1, v2, v0}, Lkotlin/io/FileSystemException;-><init>(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
invoke-virtual {v2}, Ljava/io/File;->getParentFile()Ljava/io/File;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
invoke-virtual {v3}, Ljava/io/File;->mkdirs()Z
|
|
|
|
:cond_4
|
|
new-instance v3, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v3, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
|
|
:try_start_0
|
|
new-instance v1, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_2
|
|
|
|
:try_start_1
|
|
invoke-static {v3, v1, v0}, Lf/h/a/f/f/n/g;->copyTo(Ljava/io/InputStream;Ljava/io/OutputStream;I)J
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-static {v1, v4}, Lf/h/a/f/f/n/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_2
|
|
|
|
invoke-static {v3, v4}, Lf/h/a/f/f/n/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
:goto_1
|
|
iget-object p1, p1, Lv/a/a/e/a;->a:Ljava/util/List;
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_5
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lv/a/a/e/b;
|
|
|
|
:goto_2
|
|
invoke-interface {v0, v2}, Lv/a/a/e/b;->b(Ljava/io/File;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_5
|
|
|
|
invoke-interface {v0, v2}, Lv/a/a/e/b;->a(Ljava/io/File;)Ljava/io/File;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
return-object v2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_3
|
|
throw p1
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
:try_start_4
|
|
invoke-static {v1, p1}, Lf/h/a/f/f/n/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
:catchall_2
|
|
move-exception p1
|
|
|
|
:try_start_5
|
|
throw p1
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_3
|
|
|
|
:catchall_3
|
|
move-exception v0
|
|
|
|
invoke-static {v3, p1}, Lf/h/a/f/f/n/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
:cond_7
|
|
new-instance p1, Lkotlin/io/NoSuchFileException;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const-string v2, "The source file doesn\'t exist."
|
|
|
|
invoke-direct {p1, v1, v4, v2, v0}, Lkotlin/io/NoSuchFileException;-><init>(Ljava/io/File;Ljava/io/File;Ljava/lang/String;I)V
|
|
|
|
throw p1
|
|
|
|
:cond_8
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "call to \'resume\' before \'invoke\' with coroutine"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|