当前位置: 首页>>代码示例>>Java>>正文


Java Shell.add方法代码示例

本文整理汇总了Java中com.stericson.RootTools.execution.Shell.add方法的典型用法代码示例。如果您正苦于以下问题:Java Shell.add方法的具体用法?Java Shell.add怎么用?Java Shell.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.stericson.RootTools.execution.Shell的用法示例。


在下文中一共展示了Shell.add方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initBamboo

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
private void initBamboo() {
    try {
        Shell shell = RootTools.getShell(true);
        shell.useCWD(this);
        JavaCommandCapture cmd = new JavaCommandCapture(
                43,
                false,
                Garden.this,
                "com.voilaweb.mobile.bamboogarden.RootHelper"
                + " init") {
        };
        shell.add(cmd);
    }
    catch(Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:18,代码来源:Garden.java

示例2: createNewBamboo

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
private void createNewBamboo(final BambooInfo bamboo) {
    try {
        Shell shell = RootTools.getShell(true);
        JavaCommandCapture cmd = new JavaCommandCapture(
                43,
                false,
                Garden.this,
                "com.voilaweb.mobile.bamboogarden.RootHelper"
                + " create "
                + bamboo.getName()) {
        };
        shell.add(cmd);
    }
    catch(Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:18,代码来源:Garden.java

示例3: updateBambooColor

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
protected void updateBambooColor(BambooInfo bamboo, int color) {
    try {
        Shell shell = RootTools.getShell(true);
        JavaCommandCapture cmd = new JavaCommandCapture(
                43,
                false,
                Garden.this,
                "com.voilaweb.mobile.bamboogarden.RootHelper"
                        + " color "
                        + bamboo.getName()
                        + " " + color) {

            @Override
            public void commandCompleted(int id, int exitCode) {
                super.commandCompleted(id, exitCode);
                refreshBambooGarden();
            }

        };
        shell.add(cmd);
    }
    catch(Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:26,代码来源:Garden.java

示例4: deleteBamboo

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
private void deleteBamboo(final BambooInfo bamboo) {
    if(bamboo != null) {
        try {
            Shell shell = RootTools.getShell(true);
            JavaCommandCapture cmd = new JavaCommandCapture(
                    43,
                    false,
                    Garden.this,
                    "com.voilaweb.mobile.bamboogarden.RootHelper"
                            + " delete "
                            + bamboo.getName()) {

                @Override
                public void commandCompleted(int id, int exitCode) {
                    super.commandCompleted(id, exitCode);
                    refreshBambooGarden();
                }

            };
            shell.add(cmd);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:27,代码来源:Garden.java

示例5: unmount

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
public void unmount(Shell shell, final UnmountListener listener) throws IOException {
    Command mountCommand = new CommandCapture(0, "umount " + getTarget()) {
        @Override
        public void commandCompleted(int id, int exitcode) {
            super.commandCompleted(id, exitcode);
            if (exitcode == 0) {
                getDevice().removeMount(Mount.this);
                listener.onUnmountSuccess(Mount.this);
            } else {
                listener.onUnmountError(Mount.this, null);
            }
        }
    };
    shell.add(mountCommand);
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:16,代码来源:Mount.java

示例6: runCommand

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
private static CommandResult runCommand(String command) throws IOException, CommandException
{
    final WaitCommand cmd = new WaitCommand(command);
    final Shell shell = Shell.getOpenShell();
    if (shell == null) throw new NullPointerException("Must start a shell before adding a command.");
    shell.add(cmd);
    final CommandResult result = cmd.waitForFinish();

    CommandNotFoundException.throwIfNotFound(result);
    if (result.terminated) throw new CommandException(result);

    return result;
}
 
开发者ID:Takhion,项目名称:android-tetheringfixer,代码行数:14,代码来源:Fixer.java

示例7: setSettingForce

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
public void setSettingForce(String path, String value) throws Exception {
	Shell shell = RootTools.getShell(true);
	
	CommandCapture command = new CommandCapture(0, "chmod 777 " + path);
	shell.add(command);
	commandWait(command);

	try {
		CommandCapture command2 = new CommandCapture(0, "echo " + value + " > " + path);
		shell.add(command2);
		commandWait(command2);
	} catch (Exception e) {
	}
}
 
开发者ID:shaun2029,项目名称:Multi-Core-Control,代码行数:15,代码来源:SysfsInterface.java

示例8: setFilePermissions

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
protected int setFilePermissions(Shell shell, String permissions, String file) throws Exception{
	if (shell == null) shell = RootTools.getShell(true);

	CommandCapture command = new CommandCapture(0, "chmod " + permissions + " " + file);
	shell.add(command);
	commandWait(command);
	
	return command.getExitCode();
}
 
开发者ID:shaun2029,项目名称:Multi-Core-Control,代码行数:10,代码来源:SysfsInterface.java

示例9: execute

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
public boolean execute(@NonNull final Command command) {
    final Shell shell = getShell();
    if (shell == null) {
        Log.w("ShellHolder", "No shell. Execution aborted.");
        return false;
    }
    try {
        shell.add(command);
        return true;
    } catch (IOException e) {
        e.printStackTrace();
        return false;
    }
}
 
开发者ID:Doctoror,项目名称:Pure-File-Manager,代码行数:15,代码来源:ShellHolder.java

示例10: switchToBook

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
private void switchToBook(final BambooInfo bamboo) {
    if(bamboo != null) {
        // Kill Bamboo so that it doesn't get
        // all mixed up.
        RootTools.killProcess("com.wacom.bamboopaper");

        try {
            Shell shell = RootTools.getShell(true);
            JavaCommandCapture cmd = new JavaCommandCapture(
                    43,
                    false,
                    Garden.this,
                    "com.voilaweb.mobile.bamboogarden.RootHelper"
                            + " switch "
                            + bamboo.getName()) {

                @Override
                public void commandCompleted(int id, int exitCode) {
                    super.commandCompleted(id, exitCode);
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            maybeOpenBamboo();
                        }
                    });
                    refreshBambooGarden();
                }

            };
            shell.add(cmd);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:37,代码来源:Garden.java

示例11: runShellCommand

import com.stericson.RootTools.execution.Shell; //导入方法依赖的package包/类
/**
 * Executes a given command with root access or without depending on the value of the boolean passed.
 * This will also start a root shell or a standard shell without you having to open it specifically.
 * <p/>
 * You will still need to close the shell after you are done using the shell.
 *
 * @param shell   The shell to execute the command on, this can be a root shell or a standard shell.
 * @param command The command to execute in the shell
 * @throws IOException
 */
public static void runShellCommand(Shell shell, Command command) throws IOException {
    shell.add(command);
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:14,代码来源:RootTools.java


注:本文中的com.stericson.RootTools.execution.Shell.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。