.class public final Lcom/vungle/ads/internal/util/FileUtility; .super Ljava/lang/Object; .source "SourceFile" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; } .end annotation # static fields .field public static final INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .field private static final TAG:Ljava/lang/String; .field private static final allowedClasses:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Ljava/lang/Class<", "*>;>;" } .end annotation .end field .field private static objectInputStreamProvider:Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; # direct methods .method public static synthetic $r8$lambda$6H65UxlHZlx-b7j_EkrIl2t85kA(Ljava/io/InputStream;)Ljava/io/ObjectInputStream; .locals 0 .line 0 invoke-static {p0}, Lcom/vungle/ads/internal/util/FileUtility;->objectInputStreamProvider$lambda-0(Ljava/io/InputStream;)Ljava/io/ObjectInputStream; move-result-object p0 return-object p0 .end method .method static constructor ()V .locals 3 new-instance v0, Lcom/vungle/ads/internal/util/FileUtility; invoke-direct {v0}, Lcom/vungle/ads/internal/util/FileUtility;->()V sput-object v0, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 25 new-instance v0, Lcom/vungle/ads/internal/util/FileUtility$$ExternalSyntheticLambda0; invoke-direct {v0}, Lcom/vungle/ads/internal/util/FileUtility$$ExternalSyntheticLambda0;->()V sput-object v0, Lcom/vungle/ads/internal/util/FileUtility;->objectInputStreamProvider:Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; const-class v0, Lcom/vungle/ads/internal/util/FileUtility; .line 28 invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String; move-result-object v0 sput-object v0, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; const/4 v0, 0x5 new-array v0, v0, [Ljava/lang/Class; const/4 v1, 0x0 const-class v2, Ljava/util/LinkedHashSet; aput-object v2, v0, v1 const/4 v1, 0x1 const-class v2, Ljava/util/HashSet; aput-object v2, v0, v1 const/4 v1, 0x2 const-class v2, Ljava/util/HashMap; aput-object v2, v0, v1 const/4 v1, 0x3 const-class v2, Ljava/util/ArrayList; aput-object v2, v0, v1 const/4 v1, 0x4 const-class v2, Ljava/io/File; aput-object v2, v0, v1 .line 31 invoke-static {v0}, Lkotlin/collections/CollectionsKt;->listOf([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 sput-object v0, Lcom/vungle/ads/internal/util/FileUtility;->allowedClasses:Ljava/util/List; return-void .end method .method private constructor ()V .locals 0 .line 21 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static final delete(Ljava/io/File;)V .locals 5 const-string v0, "Failed to delete file: " const-string v1, "TAG" if-eqz p0, :cond_2 .line 98 :try_start_0 invoke-virtual {p0}, Ljava/io/File;->exists()Z move-result v2 if-nez v2, :cond_0 goto :goto_2 .line 99 :cond_0 invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z move-result v2 if-eqz v2, :cond_1 .line 100 invoke-static {p0}, Lcom/vungle/ads/internal/util/FileUtility;->deleteContents(Ljava/io/File;)V goto :goto_0 :catch_0 move-exception p0 goto :goto_1 .line 102 :cond_1 :goto_0 invoke-virtual {p0}, Ljava/io/File;->delete()Z move-result v2 if-nez v2, :cond_2 .line 103 sget-object v2, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v3, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v3, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v4, Ljava/lang/StringBuilder; invoke-direct {v4}, Ljava/lang/StringBuilder;->()V invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-virtual {v2, v3, p0}, Lcom/vungle/ads/internal/util/Logger$Companion;->d(Ljava/lang/String;Ljava/lang/String;)I :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_2 .line 106 :goto_1 sget-object v2, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v3, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v3, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p0}, Ljava/lang/Throwable;->getLocalizedMessage()Ljava/lang/String; move-result-object p0 invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-virtual {v2, v3, p0}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :cond_2 :goto_2 return-void .end method .method public static final deleteAndLogIfFailed(Ljava/io/File;)V .locals 5 const-string v0, "file" invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 122 :try_start_0 invoke-virtual {p0}, Ljava/io/File;->toPath()Ljava/nio/file/Path; move-result-object v0 invoke-static {v0}, Ljava/nio/file/Files;->delete(Ljava/nio/file/Path;)V :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception v0 .line 127 sget-object v1, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v2, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; const-string v3, "TAG" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v4, "Cannot delete " invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p0}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object p0 invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-virtual {v1, v2, p0, v0}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :goto_0 return-void .end method .method public static final deleteContents(Ljava/io/File;)V .locals 3 const-string v0, "folder" invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 112 invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object p0 if-nez p0, :cond_0 return-void .line 113 :cond_0 array-length v0, p0 const/4 v1, 0x0 :goto_0 if-ge v1, v0, :cond_1 aget-object v2, p0, v1 .line 114 invoke-static {v2}, Lcom/vungle/ads/internal/util/FileUtility;->delete(Ljava/io/File;)V add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_1 return-void .end method .method public static synthetic getAllowedClasses$vungle_ads_release$annotations()V .locals 0 .annotation build Landroidx/annotation/VisibleForTesting; .end annotation return-void .end method .method private final getIndentString(I)Ljava/lang/String; .locals 3 .line 81 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const/4 v1, 0x0 :goto_0 if-ge v1, p1, :cond_0 const-string v2, "| " .line 83 invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; add-int/lit8 v1, v1, 0x1 goto :goto_0 .line 85 :cond_0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 const-string v0, "sb.toString()" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V return-object p1 .end method .method public static synthetic guessFileName$default(Lcom/vungle/ads/internal/util/FileUtility;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String; .locals 0 and-int/lit8 p3, p3, 0x2 if-eqz p3, :cond_0 const/4 p2, 0x0 .line 229 :cond_0 invoke-virtual {p0, p1, p2}, Lcom/vungle/ads/internal/util/FileUtility;->guessFileName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p0 return-object p0 .end method .method private static final objectInputStreamProvider$lambda-0(Ljava/io/InputStream;)Ljava/io/ObjectInputStream; .locals 2 .line 26 new-instance v0, Lcom/vungle/ads/internal/util/SafeObjectInputStream; sget-object v1, Lcom/vungle/ads/internal/util/FileUtility;->allowedClasses:Ljava/util/List; invoke-direct {v0, p0, v1}, Lcom/vungle/ads/internal/util/SafeObjectInputStream;->(Ljava/io/InputStream;Ljava/util/List;)V return-object v0 .end method .method public static final printDirectoryTree(Ljava/io/File;)V .locals 0 .line 0 return-void .end method .method private final printDirectoryTree(Ljava/io/File;ILjava/lang/StringBuilder;)V .locals 4 if-nez p1, :cond_0 return-void .line 64 :cond_0 invoke-virtual {p1}, Ljava/io/File;->isDirectory()Z move-result v0 if-eqz v0, :cond_4 .line 65 invoke-direct {p0, p2}, Lcom/vungle/ads/internal/util/FileUtility;->getIndentString(I)Ljava/lang/String; move-result-object v0 invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v0, "+--" invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v0, "/\n" invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; .line 66 invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object p1 if-nez p1, :cond_1 return-void .line 67 :cond_1 array-length v0, p1 const/4 v1, 0x0 :goto_0 if-ge v1, v0, :cond_3 aget-object v2, p1, v1 .line 68 invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z move-result v3 if-eqz v3, :cond_2 add-int/lit8 v3, p2, 0x1 .line 69 invoke-direct {p0, v2, v3, p3}, Lcom/vungle/ads/internal/util/FileUtility;->printDirectoryTree(Ljava/io/File;ILjava/lang/StringBuilder;)V goto :goto_1 :cond_2 const-string v3, "file" .line 71 invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V add-int/lit8 v3, p2, 0x1 invoke-direct {p0, v2, v3, p3}, Lcom/vungle/ads/internal/util/FileUtility;->printFile(Ljava/io/File;ILjava/lang/StringBuilder;)V :goto_1 add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_3 return-void .line 64 :cond_4 new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "folder is not a Directory" invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .end method .method private final printFile(Ljava/io/File;ILjava/lang/StringBuilder;)V .locals 0 .line 77 invoke-direct {p0, p2}, Lcom/vungle/ads/internal/util/FileUtility;->getIndentString(I)Ljava/lang/String; move-result-object p2 invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string p2, "+--" invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object p1 invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const/16 p1, 0xa invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; return-void .end method .method public static final readSerializable(Ljava/io/File;)Ljava/lang/Object; .locals 8 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/io/File;", ")TT;" } .end annotation const-string v0, "TAG" const-string v1, "file" invoke-static {p0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 172 invoke-virtual {p0}, Ljava/io/File;->exists()Z move-result v1 const/4 v2, 0x0 if-nez v1, :cond_0 return-object v2 .line 176 :cond_0 :try_start_0 new-instance v1, Ljava/io/FileInputStream; invoke-direct {v1, p0}, Ljava/io/FileInputStream;->(Ljava/io/File;)V :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_8 .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_7 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_6 .catchall {:try_start_0 .. :try_end_0} :catchall_2 :try_start_1 sget-object v3, Lcom/vungle/ads/internal/util/FileUtility;->objectInputStreamProvider:Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; .line 177 invoke-interface {v3, v1}, Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider;->provideObjectInputStream(Ljava/io/InputStream;)Ljava/io/ObjectInputStream; move-result-object v3 :try_end_1 .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_5 .catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_4 .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_3 .catchall {:try_start_1 .. :try_end_1} :catchall_1 .line 178 :try_start_2 invoke-virtual {v3}, Ljava/io/ObjectInputStream;->readObject()Ljava/lang/Object; move-result-object p0 :try_end_2 .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2 .catch Ljava/lang/ClassNotFoundException; {:try_start_2 .. :try_end_2} :catch_1 .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0 .catchall {:try_start_2 .. :try_end_2} :catchall_0 sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 187 invoke-virtual {v0, v3}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 188 invoke-virtual {v0, v1}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V return-object p0 :catchall_0 move-exception p0 move-object v2, v3 goto/16 :goto_5 :catch_0 move-exception v4 goto :goto_0 :catch_1 move-exception v4 goto :goto_2 :catch_2 move-exception v4 goto/16 :goto_3 :catchall_1 move-exception p0 goto/16 :goto_5 :catch_3 move-exception v4 move-object v3, v2 goto :goto_0 :catch_4 move-exception v4 move-object v3, v2 goto :goto_2 :catch_5 move-exception v4 move-object v3, v2 goto :goto_3 :catchall_2 move-exception p0 move-object v1, v2 goto/16 :goto_5 :catch_6 move-exception v4 move-object v1, v2 move-object v3, v1 goto :goto_0 :catch_7 move-exception v4 move-object v1, v2 move-object v3, v1 goto :goto_2 :catch_8 move-exception v4 move-object v1, v2 move-object v3, v1 goto :goto_3 .line 185 :goto_0 :try_start_3 sget-object v5, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v6, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v6, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v7, "cannot read serializable " invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object v4 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-virtual {v5, v6, v0}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 :goto_1 sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 187 invoke-virtual {v0, v3}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 188 invoke-virtual {v0, v1}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V goto :goto_4 .line 182 :goto_2 :try_start_4 sget-object v5, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v6, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v6, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v7, "ClassNotFoundException: " invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object v4 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-virtual {v5, v6, v0}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I goto :goto_1 .line 180 :goto_3 sget-object v5, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v6, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v6, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v7, "IOException: " invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object v4 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-virtual {v5, v6, v0}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_0 goto :goto_1 .line 191 :goto_4 :try_start_5 invoke-static {p0}, Lcom/vungle/ads/internal/util/FileUtility;->delete(Ljava/io/File;)V :try_end_5 .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_9 :catch_9 return-object v2 :goto_5 sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 187 invoke-virtual {v0, v2}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 188 invoke-virtual {v0, v1}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V throw p0 .end method .method public static final writeSerializable(Ljava/io/File;Ljava/io/Serializable;)V .locals 4 const-string v0, "file" invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 144 invoke-virtual {p0}, Ljava/io/File;->exists()Z move-result v0 if-eqz v0, :cond_0 invoke-static {p0}, Lcom/vungle/ads/internal/util/FileUtility;->deleteAndLogIfFailed(Ljava/io/File;)V :cond_0 if-nez p1, :cond_1 return-void :cond_1 const/4 v0, 0x0 .line 149 :try_start_0 new-instance v1, Ljava/io/FileOutputStream; invoke-direct {v1, p0}, Ljava/io/FileOutputStream;->(Ljava/io/File;)V :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2 .catchall {:try_start_0 .. :try_end_0} :catchall_2 .line 150 :try_start_1 new-instance p0, Ljava/io/ObjectOutputStream; invoke-direct {p0, v1}, Ljava/io/ObjectOutputStream;->(Ljava/io/OutputStream;)V :try_end_1 .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 .line 151 :try_start_2 invoke-virtual {p0, p1}, Ljava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V .line 152 invoke-virtual {p0}, Ljava/io/ObjectOutputStream;->reset()V :try_end_2 .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0 .catchall {:try_start_2 .. :try_end_2} :catchall_0 sget-object p1, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 156 invoke-virtual {p1, p0}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 157 invoke-virtual {p1, v1}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V goto :goto_3 :catchall_0 move-exception p1 :goto_0 move-object v0, p0 goto :goto_4 :catch_0 move-exception p1 :goto_1 move-object v0, v1 goto :goto_2 :catchall_1 move-exception p1 goto :goto_4 :catch_1 move-exception p1 move-object p0, v0 goto :goto_1 :catchall_2 move-exception p1 move-object v1, v0 goto :goto_4 :catch_2 move-exception p1 move-object p0, v0 .line 154 :goto_2 :try_start_3 sget-object v1, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v2, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; const-string v3, "TAG" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String; move-result-object p1 invoke-virtual {v1, v2, p1}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_3 sget-object p1, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 156 invoke-virtual {p1, p0}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 157 invoke-virtual {p1, v0}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V :goto_3 return-void :catchall_3 move-exception p1 move-object v1, v0 goto :goto_0 :goto_4 sget-object p0, Lcom/vungle/ads/internal/util/FileUtility;->INSTANCE:Lcom/vungle/ads/internal/util/FileUtility; .line 156 invoke-virtual {p0, v0}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V .line 157 invoke-virtual {p0, v1}, Lcom/vungle/ads/internal/util/FileUtility;->closeQuietly(Ljava/io/Closeable;)V throw p1 .end method # virtual methods .method public final closeQuietly(Ljava/io/Closeable;)V .locals 0 if-eqz p1, :cond_0 .line 133 :try_start_0 invoke-interface {p1}, Ljava/io/Closeable;->close()V :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 :catch_0 :cond_0 return-void .end method .method public final getAllowedClasses$vungle_ads_release()Ljava/util/List; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/List<", "Ljava/lang/Class<", "*>;>;" } .end annotation sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->allowedClasses:Ljava/util/List; return-object v0 .end method .method public final getObjectInputStreamProvider()Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; .locals 1 .annotation build Landroidx/annotation/VisibleForTesting; .end annotation sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->objectInputStreamProvider:Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; return-object v0 .end method .method public final guessFileName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; .locals 1 const-string v0, "url" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const/4 v0, 0x0 .line 230 invoke-static {p1, v0, p2}, Landroid/webkit/URLUtil;->guessFileName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p1 const-string p2, "guessFileName(url, null, ext)" invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V return-object p1 .end method .method public final isValidUrl(Ljava/lang/String;)Z .locals 1 if-eqz p1, :cond_1 .line 211 invoke-interface {p1}, Ljava/lang/CharSequence;->length()I move-result v0 if-nez v0, :cond_0 goto :goto_0 :cond_0 sget-object v0, Lokhttp3/HttpUrl;->Companion:Lokhttp3/HttpUrl$Companion; invoke-virtual {v0, p1}, Lokhttp3/HttpUrl$Companion;->parse(Ljava/lang/String;)Lokhttp3/HttpUrl; move-result-object p1 if-eqz p1, :cond_1 const/4 p1, 0x1 goto :goto_1 :cond_1 :goto_0 const/4 p1, 0x0 :goto_1 return p1 .end method .method public final readString(Ljava/io/File;)Ljava/lang/String; .locals 5 const-string v0, "TAG" const-string v1, "file" invoke-static {p1, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 199 invoke-virtual {p1}, Ljava/io/File;->exists()Z move-result v1 const/4 v2, 0x0 if-nez v1, :cond_0 return-object v2 :cond_0 const/4 v1, 0x1 .line 201 :try_start_0 invoke-static {p1, v2, v1, v2}, Lkotlin/io/FilesKt;->readText$default(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String; move-result-object p1 :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 :catch_0 move-exception p1 .line 205 sget-object v1, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v3, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v4, "cannot read string " invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 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 p1 invoke-virtual {v1, v3, p1}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I goto :goto_0 :catch_1 move-exception p1 .line 203 sget-object v1, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v3, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; invoke-static {v3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v4, "IOException: " invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 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 p1 invoke-virtual {v1, v3, p1}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :goto_0 return-object v2 .end method .method public final setObjectInputStreamProvider(Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider;)V .locals 1 .annotation build Landroidx/annotation/VisibleForTesting; .end annotation const-string v0, "" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V sput-object p1, Lcom/vungle/ads/internal/util/FileUtility;->objectInputStreamProvider:Lcom/vungle/ads/internal/util/FileUtility$ObjectInputStreamProvider; return-void .end method .method public final size(Ljava/io/File;)J .locals 6 const-wide/16 v0, 0x0 if-eqz p1, :cond_4 .line 215 invoke-virtual {p1}, Ljava/io/File;->exists()Z move-result v2 if-nez v2, :cond_0 goto :goto_2 .line 217 :cond_0 invoke-virtual {p1}, Ljava/io/File;->isDirectory()Z move-result v2 if-eqz v2, :cond_3 .line 218 invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object p1 if-eqz p1, :cond_2 .line 219 array-length v2, p1 const/4 v3, 0x0 const/4 v4, 0x1 if-nez v2, :cond_1 move v2, v4 goto :goto_0 :cond_1 move v2, v3 :goto_0 xor-int/2addr v2, v4 if-eqz v2, :cond_2 .line 220 array-length v2, p1 :goto_1 if-ge v3, v2, :cond_2 aget-object v4, p1, v3 .line 221 invoke-virtual {p0, v4}, Lcom/vungle/ads/internal/util/FileUtility;->size(Ljava/io/File;)J move-result-wide v4 add-long/2addr v0, v4 add-int/lit8 v3, v3, 0x1 goto :goto_1 :cond_2 return-wide v0 .line 226 :cond_3 invoke-virtual {p1}, Ljava/io/File;->length()J move-result-wide v0 :cond_4 :goto_2 return-wide v0 .end method .method public final writeString(Ljava/io/File;Ljava/lang/String;)V .locals 2 const-string v0, "file" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V if-nez p2, :cond_0 return-void .line 164 :cond_0 :try_start_0 sget-object v0, Lkotlin/text/Charsets;->UTF_8:Ljava/nio/charset/Charset; invoke-static {p1, p2, v0}, Lkotlin/io/FilesKt;->writeText(Ljava/io/File;Ljava/lang/String;Ljava/nio/charset/Charset;)V :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception p1 .line 166 sget-object p2, Lcom/vungle/ads/internal/util/Logger;->Companion:Lcom/vungle/ads/internal/util/Logger$Companion; sget-object v0, Lcom/vungle/ads/internal/util/FileUtility;->TAG:Ljava/lang/String; const-string v1, "TAG" invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String; move-result-object p1 invoke-virtual {p2, v0, p1}, Lcom/vungle/ads/internal/util/Logger$Companion;->e(Ljava/lang/String;Ljava/lang/String;)I :goto_0 return-void .end method