- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3 - APKTool decompilation (Smali bytecode) for modding and rebuilding APK - Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures - Includes full Smali source, resources, and native libraries - Ready to rebuild APK after modifications with apktool b command - Added comprehensive README-apktool.md with modding guide This branch complements the JADX branches: - Use JADX (main/discord-community) to UNDERSTAND code (readable Java) - Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali) Total: 44,417 files, 538.51 MB Smali source code
315 lines
9.0 KiB
Smali
315 lines
9.0 KiB
Smali
.class public final Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile$AtomicFileOutputStream;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final TAG:Ljava/lang/String; = "AtomicFile"
|
|
|
|
|
|
# instance fields
|
|
.field private final backupName:Ljava/io/File;
|
|
|
|
.field private final baseName:Ljava/io/File;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/io/File;)V
|
|
.locals 2
|
|
|
|
.line 23
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 25
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ".bak"
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private restoreBackup()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
.line 77
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 78
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 79
|
|
invoke-virtual {v0, v1}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final delete()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 30
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
.line 31
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final endWrite(Ljava/io/OutputStream;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 65
|
|
invoke-virtual {p1}, Ljava/io/OutputStream;->close()V
|
|
|
|
iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
.line 67
|
|
invoke-virtual {p1}, Ljava/io/File;->delete()Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final openRead()Ljava/io/InputStream;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/FileNotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 72
|
|
invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->restoreBackup()V
|
|
|
|
.line 73
|
|
new-instance v0, Ljava/io/FileInputStream;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final startWrite()Ljava/io/OutputStream;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 37
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
.line 38
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
.line 39
|
|
invoke-virtual {v0, v1}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 40
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Couldn\'t rename file "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " to backup file "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->backupName:Ljava/io/File;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "AtomicFile"
|
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 43
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
.line 48
|
|
:cond_1
|
|
:goto_0
|
|
:try_start_0
|
|
new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile$AtomicFileOutputStream;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile$AtomicFileOutputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
.line 50
|
|
invoke-virtual {v1}, Ljava/io/File;->getParentFile()Ljava/io/File;
|
|
|
|
move-result-object v1
|
|
|
|
.line 51
|
|
invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 55
|
|
:try_start_1
|
|
new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile$AtomicFileOutputStream;
|
|
|
|
iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-direct {v0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile$AtomicFileOutputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_1
|
|
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
:goto_1
|
|
return-object v0
|
|
|
|
:catch_1
|
|
move-exception v0
|
|
|
|
.line 57
|
|
new-instance v1, Ljava/io/IOException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "Couldn\'t create "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
|
|
.line 52
|
|
:cond_2
|
|
new-instance v1, Ljava/io/IOException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "Couldn\'t create directory "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v3, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/AtomicFile;->baseName:Ljava/io/File;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v1, v2, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
.end method
|