Find another difference by which you can determine which case it is. For example, a list of loaded libraries.
Tomorrow, developers can apply the approach with 10 android, for older versions. And this will break your script if it relies on the version of android.
You can make a lazy double search mechanism.
The script looks for the presence of the saved search type in the config.
If it isn’t empty, use this type. If the search is unsuccessful, it switches to another type.
If it is empty there, it first conducts one search, and if it is unsuccessful, then the second.
In any case, the type is saved in the config.
This allows you to completely solve the problem.