A
A
and7ey2017-02-19 00:37:16
Android
and7ey, 2017-02-19 00:37:16

How to emulate Aliexpress mobile app login on PC?

I managed to find that to enter aliexpress (as in a mobile application), you need to send a POST request of the form

adash.m.taobao.com/rest/sur?ak=21371611&av=5.1.7&c...

In addition to the request, there should be a form, apparently with the user's password and email. But for some reason, the data is transferred as files (stm_c, stm_d, stm_p - and what's in them - it's not clear).
And somehow the value of the parameter s should be considered.
Nobody understood how it works?
public static C5009a m18977a(int i, String str, Map<String, Object> map, boolean z) {
        Exception e;
        DataOutputStream dataOutputStream;
        Throwable th;
        C5009a c5009a = new C5009a();
        if (TextUtils.isEmpty(str)) {
            return c5009a;
        }
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
            if (httpURLConnection != null) {
                if (i == 2 || i == 3) {
                    httpURLConnection.setDoOutput(true);
                }
                httpURLConnection.setDoInput(true);
                if (i == 2 || i == 3) {
                    try {
                        httpURLConnection.setRequestMethod("POST");
                    } catch (ProtocolException e2) {
                        e2.printStackTrace();
                        return c5009a;
                    }
                }
                httpURLConnection.setRequestMethod("GET");
                httpURLConnection.setUseCaches(false);
                httpURLConnection.setConnectTimeout(SnsAuthErrorInfo.GOOGLE_AUTH_FAILED_PARAM_ACTIVITY_IS_NULL);
                httpURLConnection.setReadTimeout(60000);
                httpURLConnection.setRequestProperty("Connection", "close");
                if (z) {
                    httpURLConnection.setRequestProperty("Accept-Encoding", "gzip,deflate");
                }
                httpURLConnection.setInstanceFollowRedirects(true);
                byte[] bArr = null;
                if (i == 2 || i == 3) {
                    byte[] bArr2;
                    int length;
                    if (i == 2) {
                        httpURLConnection.setRequestProperty("Content-Type", "multipart/form-data; boundary=GJircTeP");
                    } else if (i == 3) {
                        httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                    }
                    if (map == null || map.size() <= 0) {
                        bArr2 = null;
                    } else {
                        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                        Set keySet = map.keySet();
                        String[] strArr = new String[keySet.size()];
                        keySet.toArray(strArr);
                        for (String str2 : C5014f.m18980a().m18981a(strArr, true)) {
                            if (i == 2) {
                                bArr = (byte[]) map.get(str2);
                                if (bArr != null) {
                                    try {
                                        byteArrayOutputStream.write(String.format("--GJircTeP\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: application/octet-stream \r\n\r\n", new Object[]{str2, str2}).getBytes());
                                        byteArrayOutputStream.write(bArr);
                                        byteArrayOutputStream.write("\r\n".getBytes());
                                    } catch (IOException e3) {
                                        e3.printStackTrace();
                                    }
                                }
                            } else if (i == 3) {
                                String str3 = (String) map.get(str2);
                                if (byteArrayOutputStream.size() > 0) {
                                    try {
                                        byteArrayOutputStream.write(("&" + str2 + "=" + str3).getBytes());
                                    } catch (IOException e32) {
                                        e32.printStackTrace();
                                    }
                                } else {
                                    try {
                                        byteArrayOutputStream.write((str2 + "=" + str3).getBytes());
                                    } catch (IOException e322) {
                                        e322.printStackTrace();
                                    }
                                }
                            }
                        }
                        if (i == 2) {
                            try {
                                byteArrayOutputStream.write("--GJircTeP--\r\n".getBytes());
                            } catch (IOException e3222) {
                                e3222.printStackTrace();
                            }
                        }
                        bArr2 = byteArrayOutputStream.toByteArray();
                    }
                    if (bArr2 != null) {
                        length = bArr2.length;
                    } else {
                        length = 0;
                    }
                    httpURLConnection.setRequestProperty("Content-Length", String.valueOf(length));
                    bArr = bArr2;
                }
                DataOutputStream dataOutputStream2 = null;
                try {
                    byte[] bArr3;
                    int read;
                    httpURLConnection.connect();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OsyaBender, 2017-02-19
@OsyaBender

I made a virtual machine and android on it. Now it seems that someone made the entire installation package VM + android, on the w3bsit3-dns.com forum I came across.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question