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 io.flutter.view.ResourceExtractor$ExtractTask.extractAPK() calling method java.io.FileOutputStream.<init>()


    private boolean extractAPK(java.io.File p8)
    {
        java.util.HashSet v0_1 = this.mResources.iterator();
        while (v0_1.hasNext()) {
            java.io.InputStream v1_0 = ((String) v0_1.next());
            try {
                Throwable v2_1 = new StringBuilder();
                v2_1.append("assets/");
                v2_1.append(v1_0);
                v2_1.toString();
                Throwable v2_3 = new java.io.File(p8, v1_0);
            } catch (java.io.FileNotFoundException) {
            } catch (int v8_1) {
                java.io.InputStream v1_4 = new StringBuilder();
                v1_4.append("Exception unpacking resources: ");
                v1_4.append(v8_1.getMessage());
                android.util.Log.w("ResourceExtractor", v1_4.toString());
                io.flutter.view.ResourceExtractor.access$100(this.mDataDirPath, this.mResources);
                return 0;
            }
            if (!v2_3.exists()) {
                if (v2_3.getParentFile() != null) {
                    v2_3.getParentFile().mkdirs();
                }
                java.io.InputStream v1_1 = this.mAssetManager.open(v1_0);
                Throwable v3_5 = 0;
                try {
                    java.io.FileOutputStream v4_1 = new java.io.FileOutputStream(v2_3);
                    try {
                        io.flutter.view.ResourceExtractor.access$200(v1_1, v4_1);
                    } catch (Throwable v2_5) {
                        Throwable v5_1 = 0;
                        if (v5_1 == null) {
                            v4_1.close();
                        } else {
                            v4_1.close();
                        }
                        throw v2_5;
                    } catch (Throwable v2_4) {
                        try {
                            throw v2_4;
                        } catch (Throwable v5_0) {
                            v5_1 = v2_4;
                            v2_5 = v5_0;
                        }
                    }
                    v4_1.close();
                    if (v1_1 != null) {
                        v1_1.close();
                    }
                } catch (Throwable v2_7) {
                    if (v1_1 != null) {
                        if (v3_5 == null) {
                            v1_1.close();
                        } else {
                            v1_1.close();
                        }
                    }
                    throw v2_7;
                } catch (Throwable v2_6) {
                    v3_5 = v2_6;
                    throw v3_5;
                }
            } else {
            }
        }
        return 1;
    }

Method io.flutter.view.ResourceExtractor.deleteFiles() calling method java.io.File.<init>()


    private static void deleteFiles(String p4, java.util.HashSet p5)
    {
        java.io.File v0_1 = new java.io.File(p4);
        String[] v4_1 = p5.iterator();
        while (v4_1.hasNext()) {
            int v1_2 = new java.io.File(v0_1, ((String) v4_1.next()));
            if (v1_2.exists()) {
                v1_2.delete();
            }
        }
        String[] v4_2 = io.flutter.view.ResourceExtractor.getExistingTimestamps(v0_1);
        if (v4_2 != null) {
            int v5_1 = v4_2.length;
            int v1_0 = 0;
            while (v1_0 < v5_1) {
                new java.io.File(v0_1, v4_2[v1_0]).delete();
                v1_0++;
            }
            return;
        } else {
            return;
        }
    }

Method io.flutter.view.ResourceExtractor$ExtractTask.doInBackground() calling method java.io.File.<init>()


    protected varargs Void doInBackground(Void[] p5)
    {
        String v5_2 = new java.io.File(this.mDataDirPath);
        String v0_3 = io.flutter.view.ResourceExtractor.access$000(v5_2, this.mPackageManager, this.mPackageName);
        if (v0_3 != null) {
            io.flutter.view.ResourceExtractor.access$100(this.mDataDirPath, this.mResources);
            if (this.extractAPK(v5_2)) {
                if (v0_3 != null) {
                    try {
                        new java.io.File(v5_2, v0_3).createNewFile();
                    } catch (java.io.IOException) {
                        android.util.Log.w("ResourceExtractor", "Failed to write resource timestamp");
                    }
                }
                return 0;
            } else {
                return 0;
            }
        } else {
            return 0;
        }
    }

Method io.flutter.view.ResourceExtractor$ExtractTask.extractAPK() calling method java.io.File.<init>()


    private boolean extractAPK(java.io.File p8)
    {
        java.util.HashSet v0_1 = this.mResources.iterator();
        while (v0_1.hasNext()) {
            java.io.InputStream v1_0 = ((String) v0_1.next());
            try {
                Throwable v2_1 = new StringBuilder();
                v2_1.append("assets/");
                v2_1.append(v1_0);
                v2_1.toString();
                Throwable v2_3 = new java.io.File(p8, v1_0);
            } catch (java.io.FileNotFoundException) {
            } catch (int v8_1) {
                java.io.InputStream v1_4 = new StringBuilder();
                v1_4.append("Exception unpacking resources: ");
                v1_4.append(v8_1.getMessage());
                android.util.Log.w("ResourceExtractor", v1_4.toString());
                io.flutter.view.ResourceExtractor.access$100(this.mDataDirPath, this.mResources);
                return 0;
            }
            if (!v2_3.exists()) {
                if (v2_3.getParentFile() != null) {
                    v2_3.getParentFile().mkdirs();
                }
                java.io.InputStream v1_1 = this.mAssetManager.open(v1_0);
                Throwable v3_5 = 0;
                try {
                    java.io.FileOutputStream v4_1 = new java.io.FileOutputStream(v2_3);
                    try {
                        io.flutter.view.ResourceExtractor.access$200(v1_1, v4_1);
                    } catch (Throwable v2_5) {
                        Throwable v5_1 = 0;
                        if (v5_1 == null) {
                            v4_1.close();
                        } else {
                            v4_1.close();
                        }
                        throw v2_5;
                    } catch (Throwable v2_4) {
                        try {
                            throw v2_4;
                        } catch (Throwable v5_0) {
                            v5_1 = v2_4;
                            v2_5 = v5_0;
                        }
                    }
                    v4_1.close();
                    if (v1_1 != null) {
                        v1_1.close();
                    }
                } catch (Throwable v2_7) {
                    if (v1_1 != null) {
                        if (v3_5 == null) {
                            v1_1.close();
                        } else {
                            v1_1.close();
                        }
                    }
                    throw v2_7;
                } catch (Throwable v2_6) {
                    v3_5 = v2_6;
                    throw v3_5;
                }
            } else {
            }
        }
        return 1;
    }

Method io.flutter.view.FlutterMain.initResources() calling method java.io.File.<init>()


    private static void initResources(android.content.Context p2)
    {
        new io.flutter.view.ResourceCleaner(p2).start();
        new java.io.File(io.flutter.util.PathUtils.getDataDirectory(p2), io.flutter.view.FlutterMain.sFlutterAssetsDir).mkdirs();
        return;
    }

Method io.flutter.view.FlutterMain.findAppBundlePath() calling method java.io.File.<init>()


    public static String findAppBundlePath(android.content.Context p2)
    {
        int v2_2;
        java.io.File v0_1 = new java.io.File(io.flutter.util.PathUtils.getDataDirectory(p2), io.flutter.view.FlutterMain.sFlutterAssetsDir);
        if (!v0_1.exists()) {
            v2_2 = 0;
        } else {
            v2_2 = v0_1.getPath();
        }
        return v2_2;
    }