File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/java/com/google/devtools/mobileharness/platform/android/instrumentation Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 5555import com .google .devtools .mobileharness .shared .util .file .local .LocalFileUtil ;
5656import com .google .devtools .mobileharness .shared .util .file .local .ResUtil ;
5757import com .google .devtools .mobileharness .shared .util .path .PathUtil ;
58+ import com .google .devtools .mobileharness .shared .util .shell .ShellUtils ;
5859import com .google .devtools .mobileharness .shared .util .time .Sleeper ;
5960import com .google .errorprone .annotations .CanIgnoreReturnValue ;
6061import com .google .wireless .qa .mobileharness .shared .android .Aapt ;
@@ -389,15 +390,15 @@ public String instrument(
389390 }
390391 if (!StrUtil .isEmptyOrWhitespace (className )) {
391392 command .append (" -e class " );
392- command .append (className );
393+ command .append (ShellUtils . shellEscape ( className ) );
393394 }
394395
395396 if (otherOptions != null && !otherOptions .isEmpty ()) {
396397 for (Entry <String , String > entry : otherOptions .entrySet ()) {
397398 command .append (" -e " );
398- command .append (entry .getKey ());
399+ command .append (ShellUtils . shellEscape ( entry .getKey () ));
399400 command .append (' ' );
400- command .append (entry .getValue ());
401+ command .append (ShellUtils . shellEscape ( entry .getValue () ));
401402 }
402403 }
403404
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ java_library(
5656 "//src/java/com/google/devtools/mobileharness/shared/util/file/local:res_util" ,
5757 "//src/java/com/google/devtools/mobileharness/shared/util/logging:google_logger" ,
5858 "//src/java/com/google/devtools/mobileharness/shared/util/path" ,
59+ "//src/java/com/google/devtools/mobileharness/shared/util/shell" ,
5960 "//src/java/com/google/devtools/mobileharness/shared/util/time:sleeper" ,
6061 "//src/java/com/google/wireless/qa/mobileharness/shared/android:aapt" ,
6162 "//src/java/com/google/wireless/qa/mobileharness/shared/api/device" ,
You can’t perform that action at this time.
0 commit comments