/** * This will tell you how the specified mount is mounted. rw, ro, etc... * * @param path The mount you want to check * @return <code>String</code> What the mount is mounted as. * @throws Exception if we cannot determine how the mount is mounted. */ public String getMountedAs(String path) throws Exception { ArrayList<Mount> mounts = Remounter.getMounts(); if (mounts != null) { for (Mount mount : mounts) { if (path.contains(mount.getMountPoint().getAbsolutePath())) { Log.d(RootCommands.TAG, (String) mount.getFlags().toArray()[0]); return (String) mount.getFlags().toArray()[0]; } } } throw new Exception(); }
public boolean remount(File file, String mountType) { // Recieved a request, get an instance of Remounter Remounter remounter = new Remounter(shell); // send the request return (remounter.remount(file.getAbsolutePath(), mountType)); }