2022-06-10 21:38:30 +09:00

409 lines
9.3 KiB
Smali

.class public final Lcom/appsflyer/internal/an;
.super Ljava/lang/Object;
.source ""
# static fields
.field private static AFInAppEventType:Ljava/lang/String;
# direct methods
.method public static constructor <clinit>()V
.locals 0
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static declared-synchronized AFKeystoreWrapper(Ljava/lang/ref/WeakReference;)Ljava/lang/String;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/ref/WeakReference<",
"Landroid/content/Context;",
">;)",
"Ljava/lang/String;"
}
.end annotation
const-class v0, Lcom/appsflyer/internal/an;
monitor-enter v0
.line 1
:try_start_0
invoke-virtual {p0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object v1
if-nez v1, :cond_0
.line 2
sget-object p0, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit v0
return-object p0
.line 3
:cond_0
:try_start_1
sget-object v1, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
if-nez v1, :cond_4
.line 4
invoke-virtual {p0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object v1
const/4 v2, 0x0
if-nez v1, :cond_1
goto :goto_0
.line 5
:cond_1
invoke-virtual {p0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/content/Context;
invoke-static {v1}, Lcom/appsflyer/internal/ae;->values(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v1
const-string v3, "AF_INSTALLATION"
.line 6
invoke-interface {v1, v3, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
:goto_0
if-eqz v2, :cond_2
.line 7
sput-object v2, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
goto :goto_2
.line 8
:cond_2
:try_start_2
new-instance v1, Ljava/io/File;
invoke-virtual {p0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getFilesDir()Ljava/io/File;
move-result-object v2
const-string v3, "AF_INSTALLATION"
invoke-direct {v1, v2, v3}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
.line 9
invoke-virtual {v1}, Ljava/io/File;->exists()Z
move-result v2
if-nez v2, :cond_3
.line 10
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
.line 11
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v3, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v1, "-"
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
new-instance v1, Ljava/security/SecureRandom;
invoke-direct {v1}, Ljava/security/SecureRandom;-><init>()V
invoke-virtual {v1}, Ljava/util/Random;->nextLong()J
move-result-wide v1
invoke-static {v1, v2}, Ljava/lang/Math;->abs(J)J
move-result-wide v1
invoke-virtual {v3, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
.line 12
sput-object v1, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
goto :goto_1
.line 13
:cond_3
invoke-static {v1}, Lcom/appsflyer/internal/an;->valueOf(Ljava/io/File;)Ljava/lang/String;
move-result-object v2
sput-object v2, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
.line 14
invoke-virtual {v1}, Ljava/io/File;->delete()Z
.line 15
:goto_1
sget-object v1, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
.line 16
invoke-virtual {p0}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/content/Context;
invoke-static {p0}, Lcom/appsflyer/internal/ae;->values(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object p0
.line 17
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const-string v2, "AF_INSTALLATION"
.line 18
invoke-interface {p0, v2, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
.line 19
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
.catchall {:try_start_2 .. :try_end_2} :catchall_0
goto :goto_2
:catch_0
move-exception p0
:try_start_3
const-string v1, "Error getting AF unique ID"
.line 20
invoke-static {v1, p0}, Lcom/appsflyer/AFLogger;->AFInAppEventType(Ljava/lang/String;Ljava/lang/Throwable;)V
.line 21
:goto_2
sget-object p0, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
if-eqz p0, :cond_4
.line 22
invoke-static {}, Lcom/appsflyer/AppsFlyerProperties;->getInstance()Lcom/appsflyer/AppsFlyerProperties;
move-result-object p0
const-string v1, "uid"
sget-object v2, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
invoke-virtual {p0, v1, v2}, Lcom/appsflyer/AppsFlyerProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
.line 23
:cond_4
sget-object p0, Lcom/appsflyer/internal/an;->AFInAppEventType:Ljava/lang/String;
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
monitor-exit v0
return-object p0
:catchall_0
move-exception p0
monitor-exit v0
throw p0
.end method
.method private static valueOf(Ljava/io/File;)Ljava/lang/String;
.locals 6
const-string v0, "Exception while trying to close the InstallationFile"
const/4 v1, 0x0
.line 1
:try_start_0
new-instance v2, Ljava/io/RandomAccessFile;
const-string v3, "r"
invoke-direct {v2, p0, v3}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 2
:try_start_1
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->length()J
move-result-wide v3
long-to-int p0, v3
new-array v1, p0, [B
.line 3
invoke-virtual {v2, v1}, Ljava/io/RandomAccessFile;->readFully([B)V
.line 4
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->close()V
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 5
:try_start_2
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->close()V
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
goto :goto_2
:catch_0
move-exception p0
.line 6
invoke-static {v0, p0}, Lcom/appsflyer/AFLogger;->AFInAppEventType(Ljava/lang/String;Ljava/lang/Throwable;)V
goto :goto_2
:catchall_0
move-exception p0
move-object v1, v2
goto :goto_4
:catch_1
move-exception p0
move-object v5, v2
move-object v2, v1
move-object v1, v5
goto :goto_0
:catchall_1
move-exception p0
goto :goto_4
:catch_2
move-exception p0
move-object v2, v1
:goto_0
:try_start_3
const-string v3, "Exception while reading InstallationFile: "
.line 7
invoke-static {v3, p0}, Lcom/appsflyer/AFLogger;->AFInAppEventType(Ljava/lang/String;Ljava/lang/Throwable;)V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
if-eqz v1, :cond_0
.line 8
:try_start_4
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->close()V
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3
goto :goto_1
:catch_3
move-exception p0
.line 9
invoke-static {v0, p0}, Lcom/appsflyer/AFLogger;->AFInAppEventType(Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_0
:goto_1
move-object v1, v2
.line 10
:goto_2
new-instance p0, Ljava/lang/String;
if-eqz v1, :cond_1
goto :goto_3
:cond_1
const/4 v0, 0x0
new-array v1, v0, [B
:goto_3
invoke-direct {p0, v1}, Ljava/lang/String;-><init>([B)V
return-object p0
:goto_4
if-eqz v1, :cond_2
.line 11
:try_start_5
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->close()V
:try_end_5
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_4
goto :goto_5
:catch_4
move-exception v1
.line 12
invoke-static {v0, v1}, Lcom/appsflyer/AFLogger;->AFInAppEventType(Ljava/lang/String;Ljava/lang/Throwable;)V
.line 13
:cond_2
:goto_5
throw p0
.end method