PornPluginManager.smali

.class public Lcom/cm/plugincluster/porncheck/PornPluginManager;
.super Ljava/lang/Object;
.source "PornPluginManager.java"

# interfaces
.implements Lcom/cm/plugincluster/porncheck/IPornService;


# static fields
.field private static volatile manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;


# instance fields
.field private final TAG:Ljava/lang/String;

.field private volatile iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 20
    const/4 v0, 0x0

    sput-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    return-void
.end method

.method private constructor <init>()V
    .registers 2

    .prologue
    .line 56
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 19
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    .line 21
    const-string v0, "plugin_porn"

    iput-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->TAG:Ljava/lang/String;

    .line 58
    return-void
.end method

.method public static getManager()Lcom/cm/plugincluster/porncheck/PornPluginManager;
    .registers 2

    .prologue
    .line 26
    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    if-nez v0, :cond_13

    .line 27
    const-class v1, Lcom/cm/plugincluster/vip/interfaces/IVipPluginModule;

    monitor-enter v1

    .line 28
    :try_start_7
    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    if-nez v0, :cond_12

    .line 29
    new-instance v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;

    invoke-direct {v0}, Lcom/cm/plugincluster/porncheck/PornPluginManager;-><init>()V

    sput-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    .line 31
    :cond_12
    monitor-exit v1
    :try_end_13
    .catchall {:try_start_7 .. :try_end_13} :catchall_25

    .line 33
    :cond_13
    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    if-eqz v0, :cond_22

    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    iget-object v0, v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-nez v0, :cond_22

    .line 34
    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    invoke-direct {v0}, Lcom/cm/plugincluster/porncheck/PornPluginManager;->initMoudleDelegate()V

    .line 36
    :cond_22
    sget-object v0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->manager:Lcom/cm/plugincluster/porncheck/PornPluginManager;

    return-object v0

    .line 31
    :catchall_25
    move-exception v0

    :try_start_26
    monitor-exit v1
    :try_end_27
    .catchall {:try_start_26 .. :try_end_27} :catchall_25

    throw v0
.end method

.method private initMoudleDelegate()V
    .registers 4

    .prologue
    .line 40
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-nez v0, :cond_1a

    .line 41
    const-class v1, Lcom/cm/plugincluster/porncheck/PornPluginManager;

    monitor-enter v1

    .line 42
    :try_start_7
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-nez v0, :cond_19

    .line 43
    const v0, 0x258001

    const/4 v2, 0x0

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/cm/plugincluster/spec/CommanderManager;->invokeCommandExpNull(I[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/cm/plugincluster/porncheck/IPornService;

    iput-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    .line 45
    :cond_19
    monitor-exit v1
    :try_end_1a
    .catchall {:try_start_7 .. :try_end_1a} :catchall_26

    .line 48
    :cond_1a
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_29

    .line 49
    const-string v0, "plugin_porn"

    const-string v1, "porn delegate  successfully "

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 54
    :goto_25
    return-void

    .line 45
    :catchall_26
    move-exception v0

    :try_start_27
    monitor-exit v1
    :try_end_28
    .catchall {:try_start_27 .. :try_end_28} :catchall_26

    throw v0

    .line 51
    :cond_29
    const-string v0, "plugin_porn"

    const-string v1, "porn delegate  failed"

    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_25
.end method


# virtual methods
.method public checkPornImage(Ljava/lang/String;)Lcom/cm/plugincluster/porncheck/PornResult;
    .registers 3

    .prologue
    .line 62
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_b

    .line 63
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    invoke-interface {v0, p1}, Lcom/cm/plugincluster/porncheck/IPornService;->checkPornImage(Ljava/lang/String;)Lcom/cm/plugincluster/porncheck/PornResult;

    move-result-object v0

    .line 65
    :goto_a
    return-object v0

    :cond_b
    const/4 v0, 0x0

    goto :goto_a
.end method

.method public isAvailable()Z
    .registers 2

    .prologue
    .line 90
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_6

    const/4 v0, 0x1

    :goto_5
    return v0

    :cond_6
    const/4 v0, 0x0

    goto :goto_5
.end method

.method public jumpToPrivacyAlbum(Landroid/content/Context;Landroid/os/Bundle;)V
    .registers 4

    .prologue
    .line 84
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_9

    .line 85
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    invoke-interface {v0, p1, p2}, Lcom/cm/plugincluster/porncheck/IPornService;->jumpToPrivacyAlbum(Landroid/content/Context;Landroid/os/Bundle;)V

    .line 87
    :cond_9
    return-void
.end method

.method public startScan()V
    .registers 2

    .prologue
    .line 70
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_9

    .line 71
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    invoke-interface {v0}, Lcom/cm/plugincluster/porncheck/IPornService;->startScan()V

    .line 73
    :cond_9
    return-void
.end method

.method public startScan(Landroid/os/Handler$Callback;J)V
    .registers 6

    .prologue
    .line 77
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    if-eqz v0, :cond_9

    .line 78
    iget-object v0, p0, Lcom/cm/plugincluster/porncheck/PornPluginManager;->iPornServiceDelegate:Lcom/cm/plugincluster/porncheck/IPornService;

    invoke-interface {v0, p1, p2, p3}, Lcom/cm/plugincluster/porncheck/IPornService;->startScan(Landroid/os/Handler$Callback;J)V

    .line 80
    :cond_9
    return-void
.end method