SpeechUtility.smali

.class public Lcom/iflytek/cloud/SpeechUtility;
.super Lcom/iflytek/thirdparty/v;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/iflytek/cloud/SpeechUtility$a;,
        Lcom/iflytek/cloud/SpeechUtility$b;
    }
.end annotation


# static fields
.field public static final DEF_ENGINE_MODE:Lcom/iflytek/thirdparty/v$a;

.field public static final TAG_RESOURCE_CONTENT:Ljava/lang/String; = "tag_rescontent"

.field public static final TAG_RESOURCE_RESULT:Ljava/lang/String; = "result"

.field public static final TAG_RESOURCE_RET:Ljava/lang/String; = "ret"

.field private static b:Lcom/iflytek/cloud/SpeechUtility;


# instance fields
.field protected a:Lcom/iflytek/thirdparty/v$a;

.field private c:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/iflytek/speech/SpeechComponent;",
            ">;"
        }
    .end annotation
.end field

.field private d:I

.field private e:Landroid/content/Context;

.field private f:Z

.field private g:Lcom/iflytek/cloud/SpeechUtility$a;


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

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

    sput-object v0, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;

    .line 90
    sget-object v0, Lcom/iflytek/thirdparty/v$a;->a:Lcom/iflytek/thirdparty/v$a;

    sput-object v0, Lcom/iflytek/cloud/SpeechUtility;->DEF_ENGINE_MODE:Lcom/iflytek/thirdparty/v$a;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .registers 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/iflytek/cloud/SpeechError;
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 171
    invoke-direct {p0}, Lcom/iflytek/thirdparty/v;-><init>()V

    .line 74
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:Ljava/util/ArrayList;

    .line 77
    const/4 v0, -0x1

    iput v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I

    .line 80
    iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    .line 83
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/iflytek/cloud/SpeechUtility;->f:Z

    .line 86
    iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/SpeechUtility$a;

    .line 91
    sget-object v0, Lcom/iflytek/cloud/SpeechUtility;->DEF_ENGINE_MODE:Lcom/iflytek/thirdparty/v$a;

    iput-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/thirdparty/v$a;

    .line 173
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    .line 174
    const-string v0, "params"

    invoke-super {p0, v0, p2}, Lcom/iflytek/thirdparty/v;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z

    .line 177
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v1, "lib_name"

    const-string v2, "msc"

    invoke-virtual {v0, v1, v2}, Lcom/iflytek/thirdparty/ad;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 179
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v2, "lib_path"

    const-string v3, ""

    invoke-virtual {v1, v2, v3}, Lcom/iflytek/thirdparty/ad;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 180
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "lib_path = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 181
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_74

    .line 182
    const-string v0, "lib_path start"

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 183
    invoke-static {v1}, Lcom/iflytek/msc/MSC;->load(Ljava/lang/String;)Z

    .line 188
    :goto_5c
    invoke-static {}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->updateJniLogStatus()V

    .line 190
    const-string v0, "params"

    invoke-virtual {p0, v0, p2}, Lcom/iflytek/cloud/SpeechUtility;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z

    .line 192
    sget-object v0, Lcom/iflytek/thirdparty/v$a;->a:Lcom/iflytek/thirdparty/v$a;

    iput-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/thirdparty/v$a;

    .line 195
    invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->b()I

    move-result v0

    .line 196
    if-eqz v0, :cond_78

    .line 197
    new-instance v1, Lcom/iflytek/cloud/SpeechError;

    invoke-direct {v1, v0}, Lcom/iflytek/cloud/SpeechError;-><init>(I)V

    throw v1

    .line 185
    :cond_74
    invoke-static {v0}, Lcom/iflytek/msc/MSC;->loadLibrary(Ljava/lang/String;)Z

    goto :goto_5c

    .line 199
    :cond_78
    invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->d()V

    .line 201
    const-string v0, "appid"

    invoke-virtual {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 210
    :try_start_81
    const-string v1, "enable_sunflower"

    invoke-virtual {p0, v1}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 211
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_95

    const-string v2, "false"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_a7

    .line 213
    :cond_95
    new-instance v1, Lcom/iflytek/cloud/SpeechUtility$b;

    invoke-direct {v1, p0}, Lcom/iflytek/cloud/SpeechUtility$b;-><init>(Lcom/iflytek/cloud/SpeechUtility;)V

    .line 214
    invoke-virtual {v1, v0}, Lcom/iflytek/cloud/SpeechUtility$b;->a(Ljava/lang/String;)V

    .line 215
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v1, v0}, Lcom/iflytek/cloud/SpeechUtility$b;->a(Landroid/content/Context;)V

    .line 216
    invoke-virtual {v1}, Lcom/iflytek/cloud/SpeechUtility$b;->start()V
    :try_end_a7
    .catch Ljava/lang/Exception; {:try_start_81 .. :try_end_a7} :catch_d2

    .line 221
    :cond_a7
    :goto_a7
    const-string v0, "lxy_tp_dc"

    invoke-virtual {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 223
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_bb

    const-string v1, "false"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_bb

    .line 226
    :cond_bb
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "DC init enable="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 227
    return-void

    .line 218
    :catch_d2
    move-exception v0

    .line 219
    const-string v0, "userLog creating failed"

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogW(Ljava/lang/String;)V

    goto :goto_a7
.end method

.method private a(Ljava/lang/String;)V
    .registers 8

    .prologue
    .line 453
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_7

    .line 484
    :cond_6
    return-void

    .line 456
    :cond_7
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    .line 457
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1, p1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 458
    const-string v2, "com.iflytek.vflynote"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 460
    const/16 v2, 0xe0

    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v0

    .line 463
    if-eqz v0, :cond_6

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_6

    .line 465
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_29
    :goto_29
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_6

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ResolveInfo;

    .line 467
    iget-object v2, v0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    iget-object v2, v2, Landroid/content/pm/ServiceInfo;->packageName:Ljava/lang/String;

    .line 468
    invoke-direct {p0, v2}, Lcom/iflytek/cloud/SpeechUtility;->b(Ljava/lang/String;)Lcom/iflytek/speech/SpeechComponent;

    move-result-object v2

    .line 469
    if-eqz v2, :cond_29

    .line 473
    :try_start_3f
    iget-object v0, v0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    iget-object v0, v0, Landroid/content/pm/ServiceInfo;->metaData:Landroid/os/Bundle;

    const-string v3, "enginetype"

    .line 474
    invoke-virtual {v0, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v3, ","

    invoke-virtual {v0, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v3

    .line 475
    array-length v4, v3

    const/4 v0, 0x0

    :goto_51
    if-ge v0, v4, :cond_29

    aget-object v5, v3, v0

    .line 476
    invoke-virtual {v2, v5}, Lcom/iflytek/speech/SpeechComponent;->addEngine(Ljava/lang/String;)V
    :try_end_58
    .catch Ljava/lang/Exception; {:try_start_3f .. :try_end_58} :catch_5b

    .line 475
    add-int/lit8 v0, v0, 0x1

    goto :goto_51

    .line 478
    :catch_5b
    move-exception v0

    .line 479
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    goto :goto_29
.end method

.method private static a(Landroid/content/Context;)Z
    .registers 8

    .prologue
    const/4 v1, 0x0

    .line 792
    :try_start_1
    invoke-static {}, Landroid/os/Process;->myPid()I

    move-result v2

    .line 793
    const-string v0, "activity"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/ActivityManager;

    .line 794
    if-eqz v0, :cond_7a

    .line 796
    invoke-virtual {v0}, Landroid/app/ActivityManager;->getRunningAppProcesses()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_17
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_7a

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/ActivityManager$RunningAppProcessInfo;

    .line 798
    iget v4, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I

    if-ne v4, v2, :cond_17

    .line 800
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "process name:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 801
    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v4

    invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x0

    invoke-virtual {v4, v5, v6}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;

    move-result-object v4

    .line 802
    iget-object v4, v4, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    iget-object v5, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_17

    .line 804
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "process name:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v0, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, "is own process"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
    :try_end_74
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_74} :catch_76

    .line 805
    const/4 v0, 0x1

    .line 813
    :goto_75
    return v0

    .line 810
    :catch_76
    move-exception v0

    .line 811
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    :cond_7a
    move v0, v1

    .line 813
    goto :goto_75
.end method

.method private b()I
    .registers 5

    .prologue
    .line 251
    invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z

    move-result v0

    if-nez v0, :cond_9

    .line 252
    const/16 v0, 0x520a

    .line 259
    :goto_8
    return v0

    .line 253
    :cond_9
    const-string v0, "SpeechUtility start login"

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 254
    new-instance v0, Lcom/iflytek/thirdparty/y;

    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    invoke-direct {v0, v1, v2}, Lcom/iflytek/thirdparty/y;-><init>(Landroid/content/Context;Lcom/iflytek/thirdparty/ad;)V

    .line 255
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v2, "usr"

    invoke-virtual {v1, v2}, Lcom/iflytek/thirdparty/ad;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    const-string v3, "pwd"

    invoke-virtual {v2, v3}, Lcom/iflytek/thirdparty/ad;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/iflytek/thirdparty/y;->a(Ljava/lang/String;Ljava/lang/String;)Lcom/iflytek/cloud/SpeechError;

    move-result-object v0

    .line 256
    if-nez v0, :cond_2f

    .line 257
    const/4 v0, 0x0

    goto :goto_8

    .line 259
    :cond_2f
    invoke-virtual {v0}, Lcom/iflytek/cloud/SpeechError;->getErrorCode()I

    move-result v0

    goto :goto_8
.end method

.method private b(Ljava/lang/String;)Lcom/iflytek/speech/SpeechComponent;
    .registers 6

    .prologue
    const/4 v1, 0x0

    .line 492
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_8

    .line 509
    :goto_7
    return-object v1

    .line 495
    :cond_8
    const/4 v2, 0x0

    .line 498
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_f
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_36

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/iflytek/speech/SpeechComponent;

    .line 499
    invoke-virtual {v0}, Lcom/iflytek/speech/SpeechComponent;->getPackageName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_f

    .line 500
    const/4 v0, 0x1

    .line 505
    :goto_26
    if-nez v0, :cond_34

    .line 506
    new-instance v0, Lcom/iflytek/speech/SpeechComponent;

    invoke-direct {v0, p1}, Lcom/iflytek/speech/SpeechComponent;-><init>(Ljava/lang/String;)V

    .line 507
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->c:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    :goto_32
    move-object v1, v0

    .line 509
    goto :goto_7

    :cond_34
    move-object v0, v1

    goto :goto_32

    :cond_36
    move v0, v2

    goto :goto_26
.end method

.method private c()Z
    .registers 3

    .prologue
    .line 267
    const/4 v0, 0x1

    .line 269
    invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z

    move-result v1

    if-eqz v1, :cond_b

    .line 270
    invoke-static {}, Lcom/iflytek/thirdparty/x;->a()Z

    move-result v0

    .line 273
    :cond_b
    return v0
.end method

.method private c(Ljava/lang/String;)Z
    .registers 6

    .prologue
    const/4 v0, 0x1

    .line 581
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    .line 582
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2, p1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 583
    const-string v3, "com.iflytek.vflynote"

    invoke-virtual {v2, v3}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 584
    invoke-virtual {v1, v2, v0}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v1

    .line 586
    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_1c

    :goto_1b
    return v0

    :cond_1c
    const/4 v0, 0x0

    goto :goto_1b
.end method

.method public static declared-synchronized createUtility(Landroid/content/Context;Ljava/lang/String;)Lcom/iflytek/cloud/SpeechUtility;
    .registers 7

    .prologue
    .line 129
    const-class v1, Lcom/iflytek/cloud/SpeechUtility;

    monitor-enter v1

    :try_start_3
    sget-object v2, Lcom/iflytek/cloud/SpeechUtility;->sSync:Ljava/lang/Object;

    monitor-enter v2
    :try_end_6
    .catchall {:try_start_3 .. :try_end_6} :catchall_47

    .line 130
    :try_start_6
    sget-object v0, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;

    if-nez v0, :cond_2d

    .line 132
    new-instance v0, Lcom/iflytek/thirdparty/ad;

    invoke-direct {v0}, Lcom/iflytek/thirdparty/ad;-><init>()V

    .line 133
    invoke-virtual {v0, p1}, Lcom/iflytek/thirdparty/ad;->b(Ljava/lang/String;)V

    .line 135
    const-string v3, "force_login"

    const/4 v4, 0x0

    invoke-virtual {v0, v3, v4}, Lcom/iflytek/thirdparty/ad;->a(Ljava/lang/String;Z)Z

    move-result v0

    if-nez v0, :cond_32

    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_32

    .line 136
    const-string v0, "init failed, please call this method in your main process!"

    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V

    .line 137
    const/4 v0, 0x0

    sput-object v0, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;

    .line 147
    :cond_2d
    :goto_2d
    monitor-exit v2
    :try_end_2e
    .catchall {:try_start_6 .. :try_end_2e} :catchall_44

    .line 149
    :try_start_2e
    sget-object v0, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;
    :try_end_30
    .catchall {:try_start_2e .. :try_end_30} :catchall_47

    monitor-exit v1

    return-object v0

    .line 140
    :cond_32
    :try_start_32
    new-instance v0, Lcom/iflytek/cloud/SpeechUtility;

    invoke-direct {v0, p0, p1}, Lcom/iflytek/cloud/SpeechUtility;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    sput-object v0, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;
    :try_end_39
    .catch Lcom/iflytek/cloud/SpeechError; {:try_start_32 .. :try_end_39} :catch_3a
    .catchall {:try_start_32 .. :try_end_39} :catchall_44

    goto :goto_2d

    .line 141
    :catch_3a
    move-exception v0

    .line 142
    :try_start_3b
    const-string v3, "init failed"

    invoke-static {v3}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V

    .line 143
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    goto :goto_2d

    .line 147
    :catchall_44
    move-exception v0

    monitor-exit v2
    :try_end_46
    .catchall {:try_start_3b .. :try_end_46} :catchall_44

    :try_start_46
    throw v0
    :try_end_47
    .catchall {:try_start_46 .. :try_end_47} :catchall_47

    .line 129
    :catchall_47
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method private d()V
    .registers 2

    .prologue
    .line 347
    invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->checkServiceInstalled()Z

    move-result v0

    if-eqz v0, :cond_1f

    .line 349
    const-string v0, "com.iflytek.vflynote.recognize"

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V

    .line 351
    const-string v0, "com.iflytek.vflynote.synthesize"

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V

    .line 353
    const-string v0, "com.iflytek.vflynote.speechunderstand"

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V

    .line 355
    const-string v0, "com.iflytek.vflynote.textunderstand"

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V

    .line 357
    const-string v0, "com.iflytek.vflynote.wakeup"

    invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V

    .line 359
    :cond_1f
    return-void
.end method

.method public static declared-synchronized getUtility()Lcom/iflytek/cloud/SpeechUtility;
    .registers 2

    .prologue
    .line 164
    const-class v0, Lcom/iflytek/cloud/SpeechUtility;

    monitor-enter v0

    :try_start_3
    sget-object v1, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;
    :try_end_5
    .catchall {:try_start_3 .. :try_end_5} :catchall_7

    monitor-exit v0

    return-object v1

    :catchall_7
    move-exception v1

    monitor-exit v0

    throw v1
.end method


# virtual methods
.method protected a()Z
    .registers 5

    .prologue
    const/4 v0, 0x0

    .line 331
    .line 333
    :try_start_1
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    const-string v2, "com.iflytek.vflynote"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    :try_end_d
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_1 .. :try_end_d} :catch_12

    move-result-object v1

    .line 334
    if-eqz v1, :cond_11

    .line 335
    const/4 v0, 0x1

    .line 339
    :cond_11
    :goto_11
    return v0

    .line 336
    :catch_12
    move-exception v1

    goto :goto_11
.end method

.method public checkServiceInstalled()Z
    .registers 6

    .prologue
    const/4 v1, 0x0

    .line 406
    .line 407
    const/4 v0, -0x1

    .line 409
    :try_start_2
    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v2

    const-string v3, "com.iflytek.vflynote"

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v2

    .line 410
    if-eqz v2, :cond_14

    .line 412
    const/4 v1, 0x1

    .line 413
    iget v0, v2, Landroid/content/pm/PackageInfo;->versionCode:I
    :try_end_14
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_2 .. :try_end_14} :catch_5f
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_14} :catch_5d

    .line 420
    :cond_14
    :goto_14
    iget-boolean v2, p0, Lcom/iflytek/cloud/SpeechUtility;->f:Z

    if-ne v1, v2, :cond_1c

    iget v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I

    if-eq v2, v0, :cond_5c

    .line 422
    :cond_1c
    iput-boolean v1, p0, Lcom/iflytek/cloud/SpeechUtility;->f:Z

    .line 423
    iput v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I

    .line 424
    invoke-static {}, Lcom/iflytek/cloud/SpeechRecognizer;->getRecognizer()Lcom/iflytek/cloud/SpeechRecognizer;

    move-result-object v0

    if-eqz v0, :cond_2f

    .line 426
    invoke-static {}, Lcom/iflytek/cloud/SpeechRecognizer;->getRecognizer()Lcom/iflytek/cloud/SpeechRecognizer;

    move-result-object v0

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0, v2}, Lcom/iflytek/cloud/SpeechRecognizer;->a(Landroid/content/Context;)V

    .line 429
    :cond_2f
    invoke-static {}, Lcom/iflytek/cloud/SpeechSynthesizer;->getSynthesizer()Lcom/iflytek/cloud/SpeechSynthesizer;

    move-result-object v0

    if-eqz v0, :cond_3e

    .line 431
    invoke-static {}, Lcom/iflytek/cloud/SpeechSynthesizer;->getSynthesizer()Lcom/iflytek/cloud/SpeechSynthesizer;

    move-result-object v0

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0, v2}, Lcom/iflytek/cloud/SpeechSynthesizer;->a(Landroid/content/Context;)V

    .line 434
    :cond_3e
    invoke-static {}, Lcom/iflytek/cloud/SpeechUnderstander;->getUnderstander()Lcom/iflytek/cloud/SpeechUnderstander;

    move-result-object v0

    if-eqz v0, :cond_4d

    .line 436
    invoke-static {}, Lcom/iflytek/cloud/SpeechUnderstander;->getUnderstander()Lcom/iflytek/cloud/SpeechUnderstander;

    move-result-object v0

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0, v2}, Lcom/iflytek/cloud/SpeechUnderstander;->a(Landroid/content/Context;)V

    .line 439
    :cond_4d
    invoke-static {}, Lcom/iflytek/cloud/TextUnderstander;->getTextUnderstander()Lcom/iflytek/cloud/TextUnderstander;

    move-result-object v0

    if-eqz v0, :cond_5c

    .line 441
    invoke-static {}, Lcom/iflytek/cloud/TextUnderstander;->getTextUnderstander()Lcom/iflytek/cloud/TextUnderstander;

    move-result-object v0

    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0, v2}, Lcom/iflytek/cloud/TextUnderstander;->a(Landroid/content/Context;)V

    .line 445
    :cond_5c
    return v1

    .line 416
    :catch_5d
    move-exception v2

    goto :goto_14

    .line 415
    :catch_5f
    move-exception v2

    goto :goto_14
.end method

.method public destroy()Z
    .registers 5

    .prologue
    const/4 v3, 0x0

    .line 297
    const/4 v0, 0x1

    .line 299
    sget-object v1, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;

    .line 300
    if-eqz v1, :cond_d

    .line 301
    invoke-super {p0}, Lcom/iflytek/thirdparty/v;->destroy()Z

    .line 302
    invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->c()Z

    move-result v0

    .line 305
    :cond_d
    if-eqz v0, :cond_26

    .line 306
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/SpeechUtility$a;

    .line 307
    if-eqz v1, :cond_18

    .line 308
    iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v2, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 310
    :cond_18
    iput-object v3, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/SpeechUtility$a;

    .line 312
    const-string v1, "SpeechUtility destory success"

    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V

    .line 317
    sget-object v1, Lcom/iflytek/cloud/SpeechUtility;->sSync:Ljava/lang/Object;

    monitor-enter v1

    .line 318
    const/4 v2, 0x0

    :try_start_23
    sput-object v2, Lcom/iflytek/cloud/SpeechUtility;->b:Lcom/iflytek/cloud/SpeechUtility;

    .line 319
    monitor-exit v1

    .line 322
    :cond_26
    return v0

    .line 319
    :catchall_27
    move-exception v0

    monitor-exit v1
    :try_end_29
    .catchall {:try_start_23 .. :try_end_29} :catchall_27

    throw v0
.end method

.method public getComponentUrl()Ljava/lang/String;
    .registers 4

    .prologue
    .line 594
    new-instance v0, Ljava/lang/StringBuffer;

    const-string v1, "http://iss.openspeech.cn/v?"

    invoke-direct {v0, v1}, Ljava/lang/StringBuffer;-><init>(Ljava/lang/String;)V

    .line 595
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-static {v1}, Lcom/iflytek/speech/UtilityConfig;->getComponentUrlParam(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    .line 596
    invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v1, v2}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;

    move-result-object v1

    .line 597
    invoke-static {v1}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 598
    const-string v2, "key"

    invoke-static {v0, v2, v1}, Lcom/iflytek/speech/UtilityConfig;->appendHttpParam(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;)V

    .line 599
    const-string v1, "version"

    const-string v2, "2.0"

    invoke-static {v0, v1, v2}, Lcom/iflytek/speech/UtilityConfig;->appendHttpParam(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;)V

    .line 600
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getEngineMode()Lcom/iflytek/thirdparty/v$a;
    .registers 2

    .prologue
    .line 763
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/thirdparty/v$a;

    return-object v0
.end method

.method public getParameter(Ljava/lang/String;)Ljava/lang/String;
    .registers 7

    .prologue
    const/4 v0, 0x0

    .line 641
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_8

    .line 688
    :cond_7
    :goto_7
    return-object v0

    .line 646
    :cond_8
    iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->mSessionParams:Lcom/iflytek/thirdparty/ad;

    invoke-virtual {v1, p1}, Lcom/iflytek/thirdparty/ad;->g(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_15

    .line 648
    invoke-super {p0, p1}, Lcom/iflytek/thirdparty/v;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_7

    .line 662
    :cond_15
    invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z

    move-result v1

    if-eqz v1, :cond_7

    .line 668
    :try_start_1b
    const-string v1, "ver_msc"

    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3b

    const-string v1, "ver_asr"

    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3b

    const-string v1, "ver_tts"

    .line 669
    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3b

    const-string v1, "ver_ivw"

    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_57

    .line 670
    :cond_3b
    const-string v1, "utf-8"

    invoke-virtual {p1, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v2

    .line 671
    new-instance v3, Lcom/iflytek/msc/MSCSessionInfo;

    invoke-direct {v3}, Lcom/iflytek/msc/MSCSessionInfo;-><init>()V

    .line 672
    new-instance v1, Ljava/lang/String;

    invoke-static {v2, v3}, Lcom/iflytek/msc/MSC;->QMSPGetVersion([BLcom/iflytek/msc/MSCSessionInfo;)[B

    move-result-object v2

    const-string v4, "utf-8"

    invoke-direct {v1, v2, v4}, Ljava/lang/String;-><init>([BLjava/lang/String;)V

    .line 673
    iget v2, v3, Lcom/iflytek/msc/MSCSessionInfo;->errorcode:I

    if-nez v2, :cond_7

    move-object v0, v1

    .line 674
    goto :goto_7

    .line 676
    :cond_57
    const-string v1, "utf-8"

    invoke-virtual {p1, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v1

    .line 677
    new-instance v2, Lcom/iflytek/msc/MSCSessionInfo;

    invoke-direct {v2}, Lcom/iflytek/msc/MSCSessionInfo;-><init>()V

    .line 678
    invoke-static {v1, v2}, Lcom/iflytek/msc/MSC;->QMSPGetParam([BLcom/iflytek/msc/MSCSessionInfo;)I

    move-result v1

    .line 679
    if-nez v1, :cond_7

    .line 680
    new-instance v1, Ljava/lang/String;

    iget-object v2, v2, Lcom/iflytek/msc/MSCSessionInfo;->buffer:[B

    const-string v3, "utf-8"

    invoke-direct {v1, v2, v3}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
    :try_end_71
    .catch Ljava/lang/Exception; {:try_start_1b .. :try_end_71} :catch_73
    .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_1b .. :try_end_71} :catch_78

    move-object v0, v1

    goto :goto_7

    .line 682
    :catch_73
    move-exception v1

    .line 683
    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogS(Ljava/lang/Throwable;)V

    goto :goto_7

    .line 684
    :catch_78
    move-exception v1

    .line 685
    invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogS(Ljava/lang/Throwable;)V

    goto :goto_7
.end method

.method public getPlusLocalInfo(Ljava/lang/String;)Ljava/lang/String;
    .registers 10
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    .prologue
    const/4 v2, 0x0

    .line 706
    new-instance v7, Lorg/json/JSONObject;

    invoke-direct {v7}, Lorg/json/JSONObject;-><init>()V

    .line 707
    const-string v6, ""

    .line 709
    invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->checkServiceInstalled()Z

    move-result v0

    if-nez v0, :cond_1a

    .line 711
    const-string v0, "ret"

    const/16 v1, 0x5209

    invoke-virtual {v7, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 712
    invoke-virtual {v7}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    .line 750
    :goto_19
    return-object v0

    .line 715
    :cond_1a
    invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I

    move-result v0

    const/16 v1, 0x61

    if-ge v0, v1, :cond_2e

    .line 717
    const-string v0, "ret"

    const/16 v1, 0x4e32

    invoke-virtual {v7, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 718
    invoke-virtual {v7}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_19

    .line 721
    :cond_2e
    const/16 v0, 0x2710

    invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I

    move-result v1

    if-gt v0, v1, :cond_4a

    invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I

    move-result v0

    const/16 v1, 0x2af8

    if-gt v0, v1, :cond_4a

    .line 722
    const-string v0, "ret"

    const/16 v1, 0x4e34

    invoke-virtual {v7, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 723
    invoke-virtual {v7}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_19

    .line 726
    :cond_4a
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    .line 727
    const-string v1, "content://com.iflytek.vflynote.providers.LocalResourceProvider"

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    move-object v3, p1

    move-object v4, v2

    move-object v5, v2

    .line 729
    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    .line 730
    const-string v0, "tag_rescontent"

    invoke-interface {v1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    .line 731
    if-eqz v1, :cond_a1

    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_a1

    .line 734
    invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 735
    const-string v2, "SpeechUtility"

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

    .line 738
    :goto_74
    if-eqz v1, :cond_79

    .line 739
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 743
    :cond_79
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_8b

    .line 744
    const-string v0, "ret"

    const/16 v1, 0x4e24

    invoke-virtual {v7, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 745
    invoke-virtual {v7}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_19

    .line 748
    :cond_8b
    const-string v1, "ret"

    const/4 v2, 0x0

    invoke-virtual {v7, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 749
    const-string v1, "result"

    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 750
    invoke-virtual {v7}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_19

    :cond_a1
    move-object v0, v6

    goto :goto_74
.end method

.method public getServiceVersion()I
    .registers 4

    .prologue
    .line 775
    iget v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I

    if-gez v0, :cond_17

    .line 777
    :try_start_4
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    const-string v1, "com.iflytek.vflynote"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v0

    .line 778
    if-eqz v0, :cond_17

    .line 779
    iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I

    iput v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I
    :try_end_17
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_4 .. :try_end_17} :catch_1a

    .line 784
    :cond_17
    :goto_17
    iget v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:I

    return v0

    .line 781
    :catch_1a
    move-exception v0

    goto :goto_17
.end method

.method public openEngineSettings(Ljava/lang/String;)I
    .registers 5

    .prologue
    .line 549
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 550
    const-string v0, "com.iflytek.vflynote"

    invoke-virtual {v1, v0}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 553
    const-string v0, "com.iflytek.vflynote"

    .line 555
    const-string v2, "tts"

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2d

    const-string v2, "com.iflytek.vflynote.activity.speaker.SpeakerSetting"

    .line 556
    invoke-direct {p0, v2}, Lcom/iflytek/cloud/SpeechUtility;->c(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2d

    .line 557
    const-string v0, "com.iflytek.vflynote.activity.speaker.SpeakerSetting"

    .line 564
    :cond_1e
    :goto_1e
    invoke-virtual {v1, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 565
    const/high16 v0, 0x10000000

    invoke-virtual {v1, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 566
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Landroid/content/Context;

    invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 572
    const/4 v0, 0x0

    :goto_2c
    return v0

    .line 558
    :cond_2d
    const-string v2, "asr"

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_40

    const-string v2, "com.iflytek.vflynote.settings.asr"

    .line 559
    invoke-direct {p0, v2}, Lcom/iflytek/cloud/SpeechUtility;->c(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_40

    .line 560
    const-string v0, "com.iflytek.vflynote.settings.asr"

    goto :goto_1e

    .line 561
    :cond_40
    const-string v2, "com.iflytek.vflynote.settings.main"

    invoke-direct {p0, v2}, Lcom/iflytek/cloud/SpeechUtility;->c(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_1e

    .line 562
    const-string v0, "com.iflytek.vflynote.settings.main"
    :try_end_4a
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_4a} :catch_4b

    goto :goto_1e

    .line 567
    :catch_4b
    move-exception v0

    .line 568
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    .line 569
    const/16 v0, 0x520a

    goto :goto_2c
.end method

.method public queryAvailableEngines()[Ljava/lang/String;
    .registers 5

    .prologue
    .line 524
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 525
    invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->d()V

    .line 527
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 529
    iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_13
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_27

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/iflytek/speech/SpeechComponent;

    .line 530
    invoke-virtual {v0}, Lcom/iflytek/speech/SpeechComponent;->getEngines()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    goto :goto_13

    .line 532
    :cond_27
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v0

    new-array v3, v0, [Ljava/lang/String;

    .line 533
    const/4 v0, 0x0

    move v1, v0

    :goto_2f
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-ge v1, v0, :cond_41

    .line 534
    invoke-virtual {v2, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    aput-object v0, v3, v1

    .line 533
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_2f

    .line 536
    :cond_41
    return-object v3
.end method

.method public setParameter(Ljava/lang/String;Ljava/lang/String;)Z
    .registers 7

    .prologue
    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 611
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_e

    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_10

    :cond_e
    move v0, v1

    .line 631
    :cond_f
    :goto_f
    return v0

    .line 616
    :cond_10
    invoke-super {p0, p1, p2}, Lcom/iflytek/thirdparty/v;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z

    .line 617
    invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z

    move-result v2

    if-eqz v2, :cond_f

    const-string v2, "params"

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_f

    .line 622
    :try_start_21
    const-string v2, "utf-8"

    invoke-virtual {p1, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v2

    .line 623
    const-string v3, "utf-8"

    invoke-virtual {p2, v3}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v3

    .line 624
    invoke-static {v2, v3}, Lcom/iflytek/msc/MSC;->QMSPSetParam([B[B)I
    :try_end_30
    .catch Ljava/lang/Exception; {:try_start_21 .. :try_end_30} :catch_35
    .catch Ljava/lang/UnsatisfiedLinkError; {:try_start_21 .. :try_end_30} :catch_3b

    move-result v2

    .line 625
    if-eqz v2, :cond_f

    move v0, v1

    goto :goto_f

    .line 626
    :catch_35
    move-exception v0

    .line 627
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    :goto_39
    move v0, v1

    .line 631
    goto :goto_f

    .line 628
    :catch_3b
    move-exception v0

    .line 629
    invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V

    goto :goto_39
.end method