apkfuckery/com.discord/smali/com/facebook/soloader/f.smali

121 lines
3 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public final Lcom/facebook/soloader/f;
.super Ljava/lang/Object;
.source "FileLocker.java"
# interfaces
.implements Ljava/io/Closeable;
# instance fields
2019-08-14 23:59:34 +00:00
.field private final ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
2019-08-14 23:59:34 +00:00
.field private final ZY:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
# direct methods
.method private constructor <init>(Ljava/io/File;)V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/io/FileOutputStream;
invoke-direct {v0, p1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
2019-08-14 23:59:34 +00:00
iput-object v0, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
:try_start_0
2019-08-14 23:59:34 +00:00
iget-object p1, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {p1}, Ljava/io/FileOutputStream;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object p1
invoke-virtual {p1}, Ljava/nio/channels/FileChannel;->lock()Ljava/nio/channels/FileLock;
move-result-object p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_0
2019-08-14 23:59:34 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
:cond_0
2019-08-14 23:59:34 +00:00
iput-object p1, p0, Lcom/facebook/soloader/f;->ZY:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
return-void
:catchall_0
move-exception p1
2019-08-14 23:59:34 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
throw p1
.end method
.method public static q(Ljava/io/File;)Lcom/facebook/soloader/f;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
new-instance v0, Lcom/facebook/soloader/f;
invoke-direct {v0, p0}, Lcom/facebook/soloader/f;-><init>(Ljava/io/File;)V
return-object v0
.end method
# virtual methods
.method public final close()V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
:try_start_0
2019-08-14 23:59:34 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->ZY:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
if-eqz v0, :cond_0
2019-08-14 23:59:34 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->ZY:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/nio/channels/FileLock;->release()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
2019-08-14 23:59:34 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
return-void
:catchall_0
move-exception v0
2019-08-14 23:59:34 +00:00
iget-object v1, p0, Lcom/facebook/soloader/f;->ZX:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
throw v0
.end method