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

Commit 0e25d9ae authored by Adam Lesinski's avatar Adam Lesinski
Browse files

libandroidfw: Search all packages for an identifier

In order to allow multiple packages with the same package name, but
different package ID, we need to keep searching packages until the
resource is found.

Bug: 30999713
Test: make libandroidfw_tests
Change-Id: If4540e12731ca18a18e9e550a9bf248606a586c5
parent b0c47ef8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4765,7 +4765,6 @@ nope:
                    && (targetTypeLen = attrPrivate.size())
            );
        }
        break;
    }
    return 0;
}
+3 −3
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ struct R {
      density = 0x7f030002,

      // From feature
      test3 = 0x7f080000,
      test4 = 0x7f080001,
      test3 = 0x80020000,
      test4 = 0x80020001,
    };
  };

@@ -57,7 +57,7 @@ struct R {
      ref2 = 0x7f040003,

      // From feature
      number3 = 0x7f090000,
      number3 = 0x80030000,
    };
  };

+2 −1
Original line number Diff line number Diff line
@@ -15,5 +15,6 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.basic">
    package="com.android.basic"
    featureName="feature">
</manifest>
+7 −1
Original line number Diff line number Diff line
@@ -19,4 +19,10 @@ set -e

PATH_TO_FRAMEWORK_RES=${ANDROID_BUILD_TOP}/prebuilts/sdk/current/android.jar

aapt package -M AndroidManifest.xml -S res -I $PATH_TO_FRAMEWORK_RES --feature-of ../basic/basic.apk -F feature.apk -f
aapt2 compile --dir res -o compiled.flata
aapt2 link -o feature.apk \
    --manifest AndroidManifest.xml \
    -I $PATH_TO_FRAMEWORK_RES \
    -I ../basic/basic.apk \
    --package-id 0x80 \
    compiled.flata
Loading