396 lines
9.9 KiB
Smali
396 lines
9.9 KiB
Smali
.class public Le/j/m/c;
|
|
.super Le/j/m/j;
|
|
.source "DirectorySoSource.java"
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Ljava/io/File;
|
|
|
|
.field public final b:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/io/File;I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Le/j/m/j;-><init>()V
|
|
|
|
iput-object p1, p0, Le/j/m/c;->a:Ljava/io/File;
|
|
|
|
iput p2, p0, Le/j/m/c;->b:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)I
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Le/j/m/c;->a:Ljava/io/File;
|
|
|
|
invoke-virtual {p0, p1, p2, v0, p3}, Le/j/m/c;->a(Ljava/lang/String;ILjava/io/File;Landroid/os/StrictMode$ThreadPolicy;)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public a(Ljava/lang/String;ILjava/io/File;Landroid/os/StrictMode$ThreadPolicy;)I
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-direct {v0, p3, p1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->exists()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "SoLoader"
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const-string p2, " not found on "
|
|
|
|
invoke-static {p1, p2}, Le/e/b/a/a;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p3}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, 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 {v3, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v2
|
|
|
|
:cond_0
|
|
const-string v1, " found on "
|
|
|
|
invoke-static {p1, v1}, Le/e/b/a/a;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p3}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-static {v3, p3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
and-int/lit8 p3, p2, 0x1
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
iget p3, p0, Le/j/m/c;->b:I
|
|
|
|
const/4 v1, 0x2
|
|
|
|
and-int/2addr p3, v1
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
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 p1, " loaded implicitly"
|
|
|
|
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 {v3, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v1
|
|
|
|
:cond_1
|
|
iget p3, p0, Le/j/m/c;->b:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
and-int/2addr p3, v1
|
|
|
|
if-eqz p3, :cond_6
|
|
|
|
sget-boolean p1, Lcom/facebook/soloader/SoLoader;->a:Z
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const-string p1, "SoLoader.getElfDependencies["
|
|
|
|
invoke-static {p1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p3, "]"
|
|
|
|
invoke-virtual {p1, p3}, 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 {p1}, Landroid/os/Trace;->beginSection(Ljava/lang/String;)V
|
|
|
|
:cond_2
|
|
:try_start_0
|
|
new-instance p1, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {p1, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
invoke-virtual {p1}, Ljava/io/FileInputStream;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-static {p3}, Lp/a/b/b/g/e;->a(Ljava/nio/channels/FileChannel;)[Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-virtual {p1}, Ljava/io/FileInputStream;->close()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
sget-boolean p1, Lcom/facebook/soloader/SoLoader;->a:Z
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-static {}, Landroid/os/Trace;->endSection()V
|
|
|
|
:cond_3
|
|
const-string p1, "Loading lib dependencies: "
|
|
|
|
invoke-static {p1}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p3}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p1, v4}, 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 {v3, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:goto_0
|
|
array-length p1, p3
|
|
|
|
if-ge v2, p1, :cond_7
|
|
|
|
aget-object p1, p3, v2
|
|
|
|
const-string v4, "/"
|
|
|
|
invoke-virtual {p1, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
or-int/lit8 v4, p2, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {p1, v5, v5, v4, p4}, Lcom/facebook/soloader/SoLoader;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p2
|
|
|
|
:try_start_3
|
|
invoke-virtual {p1}, Ljava/io/FileInputStream;->close()V
|
|
|
|
throw p2
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
sget-boolean p2, Lcom/facebook/soloader/SoLoader;->a:Z
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
invoke-static {}, Landroid/os/Trace;->endSection()V
|
|
|
|
:cond_5
|
|
throw p1
|
|
|
|
:cond_6
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p4, "Not resolving dependencies for "
|
|
|
|
invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {v3, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_7
|
|
:try_start_4
|
|
sget-object p1, Lcom/facebook/soloader/SoLoader;->b:Le/j/m/i;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
:try_end_4
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_4 .. :try_end_4} :catch_0
|
|
|
|
check-cast p1, Lcom/facebook/soloader/SoLoader$a;
|
|
|
|
:try_start_5
|
|
invoke-virtual {p1, p3, p2}, Lcom/facebook/soloader/SoLoader$a;->a(Ljava/lang/String;I)V
|
|
:try_end_5
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_5 .. :try_end_5} :catch_0
|
|
|
|
return v1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/UnsatisfiedLinkError;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p3, "bad ELF magic"
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_8
|
|
|
|
const-string p1, "Corrupted lib file detected"
|
|
|
|
invoke-static {v3, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
const/4 p1, 0x3
|
|
|
|
return p1
|
|
|
|
:cond_8
|
|
throw p1
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 3
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Le/j/m/c;->a:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
iget-object v0, p0, Le/j/m/c;->a:Ljava/io/File;
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "[root = "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " flags = "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v0, p0, Le/j/m/c;->b:I
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const/16 v0, 0x5d
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|