.class public abstract Lcom/helpshift/util/AssetsUtil; .super Ljava/lang/Object; .source "SourceFile" # direct methods .method public static readAssetFileContents(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String; .locals 5 const-string v0, "" if-nez p0, :cond_0 return-object v0 :cond_0 const/4 v1, 0x0 .line 45 :try_start_0 new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2}, Ljava/lang/StringBuilder;->()V .line 46 invoke-virtual {p0}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager; move-result-object p0 invoke-virtual {p0, p1}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream; move-result-object p0 :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 47 :try_start_1 new-instance p1, Ljava/io/BufferedReader; new-instance v3, Ljava/io/InputStreamReader; invoke-direct {v3, p0}, Ljava/io/InputStreamReader;->(Ljava/io/InputStream;)V invoke-direct {p1, v3}, Ljava/io/BufferedReader;->(Ljava/io/Reader;)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 49 :goto_0 :try_start_2 invoke-virtual {p1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String; move-result-object v1 if-eqz v1, :cond_1 .line 50 invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; goto :goto_0 :catchall_0 move-exception v0 :goto_1 move-object v1, p0 goto :goto_3 :catch_0 move-exception v1 goto :goto_2 .line 52 :cond_1 invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 :try_end_2 .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0 .catchall {:try_start_2 .. :try_end_2} :catchall_0 .line 58 invoke-static {p0}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V .line 59 invoke-static {p1}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V return-object v0 :catchall_1 move-exception v0 move-object p1, v1 goto :goto_1 :catch_1 move-exception p1 move-object v4, v1 move-object v1, p1 move-object p1, v4 goto :goto_2 :catchall_2 move-exception v0 move-object p1, v1 goto :goto_3 :catch_2 move-exception p0 move-object p1, v1 move-object v1, p0 move-object p0, p1 :goto_2 :try_start_3 const-string v2, "astsUtl" const-string v3, "Error in reading the file contents" .line 55 invoke-static {v2, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 .line 58 invoke-static {p0}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V .line 59 invoke-static {p1}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V return-object v0 .line 58 :goto_3 invoke-static {v1}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V .line 59 invoke-static {p1}, Lcom/helpshift/util/Utils;->closeQuietly(Ljava/io/Closeable;)V .line 60 throw v0 .end method .method public static resourceExists(Landroid/content/Context;I)Z .locals 1 const/4 v0, 0x0 if-eqz p0, :cond_0 if-eqz p1, :cond_0 .line 23 :try_start_0 invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object p0 invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getResourceName(I)Ljava/lang/String; move-result-object p0 :try_end_0 .catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0 if-eqz p0, :cond_0 const/4 v0, 0x1 :catch_0 :cond_0 return v0 .end method