smartdust-client 1.3.2 → 1.3.4
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -4
- data/lib/stf/client.rb +1 -1
- data/lib/stf/interactor/connect_ios_interactor.rb +0 -1
- data/lib/stf/interactor/stop_debug_session_interactor.rb +47 -21
- data/lib/stf/version.rb +1 -1
- data/smartdust-client.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af1a413ea84e37dedbc6a834955cdad82661d5a4a61185fb405442583c36ae2
|
4
|
+
data.tar.gz: c55e850f6291ea41eb1a7259afc06384fe791b3b8381415683714bcf7efccf58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d04347117e4db242dae76e8c64ca619b05865961441f9a09a3e03ba3727ed1855887ad2e51b220fa62678160211a4ef2232c1a88f2cf21c53ab82c853edf347d
|
7
|
+
data.tar.gz: f7c5351efdf519fb6f4799371f8c5cd707d041b0bba03d9fd73f9761bd31bdfc246312084c478c08d5c4117ca7d5045095b6974468f8c20a1b0782e49378796d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# Smartdust CLI client
|
6
6
|

|
7
|
-
Documentation: https://docs.smartdust.me/docs/cli-client
|
7
|
+
Documentation: https://docs.smartdust.me/docs/CLI%20Lab%20client/cli-client-1-3
|
8
8
|
|
9
9
|
Automation client for connecting to Smartdust Lab devices via adb from a terminal.
|
10
10
|
Designed with the following scenario in mind:
|
@@ -26,7 +26,6 @@ e.g. all unique names of devices in the lab instance.
|
|
26
26
|
- Android dependencies:
|
27
27
|
- adb (Android Debug Bridge)
|
28
28
|
- iOS dependencies:
|
29
|
-
- idevice_id (libimobiledevice)
|
30
29
|
- usbfluxd (https://github.com/corellium/usbfluxd/tree/master) (this needs to be patched to connect to multiple devices from the same Lab instance)
|
31
30
|
|
32
31
|
## Installation
|
@@ -39,13 +38,13 @@ e.g. all unique names of devices in the lab instance.
|
|
39
38
|
- "cd" into the directory where the repository is cloned
|
40
39
|
- Run the following commands: (adding "sudo" might be needed)
|
41
40
|
- ```gem build smartdust-client.gemspec```
|
42
|
-
- ```gem install smartdust-client-1.
|
41
|
+
- ```gem install smartdust-client-1.3.4.gem``` (or different version, see output of the previous command)
|
43
42
|
|
44
43
|
## Usage
|
45
44
|
|
46
45
|
```
|
47
46
|
NAME
|
48
|
-
smartdust-client - Smartdust Lab client (version 1.
|
47
|
+
smartdust-client - Smartdust Lab client (version 1.3.3)
|
49
48
|
|
50
49
|
SYNOPSIS
|
51
50
|
smartdust-client [global options] command [command options] [arguments...]
|
data/lib/stf/client.rb
CHANGED
@@ -55,7 +55,7 @@ module Stf
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def destroy_tunnel(ip, port)
|
58
|
-
response = execute "/api/v1/tunnel
|
58
|
+
response = execute "/api/v1/tunnel/#{ip}/#{port}", Net::HTTP::Delete
|
59
59
|
return response.success
|
60
60
|
end
|
61
61
|
|
@@ -11,35 +11,20 @@ module Stf
|
|
11
11
|
|
12
12
|
def execute(device)
|
13
13
|
|
14
|
-
if DI[:connect_ios].ios_serials_to_urls.
|
14
|
+
if DI[:connect_ios].ios_serials_to_urls.has_key? device.serial
|
15
15
|
DI[:connect_ios].disconnect(DI[:connect_ios].ios_serials_to_urls[device.serial])
|
16
16
|
elsif devices.include? device.serial
|
17
17
|
execute_adb_with 30, "disconnect #{remote_connect_url}"
|
18
18
|
end
|
19
19
|
|
20
20
|
if DeviceList.new(DI[:stf].get_user_devices).asArray.map {|d| d.serial}.include? device.serial
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
break if success
|
26
|
-
rescue
|
27
|
-
end
|
28
|
-
|
29
|
-
logger.error 'Can\'t stop debug session. Retrying'
|
30
|
-
end
|
31
|
-
|
32
|
-
1..10.times do
|
33
|
-
begin
|
34
|
-
success = DI[:stf].remove_device(device.serial)
|
35
|
-
break if success
|
36
|
-
rescue
|
37
|
-
end
|
38
|
-
logger.error 'Can\'t remove device from user devices. Retrying'
|
39
|
-
end
|
21
|
+
|
22
|
+
success = close_tunnel(device)
|
23
|
+
success = stop_debug(device)
|
24
|
+
success = release_control(device)
|
40
25
|
|
41
26
|
if success
|
42
|
-
logger.info "
|
27
|
+
logger.info "Removed #{device.serial}"
|
43
28
|
else
|
44
29
|
logger.error "Error removing #{device.serial}"
|
45
30
|
end
|
@@ -47,6 +32,47 @@ module Stf
|
|
47
32
|
|
48
33
|
success
|
49
34
|
end
|
35
|
+
|
36
|
+
def close_tunnel(device)
|
37
|
+
success = false
|
38
|
+
provider_ip = device.getValue("provider")["ip"]
|
39
|
+
port = device.getValue("remoteConnectUrl")&.split(":")[1].to_i
|
40
|
+
return false if provider_ip.nil? || port.nil?
|
41
|
+
1..10.times do
|
42
|
+
begin
|
43
|
+
success = DI[:stf].destroy_tunnel(provider_ip, port)
|
44
|
+
break if success
|
45
|
+
rescue
|
46
|
+
end
|
47
|
+
logger.error "Can't close tunnel for device #{device.serial}. Retrying"
|
48
|
+
end
|
49
|
+
success
|
50
|
+
end
|
51
|
+
|
52
|
+
def stop_debug(device)
|
53
|
+
success = false
|
54
|
+
1..10.times do
|
55
|
+
begin
|
56
|
+
success = DI[:stf].stop_debug(device.serial)
|
57
|
+
break if success
|
58
|
+
rescue
|
59
|
+
end
|
60
|
+
logger.error 'Can\'t stop debug session. Retrying'
|
61
|
+
end
|
62
|
+
success
|
63
|
+
end
|
64
|
+
|
65
|
+
def release_control(device)
|
66
|
+
1..10.times do
|
67
|
+
begin
|
68
|
+
success = DI[:stf].remove_device(device.serial)
|
69
|
+
break if success
|
70
|
+
rescue
|
71
|
+
end
|
72
|
+
logger.error 'Can\'t remove device from user devices. Retrying'
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
50
76
|
end
|
51
77
|
|
52
78
|
end
|
data/lib/stf/version.rb
CHANGED
data/smartdust-client.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Stf::VERSION
|
9
9
|
spec.authors = ['Smartdust']
|
10
10
|
spec.email = ['jordan@smartdust.me']
|
11
|
-
spec.summary = %q{Connect to devices from Smartdust Lab
|
12
|
-
spec.homepage = 'https://docs.smartdust.me/docs/cli-client'
|
11
|
+
spec.summary = %q{Connect to devices from Smartdust Lab from cli}
|
12
|
+
spec.homepage = 'https://docs.smartdust.me/docs/CLI%20Lab%20client/cli-client-1-3'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
15
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartdust-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Smartdust
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -247,7 +247,7 @@ files:
|
|
247
247
|
- lib/stf/view/cli.rb
|
248
248
|
- smartdust-client.gemspec
|
249
249
|
- smartdust-logo-text-2021.png
|
250
|
-
homepage: https://docs.smartdust.me/docs/cli-client
|
250
|
+
homepage: https://docs.smartdust.me/docs/CLI%20Lab%20client/cli-client-1-3
|
251
251
|
licenses:
|
252
252
|
- MIT
|
253
253
|
metadata: {}
|
@@ -269,5 +269,5 @@ requirements: []
|
|
269
269
|
rubygems_version: 3.3.5
|
270
270
|
signing_key:
|
271
271
|
specification_version: 4
|
272
|
-
summary: Connect to devices from Smartdust Lab
|
272
|
+
summary: Connect to devices from Smartdust Lab from cli
|
273
273
|
test_files: []
|