You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In file RedexResources.cpp function get_bool_attribute_value() redex asserts read value to be TYPE_INT_BOOLEAN instead of checking the value it references in case its TYPE_REFERENCE.
The text was updated successfully, but these errors were encountered:
Sorry for the very delayed response on this one. Thanks for the good quality report, we didn't consider that the manifest would contain references like this.
We could probably scan for all possible values of a boolean reference across all configurations and see if the value matches, then operate off that. But, I wonder what we'd do if the value varied on a configuration (does Android even let you vary android:exported based on something like dpi? that would be weird but I guess it could work). Maybe we'd have to provide a fallback option, or outright ban this case with an assert. Will take a look.
After making a test case for this, I realized there is actually 1 valid corner case where you could have android:exported="@bool/some_bool" such that some_bool is actually unknowable at compile time. Varying this value by API level is an acceptable thing to do (i.e. make some_bool false by default and make it true in values-v21 or whatever).
I'll propose we change ComponentTagInfo.is_exported to be boost::optional<boolean>for all cases when the attribute value is TYPE_REFERENCE, and any optimization that checks is_exported will need to do something sensible in the unknowable case.
Summary:
I'm going to bootcamp T39834130, but before doing so I'd like to supply the person who picks up the task with an example input for test cases.
As stated on #368, we don't correctly parse the AndroidManifest.xml in all cases if a boolean literal isn't supplied for the `android:exported` attribute.
Reviewed By: newobj
Differential Revision: D14899052
fbshipit-source-id: a88829971e922b007015216e5bf372fcb6be166a
Manifest contains:
<service android:exported="@bool/some_bool" android:name="some_name" android:process=":search">
and inside resources.arsc there is:
<bool name="some_bool">false</bool>
In file RedexResources.cpp function get_bool_attribute_value() redex asserts read value to be TYPE_INT_BOOLEAN instead of checking the value it references in case its TYPE_REFERENCE.
The text was updated successfully, but these errors were encountered: