454 lines
11 KiB
Smali
454 lines
11 KiB
Smali
.class public final Lcom/facebook/soloader/SoLoader$a;
|
|
.super Ljava/lang/Object;
|
|
.source "SoLoader.java"
|
|
|
|
# interfaces
|
|
.implements Lf/g/m/k;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingMethod;
|
|
value = Lcom/facebook/soloader/SoLoader;->d(Lf/g/m/k;)V
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x9
|
|
name = null
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final synthetic a:Z
|
|
|
|
.field public final synthetic b:Ljava/lang/String;
|
|
|
|
.field public final synthetic c:Ljava/lang/String;
|
|
|
|
.field public final synthetic d:Ljava/lang/Runtime;
|
|
|
|
.field public final synthetic e:Ljava/lang/reflect/Method;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/Runtime;Ljava/lang/reflect/Method;)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Lcom/facebook/soloader/SoLoader$a;->a:Z
|
|
|
|
iput-object p2, p0, Lcom/facebook/soloader/SoLoader$a;->b:Ljava/lang/String;
|
|
|
|
iput-object p3, p0, Lcom/facebook/soloader/SoLoader$a;->c:Ljava/lang/String;
|
|
|
|
iput-object p4, p0, Lcom/facebook/soloader/SoLoader$a;->d:Ljava/lang/Runtime;
|
|
|
|
iput-object p5, p0, Lcom/facebook/soloader/SoLoader$a;->e:Ljava/lang/reflect/Method;
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 6
|
|
|
|
:try_start_0
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p1, "MD5"
|
|
|
|
invoke-static {p1}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v1, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v1, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/16 v0, 0x1000
|
|
|
|
:try_start_1
|
|
new-array v0, v0, [B
|
|
|
|
:goto_0
|
|
invoke-virtual {v1, v0}, Ljava/io/InputStream;->read([B)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-lez v2, :cond_0
|
|
|
|
invoke-virtual {p1, v0, v3, v2}, Ljava/security/MessageDigest;->update([BII)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v0, "%32x"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v4, v2, [Ljava/lang/Object;
|
|
|
|
new-instance v5, Ljava/math/BigInteger;
|
|
|
|
invoke-virtual {p1}, Ljava/security/MessageDigest;->digest()[B
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v5, v2, p1}, Ljava/math/BigInteger;-><init>(I[B)V
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
invoke-static {v0, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
|
|
:try_end_2
|
|
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2
|
|
.catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_1
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_3
|
|
throw p1
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
:try_start_4
|
|
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_2
|
|
move-exception v1
|
|
|
|
:try_start_5
|
|
invoke-virtual {p1, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:goto_1
|
|
throw v0
|
|
:try_end_5
|
|
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2
|
|
.catch Ljava/lang/SecurityException; {:try_start_5 .. :try_end_5} :catch_1
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_5 .. :try_end_5} :catch_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-virtual {p1}, Ljava/security/NoSuchAlgorithmException;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_2
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/SecurityException;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_2
|
|
|
|
:catch_2
|
|
move-exception p1
|
|
|
|
invoke-virtual {p1}, Ljava/io/IOException;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_2
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public b(Ljava/lang/String;I)V
|
|
.locals 8
|
|
|
|
iget-boolean v0, p0, Lcom/facebook/soloader/SoLoader$a;->a:Z
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
const/4 v0, 0x4
|
|
|
|
and-int/2addr p2, v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-ne p2, v0, :cond_0
|
|
|
|
const/4 p2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p2, 0x0
|
|
|
|
:goto_0
|
|
if-eqz p2, :cond_1
|
|
|
|
iget-object p2, p0, Lcom/facebook/soloader/SoLoader$a;->b:Ljava/lang/String;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object p2, p0, Lcom/facebook/soloader/SoLoader$a;->c:Ljava/lang/String;
|
|
|
|
:goto_1
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v3, p0, Lcom/facebook/soloader/SoLoader$a;->d:Ljava/lang/Runtime;
|
|
|
|
monitor-enter v3
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_5
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_4
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_3
|
|
|
|
:try_start_1
|
|
iget-object v4, p0, Lcom/facebook/soloader/SoLoader$a;->e:Ljava/lang/reflect/Method;
|
|
|
|
iget-object v5, p0, Lcom/facebook/soloader/SoLoader$a;->d:Ljava/lang/Runtime;
|
|
|
|
const/4 v6, 0x3
|
|
|
|
new-array v6, v6, [Ljava/lang/Object;
|
|
|
|
aput-object p1, v6, v2
|
|
|
|
const-class v2, Lcom/facebook/soloader/SoLoader;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v6, v1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
aput-object p2, v6, v1
|
|
|
|
invoke-virtual {v4, v5, v6}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
:try_start_2
|
|
monitor-exit v3
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
const-string v0, "SoLoader"
|
|
|
|
const-string v2, "Error when loading lib: "
|
|
|
|
const-string v3, " lib hash: "
|
|
|
|
invoke-static {v2, v1, v3}, Lf/e/b/a/a;->J(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/facebook/soloader/SoLoader$a;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " search path is "
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto/16 :goto_6
|
|
|
|
:cond_2
|
|
:try_start_3
|
|
new-instance v0, Ljava/lang/UnsatisfiedLinkError;
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/UnsatisfiedLinkError;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
move-object v2, p0
|
|
|
|
move-object v7, v1
|
|
|
|
move-object v1, v0
|
|
|
|
move-object v0, v7
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_1
|
|
move-exception v1
|
|
|
|
move-object v2, p0
|
|
|
|
:goto_2
|
|
:try_start_4
|
|
monitor-exit v3
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
:try_start_5
|
|
throw v1
|
|
:try_end_5
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_5 .. :try_end_5} :catch_2
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_5 .. :try_end_5} :catch_1
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_5 .. :try_end_5} :catch_0
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_4
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
goto :goto_4
|
|
|
|
:catch_1
|
|
move-exception v1
|
|
|
|
goto :goto_4
|
|
|
|
:catch_2
|
|
move-exception v1
|
|
|
|
goto :goto_4
|
|
|
|
:catchall_2
|
|
move-exception v1
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_3
|
|
move-exception v1
|
|
|
|
move-object v2, p0
|
|
|
|
goto :goto_5
|
|
|
|
:catch_3
|
|
move-exception v1
|
|
|
|
goto :goto_3
|
|
|
|
:catch_4
|
|
move-exception v1
|
|
|
|
goto :goto_3
|
|
|
|
:catch_5
|
|
move-exception v1
|
|
|
|
:goto_3
|
|
move-object v2, p0
|
|
|
|
:goto_4
|
|
:try_start_6
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "Error: Cannot load "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v3, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {v3, v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw v3
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_4
|
|
|
|
:catchall_4
|
|
move-exception v1
|
|
|
|
:goto_5
|
|
if-eqz v0, :cond_3
|
|
|
|
const-string v3, "SoLoader"
|
|
|
|
const-string v4, "Error when loading lib: "
|
|
|
|
const-string v5, " lib hash: "
|
|
|
|
invoke-static {v4, v0, v5}, Lf/e/b/a/a;->J(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, p1}, Lcom/facebook/soloader/SoLoader$a;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " search path is "
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
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 p1
|
|
|
|
invoke-static {v3, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_3
|
|
throw v1
|
|
|
|
:cond_4
|
|
invoke-static {p1}, Ljava/lang/System;->load(Ljava/lang/String;)V
|
|
|
|
:cond_5
|
|
:goto_6
|
|
return-void
|
|
.end method
|