apkfuckery/com.discord/smali/androidx/multidex/MultiDexExtractor.smali
2019-05-23 01:20:16 +02:00

1764 lines
50 KiB
Smali

.class final Landroidx/multidex/MultiDexExtractor;
.super Ljava/lang/Object;
.source "MultiDexExtractor.java"
# interfaces
.implements Ljava/io/Closeable;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/multidex/MultiDexExtractor$ExtractedDex;
}
.end annotation
# static fields
.field private static final BUFFER_SIZE:I = 0x4000
.field private static final DEX_PREFIX:Ljava/lang/String; = "classes"
.field static final DEX_SUFFIX:Ljava/lang/String; = ".dex"
.field private static final EXTRACTED_NAME_EXT:Ljava/lang/String; = ".classes"
.field static final EXTRACTED_SUFFIX:Ljava/lang/String; = ".zip"
.field private static final KEY_CRC:Ljava/lang/String; = "crc"
.field private static final KEY_DEX_CRC:Ljava/lang/String; = "dex.crc."
.field private static final KEY_DEX_NUMBER:Ljava/lang/String; = "dex.number"
.field private static final KEY_DEX_TIME:Ljava/lang/String; = "dex.time."
.field private static final KEY_TIME_STAMP:Ljava/lang/String; = "timestamp"
.field private static final LOCK_FILENAME:Ljava/lang/String; = "MultiDex.lock"
.field private static final MAX_EXTRACT_ATTEMPTS:I = 0x3
.field private static final NO_VALUE:J = -0x1L
.field private static final PREFS_FILE:Ljava/lang/String; = "multidex.version"
.field private static final TAG:Ljava/lang/String; = "MultiDex"
# instance fields
.field private final cacheLock:Ljava/nio/channels/FileLock;
.field private final dexDir:Ljava/io/File;
.field private final lockChannel:Ljava/nio/channels/FileChannel;
.field private final lockRaf:Ljava/io/RandomAccessFile;
.field private final sourceApk:Ljava/io/File;
.field private final sourceCrc:J
# direct methods
.method constructor <init>(Ljava/io/File;Ljava/io/File;)V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "MultiDexExtractor("
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ", "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "MultiDex"
invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
iput-object p1, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
iput-object p2, p0, Landroidx/multidex/MultiDexExtractor;->dexDir:Ljava/io/File;
invoke-static {p1}, Landroidx/multidex/MultiDexExtractor;->getZipCrc(Ljava/io/File;)J
move-result-wide v2
iput-wide v2, p0, Landroidx/multidex/MultiDexExtractor;->sourceCrc:J
new-instance p1, Ljava/io/File;
const-string v0, "MultiDex.lock"
invoke-direct {p1, p2, v0}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
new-instance p2, Ljava/io/RandomAccessFile;
const-string v0, "rw"
invoke-direct {p2, p1, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
iput-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockRaf:Ljava/io/RandomAccessFile;
:try_start_0
iget-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockRaf:Ljava/io/RandomAccessFile;
invoke-virtual {p2}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object p2
iput-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockChannel:Ljava/nio/channels/FileChannel;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_5
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_4
.catch Ljava/lang/Error; {:try_start_0 .. :try_end_0} :catch_3
:try_start_1
new-instance p2, Ljava/lang/StringBuilder;
const-string v0, "Blocking on lock "
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v0
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-static {v1, p2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
iget-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockChannel:Ljava/nio/channels/FileChannel;
invoke-virtual {p2}, Ljava/nio/channels/FileChannel;->lock()Ljava/nio/channels/FileLock;
move-result-object p2
iput-object p2, p0, Landroidx/multidex/MultiDexExtractor;->cacheLock:Ljava/nio/channels/FileLock;
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2
.catch Ljava/lang/RuntimeException; {:try_start_1 .. :try_end_1} :catch_1
.catch Ljava/lang/Error; {:try_start_1 .. :try_end_1} :catch_0
:try_start_2
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object p1
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p1, " locked"
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {v1, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
return-void
:catch_0
move-exception p1
goto :goto_0
:catch_1
move-exception p1
goto :goto_0
:catch_2
move-exception p1
:goto_0
iget-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockChannel:Ljava/nio/channels/FileChannel;
invoke-static {p2}, Landroidx/multidex/MultiDexExtractor;->closeQuietly(Ljava/io/Closeable;)V
throw p1
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_5
.catch Ljava/lang/RuntimeException; {:try_start_2 .. :try_end_2} :catch_4
.catch Ljava/lang/Error; {:try_start_2 .. :try_end_2} :catch_3
:catch_3
move-exception p1
goto :goto_1
:catch_4
move-exception p1
goto :goto_1
:catch_5
move-exception p1
:goto_1
iget-object p2, p0, Landroidx/multidex/MultiDexExtractor;->lockRaf:Ljava/io/RandomAccessFile;
invoke-static {p2}, Landroidx/multidex/MultiDexExtractor;->closeQuietly(Ljava/io/Closeable;)V
throw p1
.end method
.method private clearDexDir()V
.locals 8
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->dexDir:Ljava/io/File;
new-instance v1, Landroidx/multidex/MultiDexExtractor$1;
invoke-direct {v1, p0}, Landroidx/multidex/MultiDexExtractor$1;-><init>(Landroidx/multidex/MultiDexExtractor;)V
invoke-virtual {v0, v1}, Ljava/io/File;->listFiles(Ljava/io/FileFilter;)[Ljava/io/File;
move-result-object v0
const-string v1, "MultiDex"
if-nez v0, :cond_0
new-instance v0, Ljava/lang/StringBuilder;
const-string v2, "Failed to list secondary dex dir content ("
invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v2, p0, Landroidx/multidex/MultiDexExtractor;->dexDir:Ljava/io/File;
invoke-virtual {v2}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, ")."
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v1, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
return-void
:cond_0
array-length v2, v0
const/4 v3, 0x0
:goto_0
if-ge v3, v2, :cond_2
aget-object v4, v0, v3
new-instance v5, Ljava/lang/StringBuilder;
const-string v6, "Trying to delete old file "
invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v4}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v6, " of size "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/io/File;->length()J
move-result-wide v6
invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v1, v5}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual {v4}, Ljava/io/File;->delete()Z
move-result v5
if-nez v5, :cond_1
new-instance v5, Ljava/lang/StringBuilder;
const-string v6, "Failed to delete old file "
invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v4}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v4
invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v1, v4}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
:cond_1
new-instance v5, Ljava/lang/StringBuilder;
const-string v6, "Deleted old file "
invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v4}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v4
invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v1, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:goto_1
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_2
return-void
.end method
.method private static closeQuietly(Ljava/io/Closeable;)V
.locals 2
:try_start_0
invoke-interface {p0}, Ljava/io/Closeable;->close()V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception p0
const-string v0, "MultiDex"
const-string v1, "Failed to close resource"
invoke-static {v0, v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-void
.end method
.method private static extract(Ljava/util/zip/ZipFile;Ljava/util/zip/ZipEntry;Ljava/io/File;Ljava/lang/String;)V
.locals 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;,
Ljava/io/FileNotFoundException;
}
.end annotation
invoke-virtual {p0, p1}, Ljava/util/zip/ZipFile;->getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
move-result-object p0
invoke-static {p3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p3
const-string v0, "tmp-"
invoke-virtual {v0, p3}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p3
invoke-virtual {p2}, Ljava/io/File;->getParentFile()Ljava/io/File;
move-result-object v0
const-string v1, ".zip"
invoke-static {p3, v1, v0}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
move-result-object p3
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Extracting "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p3}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "MultiDex"
invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:try_start_0
new-instance v0, Ljava/util/zip/ZipOutputStream;
new-instance v2, Ljava/io/BufferedOutputStream;
new-instance v3, Ljava/io/FileOutputStream;
invoke-direct {v3, p3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
invoke-direct {v2, v3}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
invoke-direct {v0, v2}, Ljava/util/zip/ZipOutputStream;-><init>(Ljava/io/OutputStream;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:try_start_1
new-instance v2, Ljava/util/zip/ZipEntry;
const-string v3, "classes.dex"
invoke-direct {v2, v3}, Ljava/util/zip/ZipEntry;-><init>(Ljava/lang/String;)V
invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getTime()J
move-result-wide v3
invoke-virtual {v2, v3, v4}, Ljava/util/zip/ZipEntry;->setTime(J)V
invoke-virtual {v0, v2}, Ljava/util/zip/ZipOutputStream;->putNextEntry(Ljava/util/zip/ZipEntry;)V
const/16 p1, 0x4000
new-array p1, p1, [B
invoke-virtual {p0, p1}, Ljava/io/InputStream;->read([B)I
move-result v2
:goto_0
const/4 v3, -0x1
if-eq v2, v3, :cond_0
const/4 v3, 0x0
invoke-virtual {v0, p1, v3, v2}, Ljava/util/zip/ZipOutputStream;->write([BII)V
invoke-virtual {p0, p1}, Ljava/io/InputStream;->read([B)I
move-result v2
goto :goto_0
:cond_0
invoke-virtual {v0}, Ljava/util/zip/ZipOutputStream;->closeEntry()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:try_start_2
invoke-virtual {v0}, Ljava/util/zip/ZipOutputStream;->close()V
invoke-virtual {p3}, Ljava/io/File;->setReadOnly()Z
move-result p1
if-eqz p1, :cond_2
new-instance p1, Ljava/lang/StringBuilder;
const-string v0, "Renaming to "
invoke-direct {p1, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p2}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v0
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {v1, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual {p3, p2}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
move-result p1
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
if-eqz p1, :cond_1
invoke-static {p0}, Landroidx/multidex/MultiDexExtractor;->closeQuietly(Ljava/io/Closeable;)V
invoke-virtual {p3}, Ljava/io/File;->delete()Z
return-void
:cond_1
:try_start_3
new-instance p1, Ljava/io/IOException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Failed to rename \""
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p3}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "\" to \""
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object p2
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p2, "\""
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
new-instance p1, Ljava/io/IOException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Failed to mark readonly \""
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p3}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "\" (tmp of \""
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object p2
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p2, "\")"
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
:catchall_0
move-exception p1
invoke-virtual {v0}, Ljava/util/zip/ZipOutputStream;->close()V
throw p1
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
:catchall_1
move-exception p1
invoke-static {p0}, Landroidx/multidex/MultiDexExtractor;->closeQuietly(Ljava/io/Closeable;)V
invoke-virtual {p3}, Ljava/io/File;->delete()Z
goto :goto_2
:goto_1
throw p1
:goto_2
goto :goto_1
.end method
.method private static getMultiDexPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0xb
if-ge v0, v1, :cond_0
const/4 v0, 0x0
goto :goto_0
:cond_0
const/4 v0, 0x4
:goto_0
const-string v1, "multidex.version"
invoke-virtual {p0, v1, v0}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
return-object p0
.end method
.method private static getTimeStamp(Ljava/io/File;)J
.locals 4
invoke-virtual {p0}, Ljava/io/File;->lastModified()J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long p0, v0, v2
if-nez p0, :cond_0
const-wide/16 v2, 0x1
sub-long/2addr v0, v2
:cond_0
return-wide v0
.end method
.method private static getZipCrc(Ljava/io/File;)J
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
invoke-static {p0}, Landroidx/multidex/ZipUtil;->getZipCrc(Ljava/io/File;)J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long p0, v0, v2
if-nez p0, :cond_0
const-wide/16 v2, 0x1
sub-long/2addr v0, v2
:cond_0
return-wide v0
.end method
.method private static isModified(Landroid/content/Context;Ljava/io/File;JLjava/lang/String;)Z
.locals 7
invoke-static {p0}, Landroidx/multidex/MultiDexExtractor;->getMultiDexPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object p0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "timestamp"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-wide/16 v1, -0x1
invoke-interface {p0, v0, v1, v2}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
move-result-wide v3
invoke-static {p1}, Landroidx/multidex/MultiDexExtractor;->getTimeStamp(Ljava/io/File;)J
move-result-wide v5
cmp-long p1, v3, v5
if-nez p1, :cond_1
new-instance p1, Ljava/lang/StringBuilder;
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p1, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p4, "crc"
invoke-virtual {p1, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-interface {p0, p1, v1, v2}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
move-result-wide p0
cmp-long p4, p0, p2
if-eqz p4, :cond_0
goto :goto_0
:cond_0
const/4 p0, 0x0
return p0
:cond_1
:goto_0
const/4 p0, 0x1
return p0
.end method
.method private loadExistingExtractions(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;
.locals 16
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/String;",
")",
"Ljava/util/List<",
"Landroidx/multidex/MultiDexExtractor$ExtractedDex;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
move-object/from16 v0, p0
move-object/from16 v1, p2
const-string v2, "MultiDex"
const-string v3, "loading existing secondary dex files"
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
iget-object v3, v0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v3, ".classes"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static/range {p1 .. p1}, Landroidx/multidex/MultiDexExtractor;->getMultiDexPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v3
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v5, "dex.number"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
const/4 v5, 0x1
invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v4
new-instance v5, Ljava/util/ArrayList;
add-int/lit8 v6, v4, -0x1
invoke-direct {v5, v6}, Ljava/util/ArrayList;-><init>(I)V
const/4 v6, 0x2
:goto_0
if-gt v6, v4, :cond_2
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v8, ".zip"
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
new-instance v8, Landroidx/multidex/MultiDexExtractor$ExtractedDex;
iget-object v9, v0, Landroidx/multidex/MultiDexExtractor;->dexDir:Ljava/io/File;
invoke-direct {v8, v9, v7}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;-><init>(Ljava/io/File;Ljava/lang/String;)V
invoke-virtual {v8}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->isFile()Z
move-result v7
if-eqz v7, :cond_1
invoke-static {v8}, Landroidx/multidex/MultiDexExtractor;->getZipCrc(Ljava/io/File;)J
move-result-wide v9
iput-wide v9, v8, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v9, "dex.crc."
invoke-virtual {v7, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
const-wide/16 v9, -0x1
invoke-interface {v3, v7, v9, v10}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
move-result-wide v11
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v13, "dex.time."
invoke-virtual {v7, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-interface {v3, v7, v9, v10}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
move-result-wide v9
invoke-virtual {v8}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->lastModified()J
move-result-wide v13
cmp-long v7, v9, v13
if-nez v7, :cond_0
move-object v7, v2
move-object/from16 p1, v3
iget-wide v2, v8, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
cmp-long v15, v11, v2
if-nez v15, :cond_0
invoke-interface {v5, v8}, Ljava/util/List;->add(Ljava/lang/Object;)Z
add-int/lit8 v6, v6, 0x1
move-object/from16 v3, p1
move-object v2, v7
goto :goto_0
:cond_0
new-instance v2, Ljava/io/IOException;
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "Invalid extracted dex: "
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v4, " (key \""
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "\"), expected modification time: "
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v9, v10}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, ", modification time: "
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v13, v14}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, ", expected crc: "
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v11, v12}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, ", file crc: "
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-wide v4, v8, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v2, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v2
:cond_1
new-instance v1, Ljava/io/IOException;
new-instance v2, Ljava/lang/StringBuilder;
const-string v3, "Missing extracted secondary dex file \'"
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v8}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->getPath()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v3, "\'"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v1
:cond_2
return-object v5
.end method
.method private performExtractions()Ljava/util/List;
.locals 15
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Landroidx/multidex/MultiDexExtractor$ExtractedDex;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "Failed to close resource"
const-string v1, ".dex"
const-string v2, "MultiDex"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
iget-object v4, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
invoke-virtual {v4}, Ljava/io/File;->getName()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v4, ".classes"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {p0}, Landroidx/multidex/MultiDexExtractor;->clearDexDir()V
new-instance v4, Ljava/util/ArrayList;
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
new-instance v5, Ljava/util/zip/ZipFile;
iget-object v6, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
invoke-direct {v5, v6}, Ljava/util/zip/ZipFile;-><init>(Ljava/io/File;)V
const/4 v6, 0x2
:try_start_0
new-instance v7, Ljava/lang/StringBuilder;
const-string v8, "classes2"
invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v7, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-virtual {v5, v7}, Ljava/util/zip/ZipFile;->getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
move-result-object v7
:goto_0
if-eqz v7, :cond_4
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v8, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v9, ".zip"
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v8
new-instance v9, Landroidx/multidex/MultiDexExtractor$ExtractedDex;
iget-object v10, p0, Landroidx/multidex/MultiDexExtractor;->dexDir:Ljava/io/File;
invoke-direct {v9, v10, v8}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;-><init>(Ljava/io/File;Ljava/lang/String;)V
invoke-interface {v4, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z
const-string v8, "Extraction is needed for file "
invoke-static {v9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v10
invoke-virtual {v8, v10}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v8
invoke-static {v2, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
const/4 v8, 0x0
const/4 v10, 0x0
const/4 v11, 0x0
:cond_0
:goto_1
const/4 v12, 0x3
if-ge v10, v12, :cond_2
if-nez v11, :cond_2
add-int/lit8 v10, v10, 0x1
invoke-static {v5, v7, v9, v3}, Landroidx/multidex/MultiDexExtractor;->extract(Ljava/util/zip/ZipFile;Ljava/util/zip/ZipEntry;Ljava/io/File;Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:try_start_1
invoke-static {v9}, Landroidx/multidex/MultiDexExtractor;->getZipCrc(Ljava/io/File;)J
move-result-wide v11
iput-wide v11, v9, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/4 v11, 0x1
goto :goto_2
:catch_0
move-exception v11
:try_start_2
new-instance v12, Ljava/lang/StringBuilder;
const-string v13, "Failed to read crc from "
invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->getAbsolutePath()Ljava/lang/String;
move-result-object v13
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v12
invoke-static {v2, v12, v11}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
const/4 v11, 0x0
:goto_2
new-instance v12, Ljava/lang/StringBuilder;
const-string v13, "Extraction "
invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
if-eqz v11, :cond_1
const-string v13, "succeeded"
goto :goto_3
:cond_1
const-string v13, "failed"
:goto_3
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v13, " \'"
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->getAbsolutePath()Ljava/lang/String;
move-result-object v13
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v13, "\': length "
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->length()J
move-result-wide v13
invoke-virtual {v12, v13, v14}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v13, " - crc: "
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-wide v13, v9, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
invoke-virtual {v12, v13, v14}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v12
invoke-static {v2, v12}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
if-nez v11, :cond_0
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->delete()Z
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->exists()Z
move-result v12
if-eqz v12, :cond_0
new-instance v12, Ljava/lang/StringBuilder;
const-string v13, "Failed to delete corrupted secondary dex \'"
invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->getPath()Ljava/lang/String;
move-result-object v13
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v13, "\'"
invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v12
invoke-static {v2, v12}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_1
:cond_2
if-eqz v11, :cond_3
add-int/lit8 v6, v6, 0x1
new-instance v7, Ljava/lang/StringBuilder;
const-string v8, "classes"
invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v7, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-virtual {v5, v7}, Ljava/util/zip/ZipFile;->getEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
move-result-object v7
goto/16 :goto_0
:cond_3
new-instance v1, Ljava/io/IOException;
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "Could not create zip file "
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v9}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->getAbsolutePath()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v4, " for secondary dex ("
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v4, ")"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {v1, v3}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v1
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
:cond_4
:try_start_3
invoke-virtual {v5}, Ljava/util/zip/ZipFile;->close()V
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1
goto :goto_4
:catch_1
move-exception v1
invoke-static {v2, v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:goto_4
return-object v4
:catchall_0
move-exception v1
:try_start_4
invoke-virtual {v5}, Ljava/util/zip/ZipFile;->close()V
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_2
goto :goto_5
:catch_2
move-exception v3
invoke-static {v2, v0, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:goto_5
goto :goto_7
:goto_6
throw v1
:goto_7
goto :goto_6
.end method
.method private static putStoredApkInfo(Landroid/content/Context;Ljava/lang/String;JJLjava/util/List;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/String;",
"JJ",
"Ljava/util/List<",
"Landroidx/multidex/MultiDexExtractor$ExtractedDex;",
">;)V"
}
.end annotation
invoke-static {p0}, Landroidx/multidex/MultiDexExtractor;->getMultiDexPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "timestamp"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-interface {p0, v0, p2, p3}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p3, "crc"
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-interface {p0, p2, p4, p5}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p3, "dex.number"
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-interface {p6}, Ljava/util/List;->size()I
move-result p3
add-int/lit8 p3, p3, 0x1
invoke-interface {p0, p2, p3}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
invoke-interface {p6}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p2
const/4 p3, 0x2
:goto_0
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result p4
if-eqz p4, :cond_0
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p4
check-cast p4, Landroidx/multidex/MultiDexExtractor$ExtractedDex;
new-instance p5, Ljava/lang/StringBuilder;
invoke-direct {p5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p6, "dex.crc."
invoke-virtual {p5, p6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p5, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {p5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p5
iget-wide v0, p4, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->crc:J
invoke-interface {p0, p5, v0, v1}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
new-instance p5, Ljava/lang/StringBuilder;
invoke-direct {p5}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p6, "dex.time."
invoke-virtual {p5, p6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p5, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {p5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p5
invoke-virtual {p4}, Landroidx/multidex/MultiDexExtractor$ExtractedDex;->lastModified()J
move-result-wide v0
invoke-interface {p0, p5, v0, v1}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
add-int/lit8 p3, p3, 0x1
goto :goto_0
:cond_0
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->commit()Z
return-void
.end method
# virtual methods
.method public final close()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->cacheLock:Ljava/nio/channels/FileLock;
invoke-virtual {v0}, Ljava/nio/channels/FileLock;->release()V
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->lockChannel:Ljava/nio/channels/FileChannel;
invoke-virtual {v0}, Ljava/nio/channels/FileChannel;->close()V
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->lockRaf:Ljava/io/RandomAccessFile;
invoke-virtual {v0}, Ljava/io/RandomAccessFile;->close()V
return-void
.end method
.method final load(Landroid/content/Context;Ljava/lang/String;Z)Ljava/util/List;
.locals 9
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/String;",
"Z)",
"Ljava/util/List<",
"+",
"Ljava/io/File;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "MultiDexExtractor.load("
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
invoke-virtual {v1}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ", "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ")"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "MultiDex"
invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->cacheLock:Ljava/nio/channels/FileLock;
invoke-virtual {v0}, Ljava/nio/channels/FileLock;->isValid()Z
move-result v0
if-eqz v0, :cond_2
if-nez p3, :cond_0
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
iget-wide v2, p0, Landroidx/multidex/MultiDexExtractor;->sourceCrc:J
invoke-static {p1, v0, v2, v3, p2}, Landroidx/multidex/MultiDexExtractor;->isModified(Landroid/content/Context;Ljava/io/File;JLjava/lang/String;)Z
move-result v0
if-nez v0, :cond_0
:try_start_0
invoke-direct {p0, p1, p2}, Landroidx/multidex/MultiDexExtractor;->loadExistingExtractions(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;
move-result-object p1
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception p3
const-string v0, "Failed to reload existing extracted secondary dex files, falling back to fresh extraction"
invoke-static {v1, v0, p3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_0
:cond_0
if-eqz p3, :cond_1
const-string p3, "Forced extraction must be performed."
invoke-static {v1, p3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
:cond_1
const-string p3, "Detected that extraction must be performed."
invoke-static {v1, p3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:goto_0
invoke-direct {p0}, Landroidx/multidex/MultiDexExtractor;->performExtractions()Ljava/util/List;
move-result-object p3
iget-object v0, p0, Landroidx/multidex/MultiDexExtractor;->sourceApk:Ljava/io/File;
invoke-static {v0}, Landroidx/multidex/MultiDexExtractor;->getTimeStamp(Ljava/io/File;)J
move-result-wide v4
iget-wide v6, p0, Landroidx/multidex/MultiDexExtractor;->sourceCrc:J
move-object v2, p1
move-object v3, p2
move-object v8, p3
invoke-static/range {v2 .. v8}, Landroidx/multidex/MultiDexExtractor;->putStoredApkInfo(Landroid/content/Context;Ljava/lang/String;JJLjava/util/List;)V
move-object p1, p3
:goto_1
new-instance p2, Ljava/lang/StringBuilder;
const-string p3, "load found "
invoke-direct {p2, p3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-interface {p1}, Ljava/util/List;->size()I
move-result p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string p3, " secondary dex files"
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-static {v1, p2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
return-object p1
:cond_2
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "MultiDexExtractor was closed"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method