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


Java RootDeniedException类代码示例

本文整理汇总了Java中com.stericson.RootTools.exceptions.RootDeniedException的典型用法代码示例。如果您正苦于以下问题:Java RootDeniedException类的具体用法?Java RootDeniedException怎么用?Java RootDeniedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: changePattern

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public void changePattern(View view) throws IOException, TimeoutException, RootDeniedException
{
	isCorrect =false;
	forceChange();
	//forceChange();
	if(isCorrect) {
		FileOutputStream fos;
		try {
			fos = openFileOutput("pat", Context.MODE_PRIVATE);
			fos.write(Newpin.getBytes());
			fos.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

		
			
	
	
	
}
 
开发者ID:goutamniwas,项目名称:Tap2unlock,代码行数:25,代码来源:Pattern.java

示例2: switchRootShellContext

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public Shell switchRootShellContext(ShellContext shellContext) throws IOException, TimeoutException, RootDeniedException {
    if(this.shellType == ShellType.ROOT)
    {
        try {
            Shell.closeRootShell();
        } catch(Exception e) {
            RootTools.log("Problem closing shell while trying to switch context...");
        }

        //create new root shell with new context...
        return Shell.startRootShell(this.shellTimeout, shellContext, 3);
    }
    else
    {
        //can only switch context on a root shell...
        RootTools.log("Can only switch context on a root shell!");
        return this;
    }
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:20,代码来源:Shell.java

示例3: startRootShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startRootShell(int timeout, int retry) throws IOException, TimeoutException, RootDeniedException {

        Shell.shellTimeout = timeout;

        if (rootShell == null) {
            RootTools.log("Starting Root Shell!");
            String cmd = "su";
            // keep prompting the user until they accept for x amount of times...
            int retries = 0;
            while (rootShell == null) {
                try {
                    rootShell = new Shell(cmd);
                } catch (IOException e) {
                    if (retries++ >= retry) {
                        RootTools.log("IOException, could not start shell");
                        throw e;
                    }
                }
            }
        } else {
            RootTools.log("Using Existing Root Shell!");
        }

        return rootShell;
    }
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:26,代码来源:Shell.java

示例4: useCWD

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public void useCWD(Context context) throws IOException, TimeoutException, RootDeniedException {
    add(
            new CommandCapture(
                    -1,
                    false,
                    "cd " + context.getApplicationInfo().dataDir)
    );
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:9,代码来源:Shell.java

示例5: startCustomShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startCustomShell(String shellPath, int timeout) throws IOException, TimeoutException, RootDeniedException {

        if (Shell.customShell == null) {
            RootTools.log("Starting Custom Shell!");
            Shell.customShell = new Shell(shellPath, ShellType.CUSTOM, ShellContext.NORMAL, timeout);
        } else
            RootTools.log("Using Existing Custom Shell!");

        return Shell.customShell;
    }
 
开发者ID:acomminos,项目名称:Mountie,代码行数:11,代码来源:Shell.java

示例6: startShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startShell(int timeout) throws IOException, TimeoutException {

        try {
            if (Shell.shell == null) {
                RootTools.log("Starting Shell!");
                Shell.shell = new Shell("/system/bin/sh", ShellType.NORMAL, ShellContext.NORMAL, timeout);
            } else
                RootTools.log("Using Existing Shell!");
            return Shell.shell;
        } catch (RootDeniedException e) {
            //Root Denied should never be thrown.
            throw new IOException();
        }
    }
 
开发者ID:acomminos,项目名称:Mountie,代码行数:15,代码来源:Shell.java

示例7: run

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
@Override
public void run()
{
    log("Step 2: get root...");
    Fixer.startRootShellAsync(new Async.SimpleMainThreadCallback<Void>()
    {
        @Override
        public void mainThreadCallback(Void result, boolean success, Throwable error)
        {
            logCallback(result, success, error, false);
            if (success) advanceStep();
            else
            {
                // error
                Integer errorText = null;
                if (error != null)
                {
                    if (error instanceof RootDeniedException)
                        errorText = R.string.error_root_denied;
                    else if (error instanceof TimeoutException)
                        errorText = R.string.error_timeout;
                    else if (error instanceof IOException)
                        errorText = R.string.error_io;
                }
                error(errorText);
            }
        }
    });
}
 
开发者ID:Takhion,项目名称:android-tetheringfixer,代码行数:30,代码来源:Steps.java

示例8: logCallback

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
private static void logCallback(Object result, boolean success, Throwable error, boolean resultExpected)
{
    reportState("callback_result", result == null ? "NULL" : result.toString());
    reportState("callback_result_expected", Boolean.toString(resultExpected));
    reportState("callback_success", Boolean.toString(success));
    log(String.format("Callback! success: %b\nresult: %s",
                      success, result == null ? null : result.toString()), error);
    if (error != null && !(error instanceof Exception)) throw new Async.CallbackException(result, success, error);
    if ((success && resultExpected && result == null) || (!success && (error == null ||
            !(error instanceof RootDeniedException || error instanceof TimeoutException))))
        reportException(error);
}
 
开发者ID:Takhion,项目名称:android-tetheringfixer,代码行数:13,代码来源:Steps.java

示例9: getRootShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
@Nullable
static Pair<Boolean, Shell> getRootShell() {
    try {
        return new Pair<>(true, RootTools.getShell(true));
    } catch (IOException | RootDeniedException | TimeoutException e) {
        return null;
    }
}
 
开发者ID:Doctoror,项目名称:Pure-File-Manager,代码行数:9,代码来源:ShellFactory.java

示例10: startCustomShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startCustomShell(String shellPath, int timeout) throws IOException, TimeoutException, RootDeniedException {
    Shell.shellTimeout = timeout;

    if (customShell == null) {
        RootTools.log("Starting Custom Shell!");
        customShell = new Shell(shellPath);
    } else
        RootTools.log("Using Existing Custom Shell!");

    return customShell;
}
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:12,代码来源:Shell.java

示例11: startShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startShell(int timeout) throws IOException, TimeoutException {
    Shell.shellTimeout = timeout;

    try {
        if (shell == null) {
            RootTools.log("Starting Shell!");
            shell = new Shell("/system/bin/sh");
        } else
            RootTools.log("Using Existing Shell!");
        return shell;
    } catch (RootDeniedException e) {
        //Root Denied should never be thrown.
        throw new IOException();
    }
}
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:16,代码来源:Shell.java

示例12: useCWD

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public void useCWD(Context context) throws IOException, TimeoutException, RootDeniedException {
    add(
            new CommandCapture(
                    -1,
                    false,
                    "cd " + context.getApplicationInfo().dataDir));
}
 
开发者ID:Fusion,项目名称:BambooGarden,代码行数:8,代码来源:Shell.java

示例13: runRootCommand

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static void runRootCommand(Command command) throws IOException, TimeoutException, RootDeniedException {
    Shell.startRootShell().add(command);
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:4,代码来源:Shell.java

示例14: startRootShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static Shell startRootShell() throws IOException, TimeoutException, RootDeniedException {
    return Shell.startRootShell(0, 3);
}
 
开发者ID:acomminos,项目名称:Mountie,代码行数:4,代码来源:Shell.java

示例15: startRootShell

import com.stericson.RootTools.exceptions.RootDeniedException; //导入依赖的package包/类
public static void startRootShell() throws TimeoutException, RootDeniedException, IOException
{
    Shell.startRootShell(60000, 3);
}
 
开发者ID:Takhion,项目名称:android-tetheringfixer,代码行数:5,代码来源:Fixer.java


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