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 android.app.smdt.LogcatFileManager$LogDumper.run() calling method java.lang.Runtime.exec()


    public void run()
    {
        try {
            this.logcatProc = Runtime.getRuntime().exec(this.cmds);
            this.mReader = new java.io.BufferedReader(new java.io.InputStreamReader(this.logcatProc.getInputStream()), 1024);
        } catch (java.io.IOException v0_2) {
            v0_2.printStackTrace();
            if (this.logcatProc != null) {
                this.logcatProc.destroy();
                this.logcatProc = 0;
            }
            if (this.mReader != null) {
                try {
                    this.mReader.close();
                    this.mReader = 0;
                } catch (java.io.IOException v0_3) {
                    v0_3.printStackTrace();
                }
            }
            if (this.out == null) {
                return;
            } else {
                try {
                    this.out.close();
                } catch (java.io.IOException v0_4) {
                    v0_4.printStackTrace();
                }
                this.out = 0;
                return;
            }
            if (this.logcatProc != null) {
                this.logcatProc.destroy();
                this.logcatProc = 0;
            }
            if (this.mReader != null) {
                try {
                    this.mReader.close();
                    this.mReader = 0;
                } catch (java.io.IOException v0_0) {
                    v0_0.printStackTrace();
                }
            }
            if (this.out == null) {
                return;
            } else {
                try {
                    this.out.close();
                } catch (java.io.IOException v0_1) {
                    v0_1.printStackTrace();
                }
                this.out = 0;
                return;
            }
        } catch (java.io.FileOutputStream v2_24) {
            if (this.logcatProc != null) {
                this.logcatProc.destroy();
                this.logcatProc = 0;
            }
            if (this.mReader != null) {
                try {
                    this.mReader.close();
                    this.mReader = 0;
                } catch (java.io.IOException v0_5) {
                    v0_5.printStackTrace();
                }
            }
            if (this.out != null) {
                try {
                    this.out.close();
                } catch (java.io.IOException v0_6) {
                    v0_6.printStackTrace();
                }
                this.out = 0;
            }
            throw v2_24;
        }
        while (this.mRunning) {
            String v1 = this.mReader.readLine();
            if ((v1 == null) || (!this.mRunning)) {
                break;
            }
            if ((v1.length() != 0) && ((this.out != null) && (v1.contains(this.mPID)))) {
                this.out.write(new StringBuilder().append(android.app.smdt.LogcatFileManager.access$100(this.this$0).format(new java.util.Date())).append("  ").append(v1).append("\n").toString().getBytes());
            }
        }
    }

Method android.app.smdt.SystemLogcat.testDate() calling method java.lang.Runtime.exec()


    private void testDate(String p12)
    {
        java.io.DataOutputStream v5 = 0;
        java.io.DataInputStream v3 = 0;
        try {
            Process v8 = Runtime.getRuntime().exec("su");
            java.io.DataOutputStream v6_0 = new java.io.DataOutputStream(v8.getOutputStream());
            try {
                v6_0.writeBytes(new StringBuilder().append("logcat -v time> ").append(p12).append("logcat.txt \n").toString());
                v6_0.writeBytes("exit\n");
                v6_0.flush();
                int v0 = v8.waitFor();
                java.io.DataInputStream v4_1 = new java.io.DataInputStream(v8.getInputStream());
                try {
                    byte[] v1 = new byte[v4_1.available()];
                    v4_1.read(v1);
                    System.out.println(new StringBuilder().append(new String(v1)).append(v0).toString());
                    try {
                        if (v6_0 != null) {
                            v6_0.close();
                        }
                    } catch (Exception v9) {
                        v5 = v6_0;
                        return;
                    }
                    if (v4_1 != null) {
                        v4_1.close();
                    }
                    v8.destroy();
                    v5 = v6_0;
                    return;
                } catch (Exception v9_9) {
                    v3 = v4_1;
                    v5 = v6_0;
                    try {
                        if (v5 == null) {
                            if (v3 != null) {
                                v3.close();
                            }
                            v8.destroy();
                        } else {
                            v5.close();
                        }
                    } catch (Exception v10) {
                    }
                    throw v9_9;
                } catch (Exception v2) {
                    v3 = v4_1;
                    v5 = v6_0;
                    v2.printStackTrace();
                    try {
                        if (v5 != null) {
                            v5.close();
                        }
                    } catch (Exception v9) {
                        return;
                    }
                    if (v3 != null) {
                        v3.close();
                    }
                    v8.destroy();
                    return;
                }
            } catch (Exception v9_9) {
                v5 = v6_0;
            } catch (Exception v2) {
                v5 = v6_0;
            }
        } catch (Exception v9_9) {
        } catch (Exception v2) {
        }
    }

Method com.cloudsinc.welltekmobile.native_v2_welltek.application.App.onCreate() calling method java.lang.Runtime.exec()


    public void onCreate()
    {
        super.onCreate();
        try {
            java.io.InputStream v6 = this.getAssets().open("kelvin_to_color.json");
            byte[] v2 = new byte[v6.available()];
            v6.read(v2);
            v6.close();
            com.cloudsinc.welltekmobile.native_v2_welltek.application.App.setKelvin_data(new String(v2, "UTF-8"));
            zendesk.core.Zendesk.INSTANCE.init(this, "https://androiddev.zendesk.com", "1a9ef8f708c782d47a063271a22f689336d5cf110b8d21b8", "mobile_sdk_client_cada6fed64609e8123f5");
            zendesk.core.Zendesk.INSTANCE.setIdentity(new zendesk.core.AnonymousIdentity$Builder().withNameIdentifier("Darwin").build());
            zendesk.support.Support.INSTANCE.init(zendesk.core.Zendesk.INSTANCE);
        } catch (Exception v4) {
            com.cloudsinc.welltekmobile.native_v2_welltek.utils.Logs.error("ApplicationClassError", new StringBuilder().append("------").append(v4.getMessage()).toString());
        }
        com.cloudsinc.welltekmobile.native_v2_welltek.application.App.preferences = this.getSharedPreferences("notif_type", 0);
        com.cloudsinc.welltekmobile.native_v2_welltek.application.App.preferences.edit().putInt("Sohan", 123);
        com.cloudsinc.welltekmobile.native_v2_welltek.application.App.preferences.edit().commit();
        android.util.Log.i("iiiiiiiiii_dawn_ser", new StringBuilder().append("").append(com.cloudsinc.welltekmobile.native_v2_welltek.application.App.preferences.getInt("Sohan", -1)).toString());
        Thread.setDefaultUncaughtExceptionHandler(new com.cloudsinc.welltekmobile.native_v2_welltek.application.App$1(this));
        if (!this.isExternalStorageWritable()) {
            // Both branches of the condition point to the same code.
            // if (!this.isExternalStorageReadable()) {
            // }
        } else {
            java.io.File v1_1 = new java.io.File(new StringBuilder().append(android.os.Environment.getExternalStorageDirectory()).append("/MyPersonalAppFolder").toString());
            java.io.File v7_0 = new java.io.File(new StringBuilder().append(v1_1).append("/log").toString());
            java.io.File v8_1 = new java.io.File(v7_0, new StringBuilder().append("logcat").append(System.currentTimeMillis()).append(".txt").toString());
            if (!v1_1.exists()) {
                v1_1.mkdir();
            }
            if (!v7_0.exists()) {
                v7_0.mkdir();
            }
            try {
                Runtime.getRuntime().exec("logcat -c");
                Runtime.getRuntime().exec(new StringBuilder().append("logcat -f ").append(v8_1).toString());
            } catch (java.io.IOException v3) {
                v3.printStackTrace();
            }
        }
        return;
    }

Method com.cloudsinc.welltekmobile.native_v2_welltek.fragments.home.HomeHeathByZoneFragment.SendLogcatMail() calling method java.lang.Runtime.exec()


    public void SendLogcatMail()
    {
        java.io.File v3_1 = new java.io.File(this.getActivity().getExternalCacheDir(), "logcat.txt");
        try {
            if (v3_1.exists()) {
                Runtime.getRuntime().exec(new StringBuilder().append("logcat -f ").append(v3_1.getAbsolutePath()).toString());
            } else {
                v3_1.createNewFile();
            }
        } catch (java.io.IOException v1) {
            com.cloudsinc.welltekmobile.native_v2_welltek.utils.Logs.error(this.TAG, new StringBuilder().append("***********").append(v1.getMessage()).toString());
        }
        android.content.Intent v2_1 = new android.content.Intent("android.intent.action.SEND");
        v2_1.setType("vnd.android.cursor.dir/email");
        String[] v5 = new String[2];
        v5[0] = "jaid.shaikh@nciportal.com";
        v5[1] = "nikhil.vharamble@nciportal.com";
        v2_1.putExtra("android.intent.extra.EMAIL", v5);
        v2_1.putExtra("android.intent.extra.STREAM", v3_1.getAbsolutePath());
        v2_1.putExtra("android.intent.extra.SUBJECT", "Subject");
        this.startActivity(android.content.Intent.createChooser(v2_1, "Send email..."));
        return;
    }

Method hidden.org.codehaus.plexus.interpolation.os.OperatingSystemUtils.getSystemEnvVars() calling method java.lang.Runtime.exec()


    public static java.util.Properties getSystemEnvVars(boolean p10)
    {
        Process v6;
        java.util.Properties v1_1 = new java.util.Properties();
        Runtime v7 = Runtime.getRuntime();
        if (!hidden.org.codehaus.plexus.interpolation.os.Os.isFamily("windows")) {
            v6 = v7.exec("env");
        } else {
            if (!hidden.org.codehaus.plexus.interpolation.os.Os.isFamily("win9x")) {
                v6 = v7.exec("cmd.exe /c set");
            } else {
                v6 = v7.exec("command.com /c set");
            }
        }
        java.io.BufferedReader v0_1 = new java.io.BufferedReader(new java.io.InputStreamReader(v6.getInputStream()));
        String v3 = 0;
        String v4 = 0;
        while(true) {
            String v5 = v0_1.readLine();
            if (v5 == null) {
                break;
            }
            int v2 = v5.indexOf(61);
            if (v2 <= 0) {
                if (v3 != null) {
                    v4 = new StringBuffer().append(v4).append("\n").append(v5).toString();
                    v1_1.setProperty(v3, v4);
                }
            } else {
                v3 = v5.substring(0, v2);
                if (!p10) {
                    v3 = v3.toUpperCase();
                }
                v4 = v5.substring((v2 + 1));
                v1_1.setProperty(v3, v4);
            }
        }
        return v1_1;
    }

Method org.codehaus.plexus.util.cli.CommandLineUtils.getSystemEnvVars() calling method java.lang.Runtime.exec()


    public static java.util.Properties getSystemEnvVars(boolean p10)
    {
        Process v6;
        java.util.Properties v1_1 = new java.util.Properties();
        Runtime v7 = Runtime.getRuntime();
        if (!org.codehaus.plexus.util.Os.isFamily("windows")) {
            v6 = v7.exec("env");
        } else {
            if (!org.codehaus.plexus.util.Os.isFamily("win9x")) {
                v6 = v7.exec("cmd.exe /c set");
            } else {
                v6 = v7.exec("command.com /c set");
            }
        }
        java.io.BufferedReader v0_1 = new java.io.BufferedReader(new java.io.InputStreamReader(v6.getInputStream()));
        String v3 = 0;
        String v4 = 0;
        while(true) {
            String v5 = v0_1.readLine();
            if (v5 == null) {
                break;
            }
            int v2 = v5.indexOf(61);
            if (v2 <= 0) {
                if (v3 != null) {
                    v4 = new StringBuffer().append(v4).append("\n").append(v5).toString();
                    v1_1.setProperty(v3, v4);
                }
            } else {
                v3 = v5.substring(0, v2);
                if (!p10) {
                    v3 = v3.toUpperCase(java.util.Locale.ENGLISH);
                }
                v4 = v5.substring((v2 + 1));
                v1_1.setProperty(v3, v4);
            }
        }
        return v1_1;
    }

Method org.codehaus.plexus.util.cli.Commandline.execute() calling method java.lang.Runtime.exec()


    public Process execute()
    {
        Process v2;
        this.verifyShellState();
        String[] v0 = this.getEnvironmentVariables();
        java.io.File v3 = this.shell.getWorkingDirectory();
        try {
            if (v3 != null) {
                if (v3.exists()) {
                    if (v3.isDirectory()) {
                        v2 = Runtime.getRuntime().exec(this.getShellCommandline(), v0, v3);
                    } else {
                        throw new org.codehaus.plexus.util.cli.CommandLineException(new StringBuffer().append("Path \"").append(v3.getPath()).append("\" does not specify a directory.").toString());
                    }
                } else {
                    throw new org.codehaus.plexus.util.cli.CommandLineException(new StringBuffer().append("Working directory \"").append(v3.getPath()).append("\" does not exist!").toString());
                }
            } else {
                v2 = Runtime.getRuntime().exec(this.getShellCommandline(), v0);
            }
        } catch (java.io.IOException v1) {
            throw new org.codehaus.plexus.util.cli.CommandLineException("Error while executing process.", v1);
        }
        return v2;
    }