.class public abstract Lcom/moji/statistics/AbsEventLogWriter; .super Ljava/lang/Object; .source "AbsEventLogWriter.java" # static fields .field public static final FILE_LOCK:Ljava/lang/Object; .field private static final TAG:Ljava/lang/String; = "AbsEventLogWriter" .field public static final USERLOG_FILE_NAME:Ljava/lang/String; = "lla.log" .field public static final USERLOG_ZIP_FILE_NAME:Ljava/lang/String; = "lla.zip" # direct methods .method static constructor ()V .locals 1 .line 23 new-instance v0, Ljava/lang/Object; invoke-direct {v0}, Ljava/lang/Object;->()V sput-object v0, Lcom/moji/statistics/AbsEventLogWriter;->FILE_LOCK:Ljava/lang/Object; return-void .end method .method public constructor ()V .locals 0 .line 19 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method # virtual methods .method abstract checkShouldWriteFile()Z .end method .method public abstract getCache()Ljava/util/Vector; .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/Vector<", "Ljava/lang/String;", ">;" } .end annotation .end method .method public abstract getEventLogPath()Ljava/lang/String; .end method .method public abstract getUploadEventLogPath()Ljava/lang/String; .end method .method public abstract onEvent(Ljava/lang/String;)V .end method .method public writeFile(Ljava/util/List;)Z .locals 7 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/List<", "Ljava/lang/String;", ">;)Z" } .end annotation const/4 v0, 0x1 const/4 v1, 0x0 const/4 v2, 0x0 .line 45 :try_start_0 sget-object v3, Lcom/moji/statistics/AbsEventLogWriter;->FILE_LOCK:Ljava/lang/Object; monitor-enter v3 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_3 .catchall {:try_start_0 .. :try_end_0} :catchall_3 .line 46 :try_start_1 new-instance v4, Ljava/io/File; invoke-virtual {p0}, Lcom/moji/statistics/AbsEventLogWriter;->getEventLogPath()Ljava/lang/String; move-result-object v5 invoke-direct {v4, v5}, Ljava/io/File;->(Ljava/lang/String;)V .line 47 invoke-virtual {v4}, Ljava/io/File;->exists()Z move-result v5 if-nez v5, :cond_0 invoke-virtual {v4}, Ljava/io/File;->mkdirs()Z move-result v5 if-nez v5, :cond_0 const-string p1, "AbsEventLogWriter" const-string v0, "EventLog Path not exist and create new Folder failed" .line 48 invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V .line 49 monitor-exit v3 return v2 .line 51 :cond_0 new-instance v5, Ljava/io/File; const-string v6, "lla.log" invoke-direct {v5, v4, v6}, Ljava/io/File;->(Ljava/io/File;Ljava/lang/String;)V .line 53 invoke-virtual {v5}, Ljava/io/File;->exists()Z move-result v4 if-nez v4, :cond_1 invoke-virtual {v5}, Ljava/io/File;->createNewFile()Z move-result v4 if-nez v4, :cond_1 const-string p1, "AbsEventLogWriter" const-string v0, "EventLog File not exist and create new File failed" .line 54 invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V .line 55 monitor-exit v3 return v2 .line 57 :cond_1 new-instance v4, Ljava/io/FileOutputStream; invoke-direct {v4, v5, v0}, Ljava/io/FileOutputStream;->(Ljava/io/File;Z)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_1 .line 58 :try_start_2 new-instance v5, Ljava/io/OutputStreamWriter; const-string v6, "UTF-8" invoke-direct {v5, v4, v6}, Ljava/io/OutputStreamWriter;->(Ljava/io/OutputStream;Ljava/lang/String;)V :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_2 .line 60 :try_start_3 invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object v1 :goto_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v6 if-eqz v6, :cond_2 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v6 check-cast v6, Ljava/lang/String; .line 61 invoke-virtual {v5, v6}, Ljava/io/OutputStreamWriter;->write(Ljava/lang/String;)V const-string v6, "\n" .line 62 invoke-virtual {v5, v6}, Ljava/io/OutputStreamWriter;->write(Ljava/lang/String;)V goto :goto_0 .line 64 :cond_2 invoke-virtual {v5}, Ljava/io/OutputStreamWriter;->flush()V .line 65 invoke-virtual {v4}, Ljava/io/FileOutputStream;->flush()V .line 66 invoke-interface {p1}, Ljava/util/List;->clear()V .line 68 monitor-exit v3 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 .line 75 :try_start_4 invoke-virtual {v5}, Ljava/io/OutputStreamWriter;->close()V :try_end_4 .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0 goto :goto_1 :catch_0 move-exception p1 const-string v1, "AbsEventLogWriter" .line 77 invoke-static {v1, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V .line 82 :goto_1 :try_start_5 invoke-virtual {v4}, Ljava/io/FileOutputStream;->close()V :try_end_5 .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_1 goto :goto_6 :catch_1 move-exception p1 const-string v1, "AbsEventLogWriter" .line 84 invoke-static {v1, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V goto :goto_6 :catchall_0 move-exception p1 move-object v1, v5 goto :goto_2 :catchall_1 move-exception p1 move-object v4, v1 .line 68 :goto_2 :try_start_6 monitor-exit v3 :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_2 :try_start_7 throw p1 :try_end_7 .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_2 .catchall {:try_start_7 .. :try_end_7} :catchall_4 :catch_2 move-exception p1 goto :goto_3 :catchall_2 move-exception p1 goto :goto_2 :catchall_3 move-exception p1 move-object v4, v1 goto :goto_7 :catch_3 move-exception p1 move-object v4, v1 :goto_3 :try_start_8 const-string v0, "AbsEventLogWriter" .line 70 invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V :try_end_8 .catchall {:try_start_8 .. :try_end_8} :catchall_4 if-eqz v1, :cond_3 .line 75 :try_start_9 invoke-virtual {v1}, Ljava/io/OutputStreamWriter;->close()V :try_end_9 .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_4 goto :goto_4 :catch_4 move-exception p1 const-string v0, "AbsEventLogWriter" .line 77 invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V :cond_3 :goto_4 if-eqz v4, :cond_4 .line 82 :try_start_a invoke-virtual {v4}, Ljava/io/FileOutputStream;->close()V :try_end_a .catch Ljava/lang/Exception; {:try_start_a .. :try_end_a} :catch_5 goto :goto_5 :catch_5 move-exception p1 const-string v0, "AbsEventLogWriter" .line 84 invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V :cond_4 :goto_5 const/4 v0, 0x0 :goto_6 return v0 :catchall_4 move-exception p1 :goto_7 if-eqz v1, :cond_5 .line 75 :try_start_b invoke-virtual {v1}, Ljava/io/OutputStreamWriter;->close()V :try_end_b .catch Ljava/lang/Exception; {:try_start_b .. :try_end_b} :catch_6 goto :goto_8 :catch_6 move-exception v0 const-string v1, "AbsEventLogWriter" .line 77 invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V :cond_5 :goto_8 if-eqz v4, :cond_6 .line 82 :try_start_c invoke-virtual {v4}, Ljava/io/FileOutputStream;->close()V :try_end_c .catch Ljava/lang/Exception; {:try_start_c .. :try_end_c} :catch_7 goto :goto_9 :catch_7 move-exception v0 const-string v1, "AbsEventLogWriter" .line 84 invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V .line 87 :cond_6 :goto_9 throw p1 .end method .method public zip(Ljava/io/File;Ljava/io/File;)Z .locals 0 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 32 invoke-static {p1, p2}, Lcom/moji/tool/FileTool;->b(Ljava/io/File;Ljava/io/File;)Z move-result p1 return p1 .end method