All the assemblies are wrapped in a valid ELF shared library image and
placed in the lib/{ABI} directories inside the APK/AAB archive. Since
those directories don't support subdirectories, we need to encode
satellite assembly culture in a way that doesn't use the / directory
separator char. This encoding, as originally implemented, unfortunately
used the - character which made it ambiguous with culture names that
consist of two parts (e.g. de-DE), since the unmangling process would
look for the first occurrence of - to replace it with /, which would
form invalid assembly names such as de/DE-MyAssembly.resources.dll
instead of the correct de-DE/MyAssembly.resources.dll. This would,
eventually, lead to a mismatch when looking for satellite assembly for
that specific culture.
Fix it by changing the - character to _ so that mangled assembly
name looks like lib_de-DE_MyAssembly.resources.dll.so and we can
unambiguously decode it to the correct de-DE/MyAssembly.resources.dll
name.
Fixes: https://github.com/dotnet/android/issues/9532 Context: 86260ed36dfe1a90c8ed6a2bb1cd0607d637f403
All the assemblies are wrapped in a valid ELF shared library image and placed in the
lib/{ABI}
directories inside the APK/AAB archive. Since those directories don't support subdirectories, we need to encode satellite assembly culture in a way that doesn't use the/
directory separator char. This encoding, as originally implemented, unfortunately used the-
character which made it ambiguous with culture names that consist of two parts (e.g.de-DE
), since the unmangling process would look for the first occurrence of-
to replace it with/
, which would form invalid assembly names such asde/DE-MyAssembly.resources.dll
instead of the correctde-DE/MyAssembly.resources.dll
. This would, eventually, lead to a mismatch when looking for satellite assembly for that specific culture.Fix it by changing the
-
character to_
so that mangled assembly name looks likelib_de-DE_MyAssembly.resources.dll.so
and we can unambiguously decode it to the correctde-DE/MyAssembly.resources.dll
name.