Fix issues of repackaging with multiuser

This commit is contained in:
topjohnwu
2017-12-08 23:38:03 +08:00
parent c461fc6daa
commit aa75c8e5e4
6 changed files with 20 additions and 23 deletions
@@ -123,9 +123,7 @@ public class HideManager extends ParallelTask<Void, Void, Boolean> {
// Install the application
List<String> ret = Shell.su(String.format(Locale.US,
"pm install --user %d %s >/dev/null && echo true || echo false",
mm.userId, repack));
List<String> ret = Shell.su(Utils.fmt("pm install %s >/dev/null && echo true || echo false", repack));
repack.delete();
if (!Utils.isValidShellResponse(ret) || !Boolean.parseBoolean(ret.get(0)))
return false;
@@ -188,8 +188,9 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
// Patch boot image
shell.run(console, logs,
"cd " + install,
"KEEPFORCEENCRYPT=" + mKeepEnc + " KEEPVERITY=" + mKeepVerity + " HIGHCOMP=" + highCompression +
" sh update-binary indep boot_patch.sh " + boot + " || echo 'Failed!'");
Utils.fmt("KEEPFORCEENCRYPT=%b KEEPVERITY=%b HIGHCOMP=%b " +
"sh update-binary indep boot_patch.sh %s || echo 'Failed!'",
mKeepEnc, mKeepVerity, highCompression, boot));
if (TextUtils.equals(console.get(console.size() - 1), "Failed!"))
return false;