Use root to launch su request Activity on Q

This commit is contained in:
topjohnwu
2019-04-10 05:03:26 -04:00
parent 4b54cf1288
commit b067a5bb13
3 changed files with 129 additions and 5 deletions

View File

@@ -32,6 +32,7 @@ import com.topjohnwu.superuser.Shell;
import com.topjohnwu.superuser.internal.UiThreadHandler;
import com.topjohnwu.superuser.io.SuFile;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -165,4 +166,19 @@ public class Utils {
toast(R.string.open_link_failed_toast, Toast.LENGTH_SHORT);
}
}
public static String argsToCommand(List<String> args) {
StringBuilder sb = new StringBuilder();
for (String s : args) {
if (s.contains(" ")) {
sb.append('"').append(s).append('"');
} else {
sb.append(s);
}
sb.append(' ');
}
sb.deleteCharAt(sb.length() - 1);
return sb.toString();
}
}