1526 lines
42 KiB
Smali
1526 lines
42 KiB
Smali
.class public final Landroidx/multidex/MultiDex;
|
|
.super Ljava/lang/Object;
|
|
.source "MultiDex.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/multidex/MultiDex$V4;,
|
|
Landroidx/multidex/MultiDex$V14;,
|
|
Landroidx/multidex/MultiDex$V19;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final CODE_CACHE_NAME:Ljava/lang/String; = "code_cache"
|
|
|
|
.field private static final CODE_CACHE_SECONDARY_FOLDER_NAME:Ljava/lang/String; = "secondary-dexes"
|
|
|
|
.field private static final IS_VM_MULTIDEX_CAPABLE:Z
|
|
|
|
.field private static final MAX_SUPPORTED_SDK_VERSION:I = 0x14
|
|
|
|
.field private static final MIN_SDK_VERSION:I = 0x4
|
|
|
|
.field private static final NO_KEY_PREFIX:Ljava/lang/String; = ""
|
|
|
|
.field private static final OLD_SECONDARY_FOLDER_NAME:Ljava/lang/String; = "secondary-dexes"
|
|
|
|
.field static final TAG:Ljava/lang/String; = "MultiDex"
|
|
|
|
.field private static final VM_WITH_MULTIDEX_VERSION_MAJOR:I = 0x2
|
|
|
|
.field private static final VM_WITH_MULTIDEX_VERSION_MINOR:I = 0x1
|
|
|
|
.field private static final installedApk:Ljava/util/Set;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Set<",
|
|
"Ljava/io/File;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
sput-object v0, Landroidx/multidex/MultiDex;->installedApk:Ljava/util/Set;
|
|
|
|
const-string v0, "java.vm.version"
|
|
|
|
invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroidx/multidex/MultiDex;->isVMMultidexCapable(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
sput-boolean v0, Landroidx/multidex/MultiDex;->IS_VM_MULTIDEX_CAPABLE:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchFieldException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1}, Landroidx/multidex/MultiDex;->findField(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic access$100(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchFieldException;,
|
|
Ljava/lang/IllegalArgumentException;,
|
|
Ljava/lang/IllegalAccessException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroidx/multidex/MultiDex;->expandFieldArray(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$200(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchMethodException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroidx/multidex/MultiDex;->findMethod(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static clearOldDexDir(Landroid/content/Context;)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/Exception;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getFilesDir()Ljava/io/File;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v1, "secondary-dexes"
|
|
|
|
invoke-direct {v0, p0, v1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_4
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Clearing old secondary dex dir ("
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ")."
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {p0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Failed to list secondary dex dir content ("
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ")."
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
const-string v4, "MultiDex"
|
|
|
|
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 {v3}, 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 {v3}, 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 {v4, v5}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-virtual {v3}, Ljava/io/File;->delete()Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_1
|
|
|
|
const-string v4, "MultiDex"
|
|
|
|
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 {v3}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v4, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-string v4, "MultiDex"
|
|
|
|
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 {v3}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v4, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-virtual {v0}, Ljava/io/File;->delete()Z
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_3
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Failed to delete secondary dex dir "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
const-string p0, "MultiDex"
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Deleted old secondary dex dir "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private static doInstallation(Landroid/content/Context;Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;,
|
|
Ljava/lang/IllegalArgumentException;,
|
|
Ljava/lang/IllegalAccessException;,
|
|
Ljava/lang/NoSuchFieldException;,
|
|
Ljava/lang/reflect/InvocationTargetException;,
|
|
Ljava/lang/NoSuchMethodException;,
|
|
Ljava/lang/SecurityException;,
|
|
Ljava/lang/ClassNotFoundException;,
|
|
Ljava/lang/InstantiationException;
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Landroidx/multidex/MultiDex;->installedApk:Ljava/util/Set;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
sget-object v1, Landroidx/multidex/MultiDex;->installedApk:Ljava/util/Set;
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget-object v1, Landroidx/multidex/MultiDex;->installedApk:Ljava/util/Set;
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x14
|
|
|
|
if-le v1, v2, :cond_1
|
|
|
|
const-string v1, "MultiDex"
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "MultiDex is not guaranteed to work in SDK version "
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ": SDK version higher than 20 should be backed by runtime with built-in multidex capabilty but it\'s not the "
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "case here: java.vm.version=\""
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "java.vm.version"
|
|
|
|
invoke-static {v3}, Ljava/lang/System;->getProperty(Ljava/lang/String;)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-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
invoke-virtual {p0}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v1
|
|
:try_end_1
|
|
.catch Ljava/lang/RuntimeException; {:try_start_1 .. :try_end_1} :catch_4
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
:try_start_2
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string p1, "Context class loader is null. Must be running in test mode. Skip patching."
|
|
|
|
invoke-static {p0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
monitor-exit v0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
:try_start_3
|
|
invoke-static {p0}, Landroidx/multidex/MultiDex;->clearOldDexDir(Landroid/content/Context;)V
|
|
:try_end_3
|
|
.catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_0
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v2
|
|
|
|
:try_start_4
|
|
const-string v3, "MultiDex"
|
|
|
|
const-string v4, "Something went wrong when trying to clear old MultiDex extraction, continuing without cleaning."
|
|
|
|
invoke-static {v3, v4, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:goto_0
|
|
invoke-static {p0, p2, p3}, Landroidx/multidex/MultiDex;->getDexDir(Landroid/content/Context;Ljava/io/File;Ljava/lang/String;)Ljava/io/File;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Landroidx/multidex/MultiDexExtractor;
|
|
|
|
invoke-direct {p3, p1, p2}, Landroidx/multidex/MultiDexExtractor;-><init>(Ljava/io/File;Ljava/io/File;)V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:try_start_5
|
|
invoke-virtual {p3, p0, p4, v2}, Landroidx/multidex/MultiDexExtractor;->load(Landroid/content/Context;Ljava/lang/String;Z)Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
|
|
|
:try_start_6
|
|
invoke-static {v1, p2, v2}, Landroidx/multidex/MultiDex;->installSecondaryDexes(Ljava/lang/ClassLoader;Ljava/io/File;Ljava/util/List;)V
|
|
:try_end_6
|
|
.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception v2
|
|
|
|
if-eqz p5, :cond_4
|
|
|
|
:try_start_7
|
|
const-string p5, "MultiDex"
|
|
|
|
const-string v3, "Failed to install extracted secondary dex files, retrying with forced extraction"
|
|
|
|
invoke-static {p5, v3, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
const/4 p5, 0x1
|
|
|
|
invoke-virtual {p3, p0, p4, p5}, Landroidx/multidex/MultiDexExtractor;->load(Landroid/content/Context;Ljava/lang/String;Z)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v1, p2, p0}, Landroidx/multidex/MultiDex;->installSecondaryDexes(Ljava/lang/ClassLoader;Ljava/io/File;Ljava/util/List;)V
|
|
:try_end_7
|
|
.catchall {:try_start_7 .. :try_end_7} :catchall_0
|
|
|
|
:goto_1
|
|
:try_start_8
|
|
invoke-virtual {p3}, Landroidx/multidex/MultiDexExtractor;->close()V
|
|
:try_end_8
|
|
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_2
|
|
.catchall {:try_start_8 .. :try_end_8} :catchall_1
|
|
|
|
goto :goto_2
|
|
|
|
:catch_2
|
|
move-exception p1
|
|
|
|
:goto_2
|
|
if-nez p1, :cond_3
|
|
|
|
:try_start_9
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
throw p1
|
|
:try_end_9
|
|
.catchall {:try_start_9 .. :try_end_9} :catchall_1
|
|
|
|
:cond_4
|
|
:try_start_a
|
|
throw v2
|
|
:try_end_a
|
|
.catchall {:try_start_a .. :try_end_a} :catchall_0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
:try_start_b
|
|
invoke-virtual {p3}, Landroidx/multidex/MultiDexExtractor;->close()V
|
|
:try_end_b
|
|
.catch Ljava/io/IOException; {:try_start_b .. :try_end_b} :catch_3
|
|
.catchall {:try_start_b .. :try_end_b} :catchall_1
|
|
|
|
:catch_3
|
|
:try_start_c
|
|
throw p0
|
|
|
|
:catch_4
|
|
move-exception p0
|
|
|
|
const-string p1, "MultiDex"
|
|
|
|
const-string p2, "Failure while trying to obtain Context class loader. Must be running in test mode. Skip patching."
|
|
|
|
invoke-static {p1, p2, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_1
|
|
move-exception p0
|
|
|
|
monitor-exit v0
|
|
:try_end_c
|
|
.catchall {:try_start_c .. :try_end_c} :catchall_1
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static expandFieldArray(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchFieldException;,
|
|
Ljava/lang/IllegalArgumentException;,
|
|
Ljava/lang/IllegalAccessException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1}, Landroidx/multidex/MultiDex;->findField(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Ljava/lang/Object;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
|
|
|
|
move-result-object v1
|
|
|
|
array-length v2, v0
|
|
|
|
array-length v3, p2
|
|
|
|
add-int/2addr v2, v3
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [Ljava/lang/Object;
|
|
|
|
array-length v2, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-static {v0, v3, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
array-length v0, v0
|
|
|
|
array-length v2, p2
|
|
|
|
invoke-static {p2, v3, v1, v0, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
invoke-virtual {p1, p0, v1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static findField(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchFieldException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
:try_start_0
|
|
invoke-virtual {v0, p1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/reflect/Field;->isAccessible()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:cond_0
|
|
return-object v1
|
|
|
|
:catch_0
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/NoSuchFieldException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Field "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " not found in "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/NoSuchFieldException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static varargs findMethod(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Object;",
|
|
"Ljava/lang/String;",
|
|
"[",
|
|
"Ljava/lang/Class<",
|
|
"*>;)",
|
|
"Ljava/lang/reflect/Method;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/NoSuchMethodException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
:try_start_0
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/reflect/Method;->isAccessible()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/reflect/Method;->setAccessible(Z)V
|
|
:try_end_0
|
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:cond_0
|
|
return-object v1
|
|
|
|
:catch_0
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/NoSuchMethodException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Method "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " with parameters "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {p2}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " not found in "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/NoSuchMethodException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static getApplicationInfo(Landroid/content/Context;)Landroid/content/pm/ApplicationInfo;
|
|
.locals 2
|
|
|
|
:try_start_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
const-string v0, "MultiDex"
|
|
|
|
const-string v1, "Failure while trying to obtain ApplicationInfo from Context. Must be running in test mode. Skip patching."
|
|
|
|
invoke-static {v0, v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static getDexDir(Landroid/content/Context;Ljava/io/File;Ljava/lang/String;)Ljava/io/File;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
const-string v1, "code_cache"
|
|
|
|
invoke-direct {v0, p1, v1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
:try_start_0
|
|
invoke-static {v0}, Landroidx/multidex/MultiDex;->mkdirChecked(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getFilesDir()Ljava/io/File;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "code_cache"
|
|
|
|
invoke-direct {v0, p0, p1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Landroidx/multidex/MultiDex;->mkdirChecked(Ljava/io/File;)V
|
|
|
|
:goto_0
|
|
new-instance p0, Ljava/io/File;
|
|
|
|
invoke-direct {p0, v0, p2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-static {p0}, Landroidx/multidex/MultiDex;->mkdirChecked(Ljava/io/File;)V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static install(Landroid/content/Context;)V
|
|
.locals 6
|
|
|
|
const-string v0, "MultiDex"
|
|
|
|
const-string v1, "Installing application"
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
sget-boolean v0, Landroidx/multidex/MultiDex;->IS_VM_MULTIDEX_CAPABLE:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string v0, "VM has multidex support, MultiDex support library is disabled."
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-lt v0, v1, :cond_2
|
|
|
|
:try_start_0
|
|
invoke-static {p0}, Landroidx/multidex/MultiDex;->getApplicationInfo(Landroid/content/Context;)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string v0, "No ApplicationInfo available, i.e. running on a test Context: MultiDex support library is disabled."
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
new-instance v1, Ljava/io/File;
|
|
|
|
iget-object v2, v0, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;
|
|
|
|
invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v2, Ljava/io/File;
|
|
|
|
iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->dataDir:Ljava/lang/String;
|
|
|
|
invoke-direct {v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v3, "secondary-dexes"
|
|
|
|
const-string v4, ""
|
|
|
|
const/4 v5, 0x1
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-static/range {v0 .. v5}, Landroidx/multidex/MultiDex;->doInstallation(Landroid/content/Context;Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string v0, "install done"
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
const-string v0, "MultiDex"
|
|
|
|
const-string v1, "MultiDex installation failure"
|
|
|
|
invoke-static {v0, v1, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "MultiDex installation failed ("
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, ")."
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "MultiDex installation failed. SDK "
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " is unsupported. Min SDK version is 4."
|
|
|
|
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-direct {p0, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static installInstrumentation(Landroid/content/Context;Landroid/content/Context;)V
|
|
.locals 14
|
|
|
|
const-string v0, "MultiDex"
|
|
|
|
const-string v1, "Installing instrumentation"
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
sget-boolean v0, Landroidx/multidex/MultiDex;->IS_VM_MULTIDEX_CAPABLE:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string p1, "VM has multidex support, MultiDex support library is disabled."
|
|
|
|
invoke-static {p0, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-lt v0, v1, :cond_3
|
|
|
|
:try_start_0
|
|
invoke-static {p0}, Landroidx/multidex/MultiDex;->getApplicationInfo(Landroid/content/Context;)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string p1, "No ApplicationInfo available for instrumentation, i.e. running on a test Context: MultiDex support library is disabled."
|
|
|
|
invoke-static {p0, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-static {p1}, Landroidx/multidex/MultiDex;->getApplicationInfo(Landroid/content/Context;)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string p1, "No ApplicationInfo available, i.e. running on a test Context: MultiDex support library is disabled."
|
|
|
|
invoke-static {p0, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, "."
|
|
|
|
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
new-instance v10, Ljava/io/File;
|
|
|
|
iget-object p0, v1, Landroid/content/pm/ApplicationInfo;->dataDir:Ljava/lang/String;
|
|
|
|
invoke-direct {v10, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v4, Ljava/io/File;
|
|
|
|
iget-object p0, v0, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;
|
|
|
|
invoke-direct {v4, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "secondary-dexes"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v3, p1
|
|
|
|
move-object v5, v10
|
|
|
|
invoke-static/range {v3 .. v8}, Landroidx/multidex/MultiDex;->doInstallation(Landroid/content/Context;Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)V
|
|
|
|
new-instance v9, Ljava/io/File;
|
|
|
|
iget-object p0, v1, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;
|
|
|
|
invoke-direct {v9, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v11, "secondary-dexes"
|
|
|
|
const-string v12, ""
|
|
|
|
const/4 v13, 0x0
|
|
|
|
move-object v8, p1
|
|
|
|
invoke-static/range {v8 .. v13}, Landroidx/multidex/MultiDex;->doInstallation(Landroid/content/Context;Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-string p0, "MultiDex"
|
|
|
|
const-string p1, "Installation done"
|
|
|
|
invoke-static {p0, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
const-string p1, "MultiDex"
|
|
|
|
const-string v0, "MultiDex installation failure"
|
|
|
|
invoke-static {p1, v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "MultiDex installation failed ("
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, ")."
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/RuntimeException;
|
|
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "MultiDex installation failed. SDK "
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " is unsupported. Min SDK version is 4."
|
|
|
|
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-direct {p0, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static installSecondaryDexes(Ljava/lang/ClassLoader;Ljava/io/File;Ljava/util/List;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/ClassLoader;",
|
|
"Ljava/io/File;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Ljava/io/File;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/IllegalArgumentException;,
|
|
Ljava/lang/IllegalAccessException;,
|
|
Ljava/lang/NoSuchFieldException;,
|
|
Ljava/lang/reflect/InvocationTargetException;,
|
|
Ljava/lang/NoSuchMethodException;,
|
|
Ljava/io/IOException;,
|
|
Ljava/lang/SecurityException;,
|
|
Ljava/lang/ClassNotFoundException;,
|
|
Ljava/lang/InstantiationException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-interface {p2}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x13
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-static {p0, p2, p1}, Landroidx/multidex/MultiDex$V19;->install(Ljava/lang/ClassLoader;Ljava/util/List;Ljava/io/File;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v0, 0xe
|
|
|
|
if-lt p1, v0, :cond_1
|
|
|
|
invoke-static {p0, p2}, Landroidx/multidex/MultiDex$V14;->install(Ljava/lang/ClassLoader;Ljava/util/List;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-static {p0, p2}, Landroidx/multidex/MultiDex$V4;->install(Ljava/lang/ClassLoader;Ljava/util/List;)V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method static isVMMultidexCapable(Ljava/lang/String;)Z
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
const-string v1, "(\\d+)\\.(\\d+)(\\.\\d+)?"
|
|
|
|
invoke-static {v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/util/regex/Matcher;->matches()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:try_start_0
|
|
invoke-virtual {v1, v2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-virtual {v1, v4}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-gt v3, v4, :cond_0
|
|
|
|
if-ne v3, v4, :cond_1
|
|
|
|
if-lez v1, :cond_1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
:catch_0
|
|
:cond_1
|
|
const-string v1, "MultiDex"
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "VM with version "
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const-string p0, " has multidex support"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const-string p0, " does not have multidex support"
|
|
|
|
:goto_0
|
|
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v1, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private static mkdirChecked(Ljava/io/File;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->mkdir()Z
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->getParentFile()Ljava/io/File;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Failed to create dir "
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, 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, ". Parent file is null."
|
|
|
|
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;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Failed to create dir "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ". parent file is a dir "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ", a file "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ", exists "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ", readable "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->canRead()Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ", writable "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->canWrite()Z
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "MultiDex"
|
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:goto_0
|
|
new-instance v0, Ljava/io/IOException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Failed to create directory "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|