120 lines
3 KiB
Smali
120 lines
3 KiB
Smali
.class public final Lcom/facebook/soloader/f;
|
|
.super Ljava/lang/Object;
|
|
.source "FileLocker.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/io/Closeable;
|
|
|
|
|
|
# instance fields
|
|
.field private final Wn:Ljava/io/FileOutputStream;
|
|
|
|
.field private final Wo:Ljava/nio/channels/FileLock;
|
|
.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
|
|
|
|
iput-object v0, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
:try_start_0
|
|
iget-object p1, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
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
|
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
:cond_0
|
|
iput-object p1, p0, Lcom/facebook/soloader/f;->Wo:Ljava/nio/channels/FileLock;
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
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
|
|
iget-object v0, p0, Lcom/facebook/soloader/f;->Wo:Ljava/nio/channels/FileLock;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/f;->Wo:Ljava/nio/channels/FileLock;
|
|
|
|
invoke-virtual {v0}, Ljava/nio/channels/FileLock;->release()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Lcom/facebook/soloader/f;->Wn:Ljava/io/FileOutputStream;
|
|
|
|
invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
|
|
|
|
throw v0
|
|
.end method
|