Skip to content

Commit c978f35

Browse files
authored
[native/monodroid] Fix error demangling satellite assembly names (#9166)
When assemblies are packaged in the `.apk` archive, their names are "mangled" so that we don't create clashes with "real" shared libraries, which are placed into the same "directory." Additionally, since the `lib/` directory in the `.apk` archive supports only a single level of directories, we must encode satellite assembly culture in the file name, instead of putting it in a subdirectory. Unfortunately, when the code was committed, an off-by-one error crept in, when converting satellite assembly names to their `culture/name` form. As the result, the first character of the culture was omitted which would cause the satellite assemblies not to be loaded properly. Fix the issue by using the correct mangled name prefix length.
1 parent baa7eba commit c978f35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/native/monodroid/embedded-assemblies.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ namespace xamarin::android::internal {
324324
static constexpr size_t get_mangled_prefix_length ()
325325
{
326326
if constexpr (IsSatelliteAssembly) {
327-
// +1 for the extra `-` char in the culture portion of satellite assembly's name;
328-
return SharedConstants::MANGLED_ASSEMBLY_SATELLITE_ASSEMBLY_MARKER.length () + 1;
327+
return SharedConstants::MANGLED_ASSEMBLY_SATELLITE_ASSEMBLY_MARKER.length ();
329328
} else {
330329
return SharedConstants::MANGLED_ASSEMBLY_REGULAR_ASSEMBLY_MARKER.length ();
331330
}

0 commit comments

Comments
 (0)