龙城战记 v1.0.1版本的 MD5 值为:00000931b93a3ccf40631848e86a593d

以下内容为反编译后的 bx.java 源代码,内容仅作参考


package com.unisound.sdk;

import android.text.TextUtils;
import com.iflytek.cloud.ErrorCode;
import com.unisound.client.SpeechConstants;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

public class bx {
    public static final boolean d = false;
    public static final int e = 0;
    public static final int f = 300;
    public static final int g = 50;
    public static final int h = 50;
    public static final int i = 50;
    public static final String j = "xiaoli";
    public static final int k = 22050;
    public static final boolean l = false;
    public static final int m = 100;
    public static final int n = 100;
    public static final int o = 2;
    public static final int p = 15;
    public static final int q = 5;
    public static final int r = 50;
    public static final int s = -1;
    public static final boolean t = false;
    public static final boolean u = false;
    private static bx w;
    private String H;
    private String I;
    private String y;
    private com.unisound.common.a v = new com.unisound.common.a("ttsv3.hivoice.cn", 80, "117.121.49.41", 80);
    public int a = 0;
    public String b = null;
    public c c = new c();

    private Boolean f32x = false;
    private int z = 300;
    private int A = 50;
    private int B = 50;
    private int C = 50;
    private String D = j;
    private int E = k;
    private List<Integer> F = new ArrayList();
    private int G = 3;
    private Integer J = 2;
    private int K = 0;
    private Boolean L = false;
    private int M = 100;
    private int N = 100;
    private int O = 15;
    private int P = 5;
    private int Q = 50;
    private int R = -1;
    private boolean S = false;
    private boolean T = false;
    private boolean U = false;
    private boolean V = false;
    private String W = "";
    private String X = "";
    private String Y = "";
    private String Z = "";
    private long aa = 500;
    private long ab = 0;
    private InputStream ac = null;
    private InputStream ad = null;
    private InputStream ae = null;
    private InputStream af = null;

    private bx() {
    }

    private boolean E(Object obj) {
        String str;
        if (obj == null) {
            str = "TTSParams object2Boolean: obj is null";
        } else {
            if (obj instanceof Boolean) {
                return ((Boolean) obj).booleanValue();
            }
            str = "TTSParams object2Boolean: obj is not change to boolean";
        }
        com.unisound.common.y.a(str);
        return false;
    }

    private int a(Integer num) {
        int intValue = Integer.valueOf(num.intValue()).intValue();
        if (intValue < 0) {
            com.unisound.common.y.e("TTSParams checkParams: value < 0");
            return 1;
        }
        if (intValue <= 100) {
            return intValue;
        }
        com.unisound.common.y.e("TTSParams checkParams: value > 100");
        return 100;
    }

    public static bx a() {
        if (w == null) {
            w = new bx();
        }
        return w;
    }

    private Integer c(int i2) {
        if (i2 > 1000) {
            com.unisound.common.y.e("TTSParams checkSilenceTime: silence > 1000 invoked silence = 1000");
            i2 = 1000;
        }
        if (i2 < 0) {
            com.unisound.common.y.e("TTSParams checkSilenceTime: silence < 0 invoked silence = 0");
            i2 = 0;
        }
        return Integer.valueOf(i2);
    }

    private boolean d(String str) {
        return this.v.c(str);
    }

    private boolean e(String str) {
        if (!TextUtils.isEmpty(str) && TextUtils.isDigitsOnly(str)) {
            return true;
        }
        com.unisound.common.y.a("TTSParams isNumberUseable: value is empty or unusable");
        return false;
    }

    private boolean f(String str) {
        if (!TextUtils.isEmpty(str)) {
            return true;
        }
        com.unisound.common.y.a("TTSParams isStringUseable: value is empty");
        return false;
    }

    private boolean g(String str) {
        String[] split = str.split(":");
        if (split.length != 2) {
            return false;
        }
        if (i(split[1])) {
            return true;
        }
        com.unisound.common.y.a("TTSParams checkAddress: port unusable");
        return false;
    }

    private boolean h(String str) {
        return Pattern.compile("(2[5][0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})").matcher(str).matches();
    }

    private boolean i(String str) {
        try {
            int intValue = Integer.valueOf(str).intValue();
            if (intValue > 0 && intValue < 65535) {
                return true;
            }
            com.unisound.common.y.a("TTSParams checkPort: port Illegal");
            return false;
        } catch (Exception e2) {
            e2.printStackTrace();
            com.unisound.common.y.a("TTSParams checkPort: port changeTo integer exception");
            return false;
        }
    }

    public int A() {
        return this.C;
    }

    public void A(Object obj) {
        this.V = E(obj);
    }

    public int B() {
        return this.z;
    }

    public void B(Object obj) {
        this.Q = a(v(obj));
    }

    public int C() {
        return this.E;
    }

    public void C(Object obj) {
        this.R = a(v(obj));
    }

    public List<Integer> D() {
        return this.F;
    }

    public void D(Object obj) {
        int intValue = v(obj).intValue();
        if (intValue > 1000) {
            intValue = 1000;
        } else if (intValue < 100) {
            intValue = 100;
        }
        this.aa = intValue;
    }

    public int E() {
        return this.G;
    }

    public String F() {
        return this.H;
    }

    public String G() {
        return this.I;
    }

    public Integer H() {
        return this.J;
    }

    public Map<String, Integer> I() {
        HashMap hashMap = new HashMap();
        hashMap.put(SpeechConstants.TTS_KEY_VOICE_SPEED_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_VOICE_SPEED));
        hashMap.put(SpeechConstants.TTS_KEY_VOICE_PITCH_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_VOICE_PITCH));
        hashMap.put(SpeechConstants.TTS_KEY_VOICE_VOLUME_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_VOICE_VOLUME));
        hashMap.put(SpeechConstants.TTS_KEY_SAMPLE_RATE_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_SAMPLE_RATE));
        hashMap.put(SpeechConstants.TTS_KEY_VOICE_NAME_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_VOICE_NAME));
        hashMap.put(SpeechConstants.TTS_KEY_SERVER_ADDR_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_SERVER_ADDR));
        hashMap.put(SpeechConstants.TTS_KEY_PLAY_START_BUFFER_TIME_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_PLAY_START_BUFFER_TIME));
        hashMap.put(SpeechConstants.TTS_KEY_STREAM_TYPE_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_STREAM_TYPE));
        hashMap.put(SpeechConstants.TTS_KEY_IS_DEBUG_JSONKEY, Integer.valueOf(SpeechConstants.TTS_KEY_IS_DEBUG));
        hashMap.put(SpeechConstants.TTS_SERVICE_MODE_JSONKEY, Integer.valueOf(SpeechConstants.TTS_SERVICE_MODE));
        return hashMap;
    }

    public int J() {
        return this.O;
    }

    public boolean K() {
        return this.U;
    }

    public int L() {
        return this.P;
    }

    public boolean M() {
        return this.V;
    }

    public int N() {
        return this.Q;
    }

    public int O() {
        return this.R;
    }

    public long P() {
        return this.aa;
    }

    public long Q() {
        return this.ab;
    }

    public Object a(int i2) {
        return null;
    }

    public void a(long j2) {
        if (j2 < 1) {
            this.ab = 1L;
        } else {
            this.ab = j2;
        }
    }

    public void a(InputStream inputStream) {
        this.ac = inputStream;
    }

    public void a(Object obj) {
        this.X = r(obj);
    }

    public void a(String str) {
        this.b = str;
    }

    public void a(String str, int i2) {
        this.v.a(str);
        this.v.a(i2);
        this.v.b(str);
        this.v.b(i2);
    }

    public boolean a(int i2, Object obj) {
        return false;
    }

    public c b() {
        return this.c;
    }

    public void b(int i2) {
        if (i2 != 8000) {
            if (i2 == 16000 || i2 == 22050 || i2 == 24000 || i2 == 48000) {
                this.E = i2;
            }
        }
    }

    public void b(InputStream inputStream) {
        this.ad = inputStream;
    }

    public void b(Object obj) {
        this.W = r(obj);
    }

    public void b(String str) {
        this.H = str;
    }

    public String c() {
        return this.v.a();
    }

    public void c(InputStream inputStream) {
        this.ae = inputStream;
    }

    public void c(Object obj) {
        this.Y = r(obj);
    }

    public void c(String str) {
        this.I = str;
    }

    public int d() {
        return this.v.c();
    }

    public void d(InputStream inputStream) {
        this.af = inputStream;
    }

    public void d(Object obj) {
        this.Z = r(obj);
    }

    public void e() {
        this.v.e();
    }

    public void e(Object obj) {
        this.T = E(obj);
    }

    public com.unisound.common.a f() {
        return this.v;
    }

    public void f(Object obj) {
        this.S = E(obj);
    }

    public String g() {
        return this.X;
    }

    public void g(Object obj) {
        this.L = Boolean.valueOf(E(obj));
    }

    public String h() {
        return this.W;
    }

    public void h(Object obj) {
        this.M = c(v(obj).intValue()).intValue();
    }

    public String i() {
        return this.Y;
    }

    public void i(Object obj) {
        this.N = c(v(obj).intValue()).intValue();
    }

    public String j() {
        return this.Z;
    }

    public void j(Object obj) {
        this.K = v(obj).intValue();
    }

    public InputStream k() {
        return this.ac;
    }

    public void k(Object obj) {
        this.f32x = Boolean.valueOf(E(obj));
    }

    public InputStream l() {
        return this.ad;
    }

    public void l(Object obj) {
        String r2 = r(obj);
        if (r2 == null) {
            com.unisound.common.y.a("TTSParams setDebugDir: mDebugDir is null");
        } else {
            this.y = r2;
        }
    }

    public InputStream m() {
        return this.ae;
    }

    public void m(Object obj) {
        String str;
        String r2 = r(obj);
        if (r2 == null) {
            str = "TTSParams setVoiceName: voiceName is null";
        } else {
            if (f(r2)) {
                this.D = r2;
                return;
            }
            str = "TTSParams setVoiceName: voiceName unusable";
        }
        com.unisound.common.y.a(str);
    }

    public InputStream n() {
        return this.af;
    }

    public void n(Object obj) {
        this.A = a(v(obj));
    }

    public String o() {
        return this.b;
    }

    public void o(Object obj) {
        this.B = a(v(obj));
    }

    public void p(Object obj) {
        this.C = a(v(obj));
    }

    public boolean p() {
        return this.T;
    }

    public void q(Object obj) {
        Integer v = v(obj);
        if (v.intValue() > 15000) {
            v = Integer.valueOf(ErrorCode.MSP_ERROR_MMP_BASE);
            com.unisound.common.y.e("TTSParams setPlayStartBufferTime: playStartBufferTime > 15000 ", Integer.valueOf(v.intValue()));
        }
        if (v.intValue() <= 0) {
            v = 1;
            com.unisound.common.y.e("TTSParams setPlayStartBufferTime: playStartBufferTime < 0 ", Integer.valueOf(v.intValue()));
        }
        this.z = v.intValue();
    }

    public boolean q() {
        return this.S;
    }

    public Boolean r() {
        return this.L;
    }

    public String r(Object obj) {
        String str;
        if (obj == null) {
            str = "TTSParams object2String: obj is null";
        } else {
            if (obj instanceof String) {
                return (String) obj;
            }
            str = "TTSParams object2String: obj can not change to String";
        }
        com.unisound.common.y.a(str);
        return null;
    }

    public int s() {
        return this.M;
    }

    public void s(Object obj) {
        String r2 = r(obj);
        if (r2 == null) {
            com.unisound.common.y.a("TTSParams addField: value is null");
            return;
        }
        try {
            this.F.add(Integer.valueOf(Integer.valueOf(r2).intValue()));
        } catch (Exception e2) {
            e2.printStackTrace();
            com.unisound.common.y.a("TTSParams addField: value can not change to integer");
        }
    }

    public int t() {
        return this.N;
    }

    public boolean t(Object obj) {
        String r2 = r(obj);
        if (g(r2)) {
            return d(r2);
        }
        com.unisound.common.y.a("TTSParams setServerAddress: address unusable");
        return false;
    }

    public int u() {
        return this.K;
    }

    public void u(Object obj) {
        Integer v = v(obj);
        if (v.intValue() < 0 || v.intValue() > 8) {
            com.unisound.common.y.a("TTSParams setStreamType: mStreamType unusable");
        } else {
            this.G = v.intValue();
        }
    }

    public Boolean v() {
        return this.f32x;
    }

    public Integer v(Object obj) {
        String str;
        if (obj == null) {
            str = "TTSParams object2Integer: obj is null";
        } else {
            if (obj instanceof Integer) {
                return (Integer) obj;
            }
            str = "TTSParams object2Integer: obj can not change to integer";
        }
        com.unisound.common.y.a(str);
        return 1;
    }

    public String w() {
        return this.y;
    }

    public void w(Object obj) {
        Integer v = v(obj);
        if (v.intValue() == 1 || v.intValue() == 2 || v.intValue() == 3) {
            this.J = v;
        } else {
            com.unisound.common.y.a("TTSParams setMode: mMode unusable");
        }
    }

    public String x() {
        return this.D;
    }

    public void x(Object obj) {
        int intValue = v(obj).intValue();
        if (intValue > 30) {
            intValue = 30;
        } else if (intValue <= 0) {
            intValue = 1;
        }
        this.O = intValue;
    }

    public int y() {
        return this.A;
    }

    public void y(Object obj) {
        this.U = E(obj);
    }

    public int z() {
        return this.B;
    }

    public void z(Object obj) {
        this.P = v(obj).intValue();
    }
}