@corellium/corellium-cli 1.2.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" ?>
2
2
  <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
- <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1715965392380" complexity="0" version="0.1">
3
+ <coverage lines-valid="0" lines-covered="0" line-rate="NaN" branches-valid="0" branches-covered="0" branch-rate="NaN" timestamp="1716492375648" complexity="0" version="0.1">
4
4
  <sources>
5
5
  <source>/builds/middleware/corellium-cli</source>
6
6
  </sources>
@@ -86,7 +86,7 @@
86
86
  <div class='footer quiet pad2 space-top1 center small'>
87
87
  Code coverage generated by
88
88
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
89
- at 2024-05-17T17:03:12.387Z
89
+ at 2024-05-23T19:26:15.654Z
90
90
  </div>
91
91
  <script src="prettify.js"></script>
92
92
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corellium/corellium-cli",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "Corellium CLI Tool",
5
5
  "scripts": {
6
6
  "corellium": "node index.js",
@@ -25,6 +25,9 @@ class AgentCLI extends Client {
25
25
 
26
26
  ready = async () => await this._fetch('GET', `${this.agentBasePath()}/app/ready/`, {})
27
27
 
28
+ // only for iOS
29
+ unlock = async () => await this._fetch('POST', `${this.agentBasePath()}/system/unlock/`)
30
+
28
31
  /**
29
32
  * List files on device
30
33
  * @returns {Promise<Array<{object}>>}
@@ -10,7 +10,8 @@ const subcommands = [
10
10
  require('./ready'),
11
11
  require('./file'),
12
12
  require('./apps'),
13
- require('./input')
13
+ require('./input'),
14
+ require('./unlock')
14
15
  ]
15
16
 
16
17
  let _yargs
@@ -0,0 +1,53 @@
1
+ // this is for iOS only
2
+
3
+ const chalk = require('chalk')
4
+ const AgentCLI = require('../../clients/Agent')
5
+ const { handleError } = require('../../error')
6
+ const { getApi } = require('../../utils')
7
+
8
+ async function builder (yargs) {
9
+ yargs
10
+ .option('instance', {
11
+ alias: 'i',
12
+ type: 'string',
13
+ demandOption: true,
14
+ describe: 'virtual device id'
15
+ })
16
+ .option('verbose', {
17
+ alias: 'v',
18
+ type: 'boolean',
19
+ describe: 'Console will receive verbose error output'
20
+ })
21
+ }
22
+
23
+ async function handler (argv) {
24
+ const api = await getApi()
25
+
26
+ try {
27
+ // verify instance type
28
+ const instance = await api.v1GetInstance(argv.instance)
29
+ if (!instance) {
30
+ console.error('Instance not found')
31
+ return
32
+ }
33
+ if (instance.type !== 'ios') {
34
+ console.error('Instance is not an iOS device')
35
+ return
36
+ }
37
+
38
+ const agent = new AgentCLI(argv)
39
+ await agent.unlock()
40
+ console.log(
41
+ chalk.green(`Successfully unlocked ${argv.instance}`)
42
+ )
43
+ } catch (err) {
44
+ handleError(err, 'Unlock failed', argv.verbose)
45
+ }
46
+ }
47
+
48
+ module.exports = {
49
+ builder,
50
+ handler,
51
+ command: 'unlock',
52
+ describe: 'Unlock iOS device'
53
+ }