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.unity3d.services.core.misc.Utilities.writeFile() calling method java.io.FileOutputStream.<init>()


    public static boolean writeFile(java.io.File p6, String p7)
    {
        int v3;
        if (p6 != null) {
            java.io.FileOutputStream v1 = 0;
            v3 = 1;
            try {
                java.io.FileOutputStream v2_1 = new java.io.FileOutputStream(p6);
                try {
                    v2_1.write(p7.getBytes());
                    v2_1.flush();
                } catch (String v4_1) {
                    v1 = v2_1;
                    if (v1 != null) {
                        try {
                            v1.close();
                        } catch (Exception v0_2) {
                            com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_2);
                        }
                    }
                    throw v4_1;
                } catch (Exception v0_0) {
                    v1 = v2_1;
                    v3 = 0;
                    com.unity3d.services.core.log.DeviceLog.exception("Could not write file", v0_0);
                    if (v1 == null) {
                        if (v3 != 0) {
                            com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Wrote file: ").append(p6.getAbsolutePath()).toString());
                        }
                    } else {
                        try {
                            v1.close();
                        } catch (Exception v0_1) {
                            com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_1);
                        }
                    }
                }
                if (v2_1 == null) {
                } else {
                    try {
                        v2_1.close();
                    } catch (Exception v0_3) {
                        com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_3);
                    }
                }
            } catch (String v4_1) {
            } catch (Exception v0_0) {
            }
        } else {
            v3 = 0;
        }
        return v3;
    }

Method com.unity3d.services.core.cache.CacheThreadHandler.downloadFile() calling method java.io.FileOutputStream.<init>()


    private void downloadFile(String p22, String p23, int p24, int p25, int p26, java.util.HashMap p27, boolean p28)
    {
        if ((!this._canceled) && ((p22 != null) && (p23 != null))) {
            java.io.File v11_1 = new java.io.File(p23);
            if (!p28) {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads cache: start downloading ").append(p22).append(" to ").append(p23).toString());
            } else {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads cache: resuming download ").append(p22).append(" to ").append(p23).append(" at ").append(v11_1.length()).append(" bytes").toString());
            }
            if (com.unity3d.services.core.device.Device.isActiveNetworkConnected()) {
                this._active = 1;
                long v8 = android.os.SystemClock.elapsedRealtime();
                java.io.FileOutputStream v19 = 0;
                try {
                    java.io.FileOutputStream v20 = new java.io.FileOutputStream;
                    v20(v11_1, p28);
                    try {
                        this._currentRequest = this.getWebRequest(p22, p24, p25, p27);
                        this._currentRequest.setProgressListener(new com.unity3d.services.core.cache.CacheThreadHandler$1(this, v11_1, p26));
                        long v12 = this._currentRequest.makeStreamRequest(v20);
                        this._active = 0;
                        this.postProcessDownload(v8, p22, v11_1, v12, this._currentRequest.getContentLength(), this._currentRequest.isCanceled(), this._currentRequest.getResponseCode(), this._currentRequest.getResponseHeaders());
                        this._currentRequest = 0;
                    } catch (com.unity3d.services.core.webview.WebViewApp v7_44) {
                        v19 = v20;
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_10) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_10);
                                com.unity3d.services.core.webview.WebViewEventCategory v10_17 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v0_20 = new Object[3];
                                int v16_32 = v0_20;
                                v16_32[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v16_32[1] = p22;
                                v16_32[2] = v6_10.getMessage();
                                v10_17.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v16_32);
                            }
                        }
                        throw v7_44;
                    } catch (Exception v6_8) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t create target file", v6_8);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_41 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_17 = new Object[3];
                        v15_17[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                        v15_17[1] = p22;
                        v15_17[2] = v6_8.getMessage();
                        v7_41.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_17);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_9) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_9);
                                com.unity3d.services.core.webview.WebViewApp v7_46 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_19 = new Object[3];
                                v15_19[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_19[1] = p22;
                                v15_19[2] = v6_9.getMessage();
                                v7_46.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_19);
                            }
                        }
                    } catch (Exception v6_6) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Malformed URL", v6_6);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_33 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_13 = new Object[3];
                        v15_13[0] = com.unity3d.services.core.cache.CacheError.MALFORMED_URL;
                        v15_13[1] = p22;
                        v15_13[2] = v6_6.getMessage();
                        v7_33.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_13);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_7) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_7);
                                com.unity3d.services.core.webview.WebViewApp v7_37 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_15 = new Object[3];
                                v15_15[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_15[1] = p22;
                                v15_15[2] = v6_7.getMessage();
                                v7_37.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_15);
                            }
                        }
                    } catch (Exception v6_4) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t request stream", v6_4);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_25 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_9 = new Object[3];
                        v15_9[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                        v15_9[1] = p22;
                        v15_9[2] = v6_4.getMessage();
                        v7_25.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_9);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_5) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_5);
                                com.unity3d.services.core.webview.WebViewApp v7_29 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_11 = new Object[3];
                                v15_11[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_11[1] = p22;
                                v15_11[2] = v6_5.getMessage();
                                v7_29.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_11);
                            }
                        }
                    } catch (Exception v6_2) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Illegal state", v6_2);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_17 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_5 = new Object[3];
                        v15_5[0] = com.unity3d.services.core.cache.CacheError.ILLEGAL_STATE;
                        v15_5[1] = p22;
                        v15_5[2] = v6_2.getMessage();
                        v7_17.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_5);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_3) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_3);
                                com.unity3d.services.core.webview.WebViewApp v7_21 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_7 = new Object[3];
                                v15_7[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_7[1] = p22;
                                v15_7[2] = v6_3.getMessage();
                                v7_21.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_7);
                            }
                        }
                    } catch (Exception v6_0) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Network error", v6_0);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_9 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_1 = new Object[3];
                        v15_1[0] = com.unity3d.services.core.cache.CacheError.NETWORK_ERROR;
                        v15_1[1] = p22;
                        v15_1[2] = v6_0.getMessage();
                        v7_9.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_1);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_1) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_1);
                                com.unity3d.services.core.webview.WebViewApp v7_13 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_3 = new Object[3];
                                v15_3[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_3[1] = p22;
                                v15_3[2] = v6_1.getMessage();
                                v7_13.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_3);
                            }
                        }
                    }
                    if (v20 != null) {
                        try {
                            v20.close();
                        } catch (Exception v6_11) {
                            com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_11);
                            com.unity3d.services.core.webview.WebViewApp v7_49 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                            Object[] v15_22 = new Object[3];
                            v15_22[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                            v15_22[1] = p22;
                            v15_22[2] = v6_11.getMessage();
                            v7_49.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_22);
                        }
                    }
                } catch (com.unity3d.services.core.webview.WebViewApp v7_44) {
                } catch (Exception v6_8) {
                } catch (Exception v6_6) {
                } catch (Exception v6_4) {
                } catch (Exception v6_2) {
                } catch (Exception v6_0) {
                }
            } else {
                com.unity3d.services.core.log.DeviceLog.debug("Unity Ads cache: download cancelled, no internet connection available");
                com.unity3d.services.core.webview.WebViewApp v7_52 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                Object[] v15_24 = new Object[2];
                v15_24[0] = com.unity3d.services.core.cache.CacheError.NO_INTERNET;
                v15_24[1] = p22;
                v7_52.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_24);
            }
        }
        return;
    }

Method com.unity3d.services.core.cache.CacheDirectory.testCacheDirectory() calling method java.io.FileOutputStream.<init>()


    public boolean testCacheDirectory(java.io.File p12)
    {
        int v8 = 0;
        if ((p12 != null) && (p12.isDirectory())) {
            try {
                byte[] v3 = "test".getBytes("UTF-8");
                byte[] v4 = new byte[v3.length];
                java.io.File v7_1 = new java.io.File(p12, "UnityAdsTest.txt");
                java.io.FileOutputStream v2_1 = new java.io.FileOutputStream(v7_1);
                v2_1.write(v3);
                v2_1.flush();
                v2_1.close();
                java.io.FileInputStream v1_1 = new java.io.FileInputStream(v7_1);
                int v5 = v1_1.read(v4, 0, v4.length);
                v1_1.close();
            } catch (Exception v0) {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads exception while testing cache directory ").append(p12.getAbsolutePath()).append(": ").append(v0.getMessage()).toString());
            }
            if (v7_1.delete()) {
                if (v5 == v4.length) {
                    if (!new String(v4, "UTF-8").equals("test")) {
                        com.unity3d.services.core.log.DeviceLog.debug("Read buffer content mismatch");
                    } else {
                        v8 = 1;
                    }
                } else {
                    com.unity3d.services.core.log.DeviceLog.debug("Read buffer size mismatch");
                }
            } else {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Failed to delete testfile ").append(v7_1.getAbsoluteFile()).toString());
            }
        }
        return v8;
    }

Method com.unity3d.services.core.api.Cache.setFileContent() calling method java.io.FileOutputStream.<init>()


    public static void setFileContent(String p11, String p12, String p13, com.unity3d.services.core.webview.bridge.WebViewCallback p14)
    {
        String v5 = com.unity3d.services.core.api.Cache.fileIdToFilename(p11);
        java.io.FileOutputStream v2 = 0;
        int v4 = 0;
        try {
            byte[] v1 = p13.getBytes("UTF-8");
        } catch (Exception v0) {
            String v7_1 = new Object[3];
            v7_1[0] = p11;
            v7_1[1] = v5;
            v7_1[2] = p12;
            p14.error(com.unity3d.services.core.cache.CacheError.UNSUPPORTED_ENCODING, v7_1);
            return;
        }
        if ((p12 != null) && (p12.length() > 0)) {
            if (!p12.equals("Base64")) {
                if (!p12.equals("UTF-8")) {
                    String v7_2 = new Object[3];
                    v7_2[0] = p11;
                    v7_2[1] = v5;
                    v7_2[2] = p12;
                    p14.error(com.unity3d.services.core.cache.CacheError.UNSUPPORTED_ENCODING, v7_2);
                    return;
                }
            } else {
                v1 = android.util.Base64.decode(p13, 2);
            }
        }
        try {
            java.io.FileOutputStream v3_1 = new java.io.FileOutputStream(v5);
            try {
                v3_1.write(v1);
                v3_1.flush();
                v4 = 1;
            } catch (String v6_10) {
                v2 = v3_1;
                if (v2 != null) {
                    try {
                        v2.close();
                    } catch (Exception v0_2) {
                        com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_2);
                    }
                }
                throw v6_10;
            } catch (Exception v0) {
                v2 = v3_1;
                String v7_6 = new Object[3];
                v7_6[0] = p11;
                v7_6[1] = v5;
                v7_6[2] = p12;
                p14.error(com.unity3d.services.core.cache.CacheError.FILE_NOT_FOUND, v7_6);
                if (v2 == null) {
                    if (v4 == 0) {
                        return;
                    } else {
                        String v6_14 = new Object[0];
                        p14.invoke(v6_14);
                        return;
                    }
                } else {
                    try {
                        v2.close();
                    } catch (Exception v0_1) {
                        com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_1);
                    }
                }
            } catch (Exception v0) {
                v2 = v3_1;
                String v7_4 = new Object[3];
                v7_4[0] = p11;
                v7_4[1] = v5;
                v7_4[2] = p12;
                p14.error(com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR, v7_4);
                if (v2 == null) {
                } else {
                    try {
                        v2.close();
                    } catch (Exception v0_0) {
                        com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_0);
                    }
                }
            }
            if (v3_1 == null) {
            } else {
                try {
                    v3_1.close();
                } catch (Exception v0_3) {
                    com.unity3d.services.core.log.DeviceLog.exception("Error closing FileOutputStream", v0_3);
                }
            }
        } catch (String v6_10) {
        } catch (Exception v0) {
        } catch (Exception v0) {
        }
    }

Method android.support.v4.util.AtomicFile.startWrite() calling method java.io.FileOutputStream.<init>()


    public java.io.FileOutputStream startWrite()
    {
        if (this.mBaseName.exists()) {
            if (this.mBackupName.exists()) {
                this.mBaseName.delete();
            } else {
                if (!this.mBaseName.renameTo(this.mBackupName)) {
                    android.util.Log.w("AtomicFile", new StringBuilder().append("Couldn\'t rename file ").append(this.mBaseName).append(" to backup file ").append(this.mBackupName).toString());
                }
            }
        }
        try {
            java.io.FileOutputStream v3_1 = new java.io.FileOutputStream(this.mBaseName);
        } catch (java.io.FileNotFoundException v0) {
            if (this.mBaseName.getParentFile().mkdirs()) {
                try {
                    v3_1 = new java.io.FileOutputStream(this.mBaseName);
                } catch (java.io.FileNotFoundException v1) {
                    throw new java.io.IOException(new StringBuilder().append("Couldn\'t create ").append(this.mBaseName).toString());
                }
            } else {
                throw new java.io.IOException(new StringBuilder().append("Couldn\'t create directory ").append(this.mBaseName).toString());
            }
        }
        return v3_1;
    }

Method android.support.v4.print.PrintHelper$1.doInBackground() calling method java.io.FileOutputStream.<init>()


    protected varargs Throwable doInBackground(Void[] p12)
    {
        Throwable v7 = 0;
        try {
            if (!this.val$cancellationSignal.isCanceled()) {
                android.print.pdf.PrintedPdfDocument v6_1 = new android.print.pdf.PrintedPdfDocument(this.this$0.mContext, this.val$pdfAttributes);
                android.graphics.Bitmap v4 = android.support.v4.print.PrintHelper.convertBitmapForColorMode(this.val$bitmap, this.val$pdfAttributes.getColorMode());
                if (!this.val$cancellationSignal.isCanceled()) {
                    try {
                        android.graphics.RectF v0_1;
                        android.graphics.pdf.PdfDocument$Page v5 = v6_1.startPage(1);
                    } catch (java.io.IOException v8_27) {
                        v6_1.close();
                        if (this.val$fileDescriptor != null) {
                            try {
                                this.val$fileDescriptor.close();
                            } catch (java.io.FileDescriptor v9) {
                            }
                        }
                        if (v4 != this.val$bitmap) {
                            v4.recycle();
                        }
                        throw v8_27;
                    }
                    if (!android.support.v4.print.PrintHelper.IS_MIN_MARGINS_HANDLING_CORRECT) {
                        android.print.pdf.PrintedPdfDocument v1_1 = new android.print.pdf.PrintedPdfDocument(this.this$0.mContext, this.val$attributes);
                        android.graphics.pdf.PdfDocument$Page v2 = v1_1.startPage(1);
                        v0_1 = new android.graphics.RectF(v2.getInfo().getContentRect());
                        v1_1.finishPage(v2);
                        v1_1.close();
                    } else {
                        v0_1 = new android.graphics.RectF(v5.getInfo().getContentRect());
                    }
                    android.graphics.Matrix v3 = android.support.v4.print.PrintHelper.getMatrix(v4.getWidth(), v4.getHeight(), v0_1, this.val$fittingMode);
                    if (!android.support.v4.print.PrintHelper.IS_MIN_MARGINS_HANDLING_CORRECT) {
                        v3.postTranslate(v0_1.left, v0_1.top);
                        v5.getCanvas().clipRect(v0_1);
                    }
                    v5.getCanvas().drawBitmap(v4, v3, 0);
                    v6_1.finishPage(v5);
                    if (!this.val$cancellationSignal.isCanceled()) {
                        v6_1.writeTo(new java.io.FileOutputStream(this.val$fileDescriptor.getFileDescriptor()));
                        v6_1.close();
                        if (this.val$fileDescriptor != null) {
                            try {
                                this.val$fileDescriptor.close();
                            } catch (java.io.IOException v8) {
                            }
                        }
                        if (v4 != this.val$bitmap) {
                            v4.recycle();
                        }
                    } else {
                        v6_1.close();
                        if (this.val$fileDescriptor != null) {
                            try {
                                this.val$fileDescriptor.close();
                            } catch (java.io.IOException v8) {
                            }
                        }
                        if (v4 != this.val$bitmap) {
                            v4.recycle();
                        }
                    }
                }
            }
        } catch (Throwable v7) {
        }
        return v7;
    }

Method android.support.v4.graphics.TypefaceCompatUtil.copyToFile() calling method java.io.FileOutputStream.<init>()


    public static boolean copyToFile(java.io.File p10, java.io.InputStream p11)
    {
        int v6_0 = 0;
        java.io.FileOutputStream v3 = 0;
        android.os.StrictMode$ThreadPolicy v2 = android.os.StrictMode.allowThreadDiskWrites();
        try {
            java.io.FileOutputStream v4_1 = new java.io.FileOutputStream(p10, 0);
            try {
                byte[] v0 = new byte[1024];
            } catch (int v6_1) {
                v3 = v4_1;
                android.support.v4.graphics.TypefaceCompatUtil.closeQuietly(v3);
                android.os.StrictMode.setThreadPolicy(v2);
                throw v6_1;
            } catch (java.io.IOException v1) {
                v3 = v4_1;
                android.util.Log.e("TypefaceCompatUtil", new StringBuilder().append("Error copying resource contents to temp file: ").append(v1.getMessage()).toString());
                android.support.v4.graphics.TypefaceCompatUtil.closeQuietly(v3);
                android.os.StrictMode.setThreadPolicy(v2);
                return v6_0;
            }
            while(true) {
                int v5 = p11.read(v0);
                if (v5 == -1) {
                    break;
                }
                v4_1.write(v0, 0, v5);
            }
            v6_0 = 1;
            android.support.v4.graphics.TypefaceCompatUtil.closeQuietly(v4_1);
            android.os.StrictMode.setThreadPolicy(v2);
            return v6_0;
        } catch (int v6_1) {
        } catch (java.io.IOException v1) {
        }
    }

Method android.support.v4.graphics.drawable.IconCompat.loadDrawableInner() calling method java.io.FileInputStream.<init>()


    private android.graphics.drawable.Drawable loadDrawableInner(android.content.Context p13)
    {
        android.graphics.drawable.BitmapDrawable v7_1;
        switch (this.mType) {
            case 1:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), ((android.graphics.Bitmap) this.mObj1));
                break;
            case 2:
                String v4 = this.getResPackage();
                if (android.text.TextUtils.isEmpty(v4)) {
                    v4 = p13.getPackageName();
                }
                try {
                    v7_1 = android.support.v4.content.res.ResourcesCompat.getDrawable(android.support.v4.graphics.drawable.IconCompat.getResources(p13, v4), this.mInt1, p13.getTheme());
                } catch (java.io.FileNotFoundException v0_2) {
                    android.graphics.Bitmap v9_7 = new Object[2];
                    v9_7[0] = Integer.valueOf(this.mInt1);
                    v9_7[1] = this.mObj1;
                    android.util.Log.e("IconCompat", String.format("Unable to load resource 0x%08x from pkg=%s", v9_7), v0_2);
                    v7_1 = 0;
                }
                break;
            case 3:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.graphics.BitmapFactory.decodeByteArray(((byte[]) ((byte[]) this.mObj1)), this.mInt1, this.mInt2));
                break;
            case 4:
                java.io.FileInputStream v1;
                android.net.Uri v6 = android.net.Uri.parse(((String) this.mObj1));
                String v5 = v6.getScheme();
                if ((!"content".equals(v5)) && (!"file".equals(v5))) {
                    try {
                        v1 = new java.io.FileInputStream(new java.io.File(((String) this.mObj1)));
                    } catch (java.io.FileNotFoundException v0_0) {
                        android.util.Log.w("IconCompat", new StringBuilder().append("Unable to load image from path: ").append(v6).toString(), v0_0);
                    }
                } else {
                    try {
                        v1 = p13.getContentResolver().openInputStream(v6);
                    } catch (java.io.FileNotFoundException v0_1) {
                        android.util.Log.w("IconCompat", new StringBuilder().append("Unable to load image from URI: ").append(v6).toString(), v0_1);
                    }
                }
                if (v1 == null) {
                } else {
                    v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.graphics.BitmapFactory.decodeStream(v1));
                }
                break;
            case 5:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.support.v4.graphics.drawable.IconCompat.createLegacyIconFromAdaptiveIcon(((android.graphics.Bitmap) this.mObj1), 0));
                break;
            default:
        }
        return v7_1;
    }

Method android.support.v4.graphics.TypefaceCompatApi21Impl.createFromFontInfo() calling method java.io.FileInputStream.<init>()


    public android.graphics.Typeface createFromFontInfo(android.content.Context p12, android.os.CancellationSignal p13, android.support.v4.provider.FontsContractCompat$FontInfo[] p14, int p15)
    {
        Throwable v6_2;
        if (p14.length >= 1) {
            try {
                android.os.ParcelFileDescriptor v4 = p12.getContentResolver().openFileDescriptor(this.findBestInfo(p14, p15).getUri(), "r", p13);
                try {
                    java.io.File v2 = this.getFile(v4);
                } catch (Throwable v6_6) {
                    Throwable v7_4 = 0;
                    if (v4 != null) {
                        if (v7_4 == null) {
                            v4.close();
                        } else {
                            v4.close();
                        }
                    }
                    throw v6_6;
                } catch (Throwable v6_5) {
                    try {
                        throw v6_5;
                    } catch (Throwable v7_3) {
                        v7_4 = v6_5;
                        v6_6 = v7_3;
                    }
                }
                if ((v2 != null) && (v2.canRead())) {
                    v6_2 = android.graphics.Typeface.createFromFile(v2);
                    if (v4 != null) {
                        if (0 == 0) {
                            v4.close();
                        } else {
                            try {
                                v4.close();
                            } catch (Throwable v7_1) {
                                0.addSuppressed(v7_1);
                            }
                        }
                    }
                } else {
                    java.io.FileInputStream v3_1 = new java.io.FileInputStream(v4.getFileDescriptor());
                    Throwable v7_2 = 0;
                    try {
                        v6_2 = super.createFromInputStream(p12, v3_1);
                    } catch (Throwable v7_2) {
                        throw v7_2;
                    } catch (Throwable v6_4) {
                        if (v3_1 != null) {
                            if (v7_2 == null) {
                                v3_1.close();
                            } else {
                                v3_1.close();
                            }
                        }
                        throw v6_4;
                    }
                    if (v3_1 != null) {
                        if (0 == 0) {
                            v3_1.close();
                        } else {
                            try {
                                v3_1.close();
                            } catch (Throwable v9_1) {
                                0.addSuppressed(v9_1);
                            }
                        }
                    }
                    if (v4 != null) {
                        if (0 == 0) {
                            v4.close();
                        } else {
                            try {
                                v4.close();
                            } catch (Throwable v7_5) {
                                0.addSuppressed(v7_5);
                            }
                        }
                    }
                }
            } catch (java.io.IOException v1) {
                v6_2 = 0;
            }
        } else {
            v6_2 = 0;
        }
        return v6_2;
    }

Method com.unity3d.services.core.misc.Utilities.readFileBytes() calling method java.io.FileInputStream.<init>()


    public static byte[] readFileBytes(java.io.File p10)
    {
        byte[] v0;
        if (p10 != null) {
            int v5;
            java.io.FileInputStream v2_1 = new java.io.FileInputStream(p10);
            v0 = new byte[((int) p10.length())];
            int v3 = 0;
            if (p10.length() >= ((long) 4096)) {
                v5 = 4096;
            } else {
                v5 = ((int) p10.length());
            }
            do {
                int v4 = v2_1.read(v0, v3, v5);
                if (v4 <= 0) {
                    v2_1.close();
                } else {
                    v3 += v4;
                }
            } while((p10.length() - ((long) v3)) >= ((long) 4096));
            v5 = (((int) p10.length()) - v3);
        } else {
            v0 = 0;
        }
        return v0;
    }

Method com.unity3d.services.core.device.Device.getApkDigest() calling method java.io.FileInputStream.<init>()


    public static String getApkDigest()
    {
        java.io.FileInputStream v2 = 0;
        try {
            java.io.FileInputStream v3_1 = new java.io.FileInputStream(new java.io.File(com.unity3d.services.core.properties.ClientProperties.getApplicationContext().getPackageCodePath()));
            try {
                String v0 = com.unity3d.services.core.misc.Utilities.Sha256(v3_1);
            } catch (java.io.IOException v4_0) {
                v2 = v3_1;
                if (v2 != null) {
                    try {
                        v2.close();
                    } catch (java.io.IOException v5) {
                    }
                }
                throw v4_0;
            }
            if (v3_1 != null) {
                try {
                    v3_1.close();
                } catch (java.io.IOException v4) {
                }
            }
            return v0;
        } catch (java.io.IOException v4_0) {
        }
    }

Method com.unity3d.services.core.cache.CacheDirectory.testCacheDirectory() calling method java.io.FileInputStream.<init>()


    public boolean testCacheDirectory(java.io.File p12)
    {
        int v8 = 0;
        if ((p12 != null) && (p12.isDirectory())) {
            try {
                byte[] v3 = "test".getBytes("UTF-8");
                byte[] v4 = new byte[v3.length];
                java.io.File v7_1 = new java.io.File(p12, "UnityAdsTest.txt");
                java.io.FileOutputStream v2_1 = new java.io.FileOutputStream(v7_1);
                v2_1.write(v3);
                v2_1.flush();
                v2_1.close();
                java.io.FileInputStream v1_1 = new java.io.FileInputStream(v7_1);
                int v5 = v1_1.read(v4, 0, v4.length);
                v1_1.close();
            } catch (Exception v0) {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads exception while testing cache directory ").append(p12.getAbsolutePath()).append(": ").append(v0.getMessage()).toString());
            }
            if (v7_1.delete()) {
                if (v5 == v4.length) {
                    if (!new String(v4, "UTF-8").equals("test")) {
                        com.unity3d.services.core.log.DeviceLog.debug("Read buffer content mismatch");
                    } else {
                        v8 = 1;
                    }
                } else {
                    com.unity3d.services.core.log.DeviceLog.debug("Read buffer size mismatch");
                }
            } else {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Failed to delete testfile ").append(v7_1.getAbsoluteFile()).toString());
            }
        }
        return v8;
    }

Method android.support.v4.util.AtomicFile.openRead() calling method java.io.FileInputStream.<init>()


    public java.io.FileInputStream openRead()
    {
        if (this.mBackupName.exists()) {
            this.mBaseName.delete();
            this.mBackupName.renameTo(this.mBaseName);
        }
        return new java.io.FileInputStream(this.mBaseName);
    }

Method android.support.v4.graphics.TypefaceCompatUtil.mmap() calling method java.io.FileInputStream.<init>()


    private static java.nio.ByteBuffer mmap(java.io.File p11)
    {
        java.io.FileInputStream v7_1 = new java.io.FileInputStream(p11);
        try {
            java.nio.channels.FileChannel v0 = v7_1.getChannel();
            Throwable v1_0 = v0.map(java.nio.channels.FileChannel$MapMode.READ_ONLY, 0, v0.size());
        } catch (Throwable v1_2) {
            Throwable v2_1 = 0;
            if (v7_1 != null) {
                if (v2_1 == null) {
                    v7_1.close();
                } else {
                    v7_1.close();
                }
            }
            throw v1_2;
        } catch (Throwable v1_1) {
            try {
                throw v1_1;
            } catch (Throwable v2_0) {
                v2_1 = v1_1;
                v1_2 = v2_0;
            }
        }
        if (v7_1 == null) {
            return v1_0;
        } else {
            if (0 == 0) {
                v7_1.close();
                return v1_0;
            } else {
                try {
                    v7_1.close();
                } catch (Throwable v2_2) {
                    0.addSuppressed(v2_2);
                }
                return v1_0;
            }
        }
    }

Method android.support.v4.graphics.TypefaceCompatUtil.mmap() calling method java.io.FileInputStream.<init>()


    public static java.nio.ByteBuffer mmap(android.content.Context p13, android.os.CancellationSignal p14, android.net.Uri p15)
    {
        Throwable v1_1;
        android.os.ParcelFileDescriptor v8 = p13.getContentResolver().openFileDescriptor(p15, "r", p14);
        if (v8 != null) {
            try {
                java.io.FileInputStream v7_0 = new java.io.FileInputStream(v8.getFileDescriptor());
                try {
                    java.nio.channels.FileChannel v0 = v7_0.getChannel();
                    v1_1 = v0.map(java.nio.channels.FileChannel$MapMode.READ_ONLY, 0, v0.size());
                } catch (Throwable v1_4) {
                    Throwable v2_2 = 0;
                    if (v7_0 != null) {
                        if (v2_2 == null) {
                            v7_0.close();
                        } else {
                            v7_0.close();
                        }
                    }
                    throw v1_4;
                } catch (Throwable v1_3) {
                    try {
                        throw v1_3;
                    } catch (Throwable v2_1) {
                        v2_2 = v1_3;
                        v1_4 = v2_1;
                    }
                }
                if (v7_0 != null) {
                    if (0 == 0) {
                        v7_0.close();
                    } else {
                        try {
                            v7_0.close();
                        } catch (Throwable v2_3) {
                            0.addSuppressed(v2_3);
                        }
                    }
                }
                if (v8 == null) {
                    return v1_1;
                } else {
                    if (0 == 0) {
                        v8.close();
                        return v1_1;
                    } else {
                        try {
                            v8.close();
                        } catch (Throwable v2_6) {
                            0.addSuppressed(v2_6);
                        }
                        return v1_1;
                    }
                }
            } catch (Throwable v1_6) {
                Throwable v2_5 = 0;
                if (v8 != null) {
                    if (v2_5 == null) {
                        v8.close();
                    } else {
                        try {
                            v8.close();
                        } catch (Throwable v3_1) {
                            v2_5.addSuppressed(v3_1);
                        }
                    }
                }
                throw v1_6;
            } catch (Throwable v1_5) {
                try {
                    throw v1_5;
                } catch (Throwable v2_4) {
                    v2_5 = v1_5;
                    v1_6 = v2_4;
                }
            }
        } else {
            v1_1 = 0;
            if (v8 == null) {
                return v1_1;
            } else {
                if (0 == 0) {
                    v8.close();
                    return v1_1;
                } else {
                    try {
                        v8.close();
                    } catch (Throwable v2_7) {
                        0.addSuppressed(v2_7);
                    }
                    return v1_1;
                }
            }
        }
    }

Method com.unity3d.services.core.misc.Utilities.readFile() calling method java.io.FileReader.<init>()


    public static String readFile(java.io.File p9)
    {
        String v3;
        if (p9 != null) {
            v3 = "";
            java.io.BufferedReader v0 = 0;
            java.io.FileReader v4 = 0;
            if ((!p9.exists()) || (!p9.canRead())) {
                com.unity3d.services.core.log.DeviceLog.error("File did not exist or couldn\'t be read");
                v3 = 0;
            } else {
                try {
                    java.io.FileReader v5_1 = new java.io.FileReader(p9);
                    try {
                        java.io.BufferedReader v1_1 = new java.io.BufferedReader(v5_1);
                        try {
                            while(true) {
                                String v6 = v1_1.readLine();
                                v3 = v3.concat(v6);
                            }
                            v4 = v5_1;
                            v0 = v1_1;
                            if (v0 != null) {
                                try {
                                    v0.close();
                                } catch (Exception v2_1) {
                                    com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t close BufferedReader", v2_1);
                                }
                            }
                            if (v4 != null) {
                                try {
                                    v4.close();
                                } catch (Exception v2_2) {
                                    com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t close FileReader", v2_2);
                                }
                            }
                        } catch (Exception v2_0) {
                            v4 = v5_1;
                            v0 = v1_1;
                            com.unity3d.services.core.log.DeviceLog.exception("Problem reading file", v2_0);
                            v3 = 0;
                        }
                        if (v6 == null) {
                        }
                    } catch (Exception v2_0) {
                        v4 = v5_1;
                    }
                } catch (Exception v2_0) {
                }
            }
        } else {
            v3 = 0;
        }
        return v3;
    }

Method android.support.v4.graphics.drawable.IconCompat.loadDrawableInner() calling method java.io.File.<init>()


    private android.graphics.drawable.Drawable loadDrawableInner(android.content.Context p13)
    {
        android.graphics.drawable.BitmapDrawable v7_1;
        switch (this.mType) {
            case 1:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), ((android.graphics.Bitmap) this.mObj1));
                break;
            case 2:
                String v4 = this.getResPackage();
                if (android.text.TextUtils.isEmpty(v4)) {
                    v4 = p13.getPackageName();
                }
                try {
                    v7_1 = android.support.v4.content.res.ResourcesCompat.getDrawable(android.support.v4.graphics.drawable.IconCompat.getResources(p13, v4), this.mInt1, p13.getTheme());
                } catch (java.io.FileNotFoundException v0_2) {
                    android.graphics.Bitmap v9_7 = new Object[2];
                    v9_7[0] = Integer.valueOf(this.mInt1);
                    v9_7[1] = this.mObj1;
                    android.util.Log.e("IconCompat", String.format("Unable to load resource 0x%08x from pkg=%s", v9_7), v0_2);
                    v7_1 = 0;
                }
                break;
            case 3:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.graphics.BitmapFactory.decodeByteArray(((byte[]) ((byte[]) this.mObj1)), this.mInt1, this.mInt2));
                break;
            case 4:
                java.io.FileInputStream v1;
                android.net.Uri v6 = android.net.Uri.parse(((String) this.mObj1));
                String v5 = v6.getScheme();
                if ((!"content".equals(v5)) && (!"file".equals(v5))) {
                    try {
                        v1 = new java.io.FileInputStream(new java.io.File(((String) this.mObj1)));
                    } catch (java.io.FileNotFoundException v0_0) {
                        android.util.Log.w("IconCompat", new StringBuilder().append("Unable to load image from path: ").append(v6).toString(), v0_0);
                    }
                } else {
                    try {
                        v1 = p13.getContentResolver().openInputStream(v6);
                    } catch (java.io.FileNotFoundException v0_1) {
                        android.util.Log.w("IconCompat", new StringBuilder().append("Unable to load image from URI: ").append(v6).toString(), v0_1);
                    }
                }
                if (v1 == null) {
                } else {
                    v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.graphics.BitmapFactory.decodeStream(v1));
                }
                break;
            case 5:
                v7_1 = new android.graphics.drawable.BitmapDrawable(p13.getResources(), android.support.v4.graphics.drawable.IconCompat.createLegacyIconFromAdaptiveIcon(((android.graphics.Bitmap) this.mObj1), 0));
                break;
            default:
        }
        return v7_1;
    }

Method com.unity3d.services.core.device.Storage.writeStorage() calling method java.io.File.<init>()


    public declared_synchronized boolean writeStorage()
    {
        try {
            int v1;
            java.io.File v0_1 = new java.io.File(this._targetFileName);
        } catch (String v2_4) {
            throw v2_4;
        }
        if (this.getData() == null) {
            v1 = 0;
        } else {
            v1 = com.unity3d.services.core.misc.Utilities.writeFile(v0_1, this.getData().toString());
        }
        return v1;
    }

Method com.unity3d.services.core.device.Storage.storageFileExists() calling method java.io.File.<init>()


    public declared_synchronized boolean storageFileExists()
    {
        try {
            return new java.io.File(this._targetFileName).exists();
        } catch (Throwable v1_2) {
            throw v1_2;
        }
    }

Method com.unity3d.services.core.device.Storage.readStorage() calling method java.io.File.<init>()


    public declared_synchronized boolean readStorage()
    {
        int v3_0 = 0;
        try {
            java.io.File v1_1 = new java.io.File(this._targetFileName);
        } catch (int v3_1) {
            throw v3_1;
        }
        if (com.unity3d.services.core.misc.Utilities.readFile(v1_1) != null) {
            try {
                this.setData(new org.json.JSONObject(com.unity3d.services.core.misc.Utilities.readFile(v1_1)));
                v3_0 = 1;
            } catch (Exception v0) {
                com.unity3d.services.core.log.DeviceLog.exception("Error creating storage JSON", v0);
            }
        }
        return v3_0;
    }

Method com.unity3d.services.core.device.Storage.clearStorage() calling method java.io.File.<init>()


    public declared_synchronized boolean clearStorage()
    {
        try {
            this.clearData();
            return new java.io.File(this._targetFileName).delete();
        } catch (Throwable v1_2) {
            throw v1_2;
        }
    }

Method com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadWeb.execute() calling method java.io.File.<init>()


    public com.unity3d.services.core.configuration.InitializeThread$InitializeState execute()
    {
        com.unity3d.services.core.log.DeviceLog.info(new StringBuilder().append("Unity Ads init: loading webapp from ").append(this._configuration.getWebViewUrl()).toString());
        try {
            try {
                com.unity3d.services.core.configuration.InitializeThread$InitializeStateCreate v4_7;
                String v2 = new com.unity3d.services.core.request.WebRequest(this._configuration.getWebViewUrl(), "GET", 0).makeRequest();
                String v3 = this._configuration.getWebViewHash();
            } catch (Exception v0_1) {
                if (this._retries >= this._maxRetries) {
                    v4_7 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateNetworkError(v0_1, this, this._configuration);
                    return v4_7;
                } else {
                    this._retryDelay = (this._retryDelay * 2);
                    this._retries = (this._retries + 1);
                    v4_7 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateRetry(this, this._retryDelay);
                    return v4_7;
                }
            }
            if ((v3 == null) || (com.unity3d.services.core.misc.Utilities.Sha256(v2).equals(v3))) {
                if (v3 != null) {
                    com.unity3d.services.core.misc.Utilities.writeFile(new java.io.File(com.unity3d.services.core.properties.SdkProperties.getLocalWebViewFile()), v2);
                }
                v4_7 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateCreate(this._configuration, v2);
                return v4_7;
            } else {
                v4_7 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateError("load web", new Exception("Invalid webViewHash"), this._configuration);
                return v4_7;
            }
        } catch (Exception v0_0) {
            com.unity3d.services.core.log.DeviceLog.exception("Malformed URL", v0_0);
            v4_7 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateError("make webrequest", v0_0, this._configuration);
            return v4_7;
        }
    }

Method com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadCache.execute() calling method java.io.File.<init>()


    public com.unity3d.services.core.configuration.InitializeThread$InitializeState execute()
    {
        com.unity3d.services.core.log.DeviceLog.debug("Unity Ads init: check if webapp can be loaded from local cache");
        try {
            com.unity3d.services.core.configuration.InitializeThread$InitializeStateError v4_8;
            byte[] v1 = com.unity3d.services.core.misc.Utilities.readFileBytes(new java.io.File(com.unity3d.services.core.properties.SdkProperties.getLocalWebViewFile()));
            String v2 = com.unity3d.services.core.misc.Utilities.Sha256(v1);
        } catch (java.io.UnsupportedEncodingException v0_0) {
            com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads init: webapp not found in local cache: ").append(v0_0.getMessage()).toString());
            v4_8 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadWeb(this._configuration);
            return v4_8;
        }
        if ((v2 == null) || (!v2.equals(this._configuration.getWebViewHash()))) {
            v4_8 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateLoadWeb(this._configuration);
            return v4_8;
        } else {
            try {
                String v3_1 = new String(v1, "UTF-8");
                com.unity3d.services.core.log.DeviceLog.info("Unity Ads init: webapp loaded from local cache");
                v4_8 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateCreate(this._configuration, v3_1);
            } catch (java.io.UnsupportedEncodingException v0_1) {
                v4_8 = new com.unity3d.services.core.configuration.InitializeThread$InitializeStateError("load cache", v0_1, this._configuration);
            }
            return v4_8;
        }
    }

Method android.support.v4.provider.RawDocumentFile.renameTo() calling method java.io.File.<init>()


    public boolean renameTo(String p3)
    {
        int v1_1;
        java.io.File v0_1 = new java.io.File(this.mFile.getParentFile(), p3);
        if (!this.mFile.renameTo(v0_1)) {
            v1_1 = 0;
        } else {
            this.mFile = v0_1;
            v1_1 = 1;
        }
        return v1_1;
    }

Method android.support.v4.provider.RawDocumentFile.createFile() calling method java.io.File.<init>()


    public android.support.v4.provider.DocumentFile createFile(String p7, String p8)
    {
        String v1 = android.webkit.MimeTypeMap.getSingleton().getExtensionFromMimeType(p7);
        if (v1 != null) {
            p8 = new StringBuilder().append(p8).append(".").append(v1).toString();
        }
        java.io.File v2_1 = new java.io.File(this.mFile, p8);
        try {
            v2_1.createNewFile();
            int v3_5 = new android.support.v4.provider.RawDocumentFile(this, v2_1);
        } catch (java.io.IOException v0) {
            android.util.Log.w("DocumentFile", new StringBuilder().append("Failed to createFile: ").append(v0).toString());
            v3_5 = 0;
        }
        return v3_5;
    }

Method android.support.v4.provider.RawDocumentFile.createDirectory() calling method java.io.File.<init>()


    public android.support.v4.provider.DocumentFile createDirectory(String p3)
    {
        int v1_2;
        java.io.File v0_1 = new java.io.File(this.mFile, p3);
        if ((!v0_1.isDirectory()) && (!v0_1.mkdir())) {
            v1_2 = 0;
        } else {
            v1_2 = new android.support.v4.provider.RawDocumentFile(this, v0_1);
        }
        return v1_2;
    }

Method android.support.v4.graphics.TypefaceCompatApi21Impl.getFile() calling method java.io.File.<init>()


    private java.io.File getFile(android.os.ParcelFileDescriptor p6)
    {
        try {
            int v2_6;
            String v1 = android.system.Os.readlink(new StringBuilder().append("/proc/self/fd/").append(p6.getFd()).toString());
        } catch (android.system.ErrnoException v0) {
            v2_6 = 0;
            return v2_6;
        }
        if (!android.system.OsConstants.S_ISREG(android.system.Os.stat(v1).st_mode)) {
            v2_6 = 0;
            return v2_6;
        } else {
            v2_6 = new java.io.File(v1);
            return v2_6;
        }
    }

Method android.support.v4.content.FileProvider$SimplePathStrategy.getFileForUri() calling method java.io.File.<init>()


    public java.io.File getFileForUri(android.net.Uri p10)
    {
        String v2_1 = p10.getEncodedPath();
        int v4 = v2_1.indexOf(47, 1);
        String v5 = android.net.Uri.decode(v2_1.substring(1, v4));
        String vtmp6 = android.net.Uri.decode(v2_1.substring((v4 + 1)));
        java.io.File v3_1 = ((java.io.File) this.mRoots.get(v5));
        if (v3_1 != null) {
            try {
                java.io.File v1_2 = new java.io.File(v3_1, vtmp6).getCanonicalFile();
            } catch (java.io.IOException v0) {
                throw new IllegalArgumentException(new StringBuilder().append("Failed to resolve canonical path for ").append(v1_2).toString());
            }
            if (v1_2.getPath().startsWith(v3_1.getPath())) {
                return v1_2;
            } else {
                throw new SecurityException("Resolved path jumped beyond configured root");
            }
        } else {
            throw new IllegalArgumentException(new StringBuilder().append("Unable to find configured root for ").append(p10).toString());
        }
    }

Method com.unity3d.services.core.webview.WebViewApp$WebAppChromeClient.onConsoleMessage() calling method java.io.File.<init>()


    public void onConsoleMessage(String p7, int p8, String p9)
    {
        String v1 = p9;
        try {
            java.io.File v2 = new java.io.File(p9);
        } catch (Exception v0) {
            com.unity3d.services.core.log.DeviceLog.exception("Could not handle sourceId", v0);
        }
        if (v2 != null) {
            v1 = v2.getName();
        }
        if (android.os.Build$VERSION.SDK_INT < 19) {
            com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("JavaScript (sourceId=").append(v1).append(", line=").append(p8).append("): ").append(p7).toString());
        }
        return;
    }

Method com.unity3d.services.core.log.DeviceLog.<clinit>() calling method java.io.File.<init>()


    static DeviceLog()
    {
        com.unity3d.services.core.log.DeviceLog.LOG_ERROR = 1;
        com.unity3d.services.core.log.DeviceLog.LOG_WARNING = 1;
        com.unity3d.services.core.log.DeviceLog.LOG_INFO = 1;
        com.unity3d.services.core.log.DeviceLog.LOG_DEBUG = 1;
        com.unity3d.services.core.log.DeviceLog.FORCE_DEBUG_LOG = 0;
        com.unity3d.services.core.log.DeviceLog._deviceLogLevel = new java.util.HashMap();
        if (com.unity3d.services.core.log.DeviceLog._deviceLogLevel.size() == 0) {
            com.unity3d.services.core.log.DeviceLog._deviceLogLevel.put(com.unity3d.services.core.log.DeviceLog$UnityAdsLogLevel.INFO, new com.unity3d.services.core.log.DeviceLogLevel("i"));
            com.unity3d.services.core.log.DeviceLog._deviceLogLevel.put(com.unity3d.services.core.log.DeviceLog$UnityAdsLogLevel.DEBUG, new com.unity3d.services.core.log.DeviceLogLevel("d"));
            com.unity3d.services.core.log.DeviceLog._deviceLogLevel.put(com.unity3d.services.core.log.DeviceLog$UnityAdsLogLevel.WARNING, new com.unity3d.services.core.log.DeviceLogLevel("w"));
            com.unity3d.services.core.log.DeviceLog._deviceLogLevel.put(com.unity3d.services.core.log.DeviceLog$UnityAdsLogLevel.ERROR, new com.unity3d.services.core.log.DeviceLogLevel("e"));
        }
        if (new java.io.File("/data/local/tmp/UnityAdsForceDebugMode").exists()) {
            com.unity3d.services.core.log.DeviceLog.FORCE_DEBUG_LOG = 1;
        }
        return;
    }

Method com.unity3d.services.core.device.Device.searchPathForBinary() calling method java.io.File.<init>()


    private static boolean searchPathForBinary(String p11)
    {
        int v5 = 0;
        String[] v4 = System.getenv("PATH").split(":");
        int v8 = v4.length;
        int v7_0 = 0;
        while (v7_0 < v8) {
            java.io.File v2_1 = new java.io.File(v4[v7_0]);
            if ((v2_1.exists()) && (v2_1.isDirectory())) {
                java.io.File[] v3 = v2_1.listFiles();
                if (v3 != null) {
                    int v6_3 = 0;
                    while (v6_3 < v3.length) {
                        if (!v3[v6_3].getName().equals(p11)) {
                            v6_3++;
                        } else {
                            v5 = 1;
                            return v5;
                        }
                    }
                }
            }
            v7_0++;
        }
        return v5;
    }

Method com.unity3d.services.core.device.Device.getApkDigest() calling method java.io.File.<init>()


    public static String getApkDigest()
    {
        java.io.FileInputStream v2 = 0;
        try {
            java.io.FileInputStream v3_1 = new java.io.FileInputStream(new java.io.File(com.unity3d.services.core.properties.ClientProperties.getApplicationContext().getPackageCodePath()));
            try {
                String v0 = com.unity3d.services.core.misc.Utilities.Sha256(v3_1);
            } catch (java.io.IOException v4_0) {
                v2 = v3_1;
                if (v2 != null) {
                    try {
                        v2.close();
                    } catch (java.io.IOException v5) {
                    }
                }
                throw v4_0;
            }
            if (v3_1 != null) {
                try {
                    v3_1.close();
                } catch (java.io.IOException v4) {
                }
            }
            return v0;
        } catch (java.io.IOException v4_0) {
        }
    }

Method com.unity3d.services.core.cache.CacheThreadHandler.handleMessage() calling method java.io.File.<init>()


    public void handleMessage(android.os.Message p19)
    {
        android.os.Bundle v9 = p19.getData();
        String v2 = v9.getString("source");
        v9.remove("source");
        String v3 = v9.getString("target");
        v9.remove("target");
        int v4 = v9.getInt("connectTimeout");
        v9.remove("connectTimeout");
        int v5 = v9.getInt("readTimeout");
        v9.remove("readTimeout");
        int v6 = v9.getInt("progressInterval");
        v9.remove("progressInterval");
        boolean v8 = v9.getBoolean("append", 0);
        v9.remove("append");
        java.util.HashMap v7_0 = 0;
        if (v9.size() > 0) {
            com.unity3d.services.core.log.DeviceLog.debug("There are headers left in data, reading them");
            v7_0 = new java.util.HashMap();
            void v1_13 = v9.keySet().iterator();
            while (v1_13.hasNext()) {
                String v10_1 = ((String) v1_13.next());
                v7_0.put(v10_1, java.util.Arrays.asList(v9.getStringArray(v10_1)));
            }
        }
        java.io.File v11_1 = new java.io.File(v3);
        if (((!v8) || (v11_1.exists())) && ((v8) || (!v11_1.exists()))) {
            switch (p19.what) {
                case 1:
                    this.downloadFile(v2, v3, v4, v5, v6, v7_0, v8);
                    break;
                default:
            }
        } else {
            this._active = 0;
            void v1_20 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
            Object[] v15_1 = new Object[5];
            v15_1[0] = com.unity3d.services.core.cache.CacheError.FILE_STATE_WRONG;
            v15_1[1] = v2;
            v15_1[2] = v3;
            v15_1[3] = Boolean.valueOf(v8);
            v15_1[4] = Boolean.valueOf(v11_1.exists());
            v1_20.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_1);
        }
        return;
    }

Method com.unity3d.services.core.cache.CacheThreadHandler.downloadFile() calling method java.io.File.<init>()


    private void downloadFile(String p22, String p23, int p24, int p25, int p26, java.util.HashMap p27, boolean p28)
    {
        if ((!this._canceled) && ((p22 != null) && (p23 != null))) {
            java.io.File v11_1 = new java.io.File(p23);
            if (!p28) {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads cache: start downloading ").append(p22).append(" to ").append(p23).toString());
            } else {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads cache: resuming download ").append(p22).append(" to ").append(p23).append(" at ").append(v11_1.length()).append(" bytes").toString());
            }
            if (com.unity3d.services.core.device.Device.isActiveNetworkConnected()) {
                this._active = 1;
                long v8 = android.os.SystemClock.elapsedRealtime();
                java.io.FileOutputStream v19 = 0;
                try {
                    java.io.FileOutputStream v20 = new java.io.FileOutputStream;
                    v20(v11_1, p28);
                    try {
                        this._currentRequest = this.getWebRequest(p22, p24, p25, p27);
                        this._currentRequest.setProgressListener(new com.unity3d.services.core.cache.CacheThreadHandler$1(this, v11_1, p26));
                        long v12 = this._currentRequest.makeStreamRequest(v20);
                        this._active = 0;
                        this.postProcessDownload(v8, p22, v11_1, v12, this._currentRequest.getContentLength(), this._currentRequest.isCanceled(), this._currentRequest.getResponseCode(), this._currentRequest.getResponseHeaders());
                        this._currentRequest = 0;
                    } catch (com.unity3d.services.core.webview.WebViewApp v7_44) {
                        v19 = v20;
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_10) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_10);
                                com.unity3d.services.core.webview.WebViewEventCategory v10_17 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v0_20 = new Object[3];
                                int v16_32 = v0_20;
                                v16_32[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v16_32[1] = p22;
                                v16_32[2] = v6_10.getMessage();
                                v10_17.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v16_32);
                            }
                        }
                        throw v7_44;
                    } catch (Exception v6_8) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t create target file", v6_8);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_41 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_17 = new Object[3];
                        v15_17[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                        v15_17[1] = p22;
                        v15_17[2] = v6_8.getMessage();
                        v7_41.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_17);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_9) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_9);
                                com.unity3d.services.core.webview.WebViewApp v7_46 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_19 = new Object[3];
                                v15_19[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_19[1] = p22;
                                v15_19[2] = v6_9.getMessage();
                                v7_46.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_19);
                            }
                        }
                    } catch (Exception v6_6) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Malformed URL", v6_6);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_33 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_13 = new Object[3];
                        v15_13[0] = com.unity3d.services.core.cache.CacheError.MALFORMED_URL;
                        v15_13[1] = p22;
                        v15_13[2] = v6_6.getMessage();
                        v7_33.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_13);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_7) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_7);
                                com.unity3d.services.core.webview.WebViewApp v7_37 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_15 = new Object[3];
                                v15_15[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_15[1] = p22;
                                v15_15[2] = v6_7.getMessage();
                                v7_37.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_15);
                            }
                        }
                    } catch (Exception v6_4) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Couldn\'t request stream", v6_4);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_25 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_9 = new Object[3];
                        v15_9[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                        v15_9[1] = p22;
                        v15_9[2] = v6_4.getMessage();
                        v7_25.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_9);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_5) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_5);
                                com.unity3d.services.core.webview.WebViewApp v7_29 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_11 = new Object[3];
                                v15_11[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_11[1] = p22;
                                v15_11[2] = v6_5.getMessage();
                                v7_29.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_11);
                            }
                        }
                    } catch (Exception v6_2) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Illegal state", v6_2);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_17 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_5 = new Object[3];
                        v15_5[0] = com.unity3d.services.core.cache.CacheError.ILLEGAL_STATE;
                        v15_5[1] = p22;
                        v15_5[2] = v6_2.getMessage();
                        v7_17.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_5);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_3) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_3);
                                com.unity3d.services.core.webview.WebViewApp v7_21 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_7 = new Object[3];
                                v15_7[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_7[1] = p22;
                                v15_7[2] = v6_3.getMessage();
                                v7_21.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_7);
                            }
                        }
                    } catch (Exception v6_0) {
                        v19 = v20;
                        com.unity3d.services.core.log.DeviceLog.exception("Network error", v6_0);
                        this._active = 0;
                        com.unity3d.services.core.webview.WebViewApp v7_9 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                        Object[] v15_1 = new Object[3];
                        v15_1[0] = com.unity3d.services.core.cache.CacheError.NETWORK_ERROR;
                        v15_1[1] = p22;
                        v15_1[2] = v6_0.getMessage();
                        v7_9.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_1);
                        this._currentRequest = 0;
                        if (v19 != null) {
                            try {
                                v19.close();
                            } catch (Exception v6_1) {
                                com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_1);
                                com.unity3d.services.core.webview.WebViewApp v7_13 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                                Object[] v15_3 = new Object[3];
                                v15_3[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                                v15_3[1] = p22;
                                v15_3[2] = v6_1.getMessage();
                                v7_13.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_3);
                            }
                        }
                    }
                    if (v20 != null) {
                        try {
                            v20.close();
                        } catch (Exception v6_11) {
                            com.unity3d.services.core.log.DeviceLog.exception("Error closing stream", v6_11);
                            com.unity3d.services.core.webview.WebViewApp v7_49 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                            Object[] v15_22 = new Object[3];
                            v15_22[0] = com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR;
                            v15_22[1] = p22;
                            v15_22[2] = v6_11.getMessage();
                            v7_49.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_22);
                        }
                    }
                } catch (com.unity3d.services.core.webview.WebViewApp v7_44) {
                } catch (Exception v6_8) {
                } catch (Exception v6_6) {
                } catch (Exception v6_4) {
                } catch (Exception v6_2) {
                } catch (Exception v6_0) {
                }
            } else {
                com.unity3d.services.core.log.DeviceLog.debug("Unity Ads cache: download cancelled, no internet connection available");
                com.unity3d.services.core.webview.WebViewApp v7_52 = com.unity3d.services.core.webview.WebViewApp.getCurrentApp();
                Object[] v15_24 = new Object[2];
                v15_24[0] = com.unity3d.services.core.cache.CacheError.NO_INTERNET;
                v15_24[1] = p22;
                v7_52.sendEvent(com.unity3d.services.core.webview.WebViewEventCategory.CACHE, com.unity3d.services.core.cache.CacheEvent.DOWNLOAD_ERROR, v15_24);
            }
        }
        return;
    }

Method com.unity3d.services.core.cache.CacheDirectory.testCacheDirectory() calling method java.io.File.<init>()


    public boolean testCacheDirectory(java.io.File p12)
    {
        int v8 = 0;
        if ((p12 != null) && (p12.isDirectory())) {
            try {
                byte[] v3 = "test".getBytes("UTF-8");
                byte[] v4 = new byte[v3.length];
                java.io.File v7_1 = new java.io.File(p12, "UnityAdsTest.txt");
                java.io.FileOutputStream v2_1 = new java.io.FileOutputStream(v7_1);
                v2_1.write(v3);
                v2_1.flush();
                v2_1.close();
                java.io.FileInputStream v1_1 = new java.io.FileInputStream(v7_1);
                int v5 = v1_1.read(v4, 0, v4.length);
                v1_1.close();
            } catch (Exception v0) {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Unity Ads exception while testing cache directory ").append(p12.getAbsolutePath()).append(": ").append(v0.getMessage()).toString());
            }
            if (v7_1.delete()) {
                if (v5 == v4.length) {
                    if (!new String(v4, "UTF-8").equals("test")) {
                        com.unity3d.services.core.log.DeviceLog.debug("Read buffer content mismatch");
                    } else {
                        v8 = 1;
                    }
                } else {
                    com.unity3d.services.core.log.DeviceLog.debug("Read buffer size mismatch");
                }
            } else {
                com.unity3d.services.core.log.DeviceLog.debug(new StringBuilder().append("Failed to delete testfile ").append(v7_1.getAbsoluteFile()).toString());
            }
        }
        return v8;
    }

Method com.unity3d.services.core.cache.CacheDirectory.createCacheDirectory() calling method java.io.File.<init>()


    public java.io.File createCacheDirectory(java.io.File p4, String p5)
    {
        int v0_1;
        if (p4 != null) {
            v0_1 = new java.io.File(p4, p5);
            v0_1.mkdirs();
            if (!v0_1.isDirectory()) {
                v0_1 = 0;
            }
        } else {
            v0_1 = 0;
        }
        return v0_1;
    }

Method com.unity3d.services.core.api.Cache.getMetaData() calling method java.io.File.<init>()


    private static android.util.SparseArray getMetaData(String p9, org.json.JSONArray p10)
    {
        java.io.File v0_1 = new java.io.File(p9);
        android.util.SparseArray v5_1 = new android.util.SparseArray();
        if (!v0_1.exists()) {
            throw new java.io.IOException(new StringBuilder().append("File: ").append(v0_1.getAbsolutePath()).append(" doesn\'t exist").toString());
        } else {
            android.media.MediaMetadataRetriever v4_1 = new android.media.MediaMetadataRetriever();
            v4_1.setDataSource(v0_1.getAbsolutePath());
            int v1 = 0;
            while (v1 < p10.length()) {
                int v2 = p10.getInt(v1);
                String v3 = v4_1.extractMetadata(v2);
                if (v3 != null) {
                    v5_1.put(v2, v3);
                }
                v1++;
            }
            return v5_1;
        }
    }

Method com.unity3d.services.core.api.Cache.getFilePath() calling method java.io.File.<init>()


    public static void getFilePath(String p4, com.unity3d.services.core.webview.bridge.WebViewCallback p5)
    {
        if (!new java.io.File(com.unity3d.services.core.api.Cache.fileIdToFilename(p4)).exists()) {
            Object[] v2_1 = new Object[0];
            p5.error(com.unity3d.services.core.cache.CacheError.FILE_NOT_FOUND, v2_1);
        } else {
            com.unity3d.services.core.cache.CacheError v1_1 = new Object[1];
            v1_1[0] = com.unity3d.services.core.api.Cache.fileIdToFilename(p4);
            p5.invoke(v1_1);
        }
        return;
    }

Method com.unity3d.services.core.api.Cache.getFileJson() calling method java.io.File.<init>()


    private static org.json.JSONObject getFileJson(String p6)
    {
        org.json.JSONObject v1_1 = new org.json.JSONObject();
        v1_1.put("id", p6);
        java.io.File v0_1 = new java.io.File(com.unity3d.services.core.api.Cache.fileIdToFilename(p6));
        if (!v0_1.exists()) {
            v1_1.put("found", 0);
        } else {
            v1_1.put("found", 1);
            v1_1.put("size", v0_1.length());
            v1_1.put("mtime", v0_1.lastModified());
        }
        return v1_1;
    }

Method com.unity3d.services.core.api.Cache.getFileContent() calling method java.io.File.<init>()


    public static void getFileContent(String p12, String p13, com.unity3d.services.core.webview.bridge.WebViewCallback p14)
    {
        String v6 = com.unity3d.services.core.api.Cache.fileIdToFilename(p12);
        java.io.File v4_1 = new java.io.File(v6);
        if (v4_1.exists()) {
            try {
                byte[] v1 = com.unity3d.services.core.misc.Utilities.readFileBytes(v4_1);
            } catch (java.io.IOException v3) {
                Object[] v8_1 = new Object[3];
                v8_1[0] = p12;
                v8_1[1] = v6;
                v8_1[2] = new StringBuilder().append(v3.getMessage()).append(", ").append(v3.getClass().getName()).toString();
                p14.error(com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR, v8_1);
            }
            if (p13 != null) {
                String v5;
                if (!p13.equals("UTF-8")) {
                    if (!p13.equals("Base64")) {
                        Object[] v8_2 = new Object[3];
                        v8_2[0] = p12;
                        v8_2[1] = v6;
                        v8_2[2] = p13;
                        p14.error(com.unity3d.services.core.cache.CacheError.UNSUPPORTED_ENCODING, v8_2);
                        return;
                    } else {
                        v5 = android.util.Base64.encodeToString(v1, 2);
                    }
                } else {
                    v5 = java.nio.charset.Charset.forName("UTF-8").decode(java.nio.ByteBuffer.wrap(v1)).toString();
                }
                com.unity3d.services.core.cache.CacheError v7_8 = new Object[1];
                v7_8[0] = v5;
                p14.invoke(v7_8);
            } else {
                Object[] v8_3 = new Object[3];
                v8_3[0] = p12;
                v8_3[1] = v6;
                v8_3[2] = p13;
                p14.error(com.unity3d.services.core.cache.CacheError.UNSUPPORTED_ENCODING, v8_3);
            }
        } else {
            Object[] v8_4 = new Object[2];
            v8_4[0] = p12;
            v8_4[1] = v6;
            p14.error(com.unity3d.services.core.cache.CacheError.FILE_NOT_FOUND, v8_4);
        }
        return;
    }

Method com.unity3d.services.core.api.Cache.deleteFile() calling method java.io.File.<init>()


    public static void deleteFile(String p3, com.unity3d.services.core.webview.bridge.WebViewCallback p4)
    {
        if (!new java.io.File(com.unity3d.services.core.api.Cache.fileIdToFilename(p3)).delete()) {
            Object[] v2_1 = new Object[0];
            p4.error(com.unity3d.services.core.cache.CacheError.FILE_IO_ERROR, v2_1);
        } else {
            com.unity3d.services.core.cache.CacheError v1_0 = new Object[0];
            p4.invoke(v1_0);
        }
        return;
    }

Method android.support.v4.util.AtomicFile.<init>() calling method java.io.File.<init>()


    public AtomicFile(java.io.File p4)
    {
        this.mBaseName = p4;
        this.mBackupName = new java.io.File(new StringBuilder().append(p4.getPath()).append(".bak").toString());
        return;
    }

Method android.support.v4.graphics.TypefaceCompatUtil.getTempFile() calling method java.io.File.<init>()


    public static java.io.File getTempFile(android.content.Context p5)
    {
        String v2 = new StringBuilder().append(".font").append(android.os.Process.myPid()).append("-").append(android.os.Process.myTid()).append("-").toString();
        int v1 = 0;
        while (v1 < 100) {
            int v0_0 = new java.io.File(p5.getCacheDir(), new StringBuilder().append(v2).append(v1).toString());
            try {
                if (v0_0.createNewFile()) {
                    return v0_0;
                }
                v1++;
            } catch (java.io.IOException v3) {
            }
        }
        v0_0 = 0;
        return v0_0;
    }

Method android.support.v4.content.FileProvider.buildPath() calling method java.io.File.<init>()


    private static varargs java.io.File buildPath(java.io.File p5, String[] p6)
    {
        int v4 = p6.length;
        int v3 = 0;
        java.io.File v1 = p5;
        while (v3 < v4) {
            java.io.File v0_1;
            String v2 = p6[v3];
            if (v2 == null) {
                v0_1 = v1;
            } else {
                v0_1 = new java.io.File(v1, v2);
            }
            v3++;
            v1 = v0_1;
        }
        return v1;
    }

Method android.support.v4.content.FileProvider.<clinit>() calling method java.io.File.<init>()


    static FileProvider()
    {
        java.util.HashMap v0_1 = new String[2];
        v0_1[0] = "_display_name";
        v0_1[1] = "_size";
        android.support.v4.content.FileProvider.COLUMNS = v0_1;
        android.support.v4.content.FileProvider.DEVICE_ROOT = new java.io.File("/");
        android.support.v4.content.FileProvider.sCache = new java.util.HashMap();
        return;
    }

Method android.support.v4.content.ContextCompat.getNoBackupFilesDir() calling method java.io.File.<init>()


    public static java.io.File getNoBackupFilesDir(android.content.Context p4)
    {
        java.io.File v1_1;
        if (android.os.Build$VERSION.SDK_INT < 21) {
            v1_1 = android.support.v4.content.ContextCompat.createFilesDir(new java.io.File(p4.getApplicationInfo().dataDir, "no_backup"));
        } else {
            v1_1 = p4.getNoBackupFilesDir();
        }
        return v1_1;
    }

Method android.support.v4.content.ContextCompat.getDataDir() calling method java.io.File.<init>()


    public static java.io.File getDataDir(android.content.Context p3)
    {
        int v1_1;
        if (android.os.Build$VERSION.SDK_INT < 24) {
            String v0 = p3.getApplicationInfo().dataDir;
            if (v0 == null) {
                v1_1 = 0;
            } else {
                v1_1 = new java.io.File(v0);
            }
        } else {
            v1_1 = p3.getDataDir();
        }
        return v1_1;
    }

Method android.support.v4.content.ContextCompat.getCodeCacheDir() calling method java.io.File.<init>()


    public static java.io.File getCodeCacheDir(android.content.Context p4)
    {
        java.io.File v1_1;
        if (android.os.Build$VERSION.SDK_INT < 21) {
            v1_1 = android.support.v4.content.ContextCompat.createFilesDir(new java.io.File(p4.getApplicationInfo().dataDir, "code_cache"));
        } else {
            v1_1 = p4.getCodeCacheDir();
        }
        return v1_1;
    }

Method android.support.v4.content.ContextCompat.buildPath() calling method java.io.File.<init>()


    private static varargs java.io.File buildPath(java.io.File p5, String[] p6)
    {
        int v4 = p6.length;
        int v3 = 0;
        java.io.File v1 = p5;
        while (v3 < v4) {
            java.io.File v0_2;
            String v2 = p6[v3];
            if (v1 != null) {
                if (v2 == null) {
                    v0_2 = v1;
                } else {
                    v0_2 = new java.io.File(v1, v2);
                }
            } else {
                v0_2 = new java.io.File(v2);
            }
            v3++;
            v1 = v0_2;
        }
        return v1;
    }

Method com.unity3d.services.core.device.Device.getProcessInfo() calling method java.io.RandomAccessFile.<init>()


    public static java.util.Map getProcessInfo()
    {
        java.util.HashMap v3_1 = new java.util.HashMap();
        java.io.RandomAccessFile v1 = 0;
        try {
            java.io.RandomAccessFile v2_1 = new java.io.RandomAccessFile("/proc/self/stat", "r");
            try {
                v3_1.put("stat", v2_1.readLine());
                try {
                    v2_1.close();
                } catch (java.io.IOException v0_3) {
                    com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_3);
                }
                return v3_1;
            } catch (String v5_2) {
                v1 = v2_1;
                try {
                    v1.close();
                } catch (java.io.IOException v0_2) {
                    com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_2);
                }
                throw v5_2;
            } catch (java.io.IOException v0_0) {
                v1 = v2_1;
                com.unity3d.services.core.log.DeviceLog.exception("Error while reading processor info: ", v0_0);
                try {
                    v1.close();
                } catch (java.io.IOException v0_1) {
                    com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_1);
                }
                return v3_1;
            }
        } catch (String v5_2) {
        } catch (java.io.IOException v0_0) {
        }
    }

Method com.unity3d.services.core.device.Device.getMemoryInfo() calling method java.io.RandomAccessFile.<init>()


    private static long getMemoryInfo(com.unity3d.services.core.device.Device$MemoryInfoType p9)
    {
        try {
            int v3 = -1;
            switch (com.unity3d.services.core.device.Device$1.$SwitchMap$com$unity3d$services$core$device$Device$MemoryInfoType[p9.ordinal()]) {
                case 1:
                    v3 = 1;
                    java.io.RandomAccessFile v4 = 0;
                    String v2 = 0;
                    try {
                        java.io.RandomAccessFile v5_1 = new java.io.RandomAccessFile("/proc/meminfo", "r");
                        int v1 = 0;
                    } catch (java.io.IOException v0_0) {
                        com.unity3d.services.core.log.DeviceLog.exception(new StringBuilder().append("Error while reading memory info: ").append(p9).toString(), v0_0);
                        try {
                            v4.close();
                        } catch (java.io.IOException v0_2) {
                            com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_2);
                        }
                        long v6_2 = -1;
                        return v6_2;
                    }
                    while (v1 < v3) {
                        v2 = v5_1.readLine();
                        v1++;
                    }
                    v6_2 = com.unity3d.services.core.device.Device.getMemoryValueFromString(v2);
                    try {
                        v5_1.close();
                    } catch (java.io.IOException v0_1) {
                        com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_1);
                    }
                    return v6_2;
                case 2:
                    v3 = 2;
                    break;
                default:
            }
            try {
                v4.close();
            } catch (java.io.IOException v0_3) {
                com.unity3d.services.core.log.DeviceLog.exception("Error closing RandomAccessFile", v0_3);
            }
            throw long v6_8;
        } catch (long v6_8) {
            v4 = v5_1;
        } catch (java.io.IOException v0_0) {
            v4 = v5_1;
        } catch (long v6_8) {
        }
    }

Method android.support.v7.widget.ActivityChooserModel$PersistHistoryAsyncTask.doInBackground() calling method android.content.Context.openFileOutput()


    public varargs Void doInBackground(Object[] p19)
    {
        java.util.List v4_1 = ((java.util.List) p19[0]);
        String v5_1 = ((String) p19[1]);
        try {
            java.io.FileOutputStream v3 = this.this$0.mContext.openFileOutput(v5_1, 0);
            org.xmlpull.v1.XmlSerializer v12 = android.util.Xml.newSerializer();
            try {
                v12.setOutput(v3, 0);
                v12.startDocument("UTF-8", Boolean.valueOf(1));
                v12.startTag(0, "historical-records");
                int v11 = v4_1.size();
                int v6 = 0;
            } catch (IllegalArgumentException v7) {
                android.util.Log.e(android.support.v7.widget.ActivityChooserModel.LOG_TAG, new StringBuilder().append("Error writing historical record file: ").append(this.this$0.mHistoryFileName).toString(), v7);
                this.this$0.mCanReadHistoricalData = 1;
                if (v3 == null) {
                    java.io.IOException v13_3 = 0;
                    return v13_3;
                } else {
                    try {
                        v3.close();
                    } catch (java.io.IOException v13) {
                    }
                }
            } catch (IllegalStateException v9) {
                android.util.Log.e(android.support.v7.widget.ActivityChooserModel.LOG_TAG, new StringBuilder().append("Error writing historical record file: ").append(this.this$0.mHistoryFileName).toString(), v9);
                this.this$0.mCanReadHistoricalData = 1;
                if (v3 == null) {
                } else {
                    try {
                        v3.close();
                    } catch (java.io.IOException v13) {
                    }
                }
            } catch (java.io.IOException v8) {
                android.util.Log.e(android.support.v7.widget.ActivityChooserModel.LOG_TAG, new StringBuilder().append("Error writing historical record file: ").append(this.this$0.mHistoryFileName).toString(), v8);
                this.this$0.mCanReadHistoricalData = 1;
                if (v3 == null) {
                } else {
                    try {
                        v3.close();
                    } catch (java.io.IOException v13) {
                    }
                }
            } catch (java.io.IOException v13_2) {
                this.this$0.mCanReadHistoricalData = 1;
                if (v3 != null) {
                    try {
                        v3.close();
                    } catch (int v14) {
                    }
                }
                throw v13_2;
            }
            while (v6 < v11) {
                android.support.v7.widget.ActivityChooserModel$HistoricalRecord v10_1 = ((android.support.v7.widget.ActivityChooserModel$HistoricalRecord) v4_1.remove(0));
                v12.startTag(0, "historical-record");
                v12.attribute(0, "activity", v10_1.activity.flattenToString());
                v12.attribute(0, "time", String.valueOf(v10_1.time));
                v12.attribute(0, "weight", String.valueOf(v10_1.weight));
                v12.endTag(0, "historical-record");
                v6++;
            }
            v12.endTag(0, "historical-records");
            v12.endDocument();
            this.this$0.mCanReadHistoricalData = 1;
            if (v3 == null) {
            } else {
                try {
                    v3.close();
                } catch (java.io.IOException v13) {
                }
            }
        } catch (java.io.FileNotFoundException v2) {
            android.util.Log.e(android.support.v7.widget.ActivityChooserModel.LOG_TAG, new StringBuilder().append("Error writing historical record file: ").append(v5_1).toString(), v2);
            v13_3 = 0;
            return v13_3;
        }
    }