本文整理匯總了Java中com.stericson.RootTools.RootTools.remount方法的典型用法代碼示例。如果您正苦於以下問題:Java RootTools.remount方法的具體用法?Java RootTools.remount怎麽用?Java RootTools.remount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.stericson.RootTools.RootTools
的用法示例。
在下文中一共展示了RootTools.remount方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRootdir
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean createRootdir(String parentPath, String name) {
File dir = new File(parentPath + File.separator + name);
if (dir.exists())
return false;
try {
if (!readReadWriteFile())
RootTools.remount(parentPath, "rw");
execute("mkdir " + getCommandLineString(dir.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例2: createRootFile
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean createRootFile(String parentPath, String name) {
File dir = new File(parentPath + File.separator + name);
if (dir.exists())
return false;
try {
if (!readReadWriteFile())
RootTools.remount(parentPath, "rw");
execute("touch " + getCommandLineString(dir.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例3: renameRootTarget
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean renameRootTarget(RootFile before, RootFile after) {
File file = new File(before.getParent() + File.separator + before.getName());
File newf = new File(after.getParent() + File.separator + after.getName());
if (after.getName().length() < 1)
return false;
try {
if (!readReadWriteFile())
RootTools.remount(before.getPath(), "rw");
execute("mv " + getCommandLineString(file.getAbsolutePath()) + " "
+ getCommandLineString(newf.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例4: renameRootTarget
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean renameRootTarget(String path, String oldname, String name) {
File file = new File(path + File.separator + oldname);
File newf = new File(path + File.separator + name);
if (name.length() < 1)
return false;
try {
if (!readReadWriteFile())
RootTools.remount(path, "rw");
execute("mv " + getCommandLineString(file.getAbsolutePath()) + " "
+ getCommandLineString(newf.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例5: deleteFileRoot
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean deleteFileRoot(String path) {
try {
if (!readReadWriteFile())
RootTools.remount(path, "rw");
if (new File(path).isDirectory()) {
execute("rm -f -r " + getCommandLineString(path));
} else {
execute("rm -r " + getCommandLineString(path));
}
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例6: createRootdir
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean createRootdir(File dir, String path) {
if (dir.exists())
return false;
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(path), "rw");
runAndWait("mkdir " + getCommandLineString(dir.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例7: renameRootTarget
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static void renameRootTarget(String path, String oldname, String name) {
File file = new File(path + "/" + oldname);
File newf = new File(path + "/" + name);
if (name.length() < 1)
return;
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(path), "rw");
runAndWait("mv " + getCommandLineString(file.getAbsolutePath()) + " "
+ getCommandLineString(newf.getAbsolutePath()));
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: createRootFile
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean createRootFile(String cdir, String name) {
File dir = new File(cdir + "/" + name);
if (dir.exists())
return false;
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(cdir), "rw");
runAndWait("touch " + getCommandLineString(dir.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例9: doInBackground
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
@Override
protected Boolean doInBackground(final GenericFile... params) {
final String path = params[0].getAbsolutePath();
final Settings settings = Settings.getInstance(mContext);
final boolean remount = settings.useCommandLine() && settings.isSuEnabled() &&
Environment.needsRemount(path);
if (remount) {
RootTools.remount(path, "RW");
}
try {
return params[0].applyPermissions(this.mTarget);
} finally {
if (remount) {
RootTools.remount(path, "RO");
}
}
}
示例10: createRootdir
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean createRootdir(File dir) {
if (dir.exists())
return false;
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(dir.getParent()), "rw");
runAndWait("mkdir " + getCommandLineString(dir.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例11: moveCopyRoot
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean moveCopyRoot(String old, String newDir) {
try {
if (!readReadWriteFile())
RootTools.remount(newDir, "rw");
execute("cp -fr " + getCommandLineString(old) + " "
+ getCommandLineString(newDir));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例12: changeGroupOwner
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean changeGroupOwner(File file, String owner, String group) {
try {
if (!readReadWriteFile())
RootTools.remount(file.getAbsolutePath(), "rw");
execute("chown " + owner + "." + group + " "
+ getCommandLineString(file.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例13: applyPermissions
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean applyPermissions(File file, Permissions permissions) {
try {
if (!readReadWriteFile())
RootTools.remount(file.getAbsolutePath(), "rw");
execute("chmod " + Permissions.toOctalPermission(permissions) + " "
+ getCommandLineString(file.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
示例14: moveCopyRoot
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static void moveCopyRoot(String old, String newDir) {
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(newDir), "rw");
runAndWait("cp -fr " + getCommandLineString(old) + " " + getCommandLineString(newDir));
} catch (Exception e) {
e.printStackTrace();
}
}
示例15: changeGroupOwner
import com.stericson.RootTools.RootTools; //導入方法依賴的package包/類
public static boolean changeGroupOwner(File file, String owner, String group) {
try {
if (!readReadWriteFile())
RootTools.remount(getCommandLineString(file.getAbsolutePath()), "rw");
runAndWait("chown " + owner + "." + group + " "
+ getCommandLineString(file.getAbsolutePath()));
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}