APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:CycleView
版本号:4.40
包名称:com.esd.laundrylink.cycleview

MD5 校验值:230b791cc707d42fd585468f66a30851

反编译源代码说明

z.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.esd.laundrylink;

import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.Locale;
import java.util.UUID;
import java.util.zip.GZIPInputStream;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

final class z {
    private static final byte[] a = {83, 71, 26, 58, 54, 35, 22, 11, 83, 71, 26, 58, 54, 35, 22, 11};

    private static boolean f2439b = false;

    public static class a {
        public final int a;

        a(int i) {
            this.a = i;
        }
    }

    private static JSONObject a(JSONObject jSONObject) {
        if (jSONObject.has("_AppKey")) {
            return jSONObject;
        }
        JSONObject jSONObject2 = new JSONObject();
        try {
            jSONObject2.put("_AppKey", "$#!@ES(*#D3$!318z");
            Iterator<String> keys = jSONObject.keys();
            while (keys.hasNext()) {
                String next = keys.next();
                try {
                    jSONObject2.put(next, jSONObject.get(next));
                } catch (Exception e2) {
                    e2.printStackTrace();
                    com.google.firebase.crashlytics.g.a().d(e2);
                    return null;
                }
            }
            return jSONObject2;
        } catch (Exception e3) {
            e3.printStackTrace();
            com.google.firebase.crashlytics.g.a().d(e3);
            return null;
        }
    }

    private static byte[] b(String str, JSONObject jSONObject) {
        JSONArray jSONArray = new JSONArray();
        jSONArray.put(str);
        Iterator<String> keys = jSONObject.keys();
        while (keys.hasNext()) {
            try {
                jSONArray.put(jSONObject.get(keys.next()));
            } catch (JSONException e2) {
                e2.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e2);
            }
        }
        return jSONArray.toString().getBytes(StandardCharsets.UTF_8);
    }

    private static String c(String str) {
        GZIPInputStream gZIPInputStream;
        String str2 = null;
        try {
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(Base64.decode(str, 0));
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            byte[] bArr = new byte[200];
            try {
                gZIPInputStream = new GZIPInputStream(byteArrayInputStream);
            } catch (Exception e2) {
                e2.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e2);
                gZIPInputStream = null;
            }
            try {
                byteArrayOutputStream.close();
            } catch (Exception e3) {
                e3.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e3);
            }
            return str2;
            try {
                gZIPInputStream.close();
            } catch (Exception e4) {
                e4.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e4);
            }
            try {
                str2 = byteArrayOutputStream.toString("UTF-8");
            } catch (Exception e5) {
                e5.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e5);
            }
            try {
                byteArrayInputStream.close();
            } catch (Exception e6) {
                e6.printStackTrace();
                com.google.firebase.crashlytics.g.a().d(e6);
            }
            byteArrayOutputStream.close();
            return str2;
            byteArrayInputStream.close();
            byteArrayOutputStream.close();
            return str2;
            return str2;
            str2 = byteArrayOutputStream.toString("UTF-8");
            byteArrayInputStream.close();
            byteArrayOutputStream.close();
            return str2;
        } catch (Exception e7) {
            e7.printStackTrace();
            com.google.firebase.crashlytics.g.a().d(e7);
            return null;
        }
    }

    private static JSONObject d(JSONObject jSONObject) {
        JSONObject jSONObject2 = null;
        try {
            String c2 = c(jSONObject.getString("Response"));
            if (c2 != null) {
                try {
                    jSONObject2 = new JSONObject(c2);
                } catch (Exception e2) {
                    e2.printStackTrace();
                    com.google.firebase.crashlytics.g.a().d(e2);
                }
            }
            return jSONObject2 != null ? j(jSONObject2) : jSONObject2;
        } catch (Exception e3) {
            e3.printStackTrace();
            com.google.firebase.crashlytics.g.a().d(e3);
            return null;
        }
    }

    private static byte[] e(UUID uuid) {
        String uuid2 = uuid.toString();
        StringBuilder sb = new StringBuilder();
        for (int length = uuid2.length() - 1; length >= 0 && sb.length() < 8; length -= 2) {
            sb.append(uuid2.charAt(length));
        }
        sb.append("R&%76mhK");
        return sb.toString().getBytes();
    }

    private static byte[] f(UUID uuid, UUID uuid2) {
        String uuid3 = uuid.toString();
        String uuid4 = uuid2.toString();
        StringBuilder sb = new StringBuilder();
        for (int length = uuid3.length() - 1; length >= 0 && sb.length() < 8; length -= 2) {
            sb.append(uuid3.charAt(length));
        }
        for (int length2 = uuid4.length() - 1; length2 >= 0 && sb.length() < 16; length2 -= 2) {
            sb.append(uuid4.charAt(length2));
        }
        return sb.toString().getBytes();
    }

    private static byte[] g(byte[] bArr) {
        return String.format(Locale.US, "CP_REQ_DATA=%s", Base64.encodeToString(bArr, 2)).getBytes(StandardCharsets.UTF_8);
    }

    public static a h(String str, JSONObject jSONObject, UUID uuid, UUID uuid2, d.b.b.f<JSONObject> fVar, d.b.b.f<UUID> fVar2) {
        UUID uuid3;
        byte[] e2;
        HttpURLConnection httpURLConnection;
        if (TextUtils.isEmpty(str)) {
            return new a(4);
        }
        JSONObject a2 = a(jSONObject);
        if (a2 == null) {
            return new a(5);
        }
        if (uuid2 != null) {
            uuid3 = UUID.randomUUID();
            e2 = f(uuid3, uuid);
        } else {
            uuid3 = uuid;
            e2 = e(uuid);
        }
        byte[] g = g(Base64.encodeToString(d.b.a.b.i(b(str, a2), a, e2), 2).getBytes(StandardCharsets.UTF_8));
        if (g == null) {
            return new a(6);
        }
        BufferedReader bufferedReader = null;
        try {
            httpURLConnection = (HttpURLConnection) new URL("https://mapp.mylaundrylink.com/AppRequestHandler.aspx").openConnection();
            try {
                try {
                    httpURLConnection.setChunkedStreamingMode(0);
                    httpURLConnection.setConnectTimeout(30000);
                    httpURLConnection.setReadTimeout(30000);
                    httpURLConnection.setDoOutput(true);
                    httpURLConnection.setRequestMethod("POST");
                    httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                    httpURLConnection.setRequestProperty("Accept", "application/octet-stream");
                    httpURLConnection.setRequestProperty("CP_REQ_ID", uuid3.toString());
                    if (uuid2 != null) {
                        httpURLConnection.setRequestProperty("CP_AUTH_TOKEN", uuid2.toString());
                    } else {
                        httpURLConnection.setRequestProperty("CP_AUTH_TOKEN", "00000000-0000-0000-0000-000000000000");
                    }
                    httpURLConnection.connect();
                    httpURLConnection.getOutputStream().write(g);
                    httpURLConnection.getOutputStream().flush();
                    if (httpURLConnection.getResponseCode() == 200) {
                        BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), StandardCharsets.UTF_8));
                        try {
                            try {
                                StringBuilder sb = new StringBuilder();
                                while (true) {
                                    String readLine = bufferedReader2.readLine();
                                    if (readLine != null) {
                                        sb.append(readLine);
                                        sb.append("\n");
                                    } else {
                                        try {
                                            break;
                                        } catch (JSONException e3) {
                                            e3.printStackTrace();
                                            com.google.firebase.crashlytics.g.a().d(e3);
                                            a aVar = new a(2);
                                            try {
                                                bufferedReader2.close();
                                            } catch (IOException e4) {
                                                e4.printStackTrace();
                                                com.google.firebase.crashlytics.g.a().d(e4);
                                            }
                                            httpURLConnection.disconnect();
                                            return aVar;
                                        }
                                    }
                                }
                                JSONObject d2 = d(new JSONObject(sb.toString()));
                                if (d2 == null) {
                                    a aVar2 = new a(2);
                                    try {
                                        bufferedReader2.close();
                                    } catch (IOException e5) {
                                        e5.printStackTrace();
                                        com.google.firebase.crashlytics.g.a().d(e5);
                                    }
                                    httpURLConnection.disconnect();
                                    return aVar2;
                                }
                                fVar.b(d2);
                                if (f2439b) {
                                    for (String str2 : d2.toString(4).split("\n")) {
                                        Log.d("sendJsonRequest", String.format(Locale.US, "Response Data: %S", str2));
                                    }
                                }
                                if (fVar2 != null) {
                                    String headerField = httpURLConnection.getHeaderField("CP_AUTH_TOKEN");
                                    if (headerField == null) {
                                        com.google.firebase.crashlytics.g.a().d(new Exception("CP_AUTH_TOKEN from headers is null"));
                                        a aVar3 = new a(7);
                                        try {
                                            bufferedReader2.close();
                                        } catch (IOException e6) {
                                            e6.printStackTrace();
                                            com.google.firebase.crashlytics.g.a().d(e6);
                                        }
                                        httpURLConnection.disconnect();
                                        return aVar3;
                                    }
                                    try {
                                        fVar2.b(UUID.fromString(headerField));
                                    } catch (Exception e7) {
                                        e7.printStackTrace();
                                        com.google.firebase.crashlytics.g.a().d(e7);
                                        a aVar4 = new a(7);
                                        try {
                                            bufferedReader2.close();
                                        } catch (IOException e8) {
                                            e8.printStackTrace();
                                            com.google.firebase.crashlytics.g.a().d(e8);
                                        }
                                        httpURLConnection.disconnect();
                                        return aVar4;
                                    }
                                }
                                a aVar5 = new a(0);
                                try {
                                    bufferedReader2.close();
                                } catch (IOException e9) {
                                    e9.printStackTrace();
                                    com.google.firebase.crashlytics.g.a().d(e9);
                                }
                                httpURLConnection.disconnect();
                                return aVar5;
                            } catch (Exception e10) {
                                bufferedReader = bufferedReader2;
                                e = e10;
                                e.printStackTrace();
                                com.google.firebase.crashlytics.g.a().d(e);
                                if (bufferedReader != null) {
                                    try {
                                        bufferedReader.close();
                                    } catch (IOException e11) {
                                        e11.printStackTrace();
                                        com.google.firebase.crashlytics.g.a().d(e11);
                                    }
                                }
                                if (httpURLConnection != null) {
                                    httpURLConnection.disconnect();
                                }
                                return new a(1);
                            }
                        } catch (Throwable th) {
                            bufferedReader = bufferedReader2;
                            th = th;
                            if (bufferedReader != null) {
                                try {
                                    bufferedReader.close();
                                } catch (IOException e12) {
                                    e12.printStackTrace();
                                    com.google.firebase.crashlytics.g.a().d(e12);
                                }
                            }
                            if (httpURLConnection != null) {
                                httpURLConnection.disconnect();
                                throw th;
                            }
                            throw th;
                        }
                    }
                    if (f2439b) {
                        Log.d("sendJsonRequest", String.format(Locale.US, "Http Error Response Code: %d", Integer.valueOf(httpURLConnection.getResponseCode())));
                    }
                    a aVar6 = new a(3);
                    httpURLConnection.disconnect();
                    return aVar6;
                } catch (Throwable th2) {
                    th = th2;
                }
            } catch (Exception e13) {
                e = e13;
            }
        } catch (Exception e14) {
            e = e14;
            httpURLConnection = null;
        } catch (Throwable th3) {
            th = th3;
            httpURLConnection = null;
        }
    }

    public static void i(boolean z) {
        f2439b = z;
    }

    private static JSONObject j(JSONObject jSONObject) {
        JSONObject jSONObject2 = new JSONObject();
        try {
            jSONObject2.put("d", jSONObject);
            return jSONObject2;
        } catch (Exception e2) {
            e2.printStackTrace();
            com.google.firebase.crashlytics.g.a().d(e2);
            return null;
        }
    }
}