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
This commit is contained in:
@@ -4765,7 +4765,6 @@ nope:
|
||||
&& (targetTypeLen = attrPrivate.size())
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
@@ -15,13 +15,12 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Features are offset, so 7f020000 will become 7f080000 at runtime. -->
|
||||
<public type="string" name="test3" id="0x7f020000" />
|
||||
<public type="string" name="test3" id="0x80020000" />
|
||||
<string name="test3">test3</string>
|
||||
|
||||
<public type="string" name="test4" id="0x7f020001" />
|
||||
<public type="string" name="test4" id="0x80020001" />
|
||||
<string name="test4">test4</string>
|
||||
|
||||
<public type="integer" name="number3" id="0x7f030000" />
|
||||
<public type="integer" name="number3" id="0x80030000" />
|
||||
<integer name="number3">200</integer>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user