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

Commit a8755a84 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Fix multiArch parsing for ApkLite.

Two separate issues :
- We were not parcelling the value at all.
- We were looking for it in the wrong manifest attribute.

Note that this change has no observable effect on installs (which
is probably why it wasn't caught so far). This code path is only
used in FileInstallArgs.copyApk (where multiArch was effectively
false before this change) but the package manager extracts shared
libs *again* inside scanPackageLI where this was being done
correctly since the value there came from a "full" package
parse, and not a "lite" package parse.

Change-Id: I54c3efcf8f57e6970f8fbde8cd1f57d487b13114
parent a50cd8d4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class PackageInfoLite implements Parcelable {
        dest.writeInt(versionCode);
        dest.writeInt(recommendedInstallLocation);
        dest.writeInt(installLocation);
        dest.writeInt(multiArch ? 1 : 0);

        if (verifiers == null || verifiers.length == 0) {
            dest.writeInt(0);
@@ -98,6 +99,7 @@ public class PackageInfoLite implements Parcelable {
        versionCode = source.readInt();
        recommendedInstallLocation = source.readInt();
        installLocation = source.readInt();
        multiArch = (source.readInt() != 0);

        final int verifiersLength = source.readInt();
        if (verifiersLength == 0) {
+11 −4
Original line number Diff line number Diff line
@@ -1129,11 +1129,8 @@ public class PackageParser {
            } else if (attr.equals("versionCode")) {
                versionCode = attrs.getAttributeIntValue(i, 0);
                numFound++;
            } else if (attr.equals("multiArch")) {
                multiArch = attrs.getAttributeBooleanValue(i, false);
                numFound++;
            }
            if (numFound >= 3) {
            if (numFound >= 2) {
                break;
            }
        }
@@ -1155,6 +1152,16 @@ public class PackageParser {
                    verifiers.add(verifier);
                }
            }

            if (parser.getDepth() == searchDepth && "application".equals(parser.getName())) {
                for (int i = 0; i < attrs.getAttributeCount(); ++i) {
                    final String attr = attrs.getAttributeName(i);
                    if ("multiArch".equals(attr)) {
                        multiArch = attrs.getAttributeBooleanValue(i, false);
                        break;
                    }
                }
            }
        }

        return new ApkLite(codePath, packageSplit.first, packageSplit.second, versionCode,