Info Call to command execution API

Description

List of all command execution API calls

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method org.acra.collector.DumpSysCollector.collectMemInfo() calling method java.lang.Runtime.exec()


    public static String collectMemInfo()
    {
        StringBuilder v4_1 = new StringBuilder();
        try {
            java.util.ArrayList v1_1 = new java.util.ArrayList();
            v1_1.add("dumpsys");
            v1_1.add("meminfo");
            v1_1.add(Integer.toString(android.os.Process.myPid()));
            String v6_2 = new String[v1_1.size()];
            java.io.BufferedReader v0_1 = new java.io.BufferedReader(new java.io.InputStreamReader(Runtime.getRuntime().exec(((String[]) v1_1.toArray(v6_2))).getInputStream()), 8192);
        } catch (java.io.IOException v2) {
            android.util.Log.e(org.acra.ACRA.LOG_TAG, "DumpSysCollector.meminfo could not retrieve data", v2);
            return v4_1.toString();
        }
        while(true) {
            String v3 = v0_1.readLine();
            if (v3 == null) {
                break;
            }
            v4_1.append(v3);
            v4_1.append("\n");
        }
        return v4_1.toString();
    }

Method org.acra.collector.LogCatCollector.collectLogCat() calling method java.lang.Runtime.exec()


    public static String collectLogCat(String p13)
    {
        int v6 = android.os.Process.myPid();
        String v7 = 0;
        if ((org.acra.ACRA.getConfig().logcatFilterByPid()) && (v6 > 0)) {
            v7 = new StringBuilder().append(Integer.toString(v6)).append("):").toString();
        }
        java.util.ArrayList v1_1 = new java.util.ArrayList();
        v1_1.add("logcat");
        if (p13 != null) {
            v1_1.add("-b");
            v1_1.add(p13);
        }
        int v9;
        java.util.ArrayList v4_1 = new java.util.ArrayList(java.util.Arrays.asList(org.acra.ACRA.getConfig().logcatArguments()));
        int v10 = v4_1.indexOf("-t");
        if ((v10 <= -1) || (v10 >= v4_1.size())) {
            v9 = -1;
        } else {
            v9 = Integer.parseInt(((String) v4_1.get((v10 + 1))));
            if (org.acra.collector.Compatibility.getAPILevel() < 8) {
                v4_1.remove((v10 + 1));
                v4_1.remove(v10);
                v4_1.add("-d");
            }
        }
        if (v9 <= 0) {
            v9 = 100;
        }
        org.acra.util.BoundedLinkedList v5_1 = new org.acra.util.BoundedLinkedList(v9);
        v1_1.addAll(v4_1);
        try {
            String v11_23 = new String[v1_1.size()];
            java.io.BufferedReader v0_1 = new java.io.BufferedReader(new java.io.InputStreamReader(Runtime.getRuntime().exec(((String[]) v1_1.toArray(v11_23))).getInputStream()), 8192);
            android.util.Log.d(org.acra.ACRA.LOG_TAG, "Retrieving logcat output...");
        } catch (java.io.IOException v2) {
            android.util.Log.e(org.acra.ACRA.LOG_TAG, "LogCatCollector.collectLogCat could not retrieve data.", v2);
            return v5_1.toString();
        }
        while(true) {
            String v3 = v0_1.readLine();
            if (v3 == null) {
                break;
            }
            if ((v7 == null) || (v3.contains(v7))) {
                v5_1.add(new StringBuilder().append(v3).append("\n").toString());
            }
        }
        return v5_1.toString();
    }

Method kawa.lib.system.makeProcess() calling method java.lang.Runtime.exec()


    public static Process makeProcess(Object p6, Object p7)
    {
        Object v0_0;
        if (!kawa.lib.vectors.isVector(p6)) {
            if (!kawa.lib.lists.isList(p6)) {
                if (!kawa.lib.strings.isString(p6)) {
                    if (!(p6 instanceof String[])) {
                        gnu.mapping.WrongType v3_1 = new Object[0];
                        v0_0 = kawa.lib.misc.error$V("invalid arguments to make-process", v3_1);
                    } else {
                        v0_0 = p6;
                    }
                } else {
                    v0_0 = kawa.lib.system.command$Mnparse.apply1(p6);
                }
            } else {
                v0_0 = kawa.lib.system.convertListToStringArray(p6);
            }
        } else {
            v0_0 = kawa.lib.system.convertVectorToStringArray(p6);
        }
        try {
            Object v0_1 = ((String[]) v0_0);
            try {
                return Runtime.getRuntime().exec(v0_1, ((String[]) p7));
            } catch (ClassCastException v2_5) {
                throw new gnu.mapping.WrongType(v2_5, "java.lang.Runtime.exec(java.lang.String[],java.lang.String[])", 3, ((String[]) p7));
            }
        } catch (ClassCastException v2_3) {
            throw new gnu.mapping.WrongType(v2_3, "java.lang.Runtime.exec(java.lang.String[],java.lang.String[])", 2, v0_1);
        }
        return Runtime.getRuntime().exec(v0_1, ((String[]) p7));
    }