The native code that underlies `Resources#getIdentifier()` did not take sparse encoding into account when calculating offsets, resulting in either garbage or SEGV_MAPERR whenever a resource is first encountered in a sparsely encoded configuration. Bug: 197976367 Test: atest libandroidfw_tests --host Change-Id: Ib7550fe2e05005550f59129a06be5712b74bc9c8
21 lines
525 B
Bash
Executable File
21 lines
525 B
Bash
Executable File
#!/bin/bash
|
|
|
|
OUTPUT_default=res/values/strings.xml
|
|
OUTPUT_v26=res/values-v26/strings.xml
|
|
|
|
echo "<resources>" > $OUTPUT_default
|
|
echo "<resources>" > $OUTPUT_v26
|
|
for i in {0..999}
|
|
do
|
|
echo " <string name=\"foo_$i\">$i</string>" >> $OUTPUT_default
|
|
if [ "$(($i % 3))" -eq "0" ]
|
|
then
|
|
echo " <string name=\"foo_$i\">$(($i * 10))</string>" >> $OUTPUT_v26
|
|
fi
|
|
done
|
|
echo "</resources>" >> $OUTPUT_default
|
|
|
|
echo " <string name=\"only_v26\">only v26</string>" >> $OUTPUT_v26
|
|
echo "</resources>" >> $OUTPUT_v26
|
|
|