1874 lines
44 KiB
Smali
1874 lines
44 KiB
Smali
.class public Lcom/iflytek/cloud/SpeechUtility;
|
|
.super Lcom/iflytek/cloud/a/f/d;
|
|
.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/cloud/a/f/d$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 a:Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
|
|
# instance fields
|
|
.field private b:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/iflytek/speech/SpeechComponent;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private c:I
|
|
|
|
.field private d:Landroid/content/Context;
|
|
|
|
.field private e:Z
|
|
|
|
.field private f:Lcom/iflytek/cloud/SpeechUtility$a;
|
|
|
|
.field protected g:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/iflytek/cloud/a/f/d$a;->a:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
sput-object v0, Lcom/iflytek/cloud/SpeechUtility;->DEF_ENGINE_MODE:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/iflytek/cloud/SpeechError;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "false"
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/iflytek/cloud/a/f/d;-><init>()V
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->b:Ljava/util/ArrayList;
|
|
|
|
const/4 v1, -0x1
|
|
|
|
.line 5
|
|
iput v1, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 10
|
|
iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 15
|
|
iput-boolean v1, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Z
|
|
|
|
.line 25
|
|
sget-object v1, Lcom/iflytek/cloud/SpeechUtility;->DEF_ENGINE_MODE:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
.line 118
|
|
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
iput-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
const-string v1, "params"
|
|
|
|
.line 119
|
|
invoke-super {p0, v1, p2}, Lcom/iflytek/cloud/a/f/d;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
.line 122
|
|
iget-object v2, p0, Lcom/iflytek/cloud/a/f/d;->mSessionParams:Lcom/iflytek/cloud/b/a;
|
|
|
|
const-string v3, "lib_name"
|
|
|
|
const-string v4, "msc"
|
|
|
|
invoke-virtual {v2, v3, v4}, Lcom/iflytek/cloud/b/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
.line 123
|
|
invoke-static {v2}, Lcom/iflytek/msc/MSC;->loadLibrary(Ljava/lang/String;)Z
|
|
|
|
.line 125
|
|
invoke-static {}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->updateJniLogStatus()V
|
|
|
|
.line 127
|
|
invoke-virtual {p0, v1, p2}, Lcom/iflytek/cloud/SpeechUtility;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
.line 129
|
|
sget-object p2, Lcom/iflytek/cloud/a/f/d$a;->a:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
iput-object p2, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
.line 144
|
|
invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->d()I
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_3
|
|
|
|
.line 148
|
|
invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->b()V
|
|
|
|
const-string p2, "appid"
|
|
|
|
.line 150
|
|
invoke-virtual {p0, p2}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
:try_start_0
|
|
const-string v1, "enable_sunflower"
|
|
|
|
.line 159
|
|
invoke-virtual {p0, v1}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 160
|
|
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 162
|
|
:cond_0
|
|
new-instance v1, Lcom/iflytek/cloud/SpeechUtility$b;
|
|
|
|
invoke-direct {v1, p0}, Lcom/iflytek/cloud/SpeechUtility$b;-><init>(Lcom/iflytek/cloud/SpeechUtility;)V
|
|
|
|
.line 163
|
|
invoke-virtual {v1, p2}, Lcom/iflytek/cloud/SpeechUtility$b;->a(Ljava/lang/String;)V
|
|
|
|
.line 164
|
|
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Lcom/iflytek/cloud/SpeechUtility$b;->a(Landroid/content/Context;)V
|
|
|
|
.line 165
|
|
invoke-virtual {v1}, Ljava/lang/Thread;->start()V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
const-string p1, "userLog creating failed"
|
|
|
|
.line 168
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogW(Ljava/lang/String;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const-string p1, "lxy_tp_dc"
|
|
|
|
.line 170
|
|
invoke-virtual {p0, p1}, Lcom/iflytek/cloud/SpeechUtility;->getParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 172
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_2
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
.line 175
|
|
:cond_2
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "DC init enable="
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 176
|
|
:cond_3
|
|
new-instance p1, Lcom/iflytek/cloud/SpeechError;
|
|
|
|
invoke-direct {p1, p2}, Lcom/iflytek/cloud/SpeechError;-><init>(I)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/String;)V
|
|
.locals 5
|
|
|
|
.line 1
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
.line 5
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
invoke-direct {v1, p1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p1, "com.iflytek.vflynote"
|
|
|
|
.line 6
|
|
invoke-virtual {v1, p1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const/16 p1, 0xe0
|
|
|
|
.line 8
|
|
invoke-virtual {v0, v1, p1}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 11
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_2
|
|
|
|
.line 12
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/content/pm/ResolveInfo;
|
|
|
|
.line 13
|
|
iget-object v1, v0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;
|
|
|
|
iget-object v1, v1, Landroid/content/pm/ServiceInfo;->packageName:Ljava/lang/String;
|
|
|
|
.line 14
|
|
invoke-direct {p0, v1}, Lcom/iflytek/cloud/SpeechUtility;->c(Ljava/lang/String;)Lcom/iflytek/speech/SpeechComponent;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 19
|
|
:try_start_0
|
|
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 v2, "enginetype"
|
|
|
|
.line 20
|
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v2, ","
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 21
|
|
array-length v2, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-ge v3, v2, :cond_1
|
|
|
|
aget-object v4, v0, v3
|
|
|
|
.line 22
|
|
invoke-virtual {v1, v4}, Lcom/iflytek/speech/SpeechComponent;->addEngine(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
.line 25
|
|
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method private static a(Landroid/content/Context;)Z
|
|
.locals 7
|
|
|
|
const-string v0, "process name:"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 26
|
|
:try_start_0
|
|
invoke-static {}, Landroid/os/Process;->myPid()I
|
|
|
|
move-result v2
|
|
|
|
const-string v3, "activity"
|
|
|
|
.line 27
|
|
invoke-virtual {p0, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/app/ActivityManager;
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
.line 29
|
|
invoke-virtual {v3}, Landroid/app/ActivityManager;->getRunningAppProcesses()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:cond_0
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Landroid/app/ActivityManager$RunningAppProcessInfo;
|
|
|
|
.line 30
|
|
iget v5, v4, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I
|
|
|
|
if-ne v5, v2, :cond_0
|
|
|
|
.line 31
|
|
new-instance v5, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v5
|
|
|
|
iget-object v6, v4, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v5}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
|
|
|
|
.line 32
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v5, v6, v1}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object v5
|
|
|
|
.line 33
|
|
iget-object v5, v5, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;
|
|
|
|
iget-object v6, v4, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
|
|
|
|
invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
.line 34
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
iget-object v0, v4, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "is own process"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 41
|
|
invoke-static {p0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
:cond_1
|
|
return v1
|
|
.end method
|
|
|
|
.method private b()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->checkServiceInstalled()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "com.iflytek.vflynote.recognize"
|
|
|
|
.line 3
|
|
invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V
|
|
|
|
const-string v0, "com.iflytek.vflynote.synthesize"
|
|
|
|
.line 5
|
|
invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V
|
|
|
|
const-string v0, "com.iflytek.vflynote.speechunderstand"
|
|
|
|
.line 7
|
|
invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V
|
|
|
|
const-string v0, "com.iflytek.vflynote.textunderstand"
|
|
|
|
.line 9
|
|
invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V
|
|
|
|
const-string v0, "com.iflytek.vflynote.wakeup"
|
|
|
|
.line 11
|
|
invoke-direct {p0, v0}, Lcom/iflytek/cloud/SpeechUtility;->a(Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private b(Ljava/lang/String;)Z
|
|
.locals 2
|
|
|
|
.line 12
|
|
iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
.line 13
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
invoke-direct {v1, p1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string p1, "com.iflytek.vflynote"
|
|
|
|
.line 14
|
|
invoke-virtual {v1, p1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
.line 15
|
|
invoke-virtual {v0, v1, p1}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
.line 17
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method private c(Ljava/lang/String;)Lcom/iflytek/speech/SpeechComponent;
|
|
.locals 4
|
|
|
|
.line 2
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
.line 8
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->b:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_1
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/iflytek/speech/SpeechComponent;
|
|
|
|
.line 9
|
|
invoke-virtual {v3}, Lcom/iflytek/speech/SpeechComponent;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_2
|
|
if-nez v0, :cond_3
|
|
|
|
.line 16
|
|
new-instance v1, Lcom/iflytek/speech/SpeechComponent;
|
|
|
|
invoke-direct {v1, p1}, Lcom/iflytek/speech/SpeechComponent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 17
|
|
iget-object p1, p0, Lcom/iflytek/cloud/SpeechUtility;->b:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {p1, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_3
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public static declared-synchronized createUtility(Landroid/content/Context;Ljava/lang/String;)Lcom/iflytek/cloud/SpeechUtility;
|
|
.locals 5
|
|
|
|
const-class v0, Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
sget-object v1, Lcom/iflytek/cloud/a/f/d;->sSync:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
.line 2
|
|
:try_start_1
|
|
sget-object v2, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 4
|
|
new-instance v2, Lcom/iflytek/cloud/b/a;
|
|
|
|
invoke-direct {v2}, Lcom/iflytek/cloud/b/a;-><init>()V
|
|
|
|
.line 5
|
|
invoke-virtual {v2, p1}, Lcom/iflytek/cloud/b/a;->d(Ljava/lang/String;)V
|
|
|
|
const-string v3, "force_login"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
.line 7
|
|
invoke-virtual {v2, v3, v4}, Lcom/iflytek/cloud/b/a;->a(Ljava/lang/String;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Lcom/iflytek/cloud/SpeechUtility;->a(Landroid/content/Context;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
const-string p0, "init failed, please call this method in your main process!"
|
|
|
|
.line 8
|
|
invoke-static {p0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
.line 9
|
|
sput-object p0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 12
|
|
:cond_0
|
|
:try_start_2
|
|
new-instance v2, Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
invoke-direct {v2, p0, p1}, Lcom/iflytek/cloud/SpeechUtility;-><init>(Landroid/content/Context;Ljava/lang/String;)V
|
|
|
|
sput-object v2, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
:try_end_2
|
|
.catch Lcom/iflytek/cloud/SpeechError; {:try_start_2 .. :try_end_2} :catch_0
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
:try_start_3
|
|
const-string p1, "init failed"
|
|
|
|
.line 14
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/String;)V
|
|
|
|
.line 15
|
|
invoke-static {p0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
.line 19
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit v1
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
.line 21
|
|
:try_start_4
|
|
sget-object p0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1
|
|
|
|
monitor-exit v0
|
|
|
|
return-object p0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 22
|
|
:try_start_5
|
|
monitor-exit v1
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
|
|
|
:try_start_6
|
|
throw p0
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p0
|
|
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private d()I
|
|
.locals 4
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/16 v0, 0x520a
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const-string v0, "SpeechUtility start login"
|
|
|
|
.line 3
|
|
invoke-static {v0}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
|
|
|
|
.line 4
|
|
new-instance v0, Lcom/iflytek/cloud/a/g/b;
|
|
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/a/f/d;->mSessionParams:Lcom/iflytek/cloud/b/a;
|
|
|
|
invoke-direct {v0, v1, v2}, Lcom/iflytek/cloud/a/g/b;-><init>(Landroid/content/Context;Lcom/iflytek/cloud/b/a;)V
|
|
|
|
.line 5
|
|
iget-object v1, p0, Lcom/iflytek/cloud/a/f/d;->mSessionParams:Lcom/iflytek/cloud/b/a;
|
|
|
|
const-string v2, "usr"
|
|
|
|
invoke-virtual {v1, v2}, Lcom/iflytek/cloud/b/a;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/a/f/d;->mSessionParams:Lcom/iflytek/cloud/b/a;
|
|
|
|
const-string v3, "pwd"
|
|
|
|
invoke-virtual {v2, v3}, Lcom/iflytek/cloud/b/a;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/iflytek/cloud/a/g/b;->a(Ljava/lang/String;Ljava/lang/String;)Lcom/iflytek/cloud/SpeechError;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
|
|
.line 9
|
|
:cond_1
|
|
invoke-virtual {v0}, Lcom/iflytek/cloud/SpeechError;->getErrorCode()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private e()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {}, Lcom/iflytek/cloud/a/g/a;->a()Z
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static declared-synchronized getUtility()Lcom/iflytek/cloud/SpeechUtility;
|
|
.locals 2
|
|
|
|
const-class v0, Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
sget-object v1, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-object v1
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected c()Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "com.iflytek.vflynote"
|
|
|
|
invoke-virtual {v1, v2, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object v1
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:catch_0
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public checkServiceInstalled()Z
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, -0x1
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v2}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "com.iflytek.vflynote"
|
|
|
|
invoke-virtual {v2, v3, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 4
|
|
iget v1, v2, Landroid/content/pm/PackageInfo;->versionCode:I
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 11
|
|
:catch_0
|
|
:catchall_0
|
|
:cond_0
|
|
iget-boolean v2, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Z
|
|
|
|
if-ne v0, v2, :cond_1
|
|
|
|
iget v2, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
|
|
if-eq v2, v1, :cond_5
|
|
|
|
.line 12
|
|
:cond_1
|
|
iput-boolean v0, p0, Lcom/iflytek/cloud/SpeechUtility;->e:Z
|
|
|
|
.line 13
|
|
iput v1, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
|
|
.line 14
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechRecognizer;->getRecognizer()Lcom/iflytek/cloud/SpeechRecognizer;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 15
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechRecognizer;->getRecognizer()Lcom/iflytek/cloud/SpeechRecognizer;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/iflytek/cloud/SpeechRecognizer;->a(Landroid/content/Context;)V
|
|
|
|
.line 18
|
|
:cond_2
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechSynthesizer;->getSynthesizer()Lcom/iflytek/cloud/SpeechSynthesizer;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 19
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechSynthesizer;->getSynthesizer()Lcom/iflytek/cloud/SpeechSynthesizer;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/iflytek/cloud/SpeechSynthesizer;->a(Landroid/content/Context;)V
|
|
|
|
.line 22
|
|
:cond_3
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechUnderstander;->getUnderstander()Lcom/iflytek/cloud/SpeechUnderstander;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
.line 23
|
|
invoke-static {}, Lcom/iflytek/cloud/SpeechUnderstander;->getUnderstander()Lcom/iflytek/cloud/SpeechUnderstander;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/iflytek/cloud/SpeechUnderstander;->a(Landroid/content/Context;)V
|
|
|
|
.line 26
|
|
:cond_4
|
|
invoke-static {}, Lcom/iflytek/cloud/TextUnderstander;->getTextUnderstander()Lcom/iflytek/cloud/TextUnderstander;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
.line 27
|
|
invoke-static {}, Lcom/iflytek/cloud/TextUnderstander;->getTextUnderstander()Lcom/iflytek/cloud/TextUnderstander;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/iflytek/cloud/TextUnderstander;->a(Landroid/content/Context;)V
|
|
|
|
:cond_5
|
|
return v0
|
|
.end method
|
|
|
|
.method public destroy()Z
|
|
.locals 3
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 3
|
|
invoke-super {p0}, Lcom/iflytek/cloud/a/f/d;->destroy()Z
|
|
|
|
.line 4
|
|
invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->e()Z
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 8
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->f:Lcom/iflytek/cloud/SpeechUtility$a;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 10
|
|
iget-object v2, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v2, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
|
|
|
|
:cond_1
|
|
const-string v1, "SpeechUtility destory success"
|
|
|
|
.line 14
|
|
invoke-static {v1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogD(Ljava/lang/String;)V
|
|
|
|
.line 19
|
|
sget-object v1, Lcom/iflytek/cloud/a/f/d;->sSync:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 20
|
|
:try_start_0
|
|
sput-object v2, Lcom/iflytek/cloud/SpeechUtility;->a:Lcom/iflytek/cloud/SpeechUtility;
|
|
|
|
.line 21
|
|
monitor-exit v1
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public getComponentUrl()Ljava/lang/String;
|
|
.locals 3
|
|
|
|
.line 1
|
|
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 2
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-static {v1}, Lcom/iflytek/speech/UtilityConfig;->getComponentUrlParam(Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 3
|
|
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 4
|
|
invoke-static {v1}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "key"
|
|
|
|
.line 5
|
|
invoke-static {v0, v2, v1}, Lcom/iflytek/speech/UtilityConfig;->appendHttpParam(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
const-string v1, "version"
|
|
|
|
const-string v2, "2.0"
|
|
|
|
.line 6
|
|
invoke-static {v0, v1, v2}, Lcom/iflytek/speech/UtilityConfig;->appendHttpParam(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 7
|
|
invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getEngineMode()Lcom/iflytek/cloud/a/f/d$a;
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->g:Lcom/iflytek/cloud/a/f/d$a;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
.line 1
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v1
|
|
|
|
.line 6
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/iflytek/cloud/a/f/d;->mSessionParams:Lcom/iflytek/cloud/b/a;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/iflytek/cloud/b/a;->b(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 7
|
|
invoke-super {p0, p1}, Lcom/iflytek/cloud/a/f/d;->getParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
.line 21
|
|
:cond_1
|
|
invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
return-object v1
|
|
|
|
:cond_2
|
|
:try_start_0
|
|
const-string v0, "ver_msc"
|
|
|
|
.line 26
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-string v2, "utf-8"
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
:try_start_1
|
|
const-string v0, "ver_asr"
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
const-string v0, "ver_tts"
|
|
|
|
.line 27
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
const-string v0, "ver_ivw"
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
.line 34
|
|
:cond_3
|
|
invoke-virtual {p1, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p1
|
|
|
|
.line 35
|
|
new-instance v0, Lcom/iflytek/msc/MSCSessionInfo;
|
|
|
|
invoke-direct {v0}, Lcom/iflytek/msc/MSCSessionInfo;-><init>()V
|
|
|
|
.line 36
|
|
invoke-static {p1, v0}, Lcom/iflytek/msc/MSC;->QMSPGetParam([BLcom/iflytek/msc/MSCSessionInfo;)I
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_5
|
|
|
|
.line 38
|
|
new-instance p1, Ljava/lang/String;
|
|
|
|
iget-object v0, v0, Lcom/iflytek/msc/MSCSessionInfo;->buffer:[B
|
|
|
|
invoke-direct {p1, v0, v2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
.line 39
|
|
:cond_4
|
|
:goto_0
|
|
invoke-virtual {p1, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p1
|
|
|
|
.line 40
|
|
new-instance v0, Lcom/iflytek/msc/MSCSessionInfo;
|
|
|
|
invoke-direct {v0}, Lcom/iflytek/msc/MSCSessionInfo;-><init>()V
|
|
|
|
.line 41
|
|
new-instance v3, Ljava/lang/String;
|
|
|
|
invoke-static {p1, v0}, Lcom/iflytek/msc/MSC;->QMSPGetVersion([BLcom/iflytek/msc/MSCSessionInfo;)[B
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v3, p1, v2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
|
|
|
|
.line 42
|
|
iget p1, v0, Lcom/iflytek/msc/MSCSessionInfo;->errorcode:I
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
if-nez p1, :cond_5
|
|
|
|
return-object v3
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 54
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogS(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_1
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
.line 55
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogS(Ljava/lang/Throwable;)V
|
|
|
|
:cond_5
|
|
:goto_1
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public getPlusLocalInfo(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 9
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/json/JSONException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V
|
|
|
|
.line 4
|
|
invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->checkServiceInstalled()Z
|
|
|
|
move-result v1
|
|
|
|
const-string v2, "ret"
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/16 p1, 0x5209
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
|
|
|
|
.line 6
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
.line 9
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v3, 0x61
|
|
|
|
if-ge v1, v3, :cond_1
|
|
|
|
const/16 p1, 0x4e32
|
|
|
|
.line 10
|
|
invoke-virtual {v0, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
|
|
|
|
.line 11
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
.line 14
|
|
:cond_1
|
|
invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v3, 0x2710
|
|
|
|
if-gt v3, v1, :cond_2
|
|
|
|
invoke-virtual {p0}, Lcom/iflytek/cloud/SpeechUtility;->getServiceVersion()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v3, 0x2af8
|
|
|
|
if-gt v1, v3, :cond_2
|
|
|
|
const/16 p1, 0x4e34
|
|
|
|
.line 15
|
|
invoke-virtual {v0, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
|
|
|
|
.line 16
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
.line 19
|
|
:cond_2
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v1, "content://com.iflytek.vflynote.providers.LocalResourceProvider"
|
|
|
|
.line 20
|
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v6, p1
|
|
|
|
.line 22
|
|
invoke-virtual/range {v3 .. v8}, 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 p1
|
|
|
|
const-string v1, "tag_rescontent"
|
|
|
|
.line 23
|
|
invoke-interface {p1, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
.line 24
|
|
invoke-interface {p1}, Landroid/database/Cursor;->moveToFirst()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
.line 26
|
|
invoke-interface {p1, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "SpeechUtility"
|
|
|
|
.line 27
|
|
invoke-static {v3, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const-string v1, ""
|
|
|
|
.line 31
|
|
:goto_0
|
|
invoke-interface {p1}, Landroid/database/Cursor;->close()V
|
|
|
|
.line 35
|
|
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
const/16 p1, 0x4e24
|
|
|
|
.line 36
|
|
invoke-virtual {v0, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
|
|
|
|
.line 37
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
.line 40
|
|
invoke-virtual {v0, v2, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
|
|
|
|
.line 41
|
|
new-instance p1, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {p1, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v1, "result"
|
|
|
|
invoke-virtual {v0, v1, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
|
|
|
|
.line 42
|
|
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public getServiceVersion()I
|
|
.locals 3
|
|
|
|
.line 1
|
|
iget v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
|
|
if-gez v0, :cond_0
|
|
|
|
.line 3
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->d: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
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 5
|
|
iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I
|
|
|
|
iput v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.line 10
|
|
:catch_0
|
|
:cond_0
|
|
iget v0, p0, Lcom/iflytek/cloud/SpeechUtility;->c:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public openEngineSettings(Ljava/lang/String;)I
|
|
.locals 6
|
|
|
|
const-string v0, "com.iflytek.vflynote"
|
|
|
|
.line 1
|
|
:try_start_0
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
invoke-direct {v1}, Landroid/content/Intent;-><init>()V
|
|
|
|
.line 2
|
|
invoke-virtual {v1, v0}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string v2, "tts"
|
|
|
|
.line 7
|
|
invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-string v3, "com.iflytek.vflynote.settings.asr"
|
|
|
|
const-string v4, "com.iflytek.vflynote.settings.main"
|
|
|
|
const-string v5, "com.iflytek.vflynote.activity.speaker.SpeakerSetting"
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 8
|
|
:try_start_1
|
|
invoke-direct {p0, v5}, Lcom/iflytek/cloud/SpeechUtility;->b(Ljava/lang/String;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
move-object v0, v5
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v2, "asr"
|
|
|
|
.line 10
|
|
invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 11
|
|
invoke-direct {p0, v3}, Lcom/iflytek/cloud/SpeechUtility;->b(Ljava/lang/String;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
move-object v0, v3
|
|
|
|
goto :goto_0
|
|
|
|
.line 13
|
|
:cond_1
|
|
invoke-direct {p0, v4}, Lcom/iflytek/cloud/SpeechUtility;->b(Ljava/lang/String;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
move-object v0, v4
|
|
|
|
.line 16
|
|
:cond_2
|
|
:goto_0
|
|
invoke-virtual {v1, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const/high16 p1, 0x10000000
|
|
|
|
.line 17
|
|
invoke-virtual {v1, p1}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
|
|
|
|
.line 18
|
|
iget-object p1, p0, Lcom/iflytek/cloud/SpeechUtility;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
|
|
:try_end_1
|
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 20
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
const/16 p1, 0x520a
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public queryAvailableEngines()[Ljava/lang/String;
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/iflytek/cloud/SpeechUtility;->b:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
|
|
|
|
.line 2
|
|
invoke-direct {p0}, Lcom/iflytek/cloud/SpeechUtility;->b()V
|
|
|
|
.line 4
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 6
|
|
iget-object v1, p0, Lcom/iflytek/cloud/SpeechUtility;->b:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/iflytek/speech/SpeechComponent;
|
|
|
|
.line 7
|
|
invoke-virtual {v2}, Lcom/iflytek/speech/SpeechComponent;->getEngines()Ljava/util/ArrayList;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
goto :goto_0
|
|
|
|
.line 9
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
new-array v1, v1, [Ljava/lang/String;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 10
|
|
:goto_1
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v3
|
|
|
|
if-ge v2, v3, :cond_1
|
|
|
|
.line 11
|
|
invoke-virtual {v0, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/String;
|
|
|
|
aput-object v3, v1, v2
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public setParameter(Ljava/lang/String;Ljava/lang/String;)Z
|
|
.locals 4
|
|
|
|
const-string v0, "utf-8"
|
|
|
|
.line 1
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_4
|
|
|
|
invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 6
|
|
:cond_0
|
|
invoke-super {p0, p1, p2}, Lcom/iflytek/cloud/a/f/d;->setParameter(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
.line 7
|
|
invoke-static {}, Lcom/iflytek/msc/MSC;->isLoaded()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
const-string v1, "params"
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 12
|
|
:cond_1
|
|
:try_start_0
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p1
|
|
|
|
.line 13
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p2
|
|
|
|
.line 14
|
|
invoke-static {p1, p2}, Lcom/iflytek/msc/MSC;->QMSPSetParam([B[B)I
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
move v2, v3
|
|
|
|
:cond_2
|
|
return v2
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 19
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
.line 20
|
|
invoke-static {p1}, Lcom/iflytek/cloud/msc/util/log/DebugLog;->LogE(Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
return v2
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return v3
|
|
|
|
:cond_4
|
|
:goto_2
|
|
return v2
|
|
.end method
|