apkfuckery/com.discord/smali/com/facebook/soloader/SoLoader.smali

1866 lines
48 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Lcom/facebook/soloader/SoLoader;
.super Ljava/lang/Object;
.source "SoLoader.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/facebook/soloader/SoLoader$Api14Utils;,
Lcom/facebook/soloader/SoLoader$a;
}
.end annotation
.annotation build Ljavax/annotation/concurrent/ThreadSafe;
.end annotation
# static fields
2019-07-29 20:14:17 +00:00
.field private static final YA:Ljava/util/HashSet;
2019-07-25 02:21:43 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/HashSet<",
"Ljava/lang/String;",
">;"
}
2019-07-24 11:27:29 +00:00
.end annotation
.annotation build Ljavax/annotation/concurrent/GuardedBy;
2019-07-25 02:21:43 +00:00
value = "SoLoader.class"
2019-07-24 11:27:29 +00:00
.end annotation
.end field
2019-07-29 20:14:17 +00:00
.field private static final YB:Ljava/util/Map;
2019-07-25 02:21:43 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Ljava/lang/String;",
"Ljava/lang/Object;",
">;"
}
.end annotation
2019-07-24 11:27:29 +00:00
2019-07-25 02:21:43 +00:00
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "SoLoader.class"
2019-07-24 11:27:29 +00:00
.end annotation
.end field
2019-07-29 20:14:17 +00:00
.field private static final YC:Ljava/util/Set;
2019-07-25 02:21:43 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
2019-07-24 11:27:29 +00:00
2019-07-29 20:14:17 +00:00
.field private static YD:Lcom/facebook/soloader/j;
2019-07-24 11:27:29 +00:00
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
2019-07-25 02:21:43 +00:00
.end field
2019-07-24 11:27:29 +00:00
2019-07-29 20:14:17 +00:00
.field private static YE:I
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "sSoSourcesLock"
.end annotation
.end field
.field static final Yt:Z
.field static Yu:Lcom/facebook/soloader/h;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field private static final Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
.field private static Yw:[Lcom/facebook/soloader/i;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "sSoSourcesLock"
.end annotation
.end field
.field private static Yx:I
.field private static Yy:[Lcom/facebook/soloader/k;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "sSoSourcesLock"
.end annotation
.end field
.field private static Yz:Lcom/facebook/soloader/b;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
2019-07-24 11:27:29 +00:00
.annotation build Ljavax/annotation/concurrent/GuardedBy;
2019-07-25 02:21:43 +00:00
value = "sSoSourcesLock"
2019-07-24 11:27:29 +00:00
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.locals 3
new-instance v0, Ljava/util/concurrent/locks/ReentrantReadWriteLock;
invoke-direct {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;-><init>()V
2019-07-29 20:14:17 +00:00
sput-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
const/4 v0, 0x0
2019-07-29 20:14:17 +00:00
sput-object v0, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
const/4 v1, 0x0
2019-07-29 20:14:17 +00:00
sput v1, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
new-instance v2, Ljava/util/HashSet;
invoke-direct {v2}, Ljava/util/HashSet;-><init>()V
2019-07-29 20:14:17 +00:00
sput-object v2, Lcom/facebook/soloader/SoLoader;->YA:Ljava/util/HashSet;
2019-07-24 11:27:29 +00:00
new-instance v2, Ljava/util/HashMap;
invoke-direct {v2}, Ljava/util/HashMap;-><init>()V
2019-07-29 20:14:17 +00:00
sput-object v2, Lcom/facebook/soloader/SoLoader;->YB:Ljava/util/Map;
2019-07-24 11:27:29 +00:00
new-instance v2, Ljava/util/concurrent/ConcurrentHashMap;
invoke-direct {v2}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
invoke-static {v2}, Ljava/util/Collections;->newSetFromMap(Ljava/util/Map;)Ljava/util/Set;
move-result-object v2
2019-07-29 20:14:17 +00:00
sput-object v2, Lcom/facebook/soloader/SoLoader;->YC:Ljava/util/Set;
2019-07-24 11:27:29 +00:00
2019-07-29 20:14:17 +00:00
sput-object v0, Lcom/facebook/soloader/SoLoader;->YD:Lcom/facebook/soloader/j;
2019-07-24 11:27:29 +00:00
:try_start_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
:try_end_0
.catch Ljava/lang/NoClassDefFoundError; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0
const/16 v2, 0x12
if-lt v0, v2, :cond_0
const/4 v0, 0x1
const/4 v1, 0x1
:catch_0
:cond_0
2019-07-29 20:14:17 +00:00
sput-boolean v1, Lcom/facebook/soloader/SoLoader;->Yt:Z
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static declared-synchronized a(Lcom/facebook/soloader/h;)V
.locals 10
.param p0 # Lcom/facebook/soloader/h;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
const-class p0, Lcom/facebook/soloader/SoLoader;
monitor-enter p0
:try_start_0
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v4
2019-07-29 20:14:17 +00:00
invoke-static {}, Lcom/facebook/soloader/SoLoader;->kj()Ljava/lang/reflect/Method;
2019-07-24 11:27:29 +00:00
move-result-object v5
const/4 v0, 0x0
if-eqz v5, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
const/4 v2, 0x0
if-eqz v1, :cond_1
2019-07-29 20:14:17 +00:00
invoke-static {}, Lcom/facebook/soloader/SoLoader$Api14Utils;->kk()Ljava/lang/String;
2019-07-24 11:27:29 +00:00
move-result-object v3
goto :goto_1
:cond_1
move-object v3, v2
:goto_1
if-nez v3, :cond_2
move-object v6, v2
goto :goto_3
:cond_2
const-string v2, ":"
invoke-virtual {v3, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v2
new-instance v6, Ljava/util/ArrayList;
array-length v7, v2
invoke-direct {v6, v7}, Ljava/util/ArrayList;-><init>(I)V
array-length v7, v2
:goto_2
if-ge v0, v7, :cond_4
aget-object v8, v2, v0
const-string v9, "!"
invoke-virtual {v8, v9}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v9
if-nez v9, :cond_3
invoke-virtual {v6, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_3
add-int/lit8 v0, v0, 0x1
goto :goto_2
:cond_4
const-string v0, ":"
invoke-static {v0, v6}, Landroid/text/TextUtils;->join(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;
move-result-object v0
move-object v6, v0
:goto_3
new-instance v7, Lcom/facebook/soloader/SoLoader$1;
move-object v0, v7
move-object v2, v3
move-object v3, v6
invoke-direct/range {v0 .. v5}, Lcom/facebook/soloader/SoLoader$1;-><init>(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/Runtime;Ljava/lang/reflect/Method;)V
2019-07-29 20:14:17 +00:00
sput-object v7, Lcom/facebook/soloader/SoLoader;->Yu:Lcom/facebook/soloader/h;
2019-07-24 11:27:29 +00:00
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
goto :goto_5
:goto_4
throw v0
:goto_5
goto :goto_4
.end method
.method private static a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)Z
.locals 3
.param p1 # Ljava/lang/String;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.param p4 # Landroid/os/StrictMode$ThreadPolicy;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result p2
const/4 v0, 0x0
if-nez p2, :cond_0
2019-07-29 20:14:17 +00:00
sget-object p2, Lcom/facebook/soloader/SoLoader;->YC:Ljava/util/Set;
2019-07-24 11:27:29 +00:00
invoke-interface {p2, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
move-result p2
if-eqz p2, :cond_0
return v0
:cond_0
const-class p2, Lcom/facebook/soloader/SoLoader;
monitor-enter p2
:try_start_0
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->YA:Ljava/util/HashSet;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1, p0}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1
monitor-exit p2
return v0
:cond_1
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->YB:Ljava/util/Map;
2019-07-24 11:27:29 +00:00
invoke-interface {v1, p0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_2
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->YB:Ljava/util/Map;
2019-07-24 11:27:29 +00:00
invoke-interface {v1, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
goto :goto_0
:cond_2
new-instance v1, Ljava/lang/Object;
invoke-direct {v1}, Ljava/lang/Object;-><init>()V
2019-07-29 20:14:17 +00:00
sget-object v2, Lcom/facebook/soloader/SoLoader;->YB:Ljava/util/Map;
2019-07-24 11:27:29 +00:00
invoke-interface {v2, p0, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:goto_0
monitor-exit p2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_3
monitor-enter v1
:try_start_1
const-class p2, Lcom/facebook/soloader/SoLoader;
monitor-enter p2
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
:try_start_2
2019-07-29 20:14:17 +00:00
sget-object v2, Lcom/facebook/soloader/SoLoader;->YA:Ljava/util/HashSet;
2019-07-24 11:27:29 +00:00
invoke-virtual {v2, p0}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
monitor-exit p2
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
:try_start_3
monitor-exit v1
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_2
return v0
:cond_3
:try_start_4
monitor-exit p2
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_1
:try_start_5
const-string p2, "SoLoader"
const-string v0, "About to load: "
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
invoke-static {p2, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
invoke-static {p0, p3, p4}, Lcom/facebook/soloader/SoLoader;->c(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)V
:try_end_5
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_1
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_5 .. :try_end_5} :catch_0
.catchall {:try_start_5 .. :try_end_5} :catchall_2
:try_start_6
const-class p2, Lcom/facebook/soloader/SoLoader;
monitor-enter p2
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_2
:try_start_7
const-string p3, "SoLoader"
const-string p4, "Loaded: "
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
invoke-virtual {p4, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p4
invoke-static {p3, p4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
2019-07-29 20:14:17 +00:00
sget-object p3, Lcom/facebook/soloader/SoLoader;->YA:Ljava/util/HashSet;
2019-07-24 11:27:29 +00:00
invoke-virtual {p3, p0}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
monitor-exit p2
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_0
:try_start_8
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result p0
if-nez p0, :cond_4
2019-07-29 20:14:17 +00:00
sget-object p0, Lcom/facebook/soloader/SoLoader;->YC:Ljava/util/Set;
2019-07-24 11:27:29 +00:00
invoke-interface {p0, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
:cond_4
monitor-exit v1
:try_end_8
.catchall {:try_start_8 .. :try_end_8} :catchall_2
const/4 p0, 0x1
return p0
:catchall_0
move-exception p0
:try_start_9
monitor-exit p2
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_0
:try_start_a
throw p0
:catch_0
move-exception p0
invoke-virtual {p0}, Ljava/lang/UnsatisfiedLinkError;->getMessage()Ljava/lang/String;
move-result-object p1
if-eqz p1, :cond_5
const-string p2, "unexpected e_machine:"
invoke-virtual {p1, p2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result p1
if-eqz p1, :cond_5
new-instance p1, Lcom/facebook/soloader/SoLoader$a;
invoke-direct {p1, p0}, Lcom/facebook/soloader/SoLoader$a;-><init>(Ljava/lang/Throwable;)V
throw p1
:cond_5
throw p0
:catch_1
move-exception p0
new-instance p1, Ljava/lang/RuntimeException;
invoke-direct {p1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw p1
:try_end_a
.catchall {:try_start_a .. :try_end_a} :catchall_2
:catchall_1
move-exception p0
:try_start_b
monitor-exit p2
:try_end_b
.catchall {:try_start_b .. :try_end_b} :catchall_1
:try_start_c
throw p0
:catchall_2
move-exception p0
monitor-exit v1
:try_end_c
.catchall {:try_start_c .. :try_end_c} :catchall_2
throw p0
:catchall_3
move-exception p0
:try_start_d
monitor-exit p2
:try_end_d
.catchall {:try_start_d .. :try_end_d} :catchall_3
throw p0
.end method
.method public static aD(Ljava/lang/String;)Z
.locals 0
invoke-static {p0}, Lcom/facebook/soloader/SoLoader;->aE(Ljava/lang/String;)Z
move-result p0
return p0
.end method
.method private static aE(Ljava/lang/String;)Z
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/UnsatisfiedLinkError;
}
.end annotation
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->lock()V
:try_start_0
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
if-nez v0, :cond_3
const-string v0, "http://www.android.com/"
const-string v1, "java.vendor.url"
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_1
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->lock()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_2
:try_start_1
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
if-eqz v0, :cond_0
:try_start_2
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_2
goto :goto_0
:cond_0
:try_start_3
new-instance p0, Ljava/lang/RuntimeException;
const-string v0, "SoLoader.init() not yet called"
invoke-direct {p0, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw p0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:catchall_0
move-exception p0
:try_start_4
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
throw p0
:cond_1
const-class v0, Lcom/facebook/soloader/SoLoader;
monitor-enter v0
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_2
:try_start_5
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->YA:Ljava/util/HashSet;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1, p0}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
move-result v1
xor-int/lit8 v1, v1, 0x1
if-eqz v1, :cond_2
2019-07-29 20:14:17 +00:00
sget-object v2, Lcom/facebook/soloader/SoLoader;->YD:Lcom/facebook/soloader/j;
2019-07-24 11:27:29 +00:00
if-nez v2, :cond_2
invoke-static {p0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
:cond_2
monitor-exit v0
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
2019-07-29 20:14:17 +00:00
sget-object p0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {p0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object p0
invoke-virtual {p0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
return v1
:catchall_1
move-exception p0
:try_start_6
monitor-exit v0
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
:try_start_7
throw p0
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_2
:cond_3
:goto_0
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
invoke-static {p0}, Ljava/lang/System;->mapLibraryName(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const/4 v1, 0x2
const/4 v2, 0x0
invoke-static {v0, p0, v2, v1, v2}, Lcom/facebook/soloader/SoLoader;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)Z
move-result p0
return p0
:catchall_2
move-exception p0
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
throw p0
.end method
.method static b(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)V
.locals 1
const/4 v0, 0x0
invoke-static {p0, v0, v0, p1, p2}, Lcom/facebook/soloader/SoLoader;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)Z
return-void
.end method
.method private static c(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)V
.locals 12
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->lock()V
:try_start_0
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_3
const-string v1, "couldn\'t find DSO to load: "
const-string v2, "SoLoader"
if-eqz v0, :cond_15
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
const/4 v0, 0x0
const/4 v3, 0x1
if-nez p2, :cond_0
invoke-static {}, Landroid/os/StrictMode;->allowThreadDiskReads()Landroid/os/StrictMode$ThreadPolicy;
move-result-object p2
const/4 v4, 0x1
goto :goto_0
:cond_0
const/4 v4, 0x0
:goto_0
2019-07-29 20:14:17 +00:00
sget-boolean v5, Lcom/facebook/soloader/SoLoader;->Yt:Z
2019-07-24 11:27:29 +00:00
if-eqz v5, :cond_1
new-instance v5, Ljava/lang/StringBuilder;
const-string v6, "SoLoader.loadLibrary["
invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v5, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v6, "]"
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v5}, Lcom/facebook/soloader/Api18TraceUtils;->aC(Ljava/lang/String;)V
:cond_1
const/4 v5, 0x0
:cond_2
const/4 v6, 0x3
:try_start_1
2019-07-29 20:14:17 +00:00
sget-object v7, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v7}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v7
invoke-virtual {v7}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->lock()V
2019-07-29 20:14:17 +00:00
sget v7, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
:try_end_1
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_2
const/4 v8, 0x0
:goto_1
if-nez v5, :cond_5
:try_start_2
2019-07-29 20:14:17 +00:00
sget-object v9, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
array-length v9, v9
if-ge v8, v9, :cond_5
2019-07-29 20:14:17 +00:00
sget-object v9, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
aget-object v9, v9, v8
invoke-virtual {v9, p0, p1, p2}, Lcom/facebook/soloader/i;->a(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)I
move-result v5
if-ne v5, v6, :cond_4
2019-07-29 20:14:17 +00:00
sget-object v9, Lcom/facebook/soloader/SoLoader;->Yy:[Lcom/facebook/soloader/k;
2019-07-24 11:27:29 +00:00
if-eqz v9, :cond_4
const-string v8, "Trying backup SoSource for "
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v9
invoke-virtual {v8, v9}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v8
invoke-static {v2, v8}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yy:[Lcom/facebook/soloader/k;
2019-07-24 11:27:29 +00:00
array-length v9, v8
const/4 v10, 0x0
:goto_2
if-ge v10, v9, :cond_5
aget-object v11, v8, v10
invoke-virtual {v11, p0}, Lcom/facebook/soloader/k;->aH(Ljava/lang/String;)V
invoke-virtual {v11, p0, p1, p2}, Lcom/facebook/soloader/k;->a(Ljava/lang/String;ILandroid/os/StrictMode$ThreadPolicy;)I
move-result v11
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
if-ne v11, v3, :cond_3
move v5, v11
goto :goto_3
:cond_3
add-int/lit8 v10, v10, 0x1
goto :goto_2
:cond_4
add-int/lit8 v8, v8, 0x1
goto :goto_1
:catchall_0
move-exception p1
:try_start_3
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
throw p1
:cond_5
:goto_3
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object v8
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
and-int/lit8 v8, p1, 0x2
const/4 v9, 0x2
if-ne v8, v9, :cond_8
if-nez v5, :cond_8
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v8
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->lock()V
:try_end_3
.catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_0
.catchall {:try_start_3 .. :try_end_3} :catchall_2
:try_start_4
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yz:Lcom/facebook/soloader/b;
2019-07-24 11:27:29 +00:00
if-eqz v8, :cond_6
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yz:Lcom/facebook/soloader/b;
2019-07-24 11:27:29 +00:00
2019-07-29 20:14:17 +00:00
invoke-virtual {v8}, Lcom/facebook/soloader/b;->kd()Z
2019-07-24 11:27:29 +00:00
move-result v8
if-eqz v8, :cond_6
2019-07-29 20:14:17 +00:00
sget v8, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
add-int/2addr v8, v3
2019-07-29 20:14:17 +00:00
sput v8, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
:cond_6
2019-07-29 20:14:17 +00:00
sget v8, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_1
if-eq v8, v7, :cond_7
const/4 v7, 0x1
goto :goto_4
:cond_7
const/4 v7, 0x0
:goto_4
:try_start_5
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v8
invoke-virtual {v8}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
goto :goto_5
:catchall_1
move-exception p1
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
throw p1
:try_end_5
.catch Ljava/lang/Throwable; {:try_start_5 .. :try_end_5} :catch_0
.catchall {:try_start_5 .. :try_end_5} :catchall_2
:cond_8
const/4 v7, 0x0
:goto_5
if-nez v7, :cond_2
2019-07-29 20:14:17 +00:00
sget-boolean p1, Lcom/facebook/soloader/SoLoader;->Yt:Z
2019-07-24 11:27:29 +00:00
if-eqz p1, :cond_9
invoke-static {}, Lcom/facebook/soloader/Api18TraceUtils;->endSection()V
:cond_9
if-eqz v4, :cond_a
invoke-static {p2}, Landroid/os/StrictMode;->setThreadPolicy(Landroid/os/StrictMode$ThreadPolicy;)V
:cond_a
if-eqz v5, :cond_b
if-eq v5, v6, :cond_b
goto :goto_7
:cond_b
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-static {v2, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
new-instance p1, Ljava/lang/UnsatisfiedLinkError;
invoke-direct {p1, p0}, Ljava/lang/UnsatisfiedLinkError;-><init>(Ljava/lang/String;)V
throw p1
:catchall_2
move-exception p1
2019-07-29 20:14:17 +00:00
sget-boolean v0, Lcom/facebook/soloader/SoLoader;->Yt:Z
2019-07-24 11:27:29 +00:00
if-eqz v0, :cond_c
invoke-static {}, Lcom/facebook/soloader/Api18TraceUtils;->endSection()V
:cond_c
if-eqz v4, :cond_d
invoke-static {p2}, Landroid/os/StrictMode;->setThreadPolicy(Landroid/os/StrictMode$ThreadPolicy;)V
:cond_d
if-eqz v5, :cond_f
if-ne v5, v6, :cond_e
goto :goto_6
:cond_e
throw p1
:cond_f
:goto_6
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-static {v2, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
new-instance p1, Ljava/lang/UnsatisfiedLinkError;
invoke-direct {p1, p0}, Ljava/lang/UnsatisfiedLinkError;-><init>(Ljava/lang/String;)V
throw p1
:catch_0
move-exception p1
2019-07-29 20:14:17 +00:00
sget-boolean v0, Lcom/facebook/soloader/SoLoader;->Yt:Z
2019-07-24 11:27:29 +00:00
if-eqz v0, :cond_10
invoke-static {}, Lcom/facebook/soloader/Api18TraceUtils;->endSection()V
:cond_10
if-eqz v4, :cond_11
invoke-static {p2}, Landroid/os/StrictMode;->setThreadPolicy(Landroid/os/StrictMode$ThreadPolicy;)V
:cond_11
if-eqz v5, :cond_13
if-ne v5, v6, :cond_12
goto :goto_8
:cond_12
:goto_7
return-void
:cond_13
:goto_8
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
move-result-object p2
if-nez p2, :cond_14
invoke-virtual {p1}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object p2
:cond_14
new-instance p1, Ljava/lang/StringBuilder;
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, " caused by: "
invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
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 p0
invoke-static {v2, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
new-instance p1, Ljava/lang/UnsatisfiedLinkError;
invoke-direct {p1, p0}, Ljava/lang/UnsatisfiedLinkError;-><init>(Ljava/lang/String;)V
throw p1
:cond_15
:try_start_6
new-instance p1, Ljava/lang/StringBuilder;
const-string p2, "Could not load: "
invoke-direct {p1, p2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p2, " because no SO source exists"
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 {v2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
new-instance p1, Ljava/lang/UnsatisfiedLinkError;
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/UnsatisfiedLinkError;-><init>(Ljava/lang/String;)V
throw p1
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_3
:catchall_3
move-exception p0
2019-07-29 20:14:17 +00:00
sget-object p1, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->readLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;
move-result-object p1
invoke-virtual {p1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$ReadLock;->unlock()V
goto :goto_a
:goto_9
throw p0
:goto_a
goto :goto_9
.end method
2019-07-29 20:14:17 +00:00
.method private static ki()I
2019-07-24 11:27:29 +00:00
.locals 2
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->lock()V
:try_start_0
2019-07-29 20:14:17 +00:00
sget v0, Lcom/facebook/soloader/SoLoader;->YE:I
2019-07-24 11:27:29 +00:00
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
and-int/lit8 v0, v0, 0x2
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v1
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
return v0
:catchall_0
move-exception v0
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v1
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
throw v0
.end method
2019-07-29 20:14:17 +00:00
.method private static kj()Ljava/lang/reflect/Method;
2019-07-24 11:27:29 +00:00
.locals 7
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/4 v1, 0x0
const/16 v2, 0x17
if-lt v0, v2, :cond_1
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x1b
if-le v0, v2, :cond_0
goto :goto_1
:cond_0
:try_start_0
const-class v0, Ljava/lang/Runtime;
const-string v2, "nativeLoad"
const/4 v3, 0x3
new-array v3, v3, [Ljava/lang/Class;
const/4 v4, 0x0
const-class v5, Ljava/lang/String;
aput-object v5, v3, v4
const-class v4, Ljava/lang/ClassLoader;
const/4 v5, 0x1
aput-object v4, v3, v5
const/4 v4, 0x2
const-class v6, Ljava/lang/String;
aput-object v6, v3, v4
invoke-virtual {v0, v2, v3}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
invoke-virtual {v0, v5}, Ljava/lang/reflect/Method;->setAccessible(Z)V
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
goto :goto_0
:catch_1
move-exception v0
:goto_0
const-string v2, "SoLoader"
const-string v3, "Cannot get nativeLoad method"
invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:cond_1
:goto_1
return-object v1
.end method
.method public static z(Landroid/content/Context;)V
.locals 16
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
move-object/from16 v0, p0
const-string v1, "init exiting"
const-string v2, "SoLoader"
invoke-static {}, Landroid/os/StrictMode;->allowThreadDiskWrites()Landroid/os/StrictMode$ThreadPolicy;
move-result-object v3
const/4 v4, 0x0
:try_start_0
invoke-static {v4}, Lcom/facebook/soloader/SoLoader;->a(Lcom/facebook/soloader/h;)V
2019-07-29 20:14:17 +00:00
sget-object v5, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v5}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v5
invoke-virtual {v5}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->lock()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:try_start_1
2019-07-29 20:14:17 +00:00
sget-object v5, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
if-nez v5, :cond_9
const-string v5, "init start"
invoke-static {v2, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
const/4 v5, 0x0
2019-07-29 20:14:17 +00:00
sput v5, Lcom/facebook/soloader/SoLoader;->YE:I
2019-07-24 11:27:29 +00:00
new-instance v6, Ljava/util/ArrayList;
invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V
const-string v7, "LD_LIBRARY_PATH"
invoke-static {v7}, Ljava/lang/System;->getenv(Ljava/lang/String;)Ljava/lang/String;
move-result-object v7
if-nez v7, :cond_0
const-string v7, "/vendor/lib:/system/lib"
:cond_0
const-string v8, ":"
invoke-virtual {v7, v8}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v7
const/4 v8, 0x0
:goto_0
array-length v9, v7
if-ge v8, v9, :cond_1
new-instance v9, Ljava/lang/StringBuilder;
const-string v10, "adding system library source: "
invoke-direct {v9, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
aget-object v10, v7, v8
invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
invoke-static {v2, v9}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
new-instance v9, Ljava/io/File;
aget-object v10, v7, v8
invoke-direct {v9, v10}, Ljava/io/File;-><init>(Ljava/lang/String;)V
new-instance v10, Lcom/facebook/soloader/c;
const/4 v11, 0x2
invoke-direct {v10, v9, v11}, Lcom/facebook/soloader/c;-><init>(Ljava/io/File;I)V
invoke-virtual {v6, v10}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
add-int/lit8 v8, v8, 0x1
goto :goto_0
:cond_1
const/4 v7, 0x1
if-eqz v0, :cond_7
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v8
iget v9, v8, Landroid/content/pm/ApplicationInfo;->flags:I
and-int/2addr v9, v7
if-eqz v9, :cond_2
iget v8, v8, Landroid/content/pm/ApplicationInfo;->flags:I
and-int/lit16 v8, v8, 0x80
if-nez v8, :cond_2
const/4 v8, 0x1
goto :goto_1
:cond_2
const/4 v8, 0x0
:goto_1
if-eqz v8, :cond_3
const/4 v8, 0x0
goto :goto_3
:cond_3
sget v8, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v9, 0x11
if-gt v8, v9, :cond_4
const/4 v8, 0x1
goto :goto_2
:cond_4
const/4 v8, 0x0
:goto_2
new-instance v9, Lcom/facebook/soloader/b;
invoke-direct {v9, v0, v8}, Lcom/facebook/soloader/b;-><init>(Landroid/content/Context;I)V
2019-07-29 20:14:17 +00:00
sput-object v9, Lcom/facebook/soloader/SoLoader;->Yz:Lcom/facebook/soloader/b;
2019-07-24 11:27:29 +00:00
new-instance v8, Ljava/lang/StringBuilder;
const-string v9, "adding application source: "
invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
2019-07-29 20:14:17 +00:00
sget-object v9, Lcom/facebook/soloader/SoLoader;->Yz:Lcom/facebook/soloader/b;
2019-07-24 11:27:29 +00:00
invoke-virtual {v9}, Lcom/facebook/soloader/b;->toString()Ljava/lang/String;
move-result-object v9
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
invoke-static {v2, v8}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
2019-07-29 20:14:17 +00:00
sget-object v8, Lcom/facebook/soloader/SoLoader;->Yz:Lcom/facebook/soloader/b;
2019-07-24 11:27:29 +00:00
invoke-virtual {v6, v5, v8}, Ljava/util/ArrayList;->add(ILjava/lang/Object;)V
const/4 v8, 0x1
:goto_3
2019-07-29 20:14:17 +00:00
sget v9, Lcom/facebook/soloader/SoLoader;->YE:I
2019-07-24 11:27:29 +00:00
and-int/lit8 v9, v9, 0x8
if-eqz v9, :cond_5
2019-07-29 20:14:17 +00:00
sput-object v4, Lcom/facebook/soloader/SoLoader;->Yy:[Lcom/facebook/soloader/k;
2019-07-24 11:27:29 +00:00
goto/16 :goto_5
:cond_5
new-instance v4, Ljava/io/File;
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v9
iget-object v9, v9, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;
invoke-direct {v4, v9}, Ljava/io/File;-><init>(Ljava/lang/String;)V
new-instance v9, Ljava/util/ArrayList;
invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V
new-instance v10, Lcom/facebook/soloader/a;
const-string v11, "lib-main"
invoke-direct {v10, v0, v4, v11, v8}, Lcom/facebook/soloader/a;-><init>(Landroid/content/Context;Ljava/io/File;Ljava/lang/String;I)V
invoke-virtual {v9, v10}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
new-instance v4, Ljava/lang/StringBuilder;
const-string v11, "adding backup source from : "
invoke-direct {v4, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v10}, Lcom/facebook/soloader/a;->toString()Ljava/lang/String;
move-result-object v10
invoke-virtual {v4, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v2, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
sget v4, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v10, 0x15
if-lt v4, v10, :cond_6
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v4
iget-object v4, v4, Landroid/content/pm/ApplicationInfo;->splitSourceDirs:[Ljava/lang/String;
if-eqz v4, :cond_6
const-string v4, "adding backup sources from split apks"
invoke-static {v2, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v4
iget-object v4, v4, Landroid/content/pm/ApplicationInfo;->splitSourceDirs:[Ljava/lang/String;
array-length v10, v4
const/4 v11, 0x0
const/4 v12, 0x0
:goto_4
if-ge v11, v10, :cond_6
aget-object v13, v4, v11
new-instance v14, Lcom/facebook/soloader/a;
new-instance v15, Ljava/io/File;
invoke-direct {v15, v13}, Ljava/io/File;-><init>(Ljava/lang/String;)V
new-instance v13, Ljava/lang/StringBuilder;
const-string v7, "lib-"
invoke-direct {v13, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
add-int/lit8 v7, v12, 0x1
invoke-virtual {v13, v12}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v12
invoke-direct {v14, v0, v15, v12, v8}, Lcom/facebook/soloader/a;-><init>(Landroid/content/Context;Ljava/io/File;Ljava/lang/String;I)V
new-instance v12, Ljava/lang/StringBuilder;
const-string v13, "adding backup source: "
invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v14}, Lcom/facebook/soloader/a;->toString()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}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual {v9, v14}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
add-int/lit8 v11, v11, 0x1
move v12, v7
const/4 v7, 0x1
goto :goto_4
:cond_6
invoke-virtual {v9}, Ljava/util/ArrayList;->size()I
move-result v0
new-array v0, v0, [Lcom/facebook/soloader/k;
invoke-virtual {v9, v0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object v0
check-cast v0, [Lcom/facebook/soloader/k;
2019-07-29 20:14:17 +00:00
sput-object v0, Lcom/facebook/soloader/SoLoader;->Yy:[Lcom/facebook/soloader/k;
2019-07-24 11:27:29 +00:00
invoke-virtual {v6, v5, v9}, Ljava/util/ArrayList;->addAll(ILjava/util/Collection;)Z
:cond_7
:goto_5
invoke-virtual {v6}, Ljava/util/ArrayList;->size()I
move-result v0
new-array v0, v0, [Lcom/facebook/soloader/i;
invoke-virtual {v6, v0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object v0
check-cast v0, [Lcom/facebook/soloader/i;
2019-07-29 20:14:17 +00:00
invoke-static {}, Lcom/facebook/soloader/SoLoader;->ki()I
2019-07-24 11:27:29 +00:00
move-result v4
array-length v5, v0
:goto_6
add-int/lit8 v6, v5, -0x1
if-lez v5, :cond_8
new-instance v5, Ljava/lang/StringBuilder;
const-string v7, "Preparing SO source: "
invoke-direct {v5, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
aget-object v7, v0, v6
invoke-virtual {v5, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v2, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
aget-object v5, v0, v6
2019-07-25 02:21:43 +00:00
invoke-virtual {v5, v4}, Lcom/facebook/soloader/i;->aJ(I)V
2019-07-24 11:27:29 +00:00
move v5, v6
goto :goto_6
:cond_8
2019-07-29 20:14:17 +00:00
sput-object v0, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
2019-07-29 20:14:17 +00:00
sget v0, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
const/4 v4, 0x1
add-int/2addr v0, v4
2019-07-29 20:14:17 +00:00
sput v0, Lcom/facebook/soloader/SoLoader;->Yx:I
2019-07-24 11:27:29 +00:00
new-instance v0, Ljava/lang/StringBuilder;
const-string v4, "init finish: "
invoke-direct {v0, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
2019-07-29 20:14:17 +00:00
sget-object v4, Lcom/facebook/soloader/SoLoader;->Yw:[Lcom/facebook/soloader/i;
2019-07-24 11:27:29 +00:00
array-length v4, v4
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v4, " SO sources prepared"
invoke-virtual {v0, v4}, 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 {v2, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:cond_9
:try_start_2
invoke-static {v2, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
2019-07-29 20:14:17 +00:00
sget-object v0, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
invoke-static {v3}, Landroid/os/StrictMode;->setThreadPolicy(Landroid/os/StrictMode$ThreadPolicy;)V
return-void
:catchall_0
move-exception v0
:try_start_3
invoke-static {v2, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
2019-07-29 20:14:17 +00:00
sget-object v1, Lcom/facebook/soloader/SoLoader;->Yv:Ljava/util/concurrent/locks/ReentrantReadWriteLock;
2019-07-24 11:27:29 +00:00
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock;->writeLock()Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
move-result-object v1
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;->unlock()V
throw v0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
:catchall_1
move-exception v0
invoke-static {v3}, Landroid/os/StrictMode;->setThreadPolicy(Landroid/os/StrictMode$ThreadPolicy;)V
goto :goto_8
:goto_7
throw v0
:goto_8
goto :goto_7
.end method