public class SilentInstaller
extends java.lang.Object
The app can handle new installs, and overlaying updates to existing installs, or performing a crude "uninstall" by recursively removing files and subfolders from the specified install location.
The default ZIP file sought for RobotiumRC installs is: RobotiumRCInstall.ZIP
The default ZIP file sought for RobotiumRC overlays is: RobotiumRCOverlay.ZIP
The default install location for RobotiumRC is:
Windows: C:\RobotiumRC
Linux: /usr/local/robotiumrc
Mac: /Library/robotiumrc
The app can remove and install, install and overlay, or remove and install and overly in a single invocation if all the parameters are properly specified. If no parameters whatsoever are specified then the app will attempt an install to the default location.
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
androidHome |
(package private) static AndroidTools |
androidtool |
(package private) static java.lang.String |
antHome |
(package private) static AntTool |
anttool |
static java.lang.String |
DEFAULT_MAC_SAFS_DIR
"/Library/robotiumrc"
|
static java.lang.String |
DEFAULT_UNX_SAFS_DIR
"/usr/local/robotiumrc"
|
static java.lang.String |
DEFAULT_WIN_SAFS_DIR
"C:\RobotiumRC"
|
(package private) static int |
DEFAULTMESSENGERSDK |
(package private) static int |
DEFAULTRUNNERSDK |
(package private) static boolean |
dobuild |
(package private) static boolean |
doResign |
(package private) static java.lang.String |
installedsafsdir |
(package private) static boolean |
installsafs |
(package private) static boolean |
installsilent |
static java.lang.String |
OPTION_ALTSAFS
"-robotiumrc"
|
static java.lang.String |
OPTION_ANDROID_HOME
"-androidhome"
|
static java.lang.String |
OPTION_ANT_HOME
"-anthome"
|
static java.lang.String |
OPTION_BUILD_RUNNER_MESSENGER
"-dobuild"
|
static java.lang.String |
OPTION_ORIGINAL_APK
"-originalapk"
|
static java.lang.String |
OPTION_OVERLAY
"-overlay"
|
static java.lang.String |
OPTION_REMOVE_SAFS
"-removerobotiumrc"
|
static java.lang.String |
OPTION_RESIGN_JAR
"-resignjar"
|
static java.lang.String |
OPTION_RESIGNED_APK
"-resignedapk"
|
static java.lang.String |
OPTION_SILENT
"-silent"
|
static java.lang.String |
OPTION_TESTRUNNER
"-testrunner"
|
static java.lang.String |
OPTION_VERBOSE
"-v"
|
(package private) static java.lang.String |
originalAPK |
(package private) static java.lang.String |
overlayfile |
(package private) static boolean |
overlaysafs |
(package private) static ProgressIndicator |
progresser
progressbar is a swing panel to show the progress of installation.
|
(package private) static boolean |
removesafs |
(package private) static java.lang.String |
resignedAPK |
(package private) static java.lang.String |
resignJAR |
(package private) static java.lang.String |
ROBOTIUM_RUNNER_FOLDER |
static java.lang.String |
ROBOTIUM_TEST_RUNNER |
(package private) static java.lang.String |
SAFS_RUNNER_FOLDER |
(package private) static java.lang.String |
safs_silent |
static java.lang.String |
SAFS_TEST_RUNNER |
(package private) static java.lang.String |
safsdir |
(package private) static java.lang.String |
SAMPLE_SPINNER_FOLDER |
(package private) static java.lang.String |
TCP_MESSENGER_FOLDER |
(package private) static java.lang.String |
testRunner |
(package private) static boolean |
verbose |
(package private) static java.lang.String |
ZIP_INSTALL_FILE
"RobotiumRCInstall.ZIP"
|
(package private) static java.lang.String |
ZIP_OVERLAY_FILE
"RobotiumRCOverlay.ZIP"
|
Constructor and Description |
---|
SilentInstaller() |
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
addEscapeToFilepath(java.lang.String filepath)
To build a project, Ant requires that the file path separator "\" must be escaped as "\\" in the .properties file.
Before writing a file path to the properties file, call this method to get an escaped string. |
(package private) static boolean |
buildAPK(java.lang.String appDirString,
boolean debug) |
(package private) static void |
buildMessengerRunner()
This method will build RobotiumTestRunner, SAFSTestRunner and SAFSTCPMessenger
It will use Ant Tool to build. |
(package private) static int |
doSAFSInstall()
Perform RobotiumRC install.
|
(package private) static int |
doSAFSOverlay()
Perform RobotiumRC Overlay.
|
(package private) static int |
doSAFSUnInstall() |
static void |
main(java.lang.String[] args)
This SilentInstaller provides no GUI, but will accept some configuration parameters.
|
(package private) static void |
modifyPropertiesFile(java.io.File root)
This method will modify the file local.properties of SamplSpinner, SAFSTestRunner and SAFSTCPMessenger
It requires that android sdk has been installed. It will need androidHome to modify the property file. |
(package private) static void |
modifyPropertiesFile(java.io.File directory,
java.lang.String androidHome,
int targetLevel,
int defaultSdkLevel,
java.lang.String[] automationLibsFolder) |
(package private) static boolean |
modUnixRecursiveFolderAllWritePermissions(java.io.File afolder)
chmod -R a+w on the provided folder.
Only valid on Unix/Mac systems. |
(package private) static void |
parseArgs(java.lang.String[] args) |
(package private) static void |
printArgs(java.lang.String[] args) |
(package private) static void |
resignOriginalAPK()
|
static final java.lang.String ZIP_INSTALL_FILE
static final java.lang.String ZIP_OVERLAY_FILE
public static final java.lang.String DEFAULT_WIN_SAFS_DIR
public static final java.lang.String DEFAULT_UNX_SAFS_DIR
public static final java.lang.String DEFAULT_MAC_SAFS_DIR
public static final java.lang.String ROBOTIUM_TEST_RUNNER
public static final java.lang.String SAFS_TEST_RUNNER
public static final java.lang.String OPTION_REMOVE_SAFS
public static final java.lang.String OPTION_SILENT
public static final java.lang.String OPTION_ALTSAFS
public static final java.lang.String OPTION_ANDROID_HOME
public static final java.lang.String OPTION_ANT_HOME
public static final java.lang.String OPTION_BUILD_RUNNER_MESSENGER
public static final java.lang.String OPTION_RESIGN_JAR
public static final java.lang.String OPTION_ORIGINAL_APK
public static final java.lang.String OPTION_RESIGNED_APK
public static final java.lang.String OPTION_OVERLAY
public static final java.lang.String OPTION_VERBOSE
public static final java.lang.String OPTION_TESTRUNNER
static boolean overlaysafs
static boolean installsafs
static boolean removesafs
static boolean verbose
static boolean dobuild
static java.lang.String installedsafsdir
static java.lang.String safsdir
static java.lang.String overlayfile
static java.lang.String safs_silent
static boolean installsilent
static java.lang.String androidHome
static java.lang.String antHome
static java.lang.String resignJAR
static java.lang.String originalAPK
static java.lang.String resignedAPK
static boolean doResign
static java.lang.String testRunner
static AntTool anttool
static AndroidTools androidtool
static ProgressIndicator progresser
static final java.lang.String TCP_MESSENGER_FOLDER
static final java.lang.String ROBOTIUM_RUNNER_FOLDER
static final java.lang.String SAFS_RUNNER_FOLDER
static final java.lang.String SAMPLE_SPINNER_FOLDER
static int DEFAULTMESSENGERSDK
static int DEFAULTRUNNERSDK
static void printArgs(java.lang.String[] args)
static void parseArgs(java.lang.String[] args)
static int doSAFSInstall() throws java.io.IOException, java.io.FileNotFoundException
Any user-specified directories must exist; or, we must not be denied the ability to create them and write/copy files to them.
java.io.IOException
java.io.FileNotFoundException
static void modifyPropertiesFile(java.io.File root) throws java.io.FileNotFoundException
root,
- File, the root directory where the robotium rc has been installed.java.io.FileNotFoundException
static void modifyPropertiesFile(java.io.File directory, java.lang.String androidHome, int targetLevel, int defaultSdkLevel, java.lang.String[] automationLibsFolder) throws java.io.FileNotFoundException
directory,
- File, the Runner or Messenger's project folder.androidHome,
- String, the android sdk home, to be wrote to local.propertiestargetLevel,
- int, the real target level to be set for 'target=Google Inc.:Google APIs:?'defaultSdkLevel,
- int, for messenger; for Runner.automationLibsFolder,
- String[], an array of the libs folder of the Runner,
the first one will be used, other will be put into properties file as comment
Only used when modifying Messenger's property file.
null when modifying Runner's property file.java.io.FileNotFoundException
#modifyPropertiesFile(File)}
,
#addEscapeToFilepath(String)}
static java.lang.String addEscapeToFilepath(java.lang.String filepath)
filepath,
- String, the file path to be modified#modifyPropertiesFile(File, String, int, int, String)
static void resignOriginalAPK() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- if the re-sign JAR file or the originalAPK file are not valid,
or if the output directory for the resignedAPK is not valid.static void buildMessengerRunner() throws java.io.FileNotFoundException
java.io.FileNotFoundException
#buildAPK(String, boolean)}
static boolean modUnixRecursiveFolderAllWritePermissions(java.io.File afolder)
afolder
- static boolean buildAPK(java.lang.String appDirString, boolean debug)
appDirString,
- String, the directory where the application locatesdebug,
- boolean, to build a debug or release versionbuildMessengerRunner()
static int doSAFSOverlay() throws java.io.IOException, java.io.FileNotFoundException
The overlay ZIP file must exist. An overlay can be applied immediately following a RobotiumRC Install during the same invocation of this installer. Thus, you can run an initial install and then do an updated overlay on top of that as part of one invocation.
java.io.IOException
java.io.FileNotFoundException
static int doSAFSUnInstall()
public static void main(java.lang.String[] args)
args[]
- The following parameters or arguments can be specified:
You *must* provide this parameter with the desired install directory--even if default--if the invocation is trying to combine operations like remove then install, or install then overlay, or remove then install then overlay.
installsafs
is true, this parameter will take effect.
installsafs
/overlaysafs
and dobuild
are true, this parameter will take effect.
installsafs
or overlaysafs
, this parameter will take effect.
installsafs
will these parameters take effect.
installsafs
will these parameters take effect.
installsafs
will these parameters take effect.
Copyright © SAS Institute. All Rights Reserved.