和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518

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


package com.iflyvoice.vvmsdk.a;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Xml;
import com.google.android.mms.pdu.EncodedStringValue;
import com.huawei.mcs.base.database.DatabaseInfo;
import com.iflyvoice.vvmsdk.keep.BindCallback;
import com.iflyvoice.vvmsdk.keep.Callforward;
import com.iflyvoice.vvmsdk.keep.CallforwardType;
import com.iflyvoice.vvmsdk.keep.SDK;
import com.iflyvoice.vvmsdk.keep.ServiceInfo;
import com.iflyvoice.vvmsdk.keep.VVMException;
import com.iflyvoice.vvmsdk.keep.VoiceFileManager;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class b extends SDK {
    public b(Context context) {
        super(context);
    }

    @Override
    public void bind(BindCallback bindCallback) {
        new i(getContext()).a(bindCallback);
    }

    @Override
    public void bindWithToken(String str, String str2, BindCallback bindCallback) {
        new c(this, str2, str, new Handler(Looper.getMainLooper()), bindCallback).start();
    }

    @Override
    public VoiceFileManager createFileManager() {
        return new r(getContext(), this);
    }

    @Override
    public void modifyCallforward(String str, String str2, CallforwardType callforwardType, boolean z) {
        String a2 = new p("http://120.198.250.195:90/sdksetcallforward").a("uid", str).a("type", callforwardType.getType() + "").a("state", z ? "1" : "0").a(q.a(str, str2)).a().a();
        if (TextUtils.isEmpty(a2)) {
            throw new IOException();
        }
        XmlPullParser newPullParser = Xml.newPullParser();
        int i = -1;
        String str3 = "";
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a2.getBytes(EncodedStringValue.StringEncoding.UTF_8));
            newPullParser.setInput(byteArrayInputStream, EncodedStringValue.StringEncoding.UTF_8);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                switch (eventType) {
                    case 2:
                        String name = newPullParser.getName();
                        if ("result".equals(name)) {
                            i = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if (DatabaseInfo.GlobalDbVerColumn.DESC.equals(name)) {
                            str3 = newPullParser.nextText();
                            break;
                        } else {
                            break;
                        }
                }
            }
            byteArrayInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e2) {
            e2.printStackTrace();
        }
        if (i != 0) {
            throw new VVMException(i, str3);
        }
    }

    @Override
    public void orderService(String str, String str2, boolean z) {
        String a2 = new p("http://120.198.250.195:90/sdkserviceorder").a("uid", str).a("type", z ? "1" : "0").a(q.a(str, str2)).a().a();
        if (TextUtils.isEmpty(a2)) {
            throw new IOException();
        }
        XmlPullParser newPullParser = Xml.newPullParser();
        int i = -1;
        String str3 = "";
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a2.getBytes(EncodedStringValue.StringEncoding.UTF_8));
            newPullParser.setInput(byteArrayInputStream, EncodedStringValue.StringEncoding.UTF_8);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                switch (eventType) {
                    case 2:
                        String name = newPullParser.getName();
                        if ("result".equals(name)) {
                            i = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if (DatabaseInfo.GlobalDbVerColumn.DESC.equals(name)) {
                            str3 = newPullParser.nextText();
                            break;
                        } else {
                            break;
                        }
                }
            }
            byteArrayInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e2) {
            e2.printStackTrace();
        }
        if (i != 0) {
            throw new VVMException(i, str3);
        }
    }

    @Override
    public Callforward queryCallforward(String str, String str2) {
        int i = -1;
        String a2 = new p("http://120.198.250.195:90/sdkquerycallforward").a("uid", str).a(q.a(str, str2)).a().a();
        if (TextUtils.isEmpty(a2)) {
            throw new IOException();
        }
        XmlPullParser newPullParser = Xml.newPullParser();
        String str3 = "";
        Callforward callforward = new Callforward();
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a2.getBytes(EncodedStringValue.StringEncoding.UTF_8));
            newPullParser.setInput(byteArrayInputStream, EncodedStringValue.StringEncoding.UTF_8);
            CallforwardType callforwardType = null;
            int i2 = -1;
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                switch (eventType) {
                    case 2:
                        String name = newPullParser.getName();
                        if ("result".equals(name)) {
                            i = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if (DatabaseInfo.GlobalDbVerColumn.DESC.equals(name)) {
                            str3 = newPullParser.nextText();
                            break;
                        } else if ("type".equals(name)) {
                            callforwardType = CallforwardType.valueOf(Integer.valueOf(newPullParser.nextText()).intValue());
                            break;
                        } else if ("state".equals(name)) {
                            i2 = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        }
                        break;
                }
                if ("misscall".equals(newPullParser.getName()) && callforwardType != null) {
                    callforward.initState(callforwardType, i2);
                }
            }
            byteArrayInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e2) {
            e2.printStackTrace();
        }
        if (i != 0) {
            throw new VVMException(i, str3);
        }
        return callforward;
    }

    @Override
    public ServiceInfo queryService(String str, String str2) {
        String a2 = new p("http://120.198.250.195:90/sdkqueryservice").a("uid", str).a(q.a(str, str2)).a().a();
        if (TextUtils.isEmpty(a2)) {
            throw new IOException();
        }
        XmlPullParser newPullParser = Xml.newPullParser();
        int i = -1;
        String str3 = "";
        ServiceInfo serviceInfo = new ServiceInfo();
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a2.getBytes(EncodedStringValue.StringEncoding.UTF_8));
            newPullParser.setInput(byteArrayInputStream, EncodedStringValue.StringEncoding.UTF_8);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                switch (eventType) {
                    case 2:
                        String name = newPullParser.getName();
                        if ("result".equals(name)) {
                            i = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if (DatabaseInfo.GlobalDbVerColumn.DESC.equals(name)) {
                            str3 = newPullParser.nextText();
                            break;
                        } else if ("usertype".equals(name)) {
                            serviceInfo.userType = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if ("userstate".equals(name)) {
                            serviceInfo.userState = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if ("ordertime".equals(name)) {
                            serviceInfo.orderTime = newPullParser.nextText();
                            break;
                        } else if ("servicebegin".equals(name)) {
                            serviceInfo.serviceBegin = newPullParser.nextText();
                            break;
                        } else if ("serviceend".equals(name)) {
                            serviceInfo.serviceEnd = newPullParser.nextText();
                            break;
                        } else if ("servicetrialend".equals(name)) {
                            serviceInfo.serviceTrialend = newPullParser.nextText();
                            break;
                        } else {
                            break;
                        }
                }
            }
            byteArrayInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e2) {
            e2.printStackTrace();
        }
        if (i != 0) {
            throw new VVMException(i, str3);
        }
        return serviceInfo;
    }

    @Override
    public s queryVoiceUrl(String str, String str2, String str3) {
        s sVar = new s();
        sVar.a(str3);
        String a2 = new p("http://120.198.250.195:90/sdkgetmsgdemo").a("uid", str).a("msgid", str3).a(q.a(str, str2)).a().a();
        if (TextUtils.isEmpty(a2)) {
            throw new IOException();
        }
        XmlPullParser newPullParser = Xml.newPullParser();
        int i = -1;
        String str4 = "";
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a2.getBytes(EncodedStringValue.StringEncoding.UTF_8));
            newPullParser.setInput(byteArrayInputStream, EncodedStringValue.StringEncoding.UTF_8);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                switch (eventType) {
                    case 2:
                        String name = newPullParser.getName();
                        if ("result".equals(name)) {
                            i = Integer.valueOf(newPullParser.nextText()).intValue();
                            break;
                        } else if (DatabaseInfo.GlobalDbVerColumn.DESC.equals(name)) {
                            str4 = newPullParser.nextText();
                            break;
                        } else if ("url".equals(name)) {
                            sVar.b(newPullParser.nextText());
                            break;
                        } else if ("duration".equals(name)) {
                            String nextText = newPullParser.nextText();
                            if (!TextUtils.isEmpty(nextText) && TextUtils.isDigitsOnly(nextText)) {
                                sVar.a(Integer.valueOf(nextText).intValue());
                                break;
                            }
                        } else {
                            break;
                        }
                        break;
                }
            }
            byteArrayInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e2) {
            e2.printStackTrace();
        }
        if (i != 0) {
            throw new VVMException(i, str4);
        }
        return sVar;
    }
}