@@ -30,11 +30,12 @@ private ShellUtils() {
30
30
* @param command The command.
31
31
* @param isRooted True to use root, false otherwise.
32
32
* @param callback The callback.
33
+ * @return the task
33
34
*/
34
- public static void execCmdAsync (final String command ,
35
- final boolean isRooted ,
36
- final Utils .Callback <CommandResult > callback ) {
37
- execCmdAsync (new String []{command }, isRooted , true , callback );
35
+ public static Utils . Task < CommandResult > execCmdAsync (final String command ,
36
+ final boolean isRooted ,
37
+ final Utils .Callback <CommandResult > callback ) {
38
+ return execCmdAsync (new String []{command }, isRooted , true , callback );
38
39
}
39
40
40
41
/**
@@ -43,11 +44,12 @@ public static void execCmdAsync(final String command,
43
44
* @param commands The commands.
44
45
* @param isRooted True to use root, false otherwise.
45
46
* @param callback The callback.
47
+ * @return the task
46
48
*/
47
- public static void execCmdAsync (final List <String > commands ,
48
- final boolean isRooted ,
49
- final Utils .Callback <CommandResult > callback ) {
50
- execCmdAsync (commands == null ? null : commands .toArray (new String []{}), isRooted , true , callback );
49
+ public static Utils . Task < CommandResult > execCmdAsync (final List <String > commands ,
50
+ final boolean isRooted ,
51
+ final Utils .Callback <CommandResult > callback ) {
52
+ return execCmdAsync (commands == null ? null : commands .toArray (new String []{}), isRooted , true , callback );
51
53
}
52
54
53
55
/**
@@ -56,11 +58,12 @@ public static void execCmdAsync(final List<String> commands,
56
58
* @param commands The commands.
57
59
* @param isRooted True to use root, false otherwise.
58
60
* @param callback The callback.
61
+ * @return the task
59
62
*/
60
- public static void execCmdAsync (final String [] commands ,
61
- final boolean isRooted ,
62
- final Utils .Callback <CommandResult > callback ) {
63
- execCmdAsync (commands , isRooted , true , callback );
63
+ public static Utils . Task < CommandResult > execCmdAsync (final String [] commands ,
64
+ final boolean isRooted ,
65
+ final Utils .Callback <CommandResult > callback ) {
66
+ return execCmdAsync (commands , isRooted , true , callback );
64
67
}
65
68
66
69
/**
@@ -70,12 +73,13 @@ public static void execCmdAsync(final String[] commands,
70
73
* @param isRooted True to use root, false otherwise.
71
74
* @param isNeedResultMsg True to return the message of result, false otherwise.
72
75
* @param callback The callback.
76
+ * @return the task
73
77
*/
74
- public static void execCmdAsync (final String command ,
75
- final boolean isRooted ,
76
- final boolean isNeedResultMsg ,
77
- final Utils .Callback <CommandResult > callback ) {
78
- execCmdAsync (new String []{command }, isRooted , isNeedResultMsg , callback );
78
+ public static Utils . Task < CommandResult > execCmdAsync (final String command ,
79
+ final boolean isRooted ,
80
+ final boolean isNeedResultMsg ,
81
+ final Utils .Callback <CommandResult > callback ) {
82
+ return execCmdAsync (new String []{command }, isRooted , isNeedResultMsg , callback );
79
83
}
80
84
81
85
/**
@@ -85,12 +89,13 @@ public static void execCmdAsync(final String command,
85
89
* @param isRooted True to use root, false otherwise.
86
90
* @param isNeedResultMsg True to return the message of result, false otherwise.
87
91
* @param callback The callback.
92
+ * @return the task
88
93
*/
89
- public static void execCmdAsync (final List <String > commands ,
90
- final boolean isRooted ,
91
- final boolean isNeedResultMsg ,
92
- final Utils .Callback <CommandResult > callback ) {
93
- execCmdAsync (commands == null ? null : commands .toArray (new String []{}),
94
+ public static Utils . Task < CommandResult > execCmdAsync (final List <String > commands ,
95
+ final boolean isRooted ,
96
+ final boolean isNeedResultMsg ,
97
+ final Utils .Callback <CommandResult > callback ) {
98
+ return execCmdAsync (commands == null ? null : commands .toArray (new String []{}),
94
99
isRooted ,
95
100
isNeedResultMsg ,
96
101
callback );
0 commit comments