@@ -30,11 +30,12 @@ private ShellUtils() {
3030 * @param command The command.
3131 * @param isRooted True to use root, false otherwise.
3232 * @param callback The callback.
33+ * @return the task
3334 */
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 );
3839 }
3940
4041 /**
@@ -43,11 +44,12 @@ public static void execCmdAsync(final String command,
4344 * @param commands The commands.
4445 * @param isRooted True to use root, false otherwise.
4546 * @param callback The callback.
47+ * @return the task
4648 */
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 );
5153 }
5254
5355 /**
@@ -56,11 +58,12 @@ public static void execCmdAsync(final List<String> commands,
5658 * @param commands The commands.
5759 * @param isRooted True to use root, false otherwise.
5860 * @param callback The callback.
61+ * @return the task
5962 */
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 );
6467 }
6568
6669 /**
@@ -70,12 +73,13 @@ public static void execCmdAsync(final String[] commands,
7073 * @param isRooted True to use root, false otherwise.
7174 * @param isNeedResultMsg True to return the message of result, false otherwise.
7275 * @param callback The callback.
76+ * @return the task
7377 */
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 );
7983 }
8084
8185 /**
@@ -85,12 +89,13 @@ public static void execCmdAsync(final String command,
8589 * @param isRooted True to use root, false otherwise.
8690 * @param isNeedResultMsg True to return the message of result, false otherwise.
8791 * @param callback The callback.
92+ * @return the task
8893 */
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 []{}),
9499 isRooted ,
95100 isNeedResultMsg ,
96101 callback );
0 commit comments