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.millennialmedia.android.MMAdView.initEclipseAd() calling method java.net.URL.<init>()


    private void initEclipseAd(android.content.Context p14)
    {
        android.widget.ImageView v8_1 = new android.widget.ImageView(p14);
        java.io.InputStream v7 = 0;
        java.io.FileOutputStream v9 = 0;
        try {
            String v4 = System.getProperty("java.io.tmpdir");
        } catch (Exception v11_17) {
            try {
                if (v7 == null) {
                    if (v9 != null) {
                        v9.close();
                    }
                } else {
                    v7.close();
                }
            } catch (Exception v12) {
            }
            throw v11_17;
        } catch (Exception v11) {
            try {
                if (v7 != null) {
                    v7.close();
                }
            } catch (Exception v11) {
                this.addView(v8_1);
                return;
            }
            if (v9 == null) {
                this.addView(v8_1);
                return;
            } else {
                v9.close();
                this.addView(v8_1);
                return;
            }
            try {
                if (v7 != null) {
                    v7.close();
                }
            } catch (Exception v11) {
                this.addView(v8_1);
                return;
            }
            if (v9 == null) {
                this.addView(v8_1);
                return;
            } else {
                v9.close();
                this.addView(v8_1);
                return;
            }
        }
        if ((v4 != null) && (!v4.endsWith(java.io.File.separator))) {
            v4 = new StringBuilder().append(v4).append(java.io.File.separator).toString();
        }
        java.io.File v5_1 = new java.io.File(new StringBuilder().append(v4).append("millenial355jns6u3l1nmedia.png").toString());
        if (!v5_1.exists()) {
            java.net.HttpURLConnection v3_1 = ((java.net.HttpURLConnection) new java.net.URL("http://images.millennialmedia.com/9513/192134.gif").openConnection());
            v3_1.setDoOutput(1);
            v3_1.setConnectTimeout(3000);
            v3_1.connect();
            v7 = v3_1.getInputStream();
            java.io.FileOutputStream v10_1 = new java.io.FileOutputStream(v5_1);
            try {
                byte[] v1 = new byte[1024];
            } catch (Exception v11_17) {
                v9 = v10_1;
            } catch (Exception v11) {
                v9 = v10_1;
            }
            while(true) {
                int v2 = v7.read(v1);
                if (v2 <= 0) {
                    break;
                }
                v10_1.write(v1, 0, v2);
            }
            v9 = v10_1;
        }
        android.graphics.Bitmap v0 = android.graphics.BitmapFactory.decodeFile(v5_1.getAbsolutePath());
        if ((v8_1 != null) && (v0 != null)) {
            v8_1.setImageBitmap(v0);
        }
    }

Method com.millennialmedia.google.gson.internal.bind.TypeAdapters$18.read() calling method java.net.URL.<init>()


    public java.net.URL read(com.millennialmedia.google.gson.stream.JsonReader p5)
    {
        java.net.URL v1_0 = 0;
        if (p5.peek() != com.millennialmedia.google.gson.stream.JsonToken.NULL) {
            String v0 = p5.nextString();
            if (!"null".equals(v0)) {
                v1_0 = new java.net.URL(v0);
            }
        } else {
            p5.nextNull();
        }
        return v1_0;
    }

Method com.millennialmedia.android.HttpRedirection.navigateRedirects() calling method java.net.URL.<init>()


    static final String navigateRedirects(String p9)
    {
        if (p9 != null) {
            java.net.HttpURLConnection.setFollowRedirects(0);
            try {
                while (!p9.startsWith("https")) {
                    java.net.URL v5_1 = new java.net.URL(p9);
                    java.net.HttpURLConnection v0_1 = ((java.net.HttpURLConnection) v5_1.openConnection());
                    v0_1.setConnectTimeout(3000);
                    v0_1.setRequestMethod("GET");
                    v0_1.connect();
                    int v4 = v0_1.getResponseCode();
                    if ((v4 < 300) || (v4 >= 400)) {
                        break;
                    }
                    String v3 = v0_1.getHeaderField("Location");
                    java.net.URI v2_1 = new java.net.URI(v3);
                    if (v2_1.isAbsolute()) {
                        if (v3 != null) {
                            p9 = v3;
                        }
                    } else {
                        p9 = v5_1.toURI().resolve(v2_1).toString();
                    }
                    Object[] v7_1 = new Object[1];
                    v7_1[0] = p9;
                    com.millennialmedia.android.MMSDK$Log.v("Redirecting to: %s", v7_1);
                }
            } catch (String v6) {
            } catch (java.net.URISyntaxException v1) {
                com.millennialmedia.android.MMSDK$Log.d("Connection timeout.");
            } catch (String v6) {
            } catch (java.net.URISyntaxException v1) {
                com.millennialmedia.android.MMSDK$Log.d("URI Syntax incorrect.");
            }
        } else {
            p9 = 0;
        }
        return p9;
    }

Method com.millennialmedia.android.AdCache.downloadComponent() calling method java.net.URL.<init>()


    static boolean downloadComponent(String p19, String p20, java.io.File p21, android.content.Context p22)
    {
        int v15_2;
        if (!android.text.TextUtils.isEmpty(p19)) {
            java.io.File v9_1 = new java.io.File(p21, p20);
            Object[] v0_0 = new Object[2];
            Object[] v16_0 = v0_0;
            v16_0[0] = p20;
            v16_0[1] = p19;
            com.millennialmedia.android.MMSDK$Log.v("Downloading Component: %s from %s", v16_0);
            if ((!v9_1.exists()) || (v9_1.length() <= 0)) {
                java.io.FileOutputStream v12 = 0;
                long v5 = -1;
                try {
                    java.net.URL v4_1 = new java.net.URL(p19);
                    java.net.HttpURLConnection.setFollowRedirects(1);
                    java.net.HttpURLConnection v3_1 = ((java.net.HttpURLConnection) v4_1.openConnection());
                    v3_1.setConnectTimeout(30000);
                    v3_1.setRequestMethod("GET");
                    v3_1.connect();
                    java.io.InputStream v10 = v3_1.getInputStream();
                    String v14 = v3_1.getHeaderField("Content-Length");
                } catch (SecurityException v7_1) {
                    Object[] v0_22 = new Object[2];
                    Object[] v16_19 = v0_22;
                    v16_19[0] = p20;
                    v16_19[1] = v7_1.getMessage();
                    com.millennialmedia.android.MMSDK$Log.e("Exception downloading component %s: %s", v16_19);
                    try {
                        if (v10 != null) {
                            v10.close();
                        }
                    } catch (java.io.IOException v8_0) {
                        Object[] v0_2 = new Object[1];
                        Object[] v16_2 = v0_2;
                        v16_2[0] = v8_0.getMessage();
                        com.millennialmedia.android.MMSDK$Log.e("Content caching error: %s", v16_2);
                        if (v9_1 != null) {
                            v9_1.delete();
                        }
                        v15_2 = 0;
                    }
                    if (v12 == null) {
                        if (v9_1 != null) {
                            v9_1.delete();
                        }
                        v15_2 = 0;
                        return v15_2;
                    } else {
                        v12.close();
                    }
                    try {
                        if (v10 != null) {
                            v10.close();
                        }
                    } catch (java.io.IOException v8_2) {
                        Object[] v0_6 = new Object[1];
                        Object[] v16_6 = v0_6;
                        v16_6[0] = v8_2.getMessage();
                        com.millennialmedia.android.MMSDK$Log.e("Content caching error: %s", v16_6);
                        if (v9_1 != null) {
                            v9_1.delete();
                        }
                        v15_2 = 0;
                    }
                    if (v12 == null) {
                    } else {
                        v12.close();
                    }
                } catch (int v15_3) {
                    try {
                        if (v10 != null) {
                            v10.close();
                        }
                    } catch (java.io.IOException v8_1) {
                        Object[] v0_4 = new Object[1];
                        Object[] v16_4 = v0_4;
                        v16_4[0] = v8_1.getMessage();
                        com.millennialmedia.android.MMSDK$Log.e("Content caching error: %s", v16_4);
                        if (v9_1 != null) {
                            v9_1.delete();
                        }
                        v15_2 = 0;
                    }
                    if (v12 != null) {
                        v12.close();
                    }
                    throw v15_3;
                }
                if (v14 != null) {
                    v5 = Long.parseLong(v14);
                }
                if (v10 != null) {
                    if (!com.millennialmedia.android.AdCache.isInternalDir(p22, com.millennialmedia.android.AdCache.getCacheDirectory(p22))) {
                        v12 = new java.io.FileOutputStream(v9_1);
                    } else {
                        v12 = p22.openFileOutput(v9_1.getName(), 1);
                    }
                    byte[] v2 = new byte[4096];
                    while(true) {
                        int v11 = v10.read(v2);
                        if (v11 <= 0) {
                            break;
                        }
                        v12.write(v2, 0, v11);
                    }
                    if (v9_1 != null) {
                        try {
                            if ((v9_1.length() != v5) && (v5 != -1)) {
                                com.millennialmedia.android.MMSDK$Log.e("Content-Length does not match actual length.");
                            } else {
                                v15_2 = 1;
                                try {
                                    if (v10 != null) {
                                        v10.close();
                                    }
                                } catch (java.io.IOException v8_3) {
                                    Object[] v0_8 = new Object[1];
                                    Object[] v16_8 = v0_8;
                                    v16_8[0] = v8_3.getMessage();
                                    com.millennialmedia.android.MMSDK$Log.e("Content caching error: %s", v16_8);
                                    if (v9_1 != null) {
                                        v9_1.delete();
                                    }
                                    v15_2 = 0;
                                    return v15_2;
                                }
                                if (v12 == null) {
                                    return v15_2;
                                } else {
                                    v12.close();
                                    return v15_2;
                                }
                            }
                        } catch (SecurityException v7_0) {
                            Object[] v0_19 = new Object[2];
                            Object[] v16_17 = v0_19;
                            v16_17[0] = p20;
                            v16_17[1] = v7_0.getMessage();
                            com.millennialmedia.android.MMSDK$Log.e("Exception downloading component %s: %s", v16_17);
                        }
                    }
                } else {
                    Object[] v0_10 = new Object[1];
                    Object[] v16_10 = v0_10;
                    v16_10[0] = p20;
                    com.millennialmedia.android.MMSDK$Log.e("Connection stream is null downloading %s.", v16_10);
                    v15_2 = 0;
                    try {
                        if (v10 != null) {
                            v10.close();
                        }
                    } catch (java.io.IOException v8_4) {
                        Object[] v0_12 = new Object[1];
                        Object[] v16_12 = v0_12;
                        v16_12[0] = v8_4.getMessage();
                        com.millennialmedia.android.MMSDK$Log.e("Content caching error: %s", v16_12);
                        if (v9_1 != null) {
                            v9_1.delete();
                        }
                        v15_2 = 0;
                    }
                    if (0 != 0) {
                        0.close();
                    }
                }
            } else {
                com.millennialmedia.android.MMSDK$Log.v(new StringBuilder().append(p20).append(" already exists, skipping...").toString());
                v15_2 = 1;
            }
        } else {
            com.millennialmedia.android.MMSDK$Log.d("No Url ...");
            v15_2 = 0;
        }
        return v15_2;
    }

Method com.jumptap.adtag.activity.JTVideo.saveVideoToFile() calling method java.net.URL.<init>()


    public static void saveVideoToFile(String p10, android.content.Context p11)
    {
        java.net.URLConnection v1 = new java.net.URL(p10).openConnection();
        v1.connect();
        java.io.InputStream v4 = v1.getInputStream();
        if (v4 != null) {
            com.jumptap.adtag.activity.JTVideo.downloadingMediaFile = new java.io.File(p11.getCacheDir(), new StringBuilder().append(com.jumptap.adtag.activity.JTVideo.adId).append(".dat").toString());
            if (com.jumptap.adtag.activity.JTVideo.downloadingMediaFile.exists()) {
                com.jumptap.adtag.activity.JTVideo.downloadingMediaFile.delete();
            }
            java.io.FileOutputStream v3_1 = new java.io.FileOutputStream(com.jumptap.adtag.activity.JTVideo.downloadingMediaFile);
            byte[] v0 = new byte[16384];
            int v5 = 0;
            while(true) {
                int v2 = v4.read(v0);
                if (v2 <= 0) {
                    break;
                }
                v3_1.write(v0, 0, v2);
                v5 += v2;
                com.jumptap.adtag.activity.JTVideo.totalKbRead = (v5 / 1000);
            }
            v4.close();
            android.util.Log.i("JtAd", new StringBuilder().append("Done saving file  ").append(com.jumptap.adtag.activity.JTVideo.adId).append(".dat, total").append(com.jumptap.adtag.activity.JTVideo.totalKbRead).append(" Kb read").toString());
        } else {
            android.util.Log.e("JtAd", new StringBuilder().append("Unable to create InputStream for mediaUrl:").append(p10).toString());
        }
        return;
    }

Method com.amobee.onlineHapi.AmobeeAdView$2.run() calling method java.net.URL.<init>()


    public void run()
    {
        String v5 = "";
        try {
            java.net.HttpURLConnection v10 = ((java.net.HttpURLConnection) new java.net.URL(new StringBuilder(String.valueOf(com.amobee.onlineHapi.AmobeeAdView.access$5(this.this$0))).append(com.amobee.onlineHapi.AmobeeAdView.access$6(this.this$0)).toString()).openConnection());
            v10.setRequestProperty("User-Agent", com.amobee.onlineHapi.AmobeeAdView.access$4(this.this$0));
            v10.connect();
        } catch (com.amobee.onlineHapi.AmobeeAdView v2_0) {
            if (v10 != null) {
                v10.disconnect();
            }
            com.amobee.onlineHapi.AmobeeScheduler.getInstance().scheduleTask(new com.amobee.onlineHapi.RefreshTask(this.this$0), com.amobee.onlineHapi.AmobeeAdView.access$3(this.this$0));
            throw v2_0;
        } catch (java.io.IOException v12) {
            System.out.println(new StringBuilder("error: ").append(v12).toString());
            if (v10 != null) {
                v10.disconnect();
            }
            com.amobee.onlineHapi.AmobeeScheduler.getInstance().scheduleTask(new com.amobee.onlineHapi.RefreshTask(this.this$0), com.amobee.onlineHapi.AmobeeAdView.access$3(this.this$0));
            return;
        } catch (com.amobee.onlineHapi.AmobeeAdView v2_0) {
        }
        if (v10.getResponseCode() == 200) {
            String v6 = v10.getContentEncoding();
            if (v6 == null) {
                v6 = "utf-8";
            }
            String v4_1 = new String(com.amobee.onlineHapi.AmobeeAdView.access$7(this.this$0, v10), v6);
            try {
                if (com.amobee.onlineHapi.OnlineHAPI.isFadeAnimationEnabled) {
                    com.amobee.onlineHapi.AmobeeAdView.access$8(this.this$0).sendMessageDelayed(com.amobee.onlineHapi.AmobeeAdView.access$8(this.this$0).obtainMessage(3), 0);
                    try {
                        com.amobee.onlineHapi.AmobeeAdView$2.sleep(1500);
                    } catch (InterruptedException v11) {
                        v11.printStackTrace();
                    }
                }
            } catch (java.io.IOException v12) {
            }
            this.this$0.loadDataWithBaseURL("", v4_1, "text/html", v6, 0);
        }
        if (v10 != null) {
            v10.disconnect();
        }
        com.amobee.onlineHapi.AmobeeScheduler.getInstance().scheduleTask(new com.amobee.onlineHapi.RefreshTask(this.this$0), com.amobee.onlineHapi.AmobeeAdView.access$3(this.this$0));
        return;
    }