zeroslackr.installer
Class iPodPatcher

java.lang.Object
  extended by zeroslackr.installer.iPodPatcher

public class iPodPatcher
extends Object

iPodPatcher Class.

Use external ipodpatcher binary to install Loader2. Note that since ipodpatcher is written in C++, I may be able to port it over to Java later.

Licensed under GNU GPL (Version 3).

Sources: Rockbox's iPodPatcher wiki page, Rockbox's iPodPatcher SVN source code

Version:
Jan 18, 2008
Author:
Keripo

Field Summary
private  File ipodpatcher
           
 
Constructor Summary
iPodPatcher(String folder)
          Constructor.
 
Method Summary
 void backup(String path)
          Backup iPod's firmware to an image.
 Process exec(String[] args)
          Execute ipodpatcher binary with arguments.
 boolean exists()
          Check if the ipodpatcher binary exists.
private static String getErrOutput(Process p)
          Get ipodpatcher's error stream for parsing.
private static String getPath(String folder)
           
 void install(String path)
          Install Loader 2 from file.
 void restore(String path)
          Restore iPod's firmware from an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ipodpatcher

private File ipodpatcher
Constructor Detail

iPodPatcher

public iPodPatcher(String folder)
Constructor.

Parameters:
folder - Path to folder containing ipodpatcher binaries
Method Detail

getPath

private static String getPath(String folder)
Parameters:
folder - Path to folder containing ipodpatcher binaries.
Returns:
Path to ipodpatcher binary, null otherwise.

exists

public boolean exists()
Check if the ipodpatcher binary exists.

Returns:
True if ipodpatcher binary exists, false otherwise.

exec

public Process exec(String[] args)
             throws IOException
Execute ipodpatcher binary with arguments.

Returns:
Pointer to newly-created process.
Throws:
IOException

getErrOutput

private static String getErrOutput(Process p)
Get ipodpatcher's error stream for parsing. Primative but works. (Unable to use .exitValue() since errorlevel reporting needs to be fixed even in the SVN code; I will probably be submitting a patch to the Rockbox developers later).

Parameters:
p - ipodpatcher process.
Returns:
String containing the ipodpatcher's entire error stream.

backup

public void backup(String path)
            throws IOException,
                   InterruptedException,
                   iPodPatcherFailureException
Backup iPod's firmware to an image.

Parameters:
path - Path to backup location.
Throws:
IOException
InterruptedException
iPodPatcherFailureException

restore

public void restore(String path)
             throws IOException,
                    InterruptedException,
                    iPodPatcherFailureException
Restore iPod's firmware from an image.

Parameters:
path - Path to backup location.
Throws:
IOException
InterruptedException
iPodPatcherFailureException

install

public void install(String path)
             throws IOException,
                    InterruptedException,
                    iPodPatcherFailureException
Install Loader 2 from file.

Parameters:
path - Path to loader.bin location.
Throws:
IOException
InterruptedException
iPodPatcherFailureException