zeroslackr.installer
Class Main

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

public class Main
extends Object

Main Installer.

Where it all starts. See the printError method for exit values.

TODO list:
- figure out how to get Eclipse to auto-add referenced
libraries class files when exporting to a JAR
- test on Macs and Linux hosts
- specialize actions for the different list types
- use loader2.bin file from downloaded pack
- create an packlist for official iPL downloads
- support 7zip archives via J7Zip library (which is still in development)
- expand Pack object (not sure if needed though)
- add music extraction function via Java ID3 Tag Library
- add GUI (for new users but not necessary)
- add in MP3 playback functionality (only with GUI)

Licensed under GNU GPL (Version 3).

Version:
Jan 18, 2008
Author:
Keripo
See Also:
printError(String error, int errorLevel, Exception e)

Field Summary
private static boolean auto
           
private static boolean backup
           
private static String BACKUP_FOLDER
           
private static String DEFAULT_FW_BACKUP
           
private static String DEFAULT_LOADER2_BIN
           
private static String DOWNLOAD_FOLDER
           
private static String FILES_FOLDER
           
private static String[] FOLDER_STRUCTURE
           
private static String fw_backup
           
private static boolean help
           
private static Scanner in
           
private static String IPL_PACKLIST
           
private static String ipod
           
private static boolean ipodlinux
           
private static String IPODPATCHER_FOLDER
           
private static iPodPatcher ipp
           
private static boolean lazy
           
private static boolean loader2
           
private static String loader2_bin
           
private static String LOADER2_FOLDER
           
private static boolean mirror
           
private static String packlist
           
private static boolean restore
           
private static String[] testArgs
           
private static String TOOLS_FOLDER
           
private static boolean zeroslackr
           
private static String ZS_PACKLIST
           
 
Constructor Summary
Main()
           
 
Method Summary
private static void backup(String path)
          Backup iPod's firmware via ipodpatcher.
private static void checkArgs(String[] args)
          Check passed arguments.
private static void createFolderStructure()
          Create folder structure.
private static void installLoader2(String path)
          Install Loader2 via ipodpatcher.
private static void installPack(Pack p)
          Install pack.
static void main(String[] args)
          Main installer.
private static void printCommands()
          Print commands.
private static void printError(String error, int errorLevel, Exception e)
          Easy method for printing errors.
private static void printSplash()
          Print splash text.
private static void processList(String listFile)
          Process list.
private static void restore(String path)
          Restore iPod's firmware from backup via ipodpatcher.
private static void setupiPodPatcher()
          Setup iPodPatcher.
private static void setupLazyInstall()
          Setup lazy install mode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

help

private static boolean help

backup

private static boolean backup

restore

private static boolean restore

loader2

private static boolean loader2

ipodlinux

private static boolean ipodlinux

zeroslackr

private static boolean zeroslackr

auto

private static boolean auto

lazy

private static boolean lazy

mirror

private static boolean mirror

FILES_FOLDER

private static final String FILES_FOLDER
See Also:
Constant Field Values

BACKUP_FOLDER

private static final String BACKUP_FOLDER
See Also:
Constant Field Values

DOWNLOAD_FOLDER

private static final String DOWNLOAD_FOLDER
See Also:
Constant Field Values

TOOLS_FOLDER

private static final String TOOLS_FOLDER
See Also:
Constant Field Values

IPODPATCHER_FOLDER

private static final String IPODPATCHER_FOLDER
See Also:
Constant Field Values

LOADER2_FOLDER

private static final String LOADER2_FOLDER
See Also:
Constant Field Values

FOLDER_STRUCTURE

private static final String[] FOLDER_STRUCTURE

ipod

private static String ipod

packlist

private static String packlist

ipp

private static iPodPatcher ipp

fw_backup

private static String fw_backup

loader2_bin

private static String loader2_bin

in

private static Scanner in

IPL_PACKLIST

private static final String IPL_PACKLIST
See Also:
Constant Field Values

ZS_PACKLIST

private static final String ZS_PACKLIST
See Also:
Constant Field Values

DEFAULT_FW_BACKUP

private static final String DEFAULT_FW_BACKUP
See Also:
Constant Field Values

DEFAULT_LOADER2_BIN

private static final String DEFAULT_LOADER2_BIN
See Also:
Constant Field Values

testArgs

private static String[] testArgs
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)
Main installer. Use "zeroslackr-lazy-installer --help" for commands


printError

private static void printError(String error,
                               int errorLevel,
                               Exception e)
Easy method for printing errors.

Error levels:
-1 = warning (non-fatal),
0 = normal exit,
1 = bad command,
2 = initiation error,
3 = ipodpatcher error,
4 = packlist error


printSplash

private static void printSplash()
Print splash text.


printCommands

private static void printCommands()
Print commands.


createFolderStructure

private static void createFolderStructure()
Create folder structure.


checkArgs

private static void checkArgs(String[] args)
Check passed arguments.


setupLazyInstall

private static void setupLazyInstall()
Setup lazy install mode


setupiPodPatcher

private static void setupiPodPatcher()
Setup iPodPatcher.


backup

private static void backup(String path)
Backup iPod's firmware via ipodpatcher.

Parameters:
path - Path to firmware image.

restore

private static void restore(String path)
Restore iPod's firmware from backup via ipodpatcher.

Parameters:
path - Path to firmware image.

installLoader2

private static void installLoader2(String path)
Install Loader2 via ipodpatcher.

Parameters:
path - Path to loader.bin file.

processList

private static void processList(String listFile)
Process list.


installPack

private static void installPack(Pack p)
Install pack.

Parameters:
p - Pack object created by List object.