class SGMTool {
    private static final String pFile = new File("plugins").getAbsolutePath();
    private static final File sgmBinary = new File(pFile + File.separator + "sonic-go-mitmproxy");
    private static final String sgm = sgmBinary.getAbsolutePath();

    public static String getCommand(int pPort, int webPort) {
        return String.format(
                "%s -cert_path %s -addr :%d -web_addr :%d", sgm, pFile, pPort, webPort);
    }

    public static String getCommand() {
        return String.format(
                "%s -cert_path %s", sgm, pFile);
    }

    public static void startProxy(String udId, String command) {<FILL_FUNCTION_BODY>}

    public static void stopProxy(String udId) {
        String processName = String.format("process-%s-proxy", udId);
        if (GlobalProcessMap.getMap().get(processName) != null) {
            Process ps = GlobalProcessMap.getMap().get(processName);
            ps.children().forEach(ProcessHandle::destroy);
            ps.destroy();
        }
    }
}

        String processName = String.format("process-%s-proxy", udId);
        if (GlobalProcessMap.getMap().get(processName) != null) {
            Process ps = GlobalProcessMap.getMap().get(processName);
            ps.children().forEach(ProcessHandle::destroy);
            ps.destroy();
        }
        String system = System.getProperty("os.name").toLowerCase();
        Process ps = null;
        try {
            if (system.contains("win")) {
                ps = Runtime.getRuntime().exec(new String[]{"cmd", "/c", command});
            } else if (system.contains("linux") || system.contains("mac")) {
                ps = Runtime.getRuntime().exec(new String[]{"sh", "-c", command});
            }
            InputStreamReader inputStreamReader = new InputStreamReader(ps.getInputStream());
            BufferedReader stdInput = new BufferedReader(inputStreamReader);
            Semaphore isFinish = new Semaphore(0);
            new Thread(() -> {
                String s;
                while (true) {
                    try {
                        if ((s = stdInput.readLine()) == null) break;
                    } catch (IOException e) {
                        log.info(e.getMessage());
                        break;
                    }
                    if (s.contains("Proxy start listen")) {
                        try {
                            Thread.sleep(300);
                        } catch (InterruptedException ignored) {
                        }
                        isFinish.release();
                    }
                }
                try {
                    stdInput.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                try {
                    inputStreamReader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                log.info("{} web proxy done.", udId);
            }).start();
            int wait = 0;
            while (!isFinish.tryAcquire()) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException ex) {
                    throw new RuntimeException(ex);
                }
                wait++;
                if (wait >= 120) {
                    log.info("{} web proxy start timeout!", udId);
                    return;
                }
            }
            GlobalProcessMap.getMap().put(processName, ps);
        } catch (Exception e) {
            e.printStackTrace();
        }
    
<no_super_class>