Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8d8f6f5 authored by Andy Mast's avatar Andy Mast
Browse files

Themes: Fix -110 install error [2/2]

aapt was being called from PM with a ' ' at the end of the cmd. This would
cause installd to read unexpected parts of memory which sometimes
causes it to parse the command incorrectly.

Change-Id: I85bf93045370478fd9baaf5db784c0cc3a4a03b9
parent 2ec036ce
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Slog;
import android.util.SparseArray;

@@ -364,7 +365,13 @@ public final class Installer {

    public int aapt(String themeApkPath, String internalPath, String resTablePath, int uid,
                    int pkgId, String commonResourcesPath) {
        StringBuilder builder = new StringBuilder("aapt");

        StringBuilder builder = new StringBuilder();
        if (TextUtils.isEmpty(commonResourcesPath)) {
            builder.append("aapt");
        } else {
            builder.append("aapt_with_common");
        }
        builder.append(' ');
        builder.append(themeApkPath);
        builder.append(' ');
@@ -375,8 +382,12 @@ public final class Installer {
        builder.append(uid);
        builder.append(' ');
        builder.append(pkgId);

        if (!TextUtils.isEmpty(commonResourcesPath)) {
            builder.append(' ');
            builder.append(commonResourcesPath);
        }

        return execute(builder.toString());
    }