ash-adb 0.2.0 → 0.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.
- checksums.yaml +4 -4
- data/lib/ash/adb.rb +1 -0
- data/lib/ash/adb/device.rb +9 -9
- data/lib/ash/adb/file_saver.rb +12 -0
- data/lib/ash/adb/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22a7ed9832cafd39a43bffb09b917c6f223707f7
|
4
|
+
data.tar.gz: 58564cbdd2b69fdeb1147cf3b135ad09ca02afda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eec3444d84910d815e7247d0b5e6da1f88471b750f287b59d93f094289247d12eea6763e29c35cded11d0714d600639c85375bcc2bd94fa766a154484dc20f0
|
7
|
+
data.tar.gz: e6823b73f8a2ecc2a10be7dd784456c80e5c3ff045632b0ba703f013a900961f9a97da34ce40f0c14c8a6e7b6b33c2cff13b2c417891169bfc38f4e44846d255
|
data/lib/ash/adb.rb
CHANGED
data/lib/ash/adb/device.rb
CHANGED
@@ -10,24 +10,24 @@ module Ash::Adb
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def generate_bugreport
|
13
|
-
|
13
|
+
Client.run("adb -s #{@serial_number} shell bugreport")
|
14
14
|
end
|
15
15
|
|
16
|
-
def save_bugreport(path = "
|
16
|
+
def save_bugreport(path = FileSaver.construct_save_path("bugreport.txt"))
|
17
17
|
File.open(path, 'w') {|f| f.write(generate_bugreport) }
|
18
18
|
end
|
19
19
|
|
20
20
|
def adb_port_forward(local, remote, remote_protocol="tcp")
|
21
|
-
|
21
|
+
Client.run("adb -s #{@serial_number} forward tcp:#{local} #{remote_protocol}:#{remote}")
|
22
22
|
end
|
23
23
|
|
24
24
|
def adb_over_wifi
|
25
|
-
|
25
|
+
Client.run("adb -s #{@serial_number} tcpip 5555")
|
26
26
|
end
|
27
27
|
|
28
28
|
def permission_groups
|
29
29
|
adb_command = "adb -s #{@serial_number} shell pm list permission-groups"
|
30
|
-
raw_pg_output =
|
30
|
+
raw_pg_output = Client.run(adb_command)
|
31
31
|
raw_pg_output.split("\r\n").map do |permission_group|
|
32
32
|
permission_group.split(":").last
|
33
33
|
end
|
@@ -35,7 +35,7 @@ module Ash::Adb
|
|
35
35
|
|
36
36
|
def features
|
37
37
|
adb_command = "adb -s #{@serial_number} shell pm list features"
|
38
|
-
raw_features_output =
|
38
|
+
raw_features_output = Client.run(adb_command)
|
39
39
|
raw_features_output.split("\r\n").map do |feature|
|
40
40
|
feature.split(":").last
|
41
41
|
end
|
@@ -43,18 +43,18 @@ module Ash::Adb
|
|
43
43
|
|
44
44
|
def libraries
|
45
45
|
adb_command = "adb -s #{@serial_number} shell pm list libraries"
|
46
|
-
raw_library_output =
|
46
|
+
raw_library_output = Client.run(adb_command)
|
47
47
|
raw_library_output.split("\r\n").map do |library|
|
48
48
|
library.split(":").last
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
def parse_device_package_list
|
53
|
-
|
53
|
+
Client.run("adb -s #{@serial_number} shell pm list packages -f").split("\r\n").map do |package_line|
|
54
54
|
package_line = package_line.split(":").last.split("=")
|
55
55
|
package_path = package_line.first
|
56
56
|
package_name = package_line.last
|
57
|
-
|
57
|
+
Package.new(package_path, package_name)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Ash::Adb
|
2
|
+
module FileSaver
|
3
|
+
@save_directory = "/tmp/"
|
4
|
+
|
5
|
+
# Some adb commands require a local path to save to. Here, given a
|
6
|
+
# filename, a path is constructed based on the directory specified by
|
7
|
+
# @save_directory
|
8
|
+
def self.construct_save_path(filename)
|
9
|
+
File.join(@save_directory, filename)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/ash/adb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ash-adb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Rabczak
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/ash/adb.rb
|
87
87
|
- lib/ash/adb/client.rb
|
88
88
|
- lib/ash/adb/device.rb
|
89
|
+
- lib/ash/adb/file_saver.rb
|
89
90
|
- lib/ash/adb/package.rb
|
90
91
|
- lib/ash/adb/version.rb
|
91
92
|
homepage: ''
|