Additional wrapping tasks using CLI

The following additional tasks allow you to re-sign an app, change the wrapper mode, change the wrapper version, and view the available wrapper arguments for a wrapper version:

Signing an app

Use this procedure to:

  • Sign your own wrapped apps.
  • Re-sign Ivanti apps with your enterprise private key. Re-sign the apps each time you get a new release of the app from Ivanti.
  • Re-sign your own apps and Ivanti apps with a new enterprise private key when, for example, the previous enterprise private key had been compromised.

Before signing an app, set the keystore. See Additional wrapping tasks using CLI.

To sign an app in the CLI mode, enter the following command at the prompt:

java -jar path\wrap-tool.jar -sign-only -in path\appName.apk

Where:

  • path\ wrap-tool is the location and name of the wrapping tool jar file.

  • path\appName is the location and name of the APK file.

Using the Generation 1 wrapper

By default, the CLI mode uses the Generation 2 wrapper. To use the Generation 1 wrapper, specify -gen1 when wrapping the app.

Enter the following at the command prompt:

java -jar path\wrap-tool.jar -wrap -gen1 -in path\appName.apk [wrapping arguments]

Where:

  • path\wrap-tool is the location and name of the wrapping tool jar file.

  • path\appName is the location and name of the APK file.

  • wrapping arguments are any optional arguments you want to use for wrapping the file.

Example  

java -jar C:\Users\testuser\Downloads\wrap-tool-1.14.18-9.2.0.0.4.jar -wrap -gen1 -in C:\Users\testuser\Downloads\unTransformedApps_9.2.0.0.14\Box.apk

Wrapping with a different allowed wrapper version

By default, in CLI mode, an app is wrapped using the latest wrapper version that the tool supports. The wrapping tool also supports previous versions of the wrapper. Therefore, you can specify a previous wrapper version to wrap an app.

Enter the following command at the command prompt to view the supported previous wrapper versions:

java -jar path\ wrap-tool.jar -help -transformer-version

Where:

  • path\ wrap-tool is the location and name of the wrapping tool jar file.

Example  

java -jar C:\Users\testuser\Downloads\wrap-tool-1.14.18-9.2.0.0.4.jar -help -transformer-version

### To run wrapping tool in UI mode

Usage: java -jar wrap-tool.jar

### To run wrapping tool in CLI mode please specify proper action

Usage: java -jar wrap-tool.jar (-wrap || -sign-only || -help) -in appName.apk [wrapping arguments]

### Allowed versions of transformer:

1) 9.2

2) 9.1

3) 9.0

To receive list of all allowed wrapping arguments need to specify transformer version:

java -jar wrap-tool.jar -help -transformer-version 9.2

Enter the following command to wrap an app with a previous wrapper version:

java -jar path\wrap-tool.jar -wrap -transformer-version allowed-version -in path\appName.apk

Where:

  • path\wrap-tool is the location and name of the wrapping tool jar file.

  • path\appName is the location and name of the APK file.

  • allowed-version is an allowed wrapper version.

Example  

java -jar C:\Users\testuser\Downloads\wrap-tool-1.14.18-9.2.0.0.4.jar -wrap -transformer-version 9.1 -in C:\Users\testuser\Downloads\unTransformedApps_9.2.0.0.14\Box.apk\

selected the version 9.1

running transformer version 9.1 for the file C:\Users\testuser\Downloads\unTransformedApps_9.2.0.0.14\Box.apk

wrapping: |

Viewing wrapper arguments for a wrapper version

Enter the following command at the command prompt to view the allowed wrapper versions:

java -jar path\ wrap-tool.jar -help -transformer-version transformer-version

Where:

  • path\ wrap-tool is the location and name of the wrapping tool jar file.

Example  

java -jar C:\Users\testuser\Downloads\wrap-tool-1.14.14-9.2.0.0.4.jar -help -transformer-version 9.2

### To run wrapping tool in UI mode

Usage: java -jar wrap-tool.jar

### To run wrapping tool in CLI mode please specify proper action

Usage: java -jar wrap-tool.jar (-wrap || -sign-only || -help) -in appName.apk [wrapping arguments]

### Allowed versions of transformer:

1) 9.2

2) 9.1

3) 9.0

transformer help exit value: 1

Usage: java -Xmx4096M -jar Transformer.jar input.apk [arguments]

Version: 9.2.0.0.4-0

Arguments:

Name: -allowExternalMailToAccess

Type: Boolean

Description: Secure apps normally cannot respond to the requests of

non-secure apps. This flag lets the wrapped app respond to

'send email' requests from unwrapped apps.

Name: -allowNativeCode

Type: Boolean

Description: Lets an app be wrapped even if it contains native code.

...

Using the -help command

The -help command displays a list of available commands and descriptions.

Enter the following command at the command prompt to view a complete list of available commands and descriptions:

java -jar path\ wrap-tool.jar -help

Where:

  • path\ wrap-tool is the location and name of the wrapping tool jar file.

Example  

java -jar C:\Users\testuser\Downloads\wrap-tool-1.14.14-9.2.0.0.4.jar -help

### To run wrapping tool in UI mode

Usage: java -jar wrap-tool.jar

### To run wrapping tool in CLI mode please specify proper action

Usage: java -jar wrap-tool.jar (-wrap || -sign-only || -help) -in appName.apk [wrapping arguments]

Arguments:

Name: -help

Is required for wrapping: false

Description: Display help and exit

Name: -transformer-version

Is required for wrapping: false

Description: Can be used with or without specified transformer version. In wrapping mode will choose specific version for wrapping application.

Example: java -jar wrap-tool.jar -wrap -transformer-version 9.2

In help mode will display all available version of transformer. With specified exact version of wrapper all the arguments for exact transformer will be displayed

Example: java -jar wrap-tool.jar -help -transformer-version 9.2

...