Project

Project

Instances of this class are returned from Corellium#projects, Corellium#getProject, and Corellium#projectNamed. They should not be created using the constructor.

Members

name

Description:
  • The project's name.

Source:

The project's name.

Example
project.name();

quotas

Description:
  • The project quotas.

Source:

The project quotas.

Example
// Create map of supported devices.
let supported = {};
(await corellium.supported()).forEach(modelInfo => {
    supported[modelInfo.name] = modelInfo;
});

// Get how many CPUs we're currently using.
let cpusUsed = 0;
instances.forEach(instance => {
    cpusUsed += supported[instance.flavor].quotas.cpus;
});

console.log('Used: ' + cpusUsed + '/' + project.quotas.cpus);

quotasUsed

Description:
  • How much of the project's quotas are currently used. To ensure this information is up to date, call Project#refresh() first.

Source:
Properties:
Name Type Description
cores number

Number of used CPU cores

How much of the project's quotas are currently used. To ensure this information is up to date, call Project#refresh() first.

Example
project.quotasUsed();

Methods

(async) addKey(key, kind, labelopt) → {Promise.<ProjectKey>}

Description:
  • Add a public key to project.

Source:
Example
project.addKey('ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA+eDLGqe+nefGQ2LjvXDlTXDuF33ZHD9wHk/oEICKYd', 'ssh', 'SSH Key');
Parameters:
Name Type Attributes Default Description
key string

public key, as formatted in a .pub file

kind 'ssh' | 'adb' ssh
label string <optional>
null

defaults to the public key comment, if present

Returns:
Type
Promise.<ProjectKey>

(async) createInstance(options, vmmioopt) → {Promise.<Instance>}

Description:
  • Creates an instance and returns the Instance object. The options are passed directly to the API.

Source:
Example

Creating an instance and waiting for it to start its first boot

const instance = await project.createInstance({
    flavor: 'iphone6',
    os: '11.3',
    name: 'Test Device',
    osbuild: '15E216',
    patches: 'corelliumd',
    bootOptions: {
        udid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    },
});
await instance.finishRestore();
Parameters:
Name Type Attributes Description
options Object

The options for instance creation. These are the same as the JSON options passed to the instance creation API endpoint. For a full list of possible options, see the API documentation.

Properties
Name Type Attributes Description
flavor string

The device flavor, such as iphone6

os string

The device operating system version

ipsw string

The ID of a previously uploaded image in the project to use as the firmware

osbuild string

The device operating system build

snapshot string <optional>

The ID of snapshot to clone this device off of

name string <optional>

The device name

patches string <optional>

Instance patches, such as jailbroken (default), nonjailbroken or corelliumd which is non-jailbroken with API agent.

bootOptions Object <optional>

Boot options for the instance

Properties
Name Type Attributes Description
kernelSlide string <optional>

Change the Kernel slide value for an iOS device. When not set, the slide will default to zero. When set to an empty value, the slide will be randomized.

udid string <optional>

Predefined Unique Device ID (UDID) for iOS device

screen string <optional>

Change the screen metrics for Ranchu devices XxY[:DPI], e.g. 720x1280:280

additionalTags Array.<string> <optional>

Addition features to utilize for the device, valid options include:
kalloc : Enable kalloc/kfree trace access via GDB (Enterprise only)
gpu : Enable cloud GPU acceleration (Extra costs incurred, cloud only)
no-keyboard : Enable keyboard passthrough from web interface
nodevmode : Disable developer mode on iOS 16+
sep-cons-ext : Patch SEPOS to print debug messages to console
iboot-jailbreak : Patch iBoot to disable signature checks
llb-jailbreak : Patch LLB to disable signature checks
rom-jailbreak : Patch BootROM to disable signature checks

kernel KernelImage <optional>

Custom kernel to pass to the device on creation.

vmmio Array.<vmmio> <optional>

VMMIO options for external MMIO support

Returns:
Type
Promise.<Instance>

(async) createRole(grantee, type)

Description:
  • Give permissions to this project for a Team or a User (adds a Role).

    This function is only available to domain and project administrators.

Source:
Example
project.createRole(grantee, 'user');
Parameters:
Name Type Default Description
grantee User | Team

must be an instance of User or Team

type string user

user ID

(async) deleteImage(image)

Description:
  • Delete a Image

Source:
Parameters:
Name Type Description
image Image

(async) deleteIotFirmware(firmwareImage)

Description:
  • Delete an IoT firmware

Source:
Parameters:
Name Type Description
firmwareImage FirmwareImage

(async) deleteKernel(kernelImage)

Description:
  • Delete a kernel

Source:
Parameters:
Name Type Description
kernelImage KernelImage

(async) deleteKey(keyId)

Description:
  • Delete public key from the project

Source:
Example
project.deleteKey('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
keyId string

(async) destroy()

Description:
  • Destroy this project.

Source:
Example
project.destroy();

(async) getInstance(id) → {Promise.<Instance>}

Description:
Source:
Example
await project.getInstance('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
id string
Returns:
Type
Promise.<Instance>

(async) getToken() → {string}

Description:
  • Returns refreshed authentication token

Source:
Example
let token = await project.getToken()
Returns:

token

Type
string

(async) instances() → {Promise.<Array.<Instance>>}

Description:
  • Returns an array of the Instances in this project.

Source:
Example

Finding the first instance with a given name

const instances = await project.instances();
const instance = instances.find(instance => instance.name === 'Test Device');
Returns:

The instances in this project

Type
Promise.<Array.<Instance>>

(async) keys() → {Promise.<Array.<ProjectKey>>}

Description:
  • Returns a list of authorized keys associated with the project. When a new instance is created in this project, its authorized_keys (iOS) or adbkeys (Android) will be populated with these keys by default. Adding or removing keys from the project will have no effect on existing instances.

Source:
Example
let keys = project.keys();
for(let key of keys)
  console.log(key);
Returns:
Type
Promise.<Array.<ProjectKey>>

(async) refresh()

Description:
  • Reload the project info. This currently consists of name and quotas, but will likely include more in the future.

Source:
Example
project.refresh();

(async) roles() → {Array.<Role>}

Description:
  • Returns a list of Roles associated with this project, showing who has permissions over this project.

    This function is only available to domain and project administrators.

Source:
Example
await project.roles();
Returns:
Type
Array.<Role>

(async) setQuotas(quotas)

Description:
  • Sets the project quotas. Only the cores property is currently respected.

Source:
Parameters:
Name Type Description
quotas ProjectQuotas

(async) uploadImage(type, filePath, name, progressopt) → {Promise.<Image>}

Description:
  • Add an image to the project. These images may be removed at any time and are meant to facilitate creating a new Instance with images.

Source:
Parameters:
Name Type Attributes Description
type string

E.g. fw for the main firmware image.

filePath string

The path on the local file system to get the file.

name string

The name of the file to identify the file on the server. Usually the basename of the path.

progress Project~progressCallback <optional>

The callback for file upload progress information.

Returns:
Type
Promise.<Image>

(async) uploadIotFirmware(filePath, name, progressopt) → {Promise.<FirmwareImage>}

Description:
  • Add a custom IoT firmware image to a project for use in creating new instances.

Source:
Parameters:
Name Type Attributes Description
filePath string

The path on the local file system to get the firmware file.

name string

The name of the file to identify the file on the server. Usually the basename of the path.

progress Project~progressCallback <optional>

The callback for file upload progress information.

Returns:
Type
Promise.<FirmwareImage>

(async) uploadKernel(filePath, name, progressopt) → {Promise.<KernelImage>}

Description:
  • Add a kernel image to a project for use in creating new instances.

Source:
Parameters:
Name Type Attributes Description
filePath string

The path on the local file system to get the kernel file.

name string

The name of the file to identify the file on the server. Usually the basename of the path.

progress Project~progressCallback <optional>

The callback for file upload progress information.

Returns:
Type
Promise.<KernelImage>

(async) uploadVmfile(filePath, name, progressopt) → {Promise.<string>}

Description:
  • Add a vmfile image to a project for use in creating new instances.

Source:
Parameters:
Name Type Attributes Description
filePath string

The path on the local file system to get the vmfile file

name string

The name of the file to identify the file on the server, usually the basename of the path.

progress Project~progressCallback <optional>

The callback for the file upload progress information.

Returns:
Type
Promise.<string>

(async) vpnConfig(type, clientUUID) → {Promise.<Buffer>}

Description:
  • Get the VPN configuration to connect to the project network. This is only available for cloud. At least one instance must be on in the project.

Source:
Example
await project.vpnConfig('ovpn', undefined)
Parameters:
Name Type Default Description
type string ovpn

Could be either "ovpn" or "tblk" to select between OpenVPN and TunnelBlick configuration formats. TunnelBlick files are delivered as a ZIP file and OpenVPN configuration is just a text file.

clientUUID string

An arbitrary UUID to uniquely associate this VPN configuration with so it can be later identified in a list of connected clients. Optional.

Returns:
Type
Promise.<Buffer>