649 lines
13 KiB
Smali
649 lines
13 KiB
Smali
.class public final Lcom/vk/log/b/DefaultFileManager;
|
|
.super Ljava/lang/Object;
|
|
.source "DefaultFileManager.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/vk/log/b/FileManager;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Ljava/io/File;Z)Ljava/io/FileOutputStream;
|
|
.locals 1
|
|
|
|
.line 3
|
|
:try_start_0
|
|
new-instance v0, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v0, p1, p2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public a(Ljava/io/Closeable;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 34
|
|
:try_start_0
|
|
invoke-interface {p1}, Ljava/io/Closeable;->close()V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljava/io/File;[BZ)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/Exception;
|
|
}
|
|
.end annotation
|
|
|
|
.line 11
|
|
new-instance v0, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v0, p1, p3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
|
|
|
|
:try_start_0
|
|
invoke-virtual {v0, p2}, Ljava/io/FileOutputStream;->write([B)V
|
|
|
|
sget-object p1, Lkotlin/Unit;->a:Lkotlin/Unit;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
invoke-static {v0, p1}, Lkotlin/io/Closeable;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_1
|
|
throw p1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p2
|
|
|
|
invoke-static {v0, p1}, Lkotlin/io/Closeable;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
.end method
|
|
|
|
.method public a(Ljava/io/OutputStream;Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
:try_start_0
|
|
const-string v0, "UTF-8"
|
|
|
|
.line 1
|
|
invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Charset.forName(charsetName)"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "(this as java.lang.String).getBytes(charset)"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1, p2}, Ljava/io/OutputStream;->write([B)V
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/io/OutputStream;->flush()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:catchall_0
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljava/lang/StringBuilder;Ljava/io/File;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 4
|
|
:try_start_0
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "builder.toString()"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lkotlin/text/Charsets;->a:Ljava/nio/charset/Charset;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "(this as java.lang.String).getBytes(charset)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 5
|
|
invoke-virtual {p0, p2, p1, v0}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/File;[BZ)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_0
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string p2, "null cannot be cast to non-null type java.lang.String"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:catchall_0
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljava/io/File;)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 7
|
|
:try_start_0
|
|
invoke-virtual {p1}, Ljava/io/File;->getParentFile()Ljava/io/File;
|
|
|
|
move-result-object v1
|
|
|
|
.line 8
|
|
invoke-virtual {v1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 9
|
|
invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z
|
|
|
|
.line 10
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/io/File;->createNewFile()Z
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
:cond_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public a(Ljava/lang/String;Ljava/util/List;Ljava/io/File;)Z
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Ljava/io/File;",
|
|
">;",
|
|
"Ljava/io/File;",
|
|
")Z"
|
|
}
|
|
.end annotation
|
|
|
|
.line 12
|
|
invoke-interface {p2}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
goto/16 :goto_6
|
|
|
|
:cond_0
|
|
const/16 v0, 0x400
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:try_start_0
|
|
new-array v0, v0, [B
|
|
|
|
.line 13
|
|
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
move-object v3, v2
|
|
|
|
:cond_1
|
|
:goto_0
|
|
:try_start_1
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_6
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Ljava/io/File;
|
|
|
|
.line 14
|
|
invoke-virtual {v4}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-virtual {v4}, Ljava/io/File;->isFile()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-virtual {v4}, Ljava/io/File;->length()J
|
|
|
|
move-result-wide v5
|
|
|
|
const/4 v7, 0x4
|
|
|
|
int-to-long v7, v7
|
|
|
|
cmp-long v9, v5, v7
|
|
|
|
if-gez v9, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
if-nez v3, :cond_3
|
|
|
|
.line 15
|
|
new-instance v5, Ljava/io/FileOutputStream;
|
|
|
|
invoke-direct {v5, p3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_2
|
|
|
|
.line 16
|
|
:try_start_2
|
|
new-instance v3, Ljava/util/zip/ZipOutputStream;
|
|
|
|
invoke-direct {v3, v5}, Ljava/util/zip/ZipOutputStream;-><init>(Ljava/io/OutputStream;)V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
move-object v2, v3
|
|
|
|
move-object v3, v5
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
move-object v3, v5
|
|
|
|
goto/16 :goto_5
|
|
|
|
:catch_0
|
|
move-object v3, v5
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
:goto_1
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 17
|
|
:try_start_3
|
|
new-instance v5, Ljava/io/FileInputStream;
|
|
|
|
invoke-virtual {v4}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-direct {v5, v6}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 18
|
|
invoke-virtual {v4}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v6, "file.absolutePath"
|
|
|
|
invoke-static {v4, v6}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v6
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
invoke-virtual {v4, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v6, "(this as java.lang.String).substring(startIndex)"
|
|
|
|
invoke-static {v4, v6}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v6, Ljava/util/zip/ZipEntry;
|
|
|
|
invoke-direct {v6, v4}, Ljava/util/zip/ZipEntry;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2, v6}, Ljava/util/zip/ZipOutputStream;->putNextEntry(Ljava/util/zip/ZipEntry;)V
|
|
|
|
.line 19
|
|
:goto_2
|
|
invoke-virtual {v5, v0}, Ljava/io/FileInputStream;->read([B)I
|
|
|
|
move-result v4
|
|
|
|
if-lez v4, :cond_4
|
|
|
|
.line 20
|
|
invoke-virtual {v2, v0, v1, v4}, Ljava/util/zip/ZipOutputStream;->write([BII)V
|
|
|
|
goto :goto_2
|
|
|
|
.line 21
|
|
:cond_4
|
|
invoke-virtual {v2}, Ljava/util/zip/ZipOutputStream;->closeEntry()V
|
|
|
|
.line 22
|
|
invoke-virtual {v5}, Ljava/io/FileInputStream;->close()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 23
|
|
:cond_5
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string p2, "null cannot be cast to non-null type java.lang.String"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 24
|
|
:cond_6
|
|
invoke-virtual {p3}, Ljava/io/File;->length()J
|
|
|
|
move-result-wide p1
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
cmp-long v0, p1, v4
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
.line 25
|
|
invoke-virtual {p0, p3}, Lcom/vk/log/b/DefaultFileManager;->b(Ljava/io/File;)Z
|
|
:try_end_3
|
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_2
|
|
|
|
.line 26
|
|
:goto_3
|
|
invoke-virtual {p0, v2}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
.line 27
|
|
invoke-virtual {p0, v3}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
return v1
|
|
|
|
:cond_7
|
|
const/4 p1, 0x1
|
|
|
|
.line 28
|
|
invoke-virtual {p0, v2}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
.line 29
|
|
invoke-virtual {p0, v3}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
return p1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
move-object v3, v2
|
|
|
|
goto :goto_5
|
|
|
|
:catch_1
|
|
move-object v3, v2
|
|
|
|
.line 30
|
|
:catch_2
|
|
:goto_4
|
|
:try_start_4
|
|
invoke-virtual {p0, p3}, Lcom/vk/log/b/DefaultFileManager;->b(Ljava/io/File;)Z
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
goto :goto_3
|
|
|
|
:catchall_2
|
|
move-exception p1
|
|
|
|
.line 31
|
|
:goto_5
|
|
invoke-virtual {p0, v2}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
.line 32
|
|
invoke-virtual {p0, v3}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/Closeable;)V
|
|
|
|
throw p1
|
|
|
|
.line 33
|
|
:cond_8
|
|
:goto_6
|
|
invoke-virtual {p0, p3}, Lcom/vk/log/b/DefaultFileManager;->b(Ljava/io/File;)Z
|
|
|
|
return v1
|
|
.end method
|
|
|
|
.method public b(Ljava/io/File;)Z
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 1
|
|
invoke-virtual {p1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/vk/log/b/DefaultFileManager;->d(Ljava/io/File;)Z
|
|
|
|
move-result p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Ljava/io/File;->delete()Z
|
|
|
|
move-result p1
|
|
|
|
:goto_0
|
|
return p1
|
|
|
|
:cond_2
|
|
return v0
|
|
.end method
|
|
|
|
.method public c(Ljava/io/File;)Z
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/io/File;->delete()Z
|
|
|
|
.line 3
|
|
:cond_0
|
|
invoke-virtual {p0, p1}, Lcom/vk/log/b/DefaultFileManager;->a(Ljava/io/File;)Z
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
:cond_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public d(Ljava/io/File;)Z
|
|
.locals 5
|
|
|
|
.line 1
|
|
invoke-virtual {p1}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 3
|
|
array-length v2, v0
|
|
|
|
:goto_0
|
|
if-ge v1, v2, :cond_1
|
|
|
|
.line 4
|
|
aget-object v3, v0, v1
|
|
|
|
const-string v4, "files[i]"
|
|
|
|
invoke-static {v3, v4}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
.line 5
|
|
aget-object v3, v0, v1
|
|
|
|
invoke-static {v3, v4}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v3}, Lcom/vk/log/b/DefaultFileManager;->d(Ljava/io/File;)Z
|
|
|
|
goto :goto_1
|
|
|
|
.line 6
|
|
:cond_0
|
|
aget-object v3, v0, v1
|
|
|
|
invoke-virtual {v3}, Ljava/io/File;->delete()Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_1
|
|
invoke-virtual {p1}, Ljava/io/File;->delete()Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|