2019-02-04 20:08:30 +00:00
|
|
|
.class public Lcom/facebook/soloader/c;
|
|
|
|
.super Lcom/facebook/soloader/i;
|
2019-02-04 20:29:01 +00:00
|
|
|
.source "DirectorySoSource.java"
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-05-16 22:41:35 +00:00
|
|
|
.field protected final Wd:Ljava/io/File;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
.field protected final flags:I
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Ljava/io/File;I)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/facebook/soloader/i;-><init>()V
|
|
|
|
|
2019-05-16 22:41:35 +00:00
|
|
|
iput-object p1, p0, Lcom/facebook/soloader/c;->Wd:Ljava/io/File;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
iput p2, p0, Lcom/facebook/soloader/c;->flags:I
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private static a(Ljava/io/File;ILandroid/os/StrictMode$ThreadPolicy;)V
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/io/IOException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-static {p0}, Lcom/facebook/soloader/c;->p(Ljava/io/File;)[Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-string v1, "Loading lib dependencies: "
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-static {p0}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
move-result-object v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "SoLoader"
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
array-length v1, p0
|
|
|
|
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
|
|
|
|
aget-object v1, p0, v0
|
|
|
|
|
|
|
|
const-string v2, "/"
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
or-int/lit8 v2, p1, 0x1
|
|
|
|
|
|
|
|
invoke-static {v1, v2, p2}, Lcom/facebook/soloader/SoLoader;->b(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private static p(Ljava/io/File;)[Ljava/lang/String;
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/io/IOException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2019-05-16 22:41:35 +00:00
|
|
|
sget-boolean v0, Lcom/facebook/soloader/SoLoader;->Wq:Z
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v1, "SoLoader.getElfDependencies["
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Ljava/io/File;->getName()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
|
|
|
|
|
2019-04-25 10:39:51 +00:00
|
|
|
invoke-static {v0}, Lcom/facebook/soloader/Api18TraceUtils;->aA(Ljava/lang/String;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
:try_start_0
|
|
|
|
invoke-static {p0}, Lcom/facebook/soloader/g;->r(Ljava/io/File;)[Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
:try_end_0
|
|
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
|
2019-05-16 22:41:35 +00:00
|
|
|
sget-boolean v0, Lcom/facebook/soloader/SoLoader;->Wq:Z
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-static {}, Lcom/facebook/soloader/Api18TraceUtils;->endSection()V
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:catchall_0
|
|
|
|
move-exception p0
|
|
|
|
|
2019-05-16 22:41:35 +00:00
|
|
|
sget-boolean v0, Lcom/facebook/soloader/SoLoader;->Wq:Z
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
invoke-static {}, Lcom/facebook/soloader/Api18TraceUtils;->endSection()V
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
throw p0
|
|
|
|
.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
|
|
|
|
|
2019-05-16 22:41:35 +00:00
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/c;->Wd:Ljava/io/File;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0, p1, p2, v0, p3}, Lcom/facebook/soloader/c;->a(Ljava/lang/String;ILjava/io/File;Landroid/os/StrictMode$ThreadPolicy;)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method protected final a(Ljava/lang/String;ILjava/io/File;Landroid/os/StrictMode$ThreadPolicy;)I
|
|
|
|
.locals 4
|
|
|
|
.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
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-string v2, "SoLoader"
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
if-nez v1, :cond_0
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const-string p1, " not found on "
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-virtual {p3}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_0
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const-string v3, " found on "
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-virtual {p3}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v2, p3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
and-int/lit8 p3, p2, 0x1
|
|
|
|
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
|
|
|
|
iget p3, p0, Lcom/facebook/soloader/c;->flags:I
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
and-int/2addr p3, v1
|
|
|
|
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const-string p1, " loaded implicitly"
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
return v1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget p3, p0, Lcom/facebook/soloader/c;->flags:I
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
and-int/2addr p3, v1
|
|
|
|
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
|
|
|
|
invoke-static {v0, p2, p4}, Lcom/facebook/soloader/c;->a(Ljava/io/File;ILandroid/os/StrictMode$ThreadPolicy;)V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-string p3, "Not resolving dependencies for "
|
|
|
|
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:goto_0
|
|
|
|
:try_start_0
|
2019-05-16 22:41:35 +00:00
|
|
|
sget-object p1, Lcom/facebook/soloader/SoLoader;->Wr:Lcom/facebook/soloader/h;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
invoke-interface {p1, p3, p2}, Lcom/facebook/soloader/h;->g(Ljava/lang/String;I)V
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :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_3
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-string p1, "Corrupted lib file detected"
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-static {v2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x3
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
:try_start_0
|
2019-05-16 22:41:35 +00:00
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/c;->Wd:Ljava/io/File;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
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
|
2019-05-16 22:41:35 +00:00
|
|
|
iget-object v0, p0, Lcom/facebook/soloader/c;->Wd:Ljava/io/File;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
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, Lcom/facebook/soloader/c;->flags: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
|