CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e

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


package com.mobile.auth.c;

import android.content.Context;
import android.text.TextUtils;
import com.mobile.auth.b.f;
import com.mobile.auth.d.i;
import com.mobile.auth.gatewayauth.ExceptionProcessor;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.apache.commons.codec.language.bm.Rule;
import org.json.JSONArray;
import org.json.JSONObject;

public class d {

    private static final String f29458a = "d";

    private static final byte[] f29459b = {15, 31, 94, 10, 90, 15, 91, 24, 10, 30, 88, 7, 89, 10, 95, 30};

    static String a(Context context, Queue queue) {
        try {
            return b(context, (Queue<String>) queue);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static Queue a(Context context, List list, int i10) {
        try {
            return c(context, list, i10);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    static void a(Context context) {
        try {
            c(context);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private static void a(Context context, int i10) {
        try {
            try {
                com.mobile.auth.d.b.a(context, "key_c_l_l_v", i10);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public static void a(Context context, String str) {
        char c10;
        try {
            int hashCode = str.hashCode();
            int i10 = -1;
            if (hashCode == 64897) {
                if (str.equals(Rule.ALL)) {
                    c10 = 0;
                    if (c10 != 0) {
                    }
                    i10 = 0;
                    a(context, i10);
                    return;
                }
                c10 = 65535;
                if (c10 != 0) {
                }
                i10 = 0;
                a(context, i10);
                return;
            }
            if (hashCode == 78159) {
                if (str.equals("OFF")) {
                    c10 = 2;
                    if (c10 != 0) {
                    }
                    i10 = 0;
                    a(context, i10);
                    return;
                }
                c10 = 65535;
                if (c10 != 0) {
                }
                i10 = 0;
                a(context, i10);
                return;
            }
            if (hashCode == 66247144 && str.equals("ERROR")) {
                c10 = 1;
                if (c10 != 0) {
                    if (c10 != 1) {
                        if (c10 == 2) {
                            i10 = -2;
                        }
                    }
                    a(context, i10);
                    return;
                }
                i10 = 0;
                a(context, i10);
                return;
            }
            c10 = 65535;
            if (c10 != 0) {
            }
            i10 = 0;
            a(context, i10);
            return;
        } catch (Throwable th) {
            ExceptionProcessor.processException(th);
        }
        try {
            ExceptionProcessor.processException(th);
        } catch (Throwable th2) {
            ExceptionProcessor.processException(th2);
        }
    }

    public static void a(Context context, List<String> list) {
        try {
            int b10 = b(context);
            if (b10 == -2) {
                return;
            }
            b(context, list, b10);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    static void a(Context context, Queue queue, int i10) {
        try {
            b(context, (Queue<String>) queue, i10);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private static int b(Context context) {
        try {
            return com.mobile.auth.d.b.b(context, "key_c_l_l_v", 0);
        } catch (Throwable th) {
            try {
                th.printStackTrace();
                return 0;
            } catch (Throwable th2) {
                try {
                    ExceptionProcessor.processException(th2);
                    return -1;
                } catch (Throwable th3) {
                    ExceptionProcessor.processException(th3);
                    return -1;
                }
            }
        }
    }

    private static String b(Context context, String str) {
        try {
            return a.a(context, "https://api-e189.21cn.com/gw/client/accountMsg.do", str);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private static String b(Context context, Queue<String> queue) {
        try {
            JSONArray jSONArray = new JSONArray();
            String jSONArray2 = jSONArray.toString();
            if (!queue.isEmpty()) {
                Iterator<String> it = queue.iterator();
                while (it.hasNext()) {
                    try {
                        jSONArray.put(new JSONObject(it.next()));
                    } catch (Exception e10) {
                        e10.printStackTrace();
                    }
                }
            }
            if (jSONArray.length() <= 0) {
                return "";
            }
            String jSONArray3 = jSONArray.toString();
            if (!TextUtils.isEmpty(jSONArray3)) {
                try {
                    jSONArray2 = URLEncoder.encode(com.mobile.auth.b.b.a(com.mobile.auth.b.a.b(jSONArray3, f.a(f29459b))), "UTF-8");
                } catch (Exception e11) {
                    e11.printStackTrace();
                }
            }
            return b(context, jSONArray2);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private static void b(final Context context, final List<String> list, final int i10) {
        try {
            i.a().a(new Runnable() {
                @Override
                public void run() {
                    try {
                        Queue a10 = d.a(context, list, i10);
                        if (a10.isEmpty()) {
                            return;
                        }
                        String a11 = d.a(context, a10);
                        JSONObject jSONObject = null;
                        int i11 = -1;
                        try {
                            if (!TextUtils.isEmpty(a11)) {
                                JSONObject jSONObject2 = new JSONObject(a11);
                                try {
                                    i11 = jSONObject2.getInt("code");
                                    jSONObject = jSONObject2;
                                } catch (Exception e10) {
                                    e = e10;
                                    jSONObject = jSONObject2;
                                    e.printStackTrace();
                                    if (jSONObject != null) {
                                    }
                                    d.a(context, a10, i10);
                                }
                            }
                        } catch (Exception e11) {
                            e = e11;
                        }
                        if (jSONObject != null || i11 != 0) {
                            d.a(context, a10, i10);
                        } else {
                            d.a(context);
                            a10.clear();
                        }
                    } catch (Throwable th) {
                        try {
                            th.printStackTrace();
                        } catch (Throwable th2) {
                            try {
                                ExceptionProcessor.processException(th2);
                            } catch (Throwable th3) {
                                ExceptionProcessor.processException(th3);
                            }
                        }
                    }
                }
            });
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private static void b(Context context, Queue<String> queue, int i10) {
        JSONObject jSONObject;
        try {
            String str = "";
            JSONArray jSONArray = new JSONArray();
            if (queue != null && !queue.isEmpty()) {
                Iterator<String> it = queue.iterator();
                int i11 = 0;
                while (it.hasNext()) {
                    try {
                        jSONObject = new JSONObject(it.next());
                    } catch (Exception e10) {
                        e10.printStackTrace();
                    }
                    if (i10 != -1 || jSONObject.getInt("rt") != 0) {
                        jSONArray.put(jSONObject);
                        i11++;
                        if (i11 > 10) {
                            break;
                        }
                    }
                }
            }
            if (jSONArray.length() > 0) {
                try {
                    str = com.mobile.auth.b.a.a(jSONArray.toString(), f.a(f29459b));
                } catch (Exception e11) {
                    str = null;
                    e11.printStackTrace();
                }
            }
            if (TextUtils.isEmpty(str)) {
                return;
            }
            c.a(context, str);
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    private static synchronized Queue<String> c(Context context, List<String> list, int i10) {
        ConcurrentLinkedQueue concurrentLinkedQueue;
        synchronized (d.class) {
            try {
                concurrentLinkedQueue = new ConcurrentLinkedQueue();
                String a10 = c.a(context);
                if (!TextUtils.isEmpty(a10)) {
                    try {
                        JSONArray jSONArray = new JSONArray(com.mobile.auth.b.a.c(a10, f.a(f29459b)));
                        int length = jSONArray.length();
                        for (int i11 = 0; i11 < length && i11 <= 10; i11++) {
                            JSONObject jSONObject = jSONArray.getJSONObject(i11);
                            if (jSONObject != null) {
                                concurrentLinkedQueue.add(jSONObject.toString());
                            }
                        }
                        c.a(context, "");
                    } catch (Exception e10) {
                        e10.printStackTrace();
                    }
                }
                if (i10 == -1) {
                    for (String str : list) {
                        try {
                            if (new JSONObject(str).getInt("rt") != 0) {
                                concurrentLinkedQueue.add(str);
                            }
                        } catch (Exception e11) {
                            e11.printStackTrace();
                        }
                    }
                } else if (i10 == 0) {
                    concurrentLinkedQueue.addAll(list);
                }
                while (concurrentLinkedQueue.size() > 10) {
                    concurrentLinkedQueue.poll();
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                    return null;
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                    return null;
                }
            }
        }
        return concurrentLinkedQueue;
    }

    private static void c(Context context) {
        try {
            c.a(context, "");
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }
}