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-10-10 02:17:24 +00:00
.field private final abO:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
2019-10-10 02:17:24 +00:00
.field private final abP: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-10-10 02:17:24 +00:00
iput-object v0, p0, Lcom/facebook/soloader/f;->abO:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
:try_start_0
2019-10-10 02:17:24 +00:00
iget-object p1, p0, Lcom/facebook/soloader/f;->abO: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-10-10 02:17:24 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->abO:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
:cond_0
2019-10-10 02:17:24 +00:00
iput-object p1, p0, Lcom/facebook/soloader/f;->abP:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
return-void
:catchall_0
move-exception p1
2019-10-10 02:17:24 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->abO:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
throw p1
.end method
2019-10-01 14:15:45 +00:00
.method public static p(Ljava/io/File;)Lcom/facebook/soloader/f;
2019-07-24 11:27:29 +00:00
.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-10-10 02:17:24 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->abP:Ljava/nio/channels/FileLock;
2019-07-24 11:27:29 +00:00
if-eqz v0, :cond_0
2019-10-10 02:17:24 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->abP: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-10-10 02:17:24 +00:00
iget-object v0, p0, Lcom/facebook/soloader/f;->abO: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-10-10 02:17:24 +00:00
iget-object v1, p0, Lcom/facebook/soloader/f;->abO:Ljava/io/FileOutputStream;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
throw v0
.end method