乐健体育 v3.9.1版本的 MD5 值为:87ae8a64955cdd0e43f3559ee8984d75

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


package com.baidu.idl.face.platform.ui.utils;

import android.content.Context;
import android.util.Log;
import com.baidu.idl.face.platform.FaceSDKManager;
import com.google.common.net.HttpHeaders;
import com.taobao.weex.utils.tools.TimeCalculator;
import io.dcloud.common.constant.AbsoluteConst;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import org.json.JSONObject;
public class SecRequest {
    private static final String REQUEST_URL = "http://10.138.32.176:8518/api/v3/person/verify_sec?appid=7758258";
    private static final String TAG = "SecRequest";

    public static String requestPost(String str, String str2) {
        ByteArrayOutputStream byteArrayOutputStream;
        InputStream inputStream;
        Object obj;
        ByteArrayOutputStream byteArrayOutputStream2;
        InputStream inputStream2;
        Object obj2;
        ByteArrayOutputStream byteArrayOutputStream3;
        Object obj3;
        Object obj4;
        ByteArrayOutputStream byteArrayOutputStream4;
        ByteArrayOutputStream byteArrayOutputStream5;
        ?? r3;
        InputStream inputStream3;
        ByteArrayOutputStream byteArrayOutputStream6 = null;
        try {
            try {
                try {
                    str2 = (HttpURLConnection) new URL(str2).openConnection();
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            } catch (MalformedURLException e3) {
                e = e3;
                obj3 = null;
                obj4 = null;
                byteArrayOutputStream4 = null;
            } catch (IOException e4) {
                e = e4;
                inputStream2 = null;
                obj2 = null;
                byteArrayOutputStream3 = null;
            } catch (Exception e5) {
                e = e5;
                inputStream = null;
                obj = null;
                byteArrayOutputStream2 = null;
            } catch (Throwable th) {
                th = th;
                str = 0;
                str2 = 0;
                byteArrayOutputStream = null;
            }
            try {
                System.setProperty("sun.net.client.defaultConnectTimeout", "8000");
                System.setProperty("sun.net.client.defaultReadTimeout", "8000");
                str2.setDoOutput(true);
                str2.setDoInput(true);
                str2.setRequestMethod("POST");
                str2.setUseCaches(false);
                str2.setRequestProperty("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0;");
                str2.setRequestProperty(HttpHeaders.ACCEPT_LANGUAGE, "zh-CN");
                str2.setRequestProperty("Connection", HttpHeaders.KEEP_ALIVE);
                str2.setRequestProperty("Charset", "UTF-8");
                str2.setRequestProperty("Content-Type", "application/json");
                str2.connect();
                ?? outputStream = str2.getOutputStream();
                try {
                    outputStream.write(str.getBytes());
                    outputStream.flush();
                    outputStream.close();
                    int responseCode = str2.getResponseCode();
                    Log.e(TAG, "request code " + responseCode);
                    if (200 == responseCode) {
                        str = str2.getInputStream();
                        try {
                            byte[] bArr = new byte[1024];
                            byteArrayOutputStream = new ByteArrayOutputStream();
                            while (true) {
                                try {
                                    try {
                                        int read = str.read(bArr);
                                        if (read == -1) {
                                            break;
                                        }
                                        byteArrayOutputStream.write(bArr, 0, read);
                                    } catch (Throwable th2) {
                                        th = th2;
                                        byteArrayOutputStream6 = outputStream;
                                        if (byteArrayOutputStream6 != null) {
                                            try {
                                                byteArrayOutputStream6.close();
                                            } catch (Exception e6) {
                                                e6.printStackTrace();
                                                throw th;
                                            }
                                        }
                                        if (byteArrayOutputStream != null) {
                                            byteArrayOutputStream.close();
                                        }
                                        if (str != 0) {
                                            str.close();
                                        }
                                        if (str2 != 0) {
                                            str2.disconnect();
                                        }
                                        throw th;
                                    }
                                } catch (MalformedURLException e7) {
                                    e = e7;
                                    r3 = 0;
                                } catch (IOException e8) {
                                    e = e8;
                                    r3 = 0;
                                } catch (Exception e9) {
                                    e = e9;
                                    r3 = 0;
                                }
                            }
                            r3 = new String(byteArrayOutputStream.toByteArray(), "utf-8");
                            try {
                                byteArrayOutputStream.flush();
                                Log.e(TAG, "request data " + r3);
                                byteArrayOutputStream6 = byteArrayOutputStream;
                                byteArrayOutputStream5 = r3;
                                inputStream3 = str;
                            } catch (MalformedURLException e10) {
                                e = e10;
                                byteArrayOutputStream6 = outputStream;
                                byteArrayOutputStream5 = r3;
                                str = str;
                                str2 = str2;
                                Log.e(TAG, "MalformedURLException " + e.getMessage());
                                e.printStackTrace();
                                if (byteArrayOutputStream6 != null) {
                                    byteArrayOutputStream6.close();
                                }
                                if (byteArrayOutputStream != null) {
                                    byteArrayOutputStream.close();
                                }
                                if (str != 0) {
                                    str.close();
                                }
                                if (str2 != 0) {
                                    str2.disconnect();
                                }
                                return byteArrayOutputStream5;
                            } catch (IOException e11) {
                                e = e11;
                                byteArrayOutputStream6 = outputStream;
                                byteArrayOutputStream5 = r3;
                                str = str;
                                str2 = str2;
                                Log.e(TAG, "IOException " + e.getMessage());
                                e.printStackTrace();
                                if (byteArrayOutputStream6 != null) {
                                    byteArrayOutputStream6.close();
                                }
                                if (byteArrayOutputStream != null) {
                                    byteArrayOutputStream.close();
                                }
                                if (str != null) {
                                    str.close();
                                }
                                if (str2 != 0) {
                                    str2.disconnect();
                                }
                                return byteArrayOutputStream5;
                            } catch (Exception e12) {
                                e = e12;
                                byteArrayOutputStream6 = outputStream;
                                byteArrayOutputStream5 = r3;
                                str = str;
                                str2 = str2;
                                Log.e(TAG, "Exception " + e.getMessage());
                                e.printStackTrace();
                                if (byteArrayOutputStream6 != null) {
                                    byteArrayOutputStream6.close();
                                }
                                if (byteArrayOutputStream != null) {
                                    byteArrayOutputStream.close();
                                }
                                if (str != null) {
                                    str.close();
                                }
                                if (str2 != 0) {
                                    str2.disconnect();
                                }
                                return byteArrayOutputStream5;
                            }
                        } catch (MalformedURLException e13) {
                            e = e13;
                            r3 = 0;
                            str = str;
                            byteArrayOutputStream = r3;
                            byteArrayOutputStream6 = outputStream;
                            byteArrayOutputStream5 = r3;
                            str = str;
                            str2 = str2;
                            Log.e(TAG, "MalformedURLException " + e.getMessage());
                            e.printStackTrace();
                            if (byteArrayOutputStream6 != null) {
                            }
                            if (byteArrayOutputStream != null) {
                            }
                            if (str != 0) {
                            }
                            if (str2 != 0) {
                            }
                            return byteArrayOutputStream5;
                        } catch (IOException e14) {
                            e = e14;
                            r3 = 0;
                            str = str;
                            byteArrayOutputStream = r3;
                            byteArrayOutputStream6 = outputStream;
                            byteArrayOutputStream5 = r3;
                            str = str;
                            str2 = str2;
                            Log.e(TAG, "IOException " + e.getMessage());
                            e.printStackTrace();
                            if (byteArrayOutputStream6 != null) {
                            }
                            if (byteArrayOutputStream != null) {
                            }
                            if (str != null) {
                            }
                            if (str2 != 0) {
                            }
                            return byteArrayOutputStream5;
                        } catch (Exception e15) {
                            e = e15;
                            r3 = 0;
                            str = str;
                            byteArrayOutputStream = r3;
                            byteArrayOutputStream6 = outputStream;
                            byteArrayOutputStream5 = r3;
                            str = str;
                            str2 = str2;
                            Log.e(TAG, "Exception " + e.getMessage());
                            e.printStackTrace();
                            if (byteArrayOutputStream6 != null) {
                            }
                            if (byteArrayOutputStream != null) {
                            }
                            if (str != null) {
                            }
                            if (str2 != 0) {
                            }
                            return byteArrayOutputStream5;
                        } catch (Throwable th3) {
                            th = th3;
                            byteArrayOutputStream = null;
                        }
                    } else {
                        inputStream3 = null;
                        byteArrayOutputStream5 = 0;
                    }
                    outputStream.close();
                    if (byteArrayOutputStream6 != null) {
                        byteArrayOutputStream6.close();
                    }
                    if (inputStream3 != null) {
                        inputStream3.close();
                    }
                    str2.disconnect();
                } catch (MalformedURLException e16) {
                    e = e16;
                    str = null;
                    r3 = 0;
                } catch (IOException e17) {
                    e = e17;
                    str = null;
                    r3 = 0;
                } catch (Exception e18) {
                    e = e18;
                    str = null;
                    r3 = 0;
                } catch (Throwable th4) {
                    th = th4;
                    str = null;
                    byteArrayOutputStream = null;
                }
            } catch (MalformedURLException e19) {
                e = e19;
                obj3 = null;
                byteArrayOutputStream4 = null;
                obj4 = str2;
                byteArrayOutputStream = byteArrayOutputStream4;
                byteArrayOutputStream5 = byteArrayOutputStream4;
                str = obj3;
                str2 = obj4;
                Log.e(TAG, "MalformedURLException " + e.getMessage());
                e.printStackTrace();
                if (byteArrayOutputStream6 != null) {
                }
                if (byteArrayOutputStream != null) {
                }
                if (str != 0) {
                }
                if (str2 != 0) {
                }
                return byteArrayOutputStream5;
            } catch (IOException e20) {
                e = e20;
                inputStream2 = null;
                byteArrayOutputStream3 = null;
                obj2 = str2;
                byteArrayOutputStream = byteArrayOutputStream3;
                byteArrayOutputStream5 = byteArrayOutputStream3;
                str = inputStream2;
                str2 = obj2;
                Log.e(TAG, "IOException " + e.getMessage());
                e.printStackTrace();
                if (byteArrayOutputStream6 != null) {
                }
                if (byteArrayOutputStream != null) {
                }
                if (str != null) {
                }
                if (str2 != 0) {
                }
                return byteArrayOutputStream5;
            } catch (Exception e21) {
                e = e21;
                inputStream = null;
                byteArrayOutputStream2 = null;
                obj = str2;
                byteArrayOutputStream = byteArrayOutputStream2;
                byteArrayOutputStream5 = byteArrayOutputStream2;
                str = inputStream;
                str2 = obj;
                Log.e(TAG, "Exception " + e.getMessage());
                e.printStackTrace();
                if (byteArrayOutputStream6 != null) {
                }
                if (byteArrayOutputStream != null) {
                }
                if (str != null) {
                }
                if (str2 != 0) {
                }
                return byteArrayOutputStream5;
            } catch (Throwable th5) {
                th = th5;
                str = 0;
                byteArrayOutputStream = null;
            }
            return byteArrayOutputStream5;
        } catch (Throwable th6) {
            th = th6;
        }
    }

    public static void sendMessage(final Context context, final String str, final int i2) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("image_type", "BASE64");
                    jSONObject.put("image", str);
                    jSONObject.put("id_card_number", "101111111111111111");
                    jSONObject.put("name", URLDecoder.decode("张三", "UTF-8"));
                    jSONObject.put("quality_control", "NONE");
                    jSONObject.put("liveness_control", "NONE");
                    jSONObject.put("risk_identify", false);
                    jSONObject.put("zid", FaceSDKManager.getInstance().getZid(context));
                    jSONObject.put("ip", "172.30.154.173");
                    jSONObject.put("phone", "13000000000");
                    int i3 = i2;
                    if (i3 == 0) {
                        jSONObject.put("image_sec", false);
                    } else if (i3 == 1) {
                        jSONObject.put("image_sec", true);
                    }
                    jSONObject.put(AbsoluteConst.XML_APP, TimeCalculator.PLATFORM_ANDROID);
                    jSONObject.put("ev", "smrz");
                    SecRequest.requestPost(jSONObject.toString(), SecRequest.REQUEST_URL);
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
        }).start();
    }
}