.class public final Lcom/facebook/ads/internal/util/process/ProcessUtils; .super Ljava/lang/Object; .source "SourceFile" # annotations .annotation build Landroidx/annotation/AnyThread; .end annotation .annotation build Landroidx/annotation/Keep; .end annotation # static fields .field private static sProcessName:Ljava/lang/String; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private static final sRemoteRenderingProcess:Ljava/util/concurrent/atomic/AtomicBoolean; # direct methods .method static constructor ()V .locals 1 .line 24 new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean; invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->()V sput-object v0, Lcom/facebook/ads/internal/util/process/ProcessUtils;->sRemoteRenderingProcess:Ljava/util/concurrent/atomic/AtomicBoolean; return-void .end method .method private constructor ()V .locals 0 .line 27 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static getProcessName(Landroid/content/Context;)Ljava/lang/String; .locals 2 .annotation build Landroidx/annotation/Nullable; .end annotation const-class v0, Lcom/facebook/ads/internal/util/process/ProcessUtils; .line 39 monitor-enter v0 :try_start_0 sget-object v1, Lcom/facebook/ads/internal/util/process/ProcessUtils;->sProcessName:Ljava/lang/String; if-eqz v1, :cond_0 .line 41 monitor-exit v0 return-object v1 :catchall_0 move-exception p0 goto :goto_0 .line 43 :cond_0 monitor-exit v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 sget v0, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v1, 0x1c if-lt v0, v1, :cond_1 .line 46 invoke-static {}, Lcom/facebook/ads/internal/util/process/ProcessUtils;->getProcessNameAPI28()Ljava/lang/String; move-result-object p0 return-object p0 .line 48 :cond_1 invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context; move-result-object p0 .line 49 instance-of v0, p0, Landroid/app/Application; if-eqz v0, :cond_2 .line 50 check-cast p0, Landroid/app/Application; invoke-static {p0}, Lcom/facebook/ads/internal/util/process/ProcessUtils;->getProcessNameViaReflection(Landroid/app/Application;)Ljava/lang/String; move-result-object p0 const-class v0, Lcom/facebook/ads/internal/util/process/ProcessUtils; .line 51 monitor-enter v0 :try_start_1 sput-object p0, Lcom/facebook/ads/internal/util/process/ProcessUtils;->sProcessName:Ljava/lang/String; .line 53 monitor-exit v0 return-object p0 :catchall_1 move-exception p0 .line 54 monitor-exit v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 throw p0 :cond_2 const/4 p0, 0x0 return-object p0 .line 43 :goto_0 :try_start_2 monitor-exit v0 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 throw p0 .end method .method private static getProcessNameAPI28()Ljava/lang/String; .locals 3 .annotation build Landroidx/annotation/Nullable; .end annotation const/4 v0, 0x0 :try_start_0 const-class v1, Landroid/app/Application; const-string v2, "getProcessName" .line 65 invoke-virtual {v1, v2, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 .line 66 invoke-virtual {v1, v0, v0}, 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_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object v1 :catch_0 return-object v0 .end method .method private static getProcessNameViaReflection(Landroid/app/Application;)Ljava/lang/String; .locals 4 .annotation build Landroidx/annotation/Nullable; .end annotation const/4 v0, 0x0 .line 75 :try_start_0 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 const-string v2, "mLoadedApk" invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field; move-result-object v1 const/4 v2, 0x1 .line 76 invoke-virtual {v1, v2}, Ljava/lang/reflect/AccessibleObject;->setAccessible(Z)V .line 77 invoke-virtual {v1, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 .line 79 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 const-string v3, "mActivityThread" invoke-virtual {v1, v3}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field; move-result-object v1 .line 80 invoke-virtual {v1, v2}, Ljava/lang/reflect/AccessibleObject;->setAccessible(Z)V .line 81 invoke-virtual {v1, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 .line 84 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 const-string v2, "getProcessName" invoke-virtual {v1, v2, v0}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; move-result-object v1 .line 85 invoke-virtual {v1, p0, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 check-cast p0, Ljava/lang/String; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p0 :catch_0 return-object v0 .end method .method public static getProcessSpecificName(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String; .locals 2 .line 92 invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String; move-result-object v0 .line 93 invoke-static {p1}, Lcom/facebook/ads/internal/util/process/ProcessUtils;->getProcessName(Landroid/content/Context;)Ljava/lang/String; move-result-object p1 .line 94 invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v1 if-nez v1, :cond_1 invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v0 if-nez v0, :cond_1 const-string v0, ":" .line 97 invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z move-result v1 if-eqz v1, :cond_0 .line 98 invoke-virtual {p1, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String; move-result-object p1 const/4 v0, 0x1 aget-object p1, p1, v0 .line 103 :cond_0 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string p0, "_" invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 :cond_1 return-object p0 .end method .method public static isRemoteRenderingProcess()Z .locals 1 sget-object v0, Lcom/facebook/ads/internal/util/process/ProcessUtils;->sRemoteRenderingProcess:Ljava/util/concurrent/atomic/AtomicBoolean; .line 34 invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z move-result v0 return v0 .end method .method public static setRemoteRenderingProcess(Z)V .locals 1 sget-object v0, Lcom/facebook/ads/internal/util/process/ProcessUtils;->sRemoteRenderingProcess:Ljava/util/concurrent/atomic/AtomicBoolean; .line 30 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V return-void .end method