droid_adbs 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/droid_adbs/commons/settings.rb +32 -5
- data/lib/droid_adbs/version.rb +1 -1
- data/lib/droid_adbs.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373c4e52dead49c869d4cc4628f0268a0bf5c25c
|
4
|
+
data.tar.gz: 7cf25c9bc5a99007c1e6311fddeefdc0c51f8b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d616edfb519a5dd5f41867328ab265f6beec44a1b7c1ba499adc07c3f3a9729ed8db675bc585bd70bed5937604acda92ad849eeb2708b08dddcf3d1a7baf00
|
7
|
+
data.tar.gz: d87207b04a1d329ab79e1a2705fffd8029a2e7b9b6c87a8004a94810629f6b7be201e15327d895bc0e4cdaa91caf00394192b760f96b7c88cc428a823969a375
|
@@ -67,7 +67,16 @@ module DroidAdbs
|
|
67
67
|
# animation settings
|
68
68
|
# @return [String] message from adb command
|
69
69
|
def turn_all_animation_off
|
70
|
-
|
70
|
+
turn_all_animation_off_without_reboot
|
71
|
+
intent_boot_completed
|
72
|
+
puts "adopt settings..."
|
73
|
+
false
|
74
|
+
end
|
75
|
+
|
76
|
+
# animation settings
|
77
|
+
# @return [String] message from adb command
|
78
|
+
def turn_all_animation_off_without_reboot
|
79
|
+
unless available_changing_animation?
|
71
80
|
puts "the device is not over API Level 17"
|
72
81
|
return true
|
73
82
|
end
|
@@ -80,23 +89,32 @@ module DroidAdbs
|
|
80
89
|
scale_off "window_animation_scale"
|
81
90
|
scale_off "transition_animation_scale"
|
82
91
|
scale_off "animator_duration_scale"
|
92
|
+
false
|
93
|
+
end
|
94
|
+
|
95
|
+
# @return [String] message from adb command
|
96
|
+
def turn_all_animation_on
|
97
|
+
turn_all_animation_on_without_reboot
|
83
98
|
intent_boot_completed
|
84
99
|
puts "adopt settings..."
|
85
100
|
false
|
86
101
|
end
|
87
102
|
|
88
103
|
# @return [String] message from adb command
|
89
|
-
def
|
90
|
-
|
104
|
+
def turn_all_animation_on_without_reboot
|
105
|
+
unless available_changing_animation?
|
91
106
|
puts "the device is not over API Level 17"
|
92
107
|
return true
|
93
108
|
end
|
94
109
|
|
110
|
+
if all_animation_on?
|
111
|
+
puts "already all animation settings are on"
|
112
|
+
return true
|
113
|
+
end
|
114
|
+
|
95
115
|
scale_on "window_animation_scale"
|
96
116
|
scale_on "transition_animation_scale"
|
97
117
|
scale_on "animator_duration_scale"
|
98
|
-
intent_boot_completed
|
99
|
-
puts "adopt settings..."
|
100
118
|
false
|
101
119
|
end
|
102
120
|
|
@@ -133,11 +151,20 @@ module DroidAdbs
|
|
133
151
|
get_scale_of "transition_animation_scale"
|
134
152
|
end
|
135
153
|
|
154
|
+
def available_changing_animation?
|
155
|
+
::DroidAdbs::Devices.device_build_version_sdk.to_i >= 17
|
156
|
+
end
|
157
|
+
|
136
158
|
def all_animation_off?
|
137
159
|
return true if window_animation_scale == 0 && transition_animation_scale == 0 && animator_duration_scale == 0
|
138
160
|
false
|
139
161
|
end
|
140
162
|
|
163
|
+
def all_animation_on?
|
164
|
+
return true if window_animation_scale == 1 && transition_animation_scale == 1 && animator_duration_scale == 1
|
165
|
+
false
|
166
|
+
end
|
167
|
+
|
141
168
|
end
|
142
169
|
end
|
143
170
|
end
|
data/lib/droid_adbs/version.rb
CHANGED
data/lib/droid_adbs.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative "droid_adbs/version"
|
2
2
|
require_relative "droid_adbs/commons/settings"
|
3
3
|
require_relative "droid_adbs/commons/devices"
|
4
4
|
require_relative "droid_adbs/commons/backup"
|
@@ -37,6 +37,25 @@ module DroidAdbs
|
|
37
37
|
result
|
38
38
|
end
|
39
39
|
|
40
|
+
# @param app [String] application path
|
41
|
+
# @return [String] message from adb command
|
42
|
+
def install_with_grant(app)
|
43
|
+
result = `#{adb_serial} install -r -g #{app}`
|
44
|
+
fail "invalid APK" if result.include?("Invalid APK file:")
|
45
|
+
fail "failed to update apk because INSTALL_FAILED_VERSION_DOWNGRADE" if result.include?("INSTALL_FAILED_VERSION_DOWNGRADE")
|
46
|
+
result
|
47
|
+
end
|
48
|
+
|
49
|
+
# @param app [String] application path
|
50
|
+
# @return [String] message from adb command
|
51
|
+
def install_with(app, option = "")
|
52
|
+
result = `#{adb_serial} install #{option} #{app}`
|
53
|
+
fail "invalid APK" if result.include?("Invalid APK file:")
|
54
|
+
fail "failed to update apk because INSTALL_FAILED_VERSION_DOWNGRADE" if result.include?("INSTALL_FAILED_VERSION_DOWNGRADE")
|
55
|
+
result
|
56
|
+
end
|
57
|
+
|
58
|
+
|
40
59
|
# @param package [String] package name you would like to uninstall
|
41
60
|
# @return [String] message from adb command
|
42
61
|
def uninstall(package)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: droid_adbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|