Info Call to External Storage API

Description

List of all external storage API calls. Insecure storage of sensitive information by setting insecure permissions or storing data without encryption might expose this information to an attacker.

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method com.millennialmedia.android.MMAdView.initEclipseAd() calling method java.io.FileOutputStream.<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.android.BridgeMMMedia.moveFile() calling method java.io.FileOutputStream.<init>()


    private boolean moveFile(java.io.File p8, java.io.File p9)
    {
        try {
            java.nio.channels.FileChannel v0 = new java.io.FileInputStream(p8).getChannel();
            p9.createNewFile();
            v0.transferTo(0, v0.size(), new java.io.FileOutputStream(p9).getChannel());
            int v1_2 = 1;
        } catch (Exception v6) {
            v6.printStackTrace();
            v1_2 = 0;
        }
        return v1_2;
    }

Method com.millennialmedia.android.BridgeMMMedia$PickerActivity.onActivityResult() calling method java.io.FileOutputStream.<init>()


    protected void onActivityResult(int p25, int p26, android.content.Intent p27)
    {
        this = super.onActivityResult(p25, p26, p27);
        if (p27 != null) {
            java.io.FileInputStream v18 = 0;
            java.io.FileOutputStream v22 = 0;
            try {
                android.net.Uri v3 = p27.getData();
            } catch (Exception v16) {
                com.millennialmedia.android.MMSDK$Log.e(new StringBuilder().append("Error with picture: ").append(v16.getMessage()).toString());
            }
            if (v3 != null) {
                if (v3 != null) {
                    String[] v4 = new String[1];
                    v4[0] = "_data";
                    android.content.ContentResolver v2 = this.getContentResolver();
                    if (v2 != null) {
                        android.database.Cursor v15 = v2.query(v3, v4, 0, 0, 0);
                        if (v15 != null) {
                            int v20 = v15.getColumnIndex("_data");
                            if (v20 != -1) {
                                v15.moveToFirst();
                                java.io.File v14_1 = new java.io.File(v15.getString(v20));
                                v15.close();
                                try {
                                    java.io.File v17_1 = new java.io.File;
                                    v17_1(this.getIntent().getData().getPath());
                                    java.io.FileInputStream v19 = new java.io.FileInputStream;
                                    v19(v14_1);
                                    try {
                                        java.io.FileOutputStream v23_1 = new java.io.FileOutputStream;
                                        v23_1(v17_1);
                                        try {
                                            byte[] v12_1 = new byte[1024];
                                        } catch (Exception v5_22) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 == null) {
                                                    if (v22 != null) {
                                                        v22.close();
                                                    }
                                                } else {
                                                    v18.close();
                                                }
                                            } catch (Exception v6) {
                                            }
                                            throw v5_22;
                                        } catch (Exception v5) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 != null) {
                                                    v18.close();
                                                }
                                            } catch (Exception v5) {
                                            }
                                            if (v22 != null) {
                                                v22.close();
                                            }
                                        }
                                        while(true) {
                                            int v21_1 = v19.read(v12_1);
                                            if (v21_1 <= 0) {
                                                break;
                                            }
                                            v23_1.write(v12_1, 0, v21_1);
                                        }
                                        try {
                                            if (v19 != null) {
                                                v19.close();
                                            }
                                        } catch (Exception v5) {
                                            v18 = v19;
                                        }
                                        if (v23_1 != null) {
                                            v23_1.close();
                                        }
                                        v18 = v19;
                                    } catch (Exception v5_22) {
                                        v18 = v19;
                                    } catch (Exception v5) {
                                        v18 = v19;
                                    }
                                } catch (Exception v5_22) {
                                } catch (Exception v5) {
                                }
                            }
                        }
                    }
                }
            } else {
                if (p27.getExtras() != null) {
                    android.graphics.Bitmap v8_1 = ((android.graphics.Bitmap) p27.getExtras().get("data"));
                    try {
                        java.io.File v17_0 = new java.io.File;
                        v17_0(this.getIntent().getData().getPath());
                        java.io.ByteArrayOutputStream v10_1 = new java.io.ByteArrayOutputStream();
                        v8_1.compress(android.graphics.Bitmap$CompressFormat.PNG, 0, v10_1);
                        java.io.ByteArrayInputStream v11_1 = new java.io.ByteArrayInputStream(v10_1.toByteArray());
                        java.io.FileOutputStream v23_0 = new java.io.FileOutputStream;
                        v23_0(v17_0);
                        try {
                            byte[] v12_0 = new byte[1024];
                        } catch (Exception v5_6) {
                            v22 = v23_0;
                            try {
                                if (0 == 0) {
                                    if (v22 != null) {
                                        v22.close();
                                    }
                                } else {
                                    0.close();
                                }
                            } catch (Exception v6) {
                            }
                            throw v5_6;
                        } catch (Exception v5) {
                            v22 = v23_0;
                            try {
                                if (0 != 0) {
                                    0.close();
                                }
                            } catch (Exception v5) {
                            }
                            if (v22 != null) {
                                v22.close();
                            }
                        }
                        while(true) {
                            int v21_0 = v11_1.read(v12_0);
                            if (v21_0 <= 0) {
                                break;
                            }
                            v23_0.write(v12_0, 0, v21_0);
                        }
                        try {
                            if (0 != 0) {
                                0.close();
                            }
                        } catch (Exception v5) {
                        }
                        if (v23_0 != null) {
                            v23_0.close();
                        }
                    } catch (Exception v5_6) {
                    } catch (Exception v5) {
                    }
                }
            }
        }
        com.millennialmedia.android.BridgeMMMedia.access$000();
        com.millennialmedia.android.BridgeMMMedia.access$000().notify();
        this.finish();
        return;
    }

Method com.millennialmedia.android.BridgeMMFileManager.writeData() calling method java.io.FileOutputStream.<init>()


    public com.millennialmedia.android.MMJSResponse writeData(java.util.HashMap p8)
    {
        com.millennialmedia.android.MMJSResponse v5_10;
        if (!this.hasCreativeDirectory()) {
            v5_10 = 0;
        } else {
            java.io.FileOutputStream v2 = 0;
            int v4 = 0;
            if ((!p8.containsKey("path")) || (!p8.containsKey("data"))) {
            } else {
                try {
                    java.io.File v1_1 = new java.io.File(this.root, ((String) p8.get("path")));
                    byte[] v0 = com.millennialmedia.android.Base64.decode(((String) p8.get("data")));
                    java.io.FileOutputStream v3_1 = new java.io.FileOutputStream(v1_1);
                    try {
                        v3_1.write(v0);
                        v4 = 1;
                    } catch (com.millennialmedia.android.MMJSResponse v5_9) {
                        v2 = v3_1;
                        if (v2 != null) {
                            try {
                                v2.close();
                            } catch (Exception v6) {
                            }
                        }
                        throw v5_9;
                    } catch (com.millennialmedia.android.MMJSResponse v5) {
                        v2 = v3_1;
                        if (v2 == null) {
                            if (v4 == 0) {
                            } else {
                                v5_10 = com.millennialmedia.android.MMJSResponse.responseWithSuccess("File written successfully");
                            }
                        } else {
                            try {
                                v2.close();
                            } catch (com.millennialmedia.android.MMJSResponse v5) {
                            }
                        }
                    }
                    if (v3_1 == null) {
                    } else {
                        try {
                            v3_1.close();
                        } catch (com.millennialmedia.android.MMJSResponse v5) {
                        }
                    }
                } catch (com.millennialmedia.android.MMJSResponse v5_9) {
                } catch (com.millennialmedia.android.MMJSResponse v5) {
                }
            }
        }
        return v5_10;
    }

Method com.millennialmedia.android.MRaid.saveMRaid() calling method java.io.FileOutputStream.<init>()


    static boolean saveMRaid(android.content.Context p11, java.io.InputStream p12)
    {
        int v6_0 = 1;
        java.io.File v2_1 = new java.io.File(com.millennialmedia.android.AdCache.getCacheDirectory(p11), "mraid.js");
        int v9_2 = new Object[1];
        v9_2[0] = v2_1;
        com.millennialmedia.android.MMSDK$Log.v("Saving mraid js to %s", v9_2);
        java.io.FileOutputStream v4 = 0;
        try {
            java.io.FileOutputStream v5_1 = new java.io.FileOutputStream(v2_1);
            try {
                byte[] v0 = new byte[1024];
            } catch (int v6_1) {
                v4 = v5_1;
                if (v4 != null) {
                    try {
                        v4.close();
                    } catch (java.io.IOException v1_2) {
                        v1_2.printStackTrace();
                    }
                }
                throw v6_1;
            } catch (java.io.IOException v1_0) {
                v4 = v5_1;
                if (v2_1 != null) {
                    v2_1.delete();
                }
                int v8_3 = new Object[1];
                v8_3[0] = v1_0.getMessage();
                com.millennialmedia.android.MMSDK$Log.e("Exception downloading component mraid.js: %s", v8_3);
                if (v4 != null) {
                    try {
                        v4.close();
                    } catch (java.io.IOException v1_1) {
                        v1_1.printStackTrace();
                    }
                }
                v6_0 = 0;
                return v6_0;
            }
            while(true) {
                int v3 = p12.read(v0);
                if (v3 <= 0) {
                    break;
                }
                v5_1.write(v0, 0, v3);
            }
            if (v5_1 == null) {
                return v6_0;
            } else {
                try {
                    v5_1.close();
                } catch (java.io.IOException v1_3) {
                    v1_3.printStackTrace();
                }
                return v6_0;
            }
        } catch (int v6_1) {
        } catch (java.io.IOException v1_0) {
        }
    }

Method com.millennialmedia.android.AdCache.save() calling method java.io.FileOutputStream.<init>()


    static boolean save(android.content.Context p11, com.millennialmedia.android.CachedAd p12)
    {
        java.io.IOException v6_0 = 0;
        java.io.File v2 = 0;
        java.io.ObjectOutputStream v4 = 0;
        if (p12 != null) {
            java.io.File v0 = com.millennialmedia.android.AdCache.getCachedAdFile(p11, p12.getId());
            if (v0 != null) {
                int v9_1 = new Object[2];
                v9_1[0] = p12.getId();
                v9_1[1] = v0;
                com.millennialmedia.android.MMSDK$Log.v("Saving CachedAd %s to %s", v9_1);
                try {
                    java.io.File v3_1 = new java.io.File(v0.getParent(), new StringBuilder().append(p12.getId()).append("ad.lock").toString());
                    try {
                        if (v3_1.createNewFile()) {
                            java.io.ObjectOutputStream v5_1 = new java.io.ObjectOutputStream(new java.io.FileOutputStream(v0));
                            try {
                                v5_1.writeInt(p12.getType());
                                v5_1.writeObject(p12.expiration);
                                v5_1.writeObject(p12.acid);
                                v5_1.writeLong(p12.deferredViewStart);
                                v5_1.writeObject(p12);
                                try {
                                    v3_1.delete();
                                } catch (boolean v8) {
                                    if (p12.saveAssets(p11)) {
                                        v2 = v3_1;
                                        v6_0 = 1;
                                    } else {
                                        p12.delete(p11);
                                        v2 = v3_1;
                                    }
                                }
                                if (v5_1 == null) {
                                } else {
                                    v5_1.close();
                                }
                            } catch (java.io.IOException v6_1) {
                                v4 = v5_1;
                                v2 = v3_1;
                                try {
                                    v2.delete();
                                } catch (java.io.IOException v7) {
                                    throw v6_1;
                                }
                                if (v4 == null) {
                                } else {
                                    v4.close();
                                }
                            } catch (Exception v1) {
                                v4 = v5_1;
                                v2 = v3_1;
                                boolean v8_14 = new Object[1];
                                v8_14[0] = p12.getId();
                                com.millennialmedia.android.MMSDK$Log.e("There was a problem saving the cached ad %s.", v8_14);
                                com.millennialmedia.android.MMSDK$Log.d(v1.getMessage());
                                com.millennialmedia.android.MMSDK$Log.d(v1);
                                try {
                                    v2.delete();
                                } catch (java.io.IOException v7) {
                                }
                                if (v4 != null) {
                                    v4.close();
                                }
                            }
                        } else {
                            boolean v8_12 = new Object[1];
                            v8_12[0] = p12.getId();
                            com.millennialmedia.android.MMSDK$Log.v("Could not save the cached ad %s. Ad was locked.", v8_12);
                            try {
                                v3_1.delete();
                            } catch (java.io.IOException v7) {
                            }
                            if (0 != 0) {
                                0.close();
                            }
                        }
                    } catch (java.io.IOException v6_1) {
                        v2 = v3_1;
                    } catch (Exception v1) {
                        v2 = v3_1;
                    }
                } catch (java.io.IOException v6_1) {
                } catch (Exception v1) {
                }
            }
        }
        return v6_0;
    }

Method com.millennialmedia.android.AdCache.downloadComponent() calling method java.io.FileOutputStream.<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.io.FileOutputStream.<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.millennialmedia.android.BridgeMMMedia.scaleBitmapToBytes() calling method java.io.FileInputStream.<init>()


    private static final byte[] scaleBitmapToBytes(java.io.File p21, int p22, int p23, String p24)
    {
        java.io.FileInputStream v10 = 0;
        java.io.FileInputStream v12 = 0;
        android.graphics.Bitmap v17 = 0;
        try {
            java.io.FileInputStream v11_1 = new java.io.FileInputStream(p21);
            try {
                android.graphics.BitmapFactory$Options v16_1 = new android.graphics.BitmapFactory$Options();
                v16_1.inJustDecodeBounds = 1;
                android.graphics.BitmapFactory.decodeStream(v11_1, 0, v16_1);
                int v14 = v16_1.outHeight;
                int v18 = v16_1.outWidth;
                int v15 = 1;
            } catch (android.graphics.Bitmap$CompressFormat v19_11) {
                v10 = v11_1;
                try {
                    if (v10 == null) {
                        if (v12 != null) {
                            v12.close();
                        }
                    } else {
                        v10.close();
                    }
                } catch (int v20) {
                }
                throw v19_11;
            } catch (android.graphics.Bitmap$CompressFormat v19) {
                v10 = v11_1;
                try {
                    if (v10 != null) {
                        v10.close();
                    }
                } catch (android.graphics.Bitmap$CompressFormat v19) {
                    byte[] v7 = 0;
                    if (v17 != null) {
                        android.graphics.Bitmap v9 = com.millennialmedia.android.BridgeMMMedia.resizeImage(v17, p24, p22, p23, 1);
                        java.io.ByteArrayOutputStream v5 = 0;
                        try {
                            java.io.ByteArrayOutputStream v6_1 = new java.io.ByteArrayOutputStream();
                            try {
                                if (!p24.equals("")) {
                                    v9.compress(android.graphics.Bitmap$CompressFormat.JPEG, 100, v6_1);
                                } else {
                                    v17.compress(android.graphics.Bitmap$CompressFormat.JPEG, 100, v6_1);
                                }
                            } catch (android.graphics.Bitmap$CompressFormat v19_5) {
                                v5 = v6_1;
                                try {
                                    if (v17 == null) {
                                        if (v9 != null) {
                                            v9.recycle();
                                        }
                                        if (v5 != null) {
                                            v5.close();
                                        }
                                    } else {
                                        v17.recycle();
                                    }
                                } catch (Exception v8_2) {
                                    v8_2.printStackTrace();
                                }
                                throw v19_5;
                            } catch (Exception v8_0) {
                                v5 = v6_1;
                                v7 = 0;
                                v8_0.printStackTrace();
                                try {
                                    if (v17 != null) {
                                        v17.recycle();
                                    }
                                } catch (Exception v8_1) {
                                    v8_1.printStackTrace();
                                }
                                if (v9 != null) {
                                    v9.recycle();
                                }
                                if (v5 == null) {
                                    return v7;
                                } else {
                                    v5.close();
                                    return v7;
                                }
                            }
                            v7 = v6_1.toByteArray();
                            try {
                                if (v17 != null) {
                                    v17.recycle();
                                }
                            } catch (Exception v8_3) {
                                v8_3.printStackTrace();
                            }
                            if (v9 != null) {
                                v9.recycle();
                            }
                            if (v6_1 != null) {
                                v6_1.close();
                            }
                        } catch (android.graphics.Bitmap$CompressFormat v19_5) {
                        } catch (Exception v8_0) {
                        }
                    }
                    return v7;
                }
                if (v12 == null) {
                } else {
                    v12.close();
                }
            }
            if ((v14 > p23) || (v18 > p22)) {
                if (v18 <= v14) {
                    v15 = Math.round((((float) v18) / ((float) p22)));
                } else {
                    v15 = Math.round((((float) v14) / ((float) p23)));
                }
            }
            java.io.FileInputStream v13_1 = new java.io.FileInputStream(p21);
            try {
                v16_1.inJustDecodeBounds = 0;
                v16_1.inSampleSize = v15;
                v17 = android.graphics.BitmapFactory.decodeStream(v13_1, 0, v16_1);
                try {
                    if (v11_1 != null) {
                        v11_1.close();
                    }
                } catch (android.graphics.Bitmap$CompressFormat v19) {
                    v10 = v11_1;
                }
                if (v13_1 != null) {
                    v13_1.close();
                }
                v10 = v11_1;
            } catch (android.graphics.Bitmap$CompressFormat v19_11) {
                v12 = v13_1;
                v10 = v11_1;
            } catch (android.graphics.Bitmap$CompressFormat v19) {
                v12 = v13_1;
                v10 = v11_1;
            }
        } catch (android.graphics.Bitmap$CompressFormat v19_11) {
        } catch (android.graphics.Bitmap$CompressFormat v19) {
        }
    }

Method com.millennialmedia.android.BridgeMMMedia.moveFile() calling method java.io.FileInputStream.<init>()


    private boolean moveFile(java.io.File p8, java.io.File p9)
    {
        try {
            java.nio.channels.FileChannel v0 = new java.io.FileInputStream(p8).getChannel();
            p9.createNewFile();
            v0.transferTo(0, v0.size(), new java.io.FileOutputStream(p9).getChannel());
            int v1_2 = 1;
        } catch (Exception v6) {
            v6.printStackTrace();
            v1_2 = 0;
        }
        return v1_2;
    }

Method com.millennialmedia.android.BridgeMMMedia$PickerActivity.onActivityResult() calling method java.io.FileInputStream.<init>()


    protected void onActivityResult(int p25, int p26, android.content.Intent p27)
    {
        this = super.onActivityResult(p25, p26, p27);
        if (p27 != null) {
            java.io.FileInputStream v18 = 0;
            java.io.FileOutputStream v22 = 0;
            try {
                android.net.Uri v3 = p27.getData();
            } catch (Exception v16) {
                com.millennialmedia.android.MMSDK$Log.e(new StringBuilder().append("Error with picture: ").append(v16.getMessage()).toString());
            }
            if (v3 != null) {
                if (v3 != null) {
                    String[] v4 = new String[1];
                    v4[0] = "_data";
                    android.content.ContentResolver v2 = this.getContentResolver();
                    if (v2 != null) {
                        android.database.Cursor v15 = v2.query(v3, v4, 0, 0, 0);
                        if (v15 != null) {
                            int v20 = v15.getColumnIndex("_data");
                            if (v20 != -1) {
                                v15.moveToFirst();
                                java.io.File v14_1 = new java.io.File(v15.getString(v20));
                                v15.close();
                                try {
                                    java.io.File v17_1 = new java.io.File;
                                    v17_1(this.getIntent().getData().getPath());
                                    java.io.FileInputStream v19 = new java.io.FileInputStream;
                                    v19(v14_1);
                                    try {
                                        java.io.FileOutputStream v23_1 = new java.io.FileOutputStream;
                                        v23_1(v17_1);
                                        try {
                                            byte[] v12_1 = new byte[1024];
                                        } catch (Exception v5_22) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 == null) {
                                                    if (v22 != null) {
                                                        v22.close();
                                                    }
                                                } else {
                                                    v18.close();
                                                }
                                            } catch (Exception v6) {
                                            }
                                            throw v5_22;
                                        } catch (Exception v5) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 != null) {
                                                    v18.close();
                                                }
                                            } catch (Exception v5) {
                                            }
                                            if (v22 != null) {
                                                v22.close();
                                            }
                                        }
                                        while(true) {
                                            int v21_1 = v19.read(v12_1);
                                            if (v21_1 <= 0) {
                                                break;
                                            }
                                            v23_1.write(v12_1, 0, v21_1);
                                        }
                                        try {
                                            if (v19 != null) {
                                                v19.close();
                                            }
                                        } catch (Exception v5) {
                                            v18 = v19;
                                        }
                                        if (v23_1 != null) {
                                            v23_1.close();
                                        }
                                        v18 = v19;
                                    } catch (Exception v5_22) {
                                        v18 = v19;
                                    } catch (Exception v5) {
                                        v18 = v19;
                                    }
                                } catch (Exception v5_22) {
                                } catch (Exception v5) {
                                }
                            }
                        }
                    }
                }
            } else {
                if (p27.getExtras() != null) {
                    android.graphics.Bitmap v8_1 = ((android.graphics.Bitmap) p27.getExtras().get("data"));
                    try {
                        java.io.File v17_0 = new java.io.File;
                        v17_0(this.getIntent().getData().getPath());
                        java.io.ByteArrayOutputStream v10_1 = new java.io.ByteArrayOutputStream();
                        v8_1.compress(android.graphics.Bitmap$CompressFormat.PNG, 0, v10_1);
                        java.io.ByteArrayInputStream v11_1 = new java.io.ByteArrayInputStream(v10_1.toByteArray());
                        java.io.FileOutputStream v23_0 = new java.io.FileOutputStream;
                        v23_0(v17_0);
                        try {
                            byte[] v12_0 = new byte[1024];
                        } catch (Exception v5_6) {
                            v22 = v23_0;
                            try {
                                if (0 == 0) {
                                    if (v22 != null) {
                                        v22.close();
                                    }
                                } else {
                                    0.close();
                                }
                            } catch (Exception v6) {
                            }
                            throw v5_6;
                        } catch (Exception v5) {
                            v22 = v23_0;
                            try {
                                if (0 != 0) {
                                    0.close();
                                }
                            } catch (Exception v5) {
                            }
                            if (v22 != null) {
                                v22.close();
                            }
                        }
                        while(true) {
                            int v21_0 = v11_1.read(v12_0);
                            if (v21_0 <= 0) {
                                break;
                            }
                            v23_0.write(v12_0, 0, v21_0);
                        }
                        try {
                            if (0 != 0) {
                                0.close();
                            }
                        } catch (Exception v5) {
                        }
                        if (v23_0 != null) {
                            v23_0.close();
                        }
                    } catch (Exception v5_6) {
                    } catch (Exception v5) {
                    }
                }
            }
        }
        com.millennialmedia.android.BridgeMMMedia.access$000();
        com.millennialmedia.android.BridgeMMMedia.access$000().notify();
        this.finish();
        return;
    }

Method com.millennialmedia.android.BridgeMMFileManager.getFileContents() calling method java.io.FileInputStream.<init>()


    public com.millennialmedia.android.MMJSResponse getFileContents(java.util.HashMap p9)
    {
        com.millennialmedia.android.MMJSResponse v5_0;
        if (!this.hasCreativeDirectory()) {
            v5_0 = 0;
        } else {
            java.io.FileInputStream v3 = 0;
            if (!p9.containsKey("path")) {
            } else {
                try {
                    java.io.File v2_0 = new java.io.File(this.root, ((String) p9.get("path")));
                    java.io.FileInputStream v4_1 = new java.io.FileInputStream(v2_0);
                    try {
                        int v0 = new byte[((int) v2_0.length())];
                        v4_1.read(v0);
                    } catch (int v6_4) {
                        v3 = v4_1;
                        if (v3 != null) {
                            try {
                                v3.close();
                            } catch (Exception v7) {
                            }
                        }
                        throw v6_4;
                    } catch (Exception v1) {
                        v3 = v4_1;
                        v0 = 0;
                        if (v3 == null) {
                            if (v0 == 0) {
                            } else {
                                v5_0 = new com.millennialmedia.android.MMJSResponse();
                                v5_0.result = 1;
                                v5_0.dataResponse = v0;
                            }
                        } else {
                            try {
                                v3.close();
                            } catch (int v6) {
                            }
                        }
                    }
                    if (v4_1 == null) {
                    } else {
                        try {
                            v4_1.close();
                        } catch (int v6) {
                        }
                    }
                } catch (int v6_4) {
                } catch (Exception v1) {
                }
            }
        }
        return v5_0;
    }

Method com.millennialmedia.android.MRaid.getMMJSStats() calling method java.io.FileInputStream.<init>()


    static String getMMJSStats(android.content.Context p14)
    {
        Exception v9_7;
        if (com.millennialmedia.android.MRaid.hasMraidLocally(p14)) {
            java.io.File v8 = com.millennialmedia.android.MRaid.getMRaidJsFile(p14);
            java.io.FileInputStream v3 = 0;
            String v7 = "";
            try {
                java.io.FileInputStream v4_1 = new java.io.FileInputStream(v8);
                try {
                    int v0 = new byte[((int) v8.length())];
                    v4_1.read(v0);
                    v7 = com.millennialmedia.android.MMSDK.byteArrayToString(java.security.MessageDigest.getInstance("MD5").digest(v0));
                } catch (Exception v9_1) {
                    v3 = v4_1;
                    if (v3 != null) {
                        try {
                            v3.close();
                        } catch (Exception v10) {
                        }
                    }
                    throw v9_1;
                } catch (Exception v2) {
                    v3 = v4_1;
                    if (v3 == null) {
                        java.util.Date v1_1 = new java.util.Date(v8.lastModified());
                        Exception v10_1 = new Object[4];
                        v10_1[0] = v7;
                        v10_1[1] = v1_1;
                        v10_1[2] = Long.valueOf(v8.length());
                        v10_1[3] = com.millennialmedia.android.HandShake.sharedHandShake(p14).mmjsUrl;
                        v9_7 = String.format("MMJS Stats: MD5[%s] Creation[%s] Size[%d] Url[%s]", v10_1);
                    } else {
                        try {
                            v3.close();
                        } catch (Exception v9) {
                        }
                    }
                }
                if (v4_1 == null) {
                } else {
                    try {
                        v4_1.close();
                    } catch (Exception v9) {
                    }
                }
            } catch (Exception v9_1) {
            } catch (Exception v2) {
            }
        } else {
            v9_7 = "No MMJS Downloaded!";
        }
        return v9_7;
    }

Method com.millennialmedia.android.AdCache.load() calling method java.io.FileInputStream.<init>()


    static com.millennialmedia.android.CachedAd load(android.content.Context p13, String p14)
    {
        if ((p14 != null) && (!p14.equals(""))) {
            java.io.ObjectInputStream v8 = 0;
            com.millennialmedia.android.CachedAd v1 = 0;
            java.io.File v2 = com.millennialmedia.android.AdCache.getCachedAdFile(p13, p14);
            if (v2 != null) {
                try {
                    java.io.ObjectInputStream v9_1 = new java.io.ObjectInputStream(new java.io.FileInputStream(v2));
                    try {
                        v9_1.readInt();
                        v9_1.readObject();
                        Object vtmp5 = v9_1.readObject();
                        v9_1.readLong();
                        v1 = ((com.millennialmedia.android.CachedAd) v9_1.readObject());
                    } catch (java.io.IOException v10_7) {
                        v8 = v9_1;
                        if (v8 != null) {
                            try {
                                v8.close();
                            } catch (java.io.IOException v11) {
                            }
                        }
                        throw v10_7;
                    } catch (java.io.FileNotFoundException v7) {
                        v8 = v9_1;
                        java.io.IOException v11_5 = new Object[1];
                        v11_5[0] = p14;
                        com.millennialmedia.android.MMSDK$Log.e("There was a problem loading up the cached ad %s. Ad is not on disk.", v11_5);
                        if (v8 != null) {
                            try {
                                v8.close();
                            } catch (java.io.IOException v10) {
                            }
                        }
                    } catch (Exception v5) {
                        v8 = v9_1;
                        java.io.IOException v11_2 = new Object[1];
                        v11_2[0] = p14;
                        com.millennialmedia.android.MMSDK$Log.e("There was a problem loading up the cached ad %s.", v11_2);
                        com.millennialmedia.android.MMSDK$Log.d(v5.getMessage());
                        com.millennialmedia.android.MMSDK$Log.d(v5);
                        if (v8 != null) {
                            try {
                                v8.close();
                            } catch (java.io.IOException v10) {
                            }
                        }
                    }
                    if (v9_1 != null) {
                        try {
                            v9_1.close();
                        } catch (java.io.IOException v10) {
                        }
                    }
                } catch (java.io.IOException v10_7) {
                } catch (java.io.FileNotFoundException v7) {
                } catch (Exception v5) {
                }
            } else {
                v1 = 0;
            }
        } else {
            v1 = 0;
        }
        return v1;
    }

Method com.millennialmedia.android.AdCache.iterateCachedAds() calling method java.io.FileInputStream.<init>()


    static void iterateCachedAds(android.content.Context p20, int p21, com.millennialmedia.android.AdCache$Iterator p22)
    {
        java.io.File v13 = com.millennialmedia.android.AdCache.getCacheDirectory(p20);
        if (v13 != null) {
            java.io.File[] v12 = v13.listFiles(new com.millennialmedia.android.AdCache$2());
            int v16 = v12.length;
            int v15 = 0;
            int v17 = 0;
            while (v15 < v16) {
                int v8_0;
                java.io.File v10 = v12[v15];
                try {
                    if ((v10 != null) && (v10.exists())) {
                        if (p21 != 0) {
                            v8_0 = new java.io.ObjectInputStream(new java.io.FileInputStream(v10));
                            try {
                                int v3 = v8_0.readInt();
                                java.util.Date v4_1 = ((java.util.Date) v8_0.readObject());
                                String v5_1 = ((String) v8_0.readObject());
                                long v6 = v8_0.readLong();
                            } catch (Exception v14) {
                                String v2_2 = new Object[1];
                                v2_2[0] = v10.getName();
                                com.millennialmedia.android.MMSDK$Log.d("There was a problem reading the cached ad %s.", v2_2);
                                com.millennialmedia.android.MMSDK$Log.d(v14);
                                if (v8_0 != 0) {
                                    try {
                                        v8_0.close();
                                        v8_0 = 0;
                                    } catch (java.io.IOException v1) {
                                    }
                                }
                            }
                            if (p21 != 1) {
                                if (!p22.callback(((com.millennialmedia.android.CachedAd) v8_0.readObject()))) {
                                    v8_0.close();
                                    if (0 == 0) {
                                        break;
                                    }
                                    try {
                                        0.close();
                                        break;
                                    } catch (java.io.IOException v1) {
                                        break;
                                    }
                                }
                            } else {
                                if (!p22.callback(v10.getName(), v3, v4_1, v5_1, v6, v8_0)) {
                                    v8_0.close();
                                    if (0 == 0) {
                                        break;
                                    }
                                    try {
                                        0.close();
                                        break;
                                    } catch (java.io.IOException v1) {
                                        break;
                                    }
                                }
                            }
                            if (v8_0 != 0) {
                                try {
                                    v8_0.close();
                                    v8_0 = 0;
                                } catch (java.io.IOException v1) {
                                }
                            }
                        } else {
                            if (p22.callback(v10.getName())) {
                                if (v17 == 0) {
                                    v8_0 = v17;
                                } else {
                                    try {
                                        v17.close();
                                        v8_0 = 0;
                                    } catch (java.io.IOException v1) {
                                        v8_0 = v17;
                                    }
                                }
                            } else {
                                if (v17 == 0) {
                                    break;
                                }
                                try {
                                    v17.close();
                                    break;
                                } catch (java.io.IOException v1) {
                                    break;
                                }
                            }
                        }
                    } else {
                        if (v17 == 0) {
                        } else {
                            try {
                                v17.close();
                                v8_0 = 0;
                            } catch (java.io.IOException v1) {
                                v8_0 = v17;
                            }
                        }
                    }
                    v15++;
                    v17 = v8_0;
                } catch (java.io.IOException v1_13) {
                    v8_0 = v17;
                    if (v8_0 != 0) {
                        try {
                            v8_0.close();
                        } catch (String v2) {
                        }
                    }
                    throw v1_13;
                } catch (Exception v14) {
                    v8_0 = v17;
                } catch (java.io.IOException v1_13) {
                }
            }
        }
        p22.done();
        return;
    }

Method com.jumptap.adtag.activity.JTVideo.prepare() calling method java.io.FileInputStream.<init>()


    protected static boolean prepare(com.jumptap.adtag.JtAdWidgetSettings p17, android.content.Context p18, boolean p19)
    {
        com.jumptap.adtag.db.DBManager v4 = com.jumptap.adtag.db.DBManager.getInstance(p18);
        com.jumptap.adtag.utils.JtAdUrlBuilder v2_1 = new com.jumptap.adtag.utils.JtAdUrlBuilder(p17, p18);
        boolean v8 = com.jumptap.adtag.activity.JTVideo.isVideoInCache(v4);
        android.util.Log.d("JtAd", new StringBuilder().append("in prepare  shouldForceDownload= ").append(p19).append("  isVideoInCache=").append(v8).toString());
        if (p19) {
            v4.deleteAllVideoCacheItems();
        }
        int v11 = 0;
        if ((v8) && (!p19)) {
            com.jumptap.adtag.media.VideoCacheItem v9 = com.jumptap.adtag.activity.JTVideo.getLastItem(v4);
            String v12 = v9.getAdID();
            android.util.Log.d("JtAd", new StringBuilder().append("video found in cache adid = ").append(v12).toString());
            com.jumptap.adtag.activity.JTVideo.getAdContent(p18, v2_1.getAdUrl(new android.webkit.WebView(p18), new StringBuilder().append("type=video&specific=true&adid=").append(v12).toString()));
            android.util.Log.d("JtAd", new StringBuilder().append("TL return adid = ").append(com.jumptap.adtag.activity.JTVideo.adId).toString());
            if (!v12.equals(com.jumptap.adtag.activity.JTVideo.adId)) {
                android.util.Log.d("JtAd", "video  in cache is not valid downloading new file");
                com.jumptap.adtag.activity.JTVideo.deleteVideo(v9, v4, p18);
                com.jumptap.adtag.activity.JTVideo.prepare(p17, p18, 1);
            } else {
                android.util.Log.d("JtAd", "prepering video from cache");
                com.jumptap.adtag.activity.JTVideo.downloadingMediaFile = new java.io.File(p18.getCacheDir(), new StringBuilder().append(com.jumptap.adtag.activity.JTVideo.adId).append(".dat").toString());
                com.jumptap.adtag.media.JTMediaPlayer v10 = com.jumptap.adtag.media.JTMediaPlayer.getInstance();
                try {
                    java.io.FileInputStream v7_1 = new java.io.FileInputStream(com.jumptap.adtag.activity.JTVideo.downloadingMediaFile);
                    v10.prepareVideo(v7_1.getFD());
                    v7_1.close();
                    v11 = 1;
                } catch (java.io.IOException v5_1) {
                    android.util.Log.e("JtAd", "Fail to play video", v5_1);
                } catch (java.io.IOException v5_0) {
                    android.util.Log.e("JtAd", "Fail to play video", v5_0);
                }
            }
        } else {
            android.util.Log.d("JtAd", "video not found in cache . downloading new video");
            com.jumptap.adtag.activity.JTVideo.getAdContent(p18, v2_1.getAdUrl(new android.webkit.WebView(p18), "type=video&specific=false"));
            com.jumptap.adtag.activity.JTVideo.runSaveVideoThread(v4, p18);
        }
        com.jumptap.adtag.activity.JTVideo.maintainDB(v4, p18);
        return v11;
    }

Method com.jumptap.adtag.utils.JtAdManager.getKernelVersion() calling method java.io.FileReader.<init>()


    public static String getKernelVersion()
    {
        try {
            String v6_3;
            if (com.jumptap.adtag.utils.JtAdManager.procVersionStr != null) {
                v6_3 = com.jumptap.adtag.utils.JtAdManager.procVersionStr;
            } else {
                java.io.BufferedReader v5_1 = new java.io.BufferedReader(new java.io.FileReader("/proc/version"), 256);
                String v4 = v5_1.readLine();
                v5_1.close();
                java.util.regex.Matcher v2 = java.util.regex.Pattern.compile("\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\s@]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\([^)]+\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)").matcher(v4);
                if (v2.matches()) {
                    if (v2.groupCount() >= 4) {
                        com.jumptap.adtag.utils.JtAdManager.procVersionStr = new StringBuilder(v2.group(1)).toString();
                        v6_3 = com.jumptap.adtag.utils.JtAdManager.procVersionStr;
                    } else {
                        android.util.Log.e("JtAd", new StringBuilder().append("Regex match on /proc/version only returned ").append(v2.groupCount()).append(" groups").toString());
                        v6_3 = "Unavailable";
                    }
                } else {
                    android.util.Log.e("JtAd", new StringBuilder().append("Regex did not match on /proc/version: ").append(v4).toString());
                    v6_3 = "Unavailable";
                }
            }
        } catch (java.io.IOException v1) {
            android.util.Log.e("JtAd", "IO Exception when getting kernel version for Device Info screen", v1);
            v6_3 = "Unavailable";
        }
        return v6_3;
    }

Method com.millennialmedia.android.MMAdView.initEclipseAd() calling method java.io.File.<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.android.VideoAd.isOnDisk() calling method java.io.File.<init>()


    boolean isOnDisk(android.content.Context p10)
    {
        int v2 = 0;
        java.io.File v0 = com.millennialmedia.android.AdCache.getCacheDirectory(p10);
        if ((v0 != null) && (v0.exists())) {
            String[] v5 = v0.list(new com.millennialmedia.android.VideoAd$2(this));
            if ((v5 != null) && (v5.length >= (this.buttons.size() + 1))) {
                v2 = 1;
            }
            if (v2 != 0) {
                if (new java.io.File(v0, new StringBuilder().append(this.videoFileId).append("video.dat").toString()).exists()) {
                    java.util.Iterator v3 = this.buttons.iterator();
                    while (v3.hasNext()) {
                        if (!new java.io.File(v0, new StringBuilder().append(this.getId()).append(((com.millennialmedia.android.VideoImage) v3.next()).getImageName()).toString()).exists()) {
                            v2 = 0;
                            break;
                        }
                    }
                } else {
                    v2 = 0;
                }
            }
        }
        return v2;
    }

Method com.millennialmedia.android.BridgeMMMedia.writeToPhotoLibrary() calling method java.io.File.<init>()


    public declared_synchronized com.millennialmedia.android.MMJSResponse writeToPhotoLibrary(java.util.HashMap p9)
    {
        try {
            com.millennialmedia.android.MMJSResponse v6_22;
            android.content.Context v0_1 = ((android.content.Context) this.contextRef.get());
            android.net.Uri v3 = android.net.Uri.parse(((String) p9.get("path")));
            java.io.File v1_1 = new java.io.File(new StringBuilder().append(com.millennialmedia.android.AdCache.getCacheDirectory(v0_1).getAbsolutePath()).append(java.io.File.separator).append("Pictures").append(java.io.File.separator).append(v3.getLastPathSegment()).toString());
            String v4 = v3.getScheme();
        } catch (com.millennialmedia.android.MMJSResponse v6_28) {
            throw v6_28;
        }
        if ((v4 == null) || (!v4.equals("http"))) {
            java.io.File v5 = com.millennialmedia.android.AdCache.getDownloadFile(v0_1, v3.getLastPathSegment());
            if (v5.exists()) {
                com.millennialmedia.android.MMJSResponse v6_19;
                if (!this.moveFile(v5, v1_1)) {
                    v6_19 = v5.getAbsolutePath();
                } else {
                    v6_19 = v1_1.getAbsolutePath();
                }
                this.scanMedia(v6_19);
                v6_22 = com.millennialmedia.android.MMJSResponse.responseWithSuccess("Image saved to photo library");
            } else {
                v6_22 = com.millennialmedia.android.MMJSResponse.responseWithError(new StringBuilder().append("No file at ").append(v5.getAbsolutePath()).toString());
            }
        } else {
            p9.put("url", v3.toString());
            p9.put("path", v3.getLastPathSegment());
            com.millennialmedia.android.BridgeMMFileManager v2_1 = new com.millennialmedia.android.BridgeMMFileManager();
            v2_1.setContext(v0_1);
            if (v2_1.downloadFile(p9) != null) {
            } else {
                v6_22 = com.millennialmedia.android.MMJSResponse.responseWithError("Failed to download");
            }
        }
        return v6_22;
    }

Method com.millennialmedia.android.BridgeMMMedia.getPicture() calling method java.io.File.<init>()


    public declared_synchronized com.millennialmedia.android.MMJSResponse getPicture(java.util.HashMap p17)
    {
        try {
            android.content.Context v3_1 = ((android.content.Context) this.contextRef.get());
            String v9_1 = ((String) p17.get("sourceType"));
            String v7_1 = ((String) p17.get("constrainHeight"));
            String v11_1 = ((String) p17.get("constrainWidth"));
            String v1_1 = ((String) p17.get("contentMode"));
        } catch (int v12_6) {
            throw v12_6;
        }
        if (v1_1 == null) {
            v1_1 = "";
        }
        if ((v7_1 != null) && (v11_1 != null)) {
            int v6 = ((int) Float.parseFloat(v7_1));
            int v10 = ((int) Float.parseFloat(v11_1));
            if ((v6 * v10) <= 360000) {
                if ((v3_1 != null) && (v9_1 != null)) {
                    java.io.File v5_1 = new java.io.File(com.millennialmedia.android.AdCache.getCacheDirectory(v3_1), new StringBuilder().append("tmp_mm_").append(String.valueOf(System.currentTimeMillis())).append(".jpg").toString());
                    if (((v9_1.equalsIgnoreCase("Camera")) && (this.isCameraAvailable())) || (((v9_1.equalsIgnoreCase("Photo Library")) || (v9_1.equalsIgnoreCase("PhotoLibrary"))) && (this.isPictureChooserAvailable()))) {
                        try {
                            com.millennialmedia.android.BridgeMMMedia.pickerActivityObject = new Object();
                        } catch (Exception v4) {
                            v4.printStackTrace();
                            com.millennialmedia.android.BridgeMMMedia.pickerActivityObject = 0;
                        }
                        com.millennialmedia.android.Utils$IntentUtils.startPickerActivity(v3_1, v5_1, v9_1);
                        com.millennialmedia.android.BridgeMMMedia.pickerActivityObject.wait();
                        com.millennialmedia.android.BridgeMMMedia.pickerActivityObject = 0;
                        if ((v5_1 != null) && ((v5_1.exists()) && (v5_1.length() > 0))) {
                            byte[] v2 = com.millennialmedia.android.BridgeMMMedia.scaleBitmapToBytes(v5_1, v10, v6, v1_1);
                            v5_1.delete();
                            if (v2 != null) {
                                com.millennialmedia.android.MMJSResponse v8_0 = new com.millennialmedia.android.MMJSResponse();
                                v8_0.result = 1;
                                v8_0.dataResponse = v2;
                                return v8_0;
                            }
                        }
                    }
                }
                v8_0 = 0;
            } else {
                v8_0 = com.millennialmedia.android.MMJSResponse.responseWithError("constrainHeight * constrainWidth > 360000");
            }
        } else {
            v8_0 = com.millennialmedia.android.MMJSResponse.responseWithError("Missing constrainHeight and/or constrainWidth");
        }
        return v8_0;
    }

Method com.millennialmedia.android.BridgeMMMedia$PickerActivity.onActivityResult() calling method java.io.File.<init>()


    protected void onActivityResult(int p25, int p26, android.content.Intent p27)
    {
        this = super.onActivityResult(p25, p26, p27);
        if (p27 != null) {
            java.io.FileInputStream v18 = 0;
            java.io.FileOutputStream v22 = 0;
            try {
                android.net.Uri v3 = p27.getData();
            } catch (Exception v16) {
                com.millennialmedia.android.MMSDK$Log.e(new StringBuilder().append("Error with picture: ").append(v16.getMessage()).toString());
            }
            if (v3 != null) {
                if (v3 != null) {
                    String[] v4 = new String[1];
                    v4[0] = "_data";
                    android.content.ContentResolver v2 = this.getContentResolver();
                    if (v2 != null) {
                        android.database.Cursor v15 = v2.query(v3, v4, 0, 0, 0);
                        if (v15 != null) {
                            int v20 = v15.getColumnIndex("_data");
                            if (v20 != -1) {
                                v15.moveToFirst();
                                java.io.File v14_1 = new java.io.File(v15.getString(v20));
                                v15.close();
                                try {
                                    java.io.File v17_1 = new java.io.File;
                                    v17_1(this.getIntent().getData().getPath());
                                    java.io.FileInputStream v19 = new java.io.FileInputStream;
                                    v19(v14_1);
                                    try {
                                        java.io.FileOutputStream v23_1 = new java.io.FileOutputStream;
                                        v23_1(v17_1);
                                        try {
                                            byte[] v12_1 = new byte[1024];
                                        } catch (Exception v5_22) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 == null) {
                                                    if (v22 != null) {
                                                        v22.close();
                                                    }
                                                } else {
                                                    v18.close();
                                                }
                                            } catch (Exception v6) {
                                            }
                                            throw v5_22;
                                        } catch (Exception v5) {
                                            v22 = v23_1;
                                            v18 = v19;
                                            try {
                                                if (v18 != null) {
                                                    v18.close();
                                                }
                                            } catch (Exception v5) {
                                            }
                                            if (v22 != null) {
                                                v22.close();
                                            }
                                        }
                                        while(true) {
                                            int v21_1 = v19.read(v12_1);
                                            if (v21_1 <= 0) {
                                                break;
                                            }
                                            v23_1.write(v12_1, 0, v21_1);
                                        }
                                        try {
                                            if (v19 != null) {
                                                v19.close();
                                            }
                                        } catch (Exception v5) {
                                            v18 = v19;
                                        }
                                        if (v23_1 != null) {
                                            v23_1.close();
                                        }
                                        v18 = v19;
                                    } catch (Exception v5_22) {
                                        v18 = v19;
                                    } catch (Exception v5) {
                                        v18 = v19;
                                    }
                                } catch (Exception v5_22) {
                                } catch (Exception v5) {
                                }
                            }
                        }
                    }
                }
            } else {
                if (p27.getExtras() != null) {
                    android.graphics.Bitmap v8_1 = ((android.graphics.Bitmap) p27.getExtras().get("data"));
                    try {
                        java.io.File v17_0 = new java.io.File;
                        v17_0(this.getIntent().getData().getPath());
                        java.io.ByteArrayOutputStream v10_1 = new java.io.ByteArrayOutputStream();
                        v8_1.compress(android.graphics.Bitmap$CompressFormat.PNG, 0, v10_1);
                        java.io.ByteArrayInputStream v11_1 = new java.io.ByteArrayInputStream(v10_1.toByteArray());
                        java.io.FileOutputStream v23_0 = new java.io.FileOutputStream;
                        v23_0(v17_0);
                        try {
                            byte[] v12_0 = new byte[1024];
                        } catch (Exception v5_6) {
                            v22 = v23_0;
                            try {
                                if (0 == 0) {
                                    if (v22 != null) {
                                        v22.close();
                                    }
                                } else {
                                    0.close();
                                }
                            } catch (Exception v6) {
                            }
                            throw v5_6;
                        } catch (Exception v5) {
                            v22 = v23_0;
                            try {
                                if (0 != 0) {
                                    0.close();
                                }
                            } catch (Exception v5) {
                            }
                            if (v22 != null) {
                                v22.close();
                            }
                        }
                        while(true) {
                            int v21_0 = v11_1.read(v12_0);
                            if (v21_0 <= 0) {
                                break;
                            }
                            v23_0.write(v12_0, 0, v21_0);
                        }
                        try {
                            if (0 != 0) {
                                0.close();
                            }
                        } catch (Exception v5) {
                        }
                        if (v23_0 != null) {
                            v23_0.close();
                        }
                    } catch (Exception v5_6) {
                    } catch (Exception v5) {
                    }
                }
            }
        }
        com.millennialmedia.android.BridgeMMMedia.access$000();
        com.millennialmedia.android.BridgeMMMedia.access$000().notify();
        this.finish();
        return;
    }

Method com.millennialmedia.android.BridgeMMFileManager.writeData() calling method java.io.File.<init>()


    public com.millennialmedia.android.MMJSResponse writeData(java.util.HashMap p8)
    {
        com.millennialmedia.android.MMJSResponse v5_10;
        if (!this.hasCreativeDirectory()) {
            v5_10 = 0;
        } else {
            java.io.FileOutputStream v2 = 0;
            int v4 = 0;
            if ((!p8.containsKey("path")) || (!p8.containsKey("data"))) {
            } else {
                try {
                    java.io.File v1_1 = new java.io.File(this.root, ((String) p8.get("path")));
                    byte[] v0 = com.millennialmedia.android.Base64.decode(((String) p8.get("data")));
                    java.io.FileOutputStream v3_1 = new java.io.FileOutputStream(v1_1);
                    try {
                        v3_1.write(v0);
                        v4 = 1;
                    } catch (com.millennialmedia.android.MMJSResponse v5_9) {
                        v2 = v3_1;
                        if (v2 != null) {
                            try {
                                v2.close();
                            } catch (Exception v6) {
                            }
                        }
                        throw v5_9;
                    } catch (com.millennialmedia.android.MMJSResponse v5) {
                        v2 = v3_1;
                        if (v2 == null) {
                            if (v4 == 0) {
                            } else {
                                v5_10 = com.millennialmedia.android.MMJSResponse.responseWithSuccess("File written successfully");
                            }
                        } else {
                            try {
                                v2.close();
                            } catch (com.millennialmedia.android.MMJSResponse v5) {
                            }
                        }
                    }
                    if (v3_1 == null) {
                    } else {
                        try {
                            v3_1.close();
                        } catch (com.millennialmedia.android.MMJSResponse v5) {
                        }
                    }
                } catch (com.millennialmedia.android.MMJSResponse v5_9) {
                } catch (com.millennialmedia.android.MMJSResponse v5) {
                }
            }
        }
        return v5_10;
    }

Method com.millennialmedia.android.BridgeMMFileManager.removeAtPath() calling method java.io.File.<init>()


    public com.millennialmedia.android.MMJSResponse removeAtPath(java.util.HashMap p4)
    {
        com.millennialmedia.android.MMJSResponse v2_2;
        if (!this.hasCreativeDirectory()) {
            v2_2 = 0;
        } else {
            try {
                String v1_1 = ((String) p4.get("path"));
            } catch (com.millennialmedia.android.MMJSResponse v2) {
            }
            if ((v1_1 == null) || (!new java.io.File(this.root, v1_1).delete())) {
            } else {
                v2_2 = com.millennialmedia.android.MMJSResponse.responseWithSuccess("File removed successfully");
            }
        }
        return v2_2;
    }

Method com.millennialmedia.android.BridgeMMFileManager.moveFile() calling method java.io.File.<init>()


    public com.millennialmedia.android.MMJSResponse moveFile(java.util.HashMap p6)
    {
        com.millennialmedia.android.MMJSResponse v4_4;
        if (!this.hasCreativeDirectory()) {
            v4_4 = 0;
        } else {
            try {
                String v1_1 = ((String) p6.get("fromPath"));
                String v3_0 = ((String) p6.get("toPath"));
            } catch (com.millennialmedia.android.MMJSResponse v4) {
            }
            if ((v1_1 == null) || ((v3_0 == null) || (!new java.io.File(this.root, v1_1).renameTo(new java.io.File(this.root, v3_0))))) {
            } else {
                v4_4 = com.millennialmedia.android.MMJSResponse.responseWithSuccess("File moved successfully");
            }
        }
        return v4_4;
    }

Method com.millennialmedia.android.BridgeMMFileManager.getFileContents() calling method java.io.File.<init>()


    public com.millennialmedia.android.MMJSResponse getFileContents(java.util.HashMap p9)
    {
        com.millennialmedia.android.MMJSResponse v5_0;
        if (!this.hasCreativeDirectory()) {
            v5_0 = 0;
        } else {
            java.io.FileInputStream v3 = 0;
            if (!p9.containsKey("path")) {
            } else {
                try {
                    java.io.File v2_0 = new java.io.File(this.root, ((String) p9.get("path")));
                    java.io.FileInputStream v4_1 = new java.io.FileInputStream(v2_0);
                    try {
                        int v0 = new byte[((int) v2_0.length())];
                        v4_1.read(v0);
                    } catch (int v6_4) {
                        v3 = v4_1;
                        if (v3 != null) {
                            try {
                                v3.close();
                            } catch (Exception v7) {
                            }
                        }
                        throw v6_4;
                    } catch (Exception v1) {
                        v3 = v4_1;
                        v0 = 0;
                        if (v3 == null) {
                            if (v0 == 0) {
                            } else {
                                v5_0 = new com.millennialmedia.android.MMJSResponse();
                                v5_0.result = 1;
                                v5_0.dataResponse = v0;
                            }
                        } else {
                            try {
                                v3.close();
                            } catch (int v6) {
                            }
                        }
                    }
                    if (v4_1 == null) {
                    } else {
                        try {
                            v4_1.close();
                        } catch (int v6) {
                        }
                    }
                } catch (int v6_4) {
                } catch (Exception v1) {
                }
            }
        }
        return v5_0;
    }

Method com.millennialmedia.android.BridgeMMFileManager.getDirectoryContents() calling method java.io.File.<init>()


    public com.millennialmedia.android.MMJSResponse getDirectoryContents(java.util.HashMap p11)
    {
        com.millennialmedia.android.MMJSResponse v7_1;
        if (!this.hasCreativeDirectory()) {
            v7_1 = 0;
        } else {
            java.io.File v1_0;
            if (!p11.containsKey("path")) {
                v1_0 = this.root;
            } else {
                v1_0 = new java.io.File(this.root, ((String) p11.get("path")));
            }
            org.json.JSONArray v5_1 = new org.json.JSONArray();
            String[] v0 = v1_0.list();
            int v6 = v0.length;
            int v4 = 0;
            while (v4 < v6) {
                v5_1.put(v0[v4]);
                v4++;
            }
            v7_1 = new com.millennialmedia.android.MMJSResponse();
            v7_1.result = 1;
            v7_1.response = v5_1;
        }
        return v7_1;
    }

Method com.millennialmedia.android.MRaid.saveMRaid() calling method java.io.File.<init>()


    static boolean saveMRaid(android.content.Context p11, java.io.InputStream p12)
    {
        int v6_0 = 1;
        java.io.File v2_1 = new java.io.File(com.millennialmedia.android.AdCache.getCacheDirectory(p11), "mraid.js");
        int v9_2 = new Object[1];
        v9_2[0] = v2_1;
        com.millennialmedia.android.MMSDK$Log.v("Saving mraid js to %s", v9_2);
        java.io.FileOutputStream v4 = 0;
        try {
            java.io.FileOutputStream v5_1 = new java.io.FileOutputStream(v2_1);
            try {
                byte[] v0 = new byte[1024];
            } catch (int v6_1) {
                v4 = v5_1;
                if (v4 != null) {
                    try {
                        v4.close();
                    } catch (java.io.IOException v1_2) {
                        v1_2.printStackTrace();
                    }
                }
                throw v6_1;
            } catch (java.io.IOException v1_0) {
                v4 = v5_1;
                if (v2_1 != null) {
                    v2_1.delete();
                }
                int v8_3 = new Object[1];
                v8_3[0] = v1_0.getMessage();
                com.millennialmedia.android.MMSDK$Log.e("Exception downloading component mraid.js: %s", v8_3);
                if (v4 != null) {
                    try {
                        v4.close();
                    } catch (java.io.IOException v1_1) {
                        v1_1.printStackTrace();
                    }
                }
                v6_0 = 0;
                return v6_0;
            }
            while(true) {
                int v3 = p12.read(v0);
                if (v3 <= 0) {
                    break;
                }
                v5_1.write(v0, 0, v3);
            }
            if (v5_1 == null) {
                return v6_0;
            } else {
                try {
                    v5_1.close();
                } catch (java.io.IOException v1_3) {
                    v1_3.printStackTrace();
                }
                return v6_0;
            }
        } catch (int v6_1) {
        } catch (java.io.IOException v1_0) {
        }
    }

Method com.millennialmedia.android.MRaid.getMRaidJsFile() calling method java.io.File.<init>()


    private static java.io.File getMRaidJsFile(android.content.Context p3)
    {
        return new java.io.File(com.millennialmedia.android.AdCache.getCacheDirectory(p3), "mraid.js");
    }

Method com.millennialmedia.android.AdCache.save() calling method java.io.File.<init>()


    static boolean save(android.content.Context p11, com.millennialmedia.android.CachedAd p12)
    {
        java.io.IOException v6_0 = 0;
        java.io.File v2 = 0;
        java.io.ObjectOutputStream v4 = 0;
        if (p12 != null) {
            java.io.File v0 = com.millennialmedia.android.AdCache.getCachedAdFile(p11, p12.getId());
            if (v0 != null) {
                int v9_1 = new Object[2];
                v9_1[0] = p12.getId();
                v9_1[1] = v0;
                com.millennialmedia.android.MMSDK$Log.v("Saving CachedAd %s to %s", v9_1);
                try {
                    java.io.File v3_1 = new java.io.File(v0.getParent(), new StringBuilder().append(p12.getId()).append("ad.lock").toString());
                    try {
                        if (v3_1.createNewFile()) {
                            java.io.ObjectOutputStream v5_1 = new java.io.ObjectOutputStream(new java.io.FileOutputStream(v0));
                            try {
                                v5_1.writeInt(p12.getType());
                                v5_1.writeObject(p12.expiration);
                                v5_1.writeObject(p12.acid);
                                v5_1.writeLong(p12.deferredViewStart);
                                v5_1.writeObject(p12);
                                try {
                                    v3_1.delete();
                                } catch (boolean v8) {
                                    if (p12.saveAssets(p11)) {
                                        v2 = v3_1;
                                        v6_0 = 1;
                                    } else {
                                        p12.delete(p11);
                                        v2 = v3_1;
                                    }
                                }
                                if (v5_1 == null) {
                                } else {
                                    v5_1.close();
                                }
                            } catch (java.io.IOException v6_1) {
                                v4 = v5_1;
                                v2 = v3_1;
                                try {
                                    v2.delete();
                                } catch (java.io.IOException v7) {
                                    throw v6_1;
                                }
                                if (v4 == null) {
                                } else {
                                    v4.close();
                                }
                            } catch (Exception v1) {
                                v4 = v5_1;
                                v2 = v3_1;
                                boolean v8_14 = new Object[1];
                                v8_14[0] = p12.getId();
                                com.millennialmedia.android.MMSDK$Log.e("There was a problem saving the cached ad %s.", v8_14);
                                com.millennialmedia.android.MMSDK$Log.d(v1.getMessage());
                                com.millennialmedia.android.MMSDK$Log.d(v1);
                                try {
                                    v2.delete();
                                } catch (java.io.IOException v7) {
                                }
                                if (v4 != null) {
                                    v4.close();
                                }
                            }
                        } else {
                            boolean v8_12 = new Object[1];
                            v8_12[0] = p12.getId();
                            com.millennialmedia.android.MMSDK$Log.v("Could not save the cached ad %s. Ad was locked.", v8_12);
                            try {
                                v3_1.delete();
                            } catch (java.io.IOException v7) {
                            }
                            if (0 != 0) {
                                0.close();
                            }
                        }
                    } catch (java.io.IOException v6_1) {
                        v2 = v3_1;
                    } catch (Exception v1) {
                        v2 = v3_1;
                    }
                } catch (java.io.IOException v6_1) {
                } catch (Exception v1) {
                }
            }
        }
        return v6_0;
    }

Method com.millennialmedia.android.AdCache.getExternalCacheDirectory() calling method java.io.File.<init>()


    private static java.io.File getExternalCacheDirectory(android.content.Context p3)
    {
        int v0_0 = 0;
        java.io.File v1 = android.os.Environment.getExternalStorageDirectory();
        if (v1 != null) {
            v0_0 = new java.io.File(v1, ".mmsyscache");
            if ((!v0_0.exists()) && (!v0_0.mkdirs())) {
                v0_0 = 0;
            }
        }
        return v0_0;
    }

Method com.millennialmedia.android.AdCache.getDownloadFile() calling method java.io.File.<init>()


    static java.io.File getDownloadFile(android.content.Context p2, String p3)
    {
        java.io.File v0 = com.millennialmedia.android.AdCache.getCacheDirectory(p2);
        java.io.File v1_0 = 0;
        if (v0 != null) {
            v1_0 = new java.io.File(v0, p3);
        }
        return v1_0;
    }

Method com.millennialmedia.android.AdCache.getCachedAdFile() calling method java.io.File.<init>()


    private static java.io.File getCachedAdFile(android.content.Context p10, String p11)
    {
        String v4 = new StringBuilder().append(p11).append("ad.dat").toString();
        boolean v7 = com.millennialmedia.android.AdCache.isExternalStorageAvailable(p10);
        java.io.File v2 = com.millennialmedia.android.AdCache.getCacheDirectory(p10);
        java.io.File v0 = 0;
        try {
            if ((v2 == null) || (!v2.isDirectory())) {
                if (((v0 == null) || (!v0.exists())) && (!v7)) {
                    java.io.File v5 = p10.getFilesDir();
                    if (v5 != null) {
                        java.io.File v6_1 = new java.io.File(v5, new StringBuilder().append(".mmsyscache").append(java.io.File.separator).append(v4).toString());
                        if ((v6_1.exists()) && (v6_1.isFile())) {
                        }
                    }
                }
                v6_1 = v0;
            } else {
                v0 = new java.io.File(v2, v4);
            }
        } catch (Exception v3) {
            com.millennialmedia.android.MMSDK$Log.e(v3);
            v6_1 = 0;
        }
        return v6_1;
    }

Method com.millennialmedia.android.AdCache.downloadComponent() calling method java.io.File.<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.io.File.<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.jumptap.adtag.activity.JTVideo.prepare() calling method java.io.File.<init>()


    protected static boolean prepare(com.jumptap.adtag.JtAdWidgetSettings p17, android.content.Context p18, boolean p19)
    {
        com.jumptap.adtag.db.DBManager v4 = com.jumptap.adtag.db.DBManager.getInstance(p18);
        com.jumptap.adtag.utils.JtAdUrlBuilder v2_1 = new com.jumptap.adtag.utils.JtAdUrlBuilder(p17, p18);
        boolean v8 = com.jumptap.adtag.activity.JTVideo.isVideoInCache(v4);
        android.util.Log.d("JtAd", new StringBuilder().append("in prepare  shouldForceDownload= ").append(p19).append("  isVideoInCache=").append(v8).toString());
        if (p19) {
            v4.deleteAllVideoCacheItems();
        }
        int v11 = 0;
        if ((v8) && (!p19)) {
            com.jumptap.adtag.media.VideoCacheItem v9 = com.jumptap.adtag.activity.JTVideo.getLastItem(v4);
            String v12 = v9.getAdID();
            android.util.Log.d("JtAd", new StringBuilder().append("video found in cache adid = ").append(v12).toString());
            com.jumptap.adtag.activity.JTVideo.getAdContent(p18, v2_1.getAdUrl(new android.webkit.WebView(p18), new StringBuilder().append("type=video&specific=true&adid=").append(v12).toString()));
            android.util.Log.d("JtAd", new StringBuilder().append("TL return adid = ").append(com.jumptap.adtag.activity.JTVideo.adId).toString());
            if (!v12.equals(com.jumptap.adtag.activity.JTVideo.adId)) {
                android.util.Log.d("JtAd", "video  in cache is not valid downloading new file");
                com.jumptap.adtag.activity.JTVideo.deleteVideo(v9, v4, p18);
                com.jumptap.adtag.activity.JTVideo.prepare(p17, p18, 1);
            } else {
                android.util.Log.d("JtAd", "prepering video from cache");
                com.jumptap.adtag.activity.JTVideo.downloadingMediaFile = new java.io.File(p18.getCacheDir(), new StringBuilder().append(com.jumptap.adtag.activity.JTVideo.adId).append(".dat").toString());
                com.jumptap.adtag.media.JTMediaPlayer v10 = com.jumptap.adtag.media.JTMediaPlayer.getInstance();
                try {
                    java.io.FileInputStream v7_1 = new java.io.FileInputStream(com.jumptap.adtag.activity.JTVideo.downloadingMediaFile);
                    v10.prepareVideo(v7_1.getFD());
                    v7_1.close();
                    v11 = 1;
                } catch (java.io.IOException v5_1) {
                    android.util.Log.e("JtAd", "Fail to play video", v5_1);
                } catch (java.io.IOException v5_0) {
                    android.util.Log.e("JtAd", "Fail to play video", v5_0);
                }
            }
        } else {
            android.util.Log.d("JtAd", "video not found in cache . downloading new video");
            com.jumptap.adtag.activity.JTVideo.getAdContent(p18, v2_1.getAdUrl(new android.webkit.WebView(p18), "type=video&specific=false"));
            com.jumptap.adtag.activity.JTVideo.runSaveVideoThread(v4, p18);
        }
        com.jumptap.adtag.activity.JTVideo.maintainDB(v4, p18);
        return v11;
    }

Method com.jumptap.adtag.activity.JTVideo.deleteVideo() calling method java.io.File.<init>()


    private static void deleteVideo(com.jumptap.adtag.media.VideoCacheItem p4, com.jumptap.adtag.db.DBManager p5, android.content.Context p6)
    {
        android.util.Log.i("JtAd", new StringBuilder().append("deleting from db item = ").append(p4.toString()).toString());
        p5.deleteVideoCacheItemById(p4.getId());
        java.io.File v0_1 = new java.io.File(p6.getCacheDir(), new StringBuilder().append(p4.getAdID()).append(".dat").toString());
        if (v0_1.exists()) {
            v0_1.delete();
        }
        return;
    }

Method com.millennialmedia.android.AdCache.downloadComponent() calling method android.content.Context.openFileOutput()


    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;
    }