コード例 #1
0
        private void ResizeMainDataPartition()
        {
            HFSResize HFSResizer = new HFSResize();

            SSH.ExecuteRemoteCommand(HFSResizer.ResizeHFS("/private/var/", iDevice.DataPartition.Size));

            GPTfdisk GPTfdiskEditor = new GPTfdisk();

            GPTfdiskEditor.FileSystemBlockSize = iDevice.NandBlockSize;
            string PartitionUniqueGUID;
            string PartitionFirstSectorTempString;
            int    PartitionFirstSector;
            string CommandOutput = "";
            int    PositionUniqueGUID;
            int    PositionFirstSector;

            CommandOutput                  = SSH.ExecuteRemoteCommandWithOutput(GPTfdiskEditor.getConsoleOutputPartitionUniqueGUID("2"));
            PositionUniqueGUID             = CommandOutput.IndexOf("GUID", CommandOutput.IndexOf("GUID") + 1);
            PartitionUniqueGUID            = CommandOutput.Substring(PositionUniqueGUID + 6, 36);
            CommandOutput                  = SSH.ExecuteRemoteCommandWithOutput(GPTfdiskEditor.getConsoleOutputPartitionInfo("2"));
            PositionFirstSector            = CommandOutput.IndexOf("First");
            PartitionFirstSectorTempString = CommandOutput.Substring(PositionFirstSector + 14, 7);
            PartitionFirstSector           = Convert.ToInt32(PartitionFirstSectorTempString.TrimEnd());
            SSH.ExecuteRemoteCommand(GPTfdiskEditor.AdjustDeviceDataPartition(PartitionFirstSector, iDevice.DataPartition.Size, PartitionUniqueGUID));
        }
コード例 #2
0
        private void btnResizeHFS_Click(object sender, EventArgs e)
        {
            HFSResize HFSResizer = new HFSResize();

            SSH.ExecuteRemoteCommand(HFSResizer.ResizeHFS("/private/var/", Convert.ToInt16(txtDataPartitionNewSize.Text)));
        }