Info Call to Socket API

Description

List of all calls to Server Socket API.

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method com.google.android.gms.internal.zzao.zza() calling method java.net.URL.<init>()


    public final org.apache.http.HttpResponse zza(com.google.android.gms.internal.zzp p8, java.util.Map p9)
    {
        String v0_6;
        String v1_10 = p8.getUrl();
        org.apache.http.message.BasicHttpResponse v5_1 = new java.util.HashMap();
        v5_1.putAll(p8.getHeaders());
        v5_1.putAll(p9);
        if (this.zzcc == null) {
            v0_6 = v1_10;
        } else {
            v0_6 = this.zzcc.zzg(v1_10);
            if (v0_6 == null) {
                String v0_18;
                String v0_16 = String.valueOf(v1_10);
                if (v0_16.length() == 0) {
                    v0_18 = new String("URL blocked by rewriter: ");
                } else {
                    v0_18 = "URL blocked by rewriter: ".concat(v0_16);
                }
                throw new java.io.IOException(v0_18);
            }
        }
        String v1_9 = new java.net.URL(v0_6);
        String v0_20 = ((java.net.HttpURLConnection) v1_9.openConnection());
        v0_20.setInstanceFollowRedirects(java.net.HttpURLConnection.getFollowRedirects());
        java.util.Iterator v2_6 = p8.zzi();
        v0_20.setConnectTimeout(v2_6);
        v0_20.setReadTimeout(v2_6);
        v0_20.setUseCaches(0);
        v0_20.setDoInput(1);
        "https".equals(v1_9.getProtocol());
        int v6_0 = v5_1.keySet().iterator();
        while (v6_0.hasNext()) {
            String v1_6 = ((String) v6_0.next());
            v0_20.addRequestProperty(v1_6, ((String) v5_1.get(v1_6)));
        }
        switch (p8.getMethod()) {
            case -1:
                break;
            case 0:
                v0_20.setRequestMethod("GET");
                break;
            case 1:
                v0_20.setRequestMethod("POST");
                com.google.android.gms.internal.zzao.zza(v0_20, p8);
                break;
            case 2:
                v0_20.setRequestMethod("PUT");
                com.google.android.gms.internal.zzao.zza(v0_20, p8);
                break;
            case 3:
                v0_20.setRequestMethod("DELETE");
                break;
            case 4:
                v0_20.setRequestMethod("HEAD");
                break;
            case 5:
                v0_20.setRequestMethod("OPTIONS");
                break;
            case 6:
                v0_20.setRequestMethod("TRACE");
                break;
            case 7:
                v0_20.setRequestMethod("PATCH");
                com.google.android.gms.internal.zzao.zza(v0_20, p8);
                break;
            default:
                throw new IllegalStateException("Unknown method type.");
        }
        String v1_24 = new org.apache.http.ProtocolVersion("HTTP", 1, 1);
        if (v0_20.getResponseCode() != -1) {
            String v1_30;
            java.util.Iterator v2_11 = new org.apache.http.message.BasicStatusLine(v1_24, v0_20.getResponseCode(), v0_20.getResponseMessage());
            org.apache.http.message.BasicHttpResponse v5_5 = new org.apache.http.message.BasicHttpResponse(v2_11);
            String v1_25 = p8.getMethod();
            java.util.Iterator v2_12 = v2_11.getStatusCode();
            if (((v1_25 == 4) || ((100 <= v2_12) && (v2_12 < 200))) || ((v2_12 == 204) || (v2_12 == 304))) {
                v1_30 = 0;
            } else {
                v1_30 = 1;
            }
            if (v1_30 != null) {
                v5_5.setEntity(com.google.android.gms.internal.zzao.zza(v0_20));
            }
            java.util.Iterator v2_0 = v0_20.getHeaderFields().entrySet().iterator();
            while (v2_0.hasNext()) {
                String v0_5 = ((java.util.Map$Entry) v2_0.next());
                if (v0_5.getKey() != null) {
                    v5_5.addHeader(new org.apache.http.message.BasicHeader(((String) v0_5.getKey()), ((String) ((java.util.List) v0_5.getValue()).get(0))));
                }
            }
            return v5_5;
        } else {
            throw new java.io.IOException("Could not retrieve response code from HttpUrlConnection.");
        }
    }

Method com.google.android.gms.ads.identifier.zze.zzb() calling method java.net.URL.<init>()


    public final void zzb(java.util.Map p7)
    {
        String v2_4 = android.net.Uri.parse("https://pagead2.googlesyndication.com/pagead/gen_204?id=gmob-apps").buildUpon();
        String v3_4 = p7.keySet().iterator();
        while (v3_4.hasNext()) {
            RuntimeException v0_3 = ((String) v3_4.next());
            v2_4.appendQueryParameter(v0_3, ((String) p7.get(v0_3)));
        }
        String v2_3 = v2_4.build().toString();
        try {
            RuntimeException v0_9 = ((java.net.HttpURLConnection) new java.net.URL(v2_3).openConnection());
        } catch (RuntimeException v0_12) {
            String v3_5 = v0_12.getMessage();
            v2_3 = new StringBuilder(((String.valueOf(v2_3).length() + 32) + String.valueOf(v3_5).length())).append("Error while parsing ping URL: ").append(v2_3).append(". ").append(v3_5).toString();
            android.util.Log.w("HttpUrlPinger", v2_3, v0_12);
            return;
        } catch (RuntimeException v0_10) {
            String v3_3 = v0_10.getMessage();
            v2_3 = new StringBuilder(((String.valueOf(v2_3).length() + 27) + String.valueOf(v3_3).length())).append("Error while pinging URL: ").append(v2_3).append(". ").append(v3_3).toString();
            android.util.Log.w("HttpUrlPinger", v2_3, v0_10);
            return;
        } catch (RuntimeException v0_10) {
        }
        String v1_2 = v0_9.getResponseCode();
        if ((v1_2 < 200) || (v1_2 >= 300)) {
            android.util.Log.w("HttpUrlPinger", new StringBuilder((String.valueOf(v2_3).length() + 65)).append("Received non-success response code ").append(v1_2).append(" from pinging URL: ").append(v2_3).toString());
        }
        v0_9.disconnect();
        return;
    }

Method android.support.v7.app.MediaRouteControllerDialog$FetchArtTask.openInputStreamByScheme() calling method java.net.URL.<init>()


    private java.io.InputStream openInputStreamByScheme(android.net.Uri p6)
    {
        java.io.InputStream v2;
        String v1 = p6.getScheme().toLowerCase();
        if ((!"android.resource".equals(v1)) && ((!"content".equals(v1)) && (!"file".equals(v1)))) {
            java.net.URLConnection v0 = new java.net.URL(p6.toString()).openConnection();
            v0.setConnectTimeout(android.support.v7.app.MediaRouteControllerDialog.CONNECTION_TIMEOUT_MILLIS);
            v0.setReadTimeout(android.support.v7.app.MediaRouteControllerDialog.CONNECTION_TIMEOUT_MILLIS);
            v2 = v0.getInputStream();
        } else {
            v2 = this.this$0.mContext.getContentResolver().openInputStream(p6);
        }
        java.io.BufferedInputStream v4_11;
        if (v2 != null) {
            v4_11 = new java.io.BufferedInputStream(v2);
        } else {
            v4_11 = 0;
        }
        return v4_11;
    }

Method android.support.v7.app.MediaRouteCastDialog$FetchArtTask.openInputStreamByScheme() calling method java.net.URL.<init>()


    private java.io.InputStream openInputStreamByScheme(android.net.Uri p6)
    {
        java.io.InputStream v2;
        String v1 = p6.getScheme().toLowerCase();
        if ((!"android.resource".equals(v1)) && ((!"content".equals(v1)) && (!"file".equals(v1)))) {
            java.net.URLConnection v0 = new java.net.URL(p6.toString()).openConnection();
            v0.setConnectTimeout(android.support.v7.app.MediaRouteCastDialog.CONNECTION_TIMEOUT_MILLIS);
            v0.setReadTimeout(android.support.v7.app.MediaRouteCastDialog.CONNECTION_TIMEOUT_MILLIS);
            v2 = v0.getInputStream();
        } else {
            v2 = this.this$0.mContext.getContentResolver().openInputStream(p6);
        }
        java.io.BufferedInputStream v4_11;
        if (v2 != null) {
            v4_11 = new java.io.BufferedInputStream(v2);
        } else {
            v4_11 = 0;
        }
        return v4_11;
    }

Method com.microsoft.appcenter.http.DefaultHttpClient.doHttpCall() calling method java.net.URL.<init>()


    private static String doHttpCall(String p21, String p22, java.util.Map p23, com.microsoft.appcenter.http.HttpClient$CallTemplate p24)
    {
        java.net.URL v16 = new java.net.URL;
        v16(p21);
        javax.net.ssl.HttpsURLConnection v17_1 = ((javax.net.ssl.HttpsURLConnection) v16.openConnection());
        try {
            int v3 = android.os.Build$VERSION.SDK_INT;
        } catch (com.microsoft.appcenter.http.HttpException v18_21) {
            v17_1.disconnect();
            throw v18_21;
        }
        if ((v3 >= 16) && (v3 < 20)) {
            v17_1.setSSLSocketFactory(new com.microsoft.appcenter.http.TLS1_2SocketFactory());
        }
        v17_1.setConnectTimeout(60000);
        v17_1.setReadTimeout(20000);
        v17_1.setRequestMethod(p22);
        String v12_1 = 0;
        byte[] v4 = 0;
        int v14 = 0;
        if ((p22.equals("POST")) && (p24 != null)) {
            v12_1 = p24.buildRequestBody();
            v4 = v12_1.getBytes("UTF-8");
            if (v4.length < 1400) {
                v14 = 0;
            } else {
                v14 = 1;
            }
            if (!p23.containsKey("Content-Type")) {
                p23.put("Content-Type", "application/json");
            }
        }
        if (v14 != 0) {
            p23.put("Content-Encoding", "gzip");
        }
        String v20_2 = p23.entrySet().iterator();
        while (v20_2.hasNext()) {
            java.util.Map$Entry v8_1 = ((java.util.Map$Entry) v20_2.next());
            v17_1.setRequestProperty(((String) v8_1.getKey()), ((String) v8_1.getValue()));
        }
        if (p24 != null) {
            p24.onBeforeCalling(v16, p23);
        }
        if (v4 != null) {
            if (com.microsoft.appcenter.utils.AppCenterLog.getLogLevel() <= 2) {
                String v12_0 = com.microsoft.appcenter.http.DefaultHttpClient.TOKEN_REGEX_URL_ENCODED.matcher(v12_1).replaceAll("token=***");
                if ("application/json".equals(p23.get("Content-Type"))) {
                    com.microsoft.appcenter.http.HttpException v18_1 = new org.json.JSONObject;
                    v18_1(v12_0);
                    v12_0 = v18_1.toString(2);
                }
                com.microsoft.appcenter.utils.AppCenterLog.verbose("AppCenter", v12_0);
            }
            if (v14 != 0) {
                java.io.ByteArrayOutputStream v6_1 = new java.io.ByteArrayOutputStream(v4.length);
                java.util.zip.GZIPOutputStream v7_1 = new java.util.zip.GZIPOutputStream(v6_1);
                v7_1.write(v4);
                v7_1.close();
                v4 = v6_1.toByteArray();
            }
            v17_1.setDoOutput(1);
            v17_1.setFixedLengthStreamingMode(v4.length);
            java.io.OutputStream v11 = v17_1.getOutputStream();
            v11.write(v4);
            v11.close();
        }
        String v10;
        int v15 = v17_1.getResponseCode();
        String v13 = com.microsoft.appcenter.http.DefaultHttpClient.dump(v17_1);
        String v5 = v17_1.getHeaderField("Content-Type");
        if ((v5 != null) && ((!v5.startsWith("text/")) && (!v5.startsWith("application/")))) {
            v10 = "<binary>";
        } else {
            v10 = com.microsoft.appcenter.http.DefaultHttpClient.TOKEN_REGEX_JSON.matcher(v13).replaceAll("token\":\"***\"");
        }
        com.microsoft.appcenter.utils.AppCenterLog.verbose("AppCenter", new StringBuilder().append("HTTP response status=").append(v15).append(" payload=").append(v10).toString());
        if ((v15 < 200) || (v15 >= 300)) {
            com.microsoft.appcenter.http.HttpException v18_20 = new com.microsoft.appcenter.http.HttpException;
            v18_20(v15, v13);
            throw v18_20;
        } else {
            v17_1.disconnect();
            return v13;
        }
    }

Method com.adobe.mobile.RequestHandler.retrieveData() calling method java.net.URL.<init>()


    protected static byte[] retrieveData(String p22, int p23, String p24, java.util.concurrent.Callable p25, com.adobe.mobile.RequestHandler$HeaderCallback p26)
    {
        java.net.HttpURLConnection v6 = 0;
        java.io.InputStream v10 = 0;
        String v2 = p22;
        int v16 = 0;
        int v14 = 0;
        try {
            while (v14 <= 21) {
                String v17_21 = new java.net.URL;
                v17_21(v2);
                v6 = ((java.net.HttpURLConnection) v17_21.openConnection());
                v6.setConnectTimeout(2000);
                v6.setReadTimeout(p23);
                v6.setInstanceFollowRedirects(0);
                v6.setRequestProperty("Accept-Language", com.adobe.mobile.StaticMethods.getDefaultAcceptLanguage());
                v6.setRequestProperty("User-Agent", com.adobe.mobile.StaticMethods.getDefaultUserAgent());
                if (p25 != null) {
                    java.util.Map v15_1 = ((java.util.Map) p25.call());
                    if (v15_1 != null) {
                        Object[] v19_18 = v15_1.entrySet().iterator();
                        while (v19_18.hasNext()) {
                            java.util.Map$Entry v7_1 = ((java.util.Map$Entry) v19_18.next());
                            v6.setRequestProperty(((String) v7_1.getKey()), ((String) v7_1.getValue()));
                        }
                    }
                }
                v16 = v6.getResponseCode();
                if (p26 != null) {
                    p26.call(v6.getHeaderFields());
                }
                switch (v16) {
                    case 301:
                    case 302:
                        v14++;
                        v2 = new java.net.URL(new java.net.URL(v2), v6.getHeaderField("Location")).toExternalForm();
                        break;
                    default:
                        String v17_1;
                        if (v16 != 200) {
                            if (v6 != null) {
                                v6.disconnect();
                            }
                            if (0 != 0) {
                                try {
                                    0.close();
                                } catch (java.io.IOException v9_0) {
                                    Object[] v0_1 = new Object[2];
                                    String v18_1 = v0_1;
                                    v18_1[0] = p24;
                                    v18_1[1] = v9_0.getLocalizedMessage();
                                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v18_1);
                                }
                            }
                            v17_1 = 0;
                        } else {
                            v10 = v6.getInputStream();
                            byte[] v5 = new byte[1024];
                            java.io.ByteArrayOutputStream v3_1 = new java.io.ByteArrayOutputStream();
                            while(true) {
                                int v11 = v10.read(v5);
                                if (v11 == -1) {
                                    break;
                                }
                                v3_1.write(v5, 0, v11);
                            }
                            v10.close();
                            v17_1 = v3_1.toByteArray();
                            if (v6 != null) {
                                v6.disconnect();
                            }
                            if (v10 != null) {
                                try {
                                    v10.close();
                                } catch (java.io.IOException v9_7) {
                                    Object[] v0_25 = new Object[2];
                                    Object[] v19_17 = v0_25;
                                    v19_17[0] = p24;
                                    v19_17[1] = v9_7.getLocalizedMessage();
                                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v19_17);
                                }
                            }
                        }
                        return v17_1;
                }
            }
        } catch (java.io.IOException v9_4) {
            Object[] v0_17 = new Object[2];
            String v18_9 = v0_17;
            v18_9[0] = p24;
            v18_9[1] = v9_4.getLocalizedMessage();
            com.adobe.mobile.StaticMethods.logWarningFormat("%s - IOException while sending request (%s)", v18_9);
            v17_1 = 0;
            if (v6 != null) {
                v6.disconnect();
            }
            if (v10 != null) {
                try {
                    v10.close();
                } catch (java.io.IOException v9_5) {
                    Object[] v0_19 = new Object[2];
                    Object[] v19_13 = v0_19;
                    v19_13[0] = p24;
                    v19_13[1] = v9_5.getLocalizedMessage();
                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v19_13);
                }
            }
            return v17_1;
        } catch (java.io.IOException v9_2) {
            Object[] v0_11 = new Object[2];
            String v18_6 = v0_11;
            v18_6[0] = p24;
            v18_6[1] = v9_2.getLocalizedMessage();
            com.adobe.mobile.StaticMethods.logWarningFormat("%s - Exception while sending request (%s)", v18_6);
            v17_1 = 0;
            if (v6 != null) {
                v6.disconnect();
            }
            if (v10 != null) {
                try {
                    v10.close();
                } catch (java.io.IOException v9_3) {
                    Object[] v0_14 = new Object[2];
                    Object[] v19_9 = v0_14;
                    v19_9[0] = p24;
                    v19_9[1] = v9_3.getLocalizedMessage();
                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v19_9);
                }
            }
            return v17_1;
        } catch (Error v8) {
            Object[] v0_6 = new Object[2];
            String v18_3 = v0_6;
            v18_3[0] = p24;
            v18_3[1] = v8.getLocalizedMessage();
            com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unexpected error while sending request (%s)", v18_3);
            v17_1 = 0;
            if (v6 != null) {
                v6.disconnect();
            }
            if (v10 != null) {
                try {
                    v10.close();
                } catch (java.io.IOException v9_1) {
                    Object[] v0_9 = new Object[2];
                    Object[] v19_5 = v0_9;
                    v19_5[0] = p24;
                    v19_5[1] = v9_1.getLocalizedMessage();
                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v19_5);
                }
            }
            return v17_1;
        } catch (String v17_10) {
            if (v6 != null) {
                v6.disconnect();
            }
            if (v10 != null) {
                try {
                    v10.close();
                } catch (java.io.IOException v9_6) {
                    Object[] v0_22 = new Object[2];
                    Object[] v19_15 = v0_22;
                    v19_15[0] = p24;
                    v19_15[1] = v9_6.getLocalizedMessage();
                    com.adobe.mobile.StaticMethods.logWarningFormat("%s - Unable to close stream (%s)", v19_15);
                }
            }
            throw v17_10;
        }
        Object[] v0_33 = new Object[3];
        String v18_18 = v0_33;
        v18_18[0] = p24;
        v18_18[1] = p22;
        v18_18[2] = Integer.valueOf(v14);
        com.adobe.mobile.StaticMethods.logErrorFormat("%s - Too many redirects for (%s) - %d", v18_18);
    }

Method com.adobe.mobile.RequestHandler.requestConnect() calling method java.net.URL.<init>()


    protected static java.net.HttpURLConnection requestConnect(String p5)
    {
        try {
            int v1_2 = ((java.net.HttpURLConnection) new java.net.URL(p5).openConnection());
        } catch (Exception v0) {
            Object[] v2_1 = new Object[1];
            v2_1[0] = v0.getLocalizedMessage();
            com.adobe.mobile.StaticMethods.logErrorFormat("Adobe Mobile - Exception opening URL(%s)", v2_1);
            v1_2 = 0;
        }
        return v1_2;
    }

Method com.adobe.mobile.RemoteDownload.stringIsUrl() calling method java.net.URL.<init>()


    protected static boolean stringIsUrl(String p3)
    {
        int v1 = 0;
        if ((p3 != null) && (p3.length() > 0)) {
            try {
                new java.net.URL(p3);
                v1 = 1;
            } catch (java.net.MalformedURLException v0) {
            }
        }
        return v1;
    }

Method com.adobe.mobile.RemoteDownload$DownloadFileTask.requestConnect() calling method java.net.URL.<init>()


    protected static java.net.HttpURLConnection requestConnect(String p6)
    {
        try {
            int v2_0 = ((java.net.HttpURLConnection) new java.net.URL(p6).openConnection());
        } catch (Exception v0) {
            Object[] v3_1 = new Object[1];
            v3_1[0] = v0.getLocalizedMessage();
            com.adobe.mobile.StaticMethods.logErrorFormat("Cached Files - Exception opening URL(%s)", v3_1);
            v2_0 = 0;
        }
        return v2_0;
    }