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 com.splunk.mint.Utils.readLogs() calling method java.lang.Runtime.exec()


    protected static final String readLogs()
    {
        int v5 = com.splunk.mint.Properties.LOG_LINES;
        if (v5 < 0) {
            v5 = 100;
        }
        StringBuilder v7_1 = new StringBuilder();
        try {
            java.io.BufferedReader v0_1 = new java.io.BufferedReader(new java.io.InputStreamReader(Runtime.getRuntime().exec(new StringBuilder().append("logcat -d ").append(com.splunk.mint.Properties.LOG_FILTER).toString()).getInputStream()));
            int v6_1 = new java.util.ArrayList();
        } catch (Exception v1) {
            com.splunk.mint.Logger.logError("Error reading logcat output!");
            String v10_6 = v1.getMessage();
            return v10_6;
        }
        while(true) {
            String v4 = v0_1.readLine();
            if (v4 == null) {
                break;
            }
            v6_1.add(v4);
        }
        if (v6_1.size() != 0) {
            int v9 = (v6_1.size() - v5);
            if (v9 < 0) {
                v9 = 0;
            }
            int v3 = v9;
            while (v3 < v6_1.size()) {
                v7_1.append(new StringBuilder().append(((String) v6_1.get(v3))).append("\n").toString());
                v3++;
            }
            v10_6 = v7_1.toString().replaceAll(java.util.regex.Pattern.quote("}{^"), "}{ ^");
            return v10_6;
        } else {
            v10_6 = "You must add the android.permission.READ_LOGS permission to your manifest file!";
            return v10_6;
        }
    }