.class public Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; .super Ljava/lang/Object; # static fields .field public static final BUGLY_SWITCH_FILE_NAME:Ljava/lang/String; = "bugly_switch.txt" .field public static final COOKIE_SWITCH_FILE_NAME:Ljava/lang/String; = "cookie_switch.txt" .field public static final SP_KEY_COOKIE_DB_VERSION:Ljava/lang/String; = "cookie_db_version" .field public static final SP_NAME_FOR_COOKIE:Ljava/lang/String; = "cookie_compatiable" .field public static final SWITCH_BYTE_COOKIE:I = 0x1 .field public static final USEX5_FILE_NAME:Ljava/lang/String; = "usex5.txt" .field private static b:Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; # instance fields .field private a:Z # direct methods .method private constructor ()V .locals 0 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static getInstance()Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; .locals 2 sget-object v0, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->b:Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; if-nez v0, :cond_1 const-class v0, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; monitor-enter v0 :try_start_0 sget-object v1, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->b:Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; if-nez v1, :cond_0 new-instance v1, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; invoke-direct {v1}, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->()V sput-object v1, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->b:Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; :cond_0 monitor-exit v0 goto :goto_0 :catchall_0 move-exception v1 monitor-exit v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v1 :cond_1 :goto_0 sget-object v0, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->b:Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager; return-object v0 .end method # virtual methods .method public declared-synchronized canUseFunction(Landroid/content/Context;Ljava/lang/String;)Z .locals 1 monitor-enter p0 :try_start_0 new-instance v0, Ljava/io/File; invoke-virtual {p1}, Landroid/content/Context;->getFilesDir()Ljava/io/File; move-result-object p1 invoke-direct {v0, p1, p2}, Ljava/io/File;->(Ljava/io/File;Ljava/lang/String;)V invoke-virtual {v0}, Ljava/io/File;->exists()Z move-result p1 if-eqz p1, :cond_0 invoke-virtual {v0}, Ljava/io/File;->isFile()Z move-result p1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz p1, :cond_0 const/4 p1, 0x1 :goto_0 monitor-exit p0 return p1 :cond_0 const/4 p1, 0x0 goto :goto_0 :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method .method public declared-synchronized getRomCookieDBVersion(Landroid/content/Context;)I .locals 2 monitor-enter p0 :try_start_0 sget v0, Landroid/os/Build$VERSION;->SDK_INT:I const/16 v1, 0xb if-lt v0, v1, :cond_0 const-string v0, "cookie_compatiable" const/4 v1, 0x4 invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences; move-result-object p1 goto :goto_0 :cond_0 const-string v0, "cookie_compatiable" const/4 v1, 0x0 invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences; move-result-object p1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 :goto_0 const/4 v0, -0x1 if-nez p1, :cond_1 monitor-exit p0 return v0 :cond_1 :try_start_1 const-string v1, "cookie_db_version" invoke-interface {p1, v1, v0}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I move-result p1 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 monitor-exit p0 return p1 :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method .method public declared-synchronized initTbsBuglyIfNeed(Landroid/content/Context;)V .locals 12 monitor-enter p0 :try_start_0 iget-boolean v0, p0, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->a:Z :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v0, :cond_0 monitor-exit p0 return-void :cond_0 :try_start_1 const-string v0, "bugly_switch.txt" invoke-virtual {p0, p1, v0}, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->canUseFunction(Landroid/content/Context;Ljava/lang/String;)Z move-result v0 if-nez v0, :cond_1 const-string p1, "TbsExtensionFunMana" const-string v0, "bugly is forbiden!!" invoke-static {p1, v0}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 monitor-exit p0 return-void :cond_1 :try_start_2 invoke-static {p1}, Lcom/tencent/smtt/sdk/TbsShareManager;->isThirdPartyApp(Landroid/content/Context;)Z move-result v0 if-eqz v0, :cond_2 invoke-static {p1}, Lcom/tencent/smtt/sdk/TbsShareManager;->c(Landroid/content/Context;)Ljava/lang/String; move-result-object v0 goto :goto_0 :cond_2 invoke-static {}, Lcom/tencent/smtt/sdk/am;->a()Lcom/tencent/smtt/sdk/am; move-result-object v0 invoke-virtual {v0, p1}, Lcom/tencent/smtt/sdk/am;->o(Landroid/content/Context;)Ljava/io/File; move-result-object v0 if-nez v0, :cond_3 const-string v1, "TbsExtensionFunMana" const-string v2, "getTbsCoreShareDir is null" invoke-static {v1, v2}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :cond_3 invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object v1 if-eqz v1, :cond_7 invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object v1 array-length v1, v1 if-gtz v1, :cond_4 goto/16 :goto_1 :cond_4 invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String; move-result-object v0 :goto_0 invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v1 if-eqz v1, :cond_5 const-string p1, "TbsExtensionFunMana" const-string v0, "bugly init ,corePath is null" invoke-static {p1, v0}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 monitor-exit p0 return-void :cond_5 :try_start_3 invoke-static {}, Lcom/tencent/smtt/sdk/am;->a()Lcom/tencent/smtt/sdk/am; move-result-object v1 invoke-virtual {v1, p1}, Lcom/tencent/smtt/sdk/am;->o(Landroid/content/Context;)Ljava/io/File; move-result-object v1 if-nez v1, :cond_6 const-string p1, "TbsExtensionFunMana" const-string v0, "bugly init ,optDir is null" invoke-static {p1, v0}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 monitor-exit p0 return-void :cond_6 :try_start_4 new-instance v2, Ljava/io/File; const-string v3, "tbs_bugly_dex.jar" invoke-direct {v2, v0, v3}, Ljava/io/File;->(Ljava/lang/String;Ljava/lang/String;)V :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_0 :try_start_5 new-instance v3, Lcom/tencent/smtt/export/external/DexLoader; invoke-virtual {v2}, Ljava/io/File;->getParent()Ljava/lang/String; move-result-object v5 const/4 v10, 0x1 new-array v7, v10, [Ljava/lang/String; invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String; move-result-object v2 const/4 v11, 0x0 aput-object v2, v7, v11 invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String; move-result-object v8 const/4 v9, 0x0 move-object v4, v3 move-object v6, p1 invoke-direct/range {v4 .. v9}, Lcom/tencent/smtt/export/external/DexLoader;->(Ljava/lang/String;Landroid/content/Context;[Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V const-string v1, "com.tencent.smtt.tbs.bugly.TBSBuglyManager" invoke-virtual {v3, v1}, Lcom/tencent/smtt/export/external/DexLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class; move-result-object v1 const-string v2, "initBugly" const/4 v3, 0x4 new-array v4, v3, [Ljava/lang/Class; const-class v5, Landroid/content/Context; aput-object v5, v4, v11 const-class v5, Ljava/lang/String; aput-object v5, v4, v10 const-class v5, Ljava/lang/String; const/4 v6, 0x2 aput-object v5, v4, v6 const-class v5, Ljava/lang/String; const/4 v7, 0x3 aput-object v5, v4, v7 new-array v3, v3, [Ljava/lang/Object; aput-object p1, v3, v11 aput-object v0, v3, v10 invoke-static {p1}, Lcom/tencent/smtt/sdk/WebView;->getTbsSDKVersion(Landroid/content/Context;)I move-result v0 invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String; move-result-object v0 aput-object v0, v3, v6 invoke-static {p1}, Lcom/tencent/smtt/sdk/WebView;->getTbsCoreVersion(Landroid/content/Context;)I move-result p1 invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String; move-result-object p1 aput-object p1, v3, v7 invoke-static {v1, v2, v4, v3}, Lcom/tencent/smtt/utils/v;->a(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object; :try_end_5 .catch Ljava/lang/Throwable; {:try_start_5 .. :try_end_5} :catch_0 .catchall {:try_start_5 .. :try_end_5} :catchall_0 :try_start_6 iput-boolean v10, p0, Lcom/tencent/smtt/sdk/TbsExtensionFunctionManager;->a:Z const-string p1, "TbsExtensionFunMana" const-string v0, "initTbsBuglyIfNeed success!" invoke-static {p1, v0}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_0 monitor-exit p0 return-void :catch_0 move-exception p1 :try_start_7 const-string v0, "TbsExtensionFunMana" new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V const-string v2, "bugly init ,try init bugly failed(need new core):" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-static {p1}, Landroid/util/Log;->getStackTraceString(Ljava/lang/Throwable;)Ljava/lang/String; move-result-object p1 invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-static {v0, p1}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_7 .catchall {:try_start_7 .. :try_end_7} :catchall_0 monitor-exit p0 return-void :cond_7 :goto_1 :try_start_8 const-string p1, "TbsExtensionFunMana" const-string v0, "getTbsCoreShareDir is empty!" invoke-static {p1, v0}, Lcom/tencent/smtt/utils/TbsLog;->i(Ljava/lang/String;Ljava/lang/String;)V :try_end_8 .catchall {:try_start_8 .. :try_end_8} :catchall_0 monitor-exit p0 return-void :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method .method public declared-synchronized setFunctionEnable(Landroid/content/Context;Ljava/lang/String;Z)Z .locals 3 monitor-enter p0 const/4 v0, 0x0 if-nez p1, :cond_0 monitor-exit p0 return v0 :cond_0 :try_start_0 new-instance v1, Ljava/io/File; invoke-virtual {p1}, Landroid/content/Context;->getFilesDir()Ljava/io/File; move-result-object p1 invoke-direct {v1, p1, p2}, Ljava/io/File;->(Ljava/io/File;Ljava/lang/String;)V const/4 p1, 0x1 if-eqz p3, :cond_1 invoke-virtual {v1}, Ljava/io/File;->exists()Z move-result p3 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-nez p3, :cond_3 :try_start_1 invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z move-result p3 :try_end_1 .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0 .catchall {:try_start_1 .. :try_end_1} :catchall_0 if-eqz p3, :cond_3 monitor-exit p0 return p1 :catch_0 move-exception p1 :try_start_2 const-string p3, "TbsExtensionFunMana" new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V const-string v2, "setFunctionEnable,createNewFile fail:" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-static {p3, p2}, Lcom/tencent/smtt/utils/TbsLog;->e(Ljava/lang/String;Ljava/lang/String;)V invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 monitor-exit p0 return v0 :cond_1 :try_start_3 invoke-virtual {v1}, Ljava/io/File;->exists()Z move-result p3 if-eqz p3, :cond_3 invoke-virtual {v1}, Ljava/io/File;->delete()Z move-result p3 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 if-eqz p3, :cond_2 monitor-exit p0 return p1 :cond_2 :try_start_4 const-string p1, "TbsExtensionFunMana" new-instance p3, Ljava/lang/StringBuilder; invoke-direct {p3}, Ljava/lang/StringBuilder;->()V const-string v1, "setFunctionEnable,file.delete fail:" invoke-virtual {p3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-static {p1, p2}, Lcom/tencent/smtt/utils/TbsLog;->e(Ljava/lang/String;Ljava/lang/String;)V :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_0 monitor-exit p0 return v0 :cond_3 monitor-exit p0 return p1 :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method