Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Documentation/project-docs/ApkSharedLibraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The first command verifies that the file is a valid ELF image and shows the head
target platform/abi/machine:

```shell
$ llvm-readelf --file-header libassemblies.arm64-v8a.blob.so
$ llvm-readelf --file-header libassembly-store.so
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Expand All @@ -134,7 +134,7 @@ The second command lists the sections contained within the ELF image, their alig
into the file where the sections begin:

```shell
$ llvm-readelf --section-headers libassemblies.arm64-v8a.blob.so
$ llvm-readelf --section-headers libassembly-store.so
There are 11 section headers, starting at offset 0xcf648:

Section Headers:
Expand Down Expand Up @@ -167,7 +167,7 @@ shared library.
In order to extract payload from the ELF image, one can use the following command:

```shell
$ llvm-objcopy --dump-section=payload=payload.bin libassemblies.arm64-v8a.blob.so
$ llvm-objcopy --dump-section=payload=payload.bin libassembly-store.so
$ ls -gG payload.bin
-rw-rw-r-- 1 833095 Sep 12 11:32 payload.bin
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override bool RunTask ()
// ABI-specific data+code.
if (!RuntimeConfigBinFilePath.IsNullOrEmpty () && File.Exists (RuntimeConfigBinFilePath)) {
foreach (var abi in SupportedAbis) {
// Prefix it with `a` because bundletool sorts entries alphabetically, and this will place it right next to `assemblies.*.blob.so`, which is what we
// Prefix it with `a` because bundletool sorts entries alphabetically, and this will place it right next to `assembly-store.so`, which is what we
// like since we can finish scanning the zip central directory earlier at startup.
var inArchivePath = MakeArchiveLibPath (abi, "libarc.bin.so");
var wrappedSourcePath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, MonoAndroidHelper.AbiToTargetArch (abi), RuntimeConfigBinFilePath, Path.GetFileName (inArchivePath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Xamarin.Android.Tasks;

/// <summary>
/// If using $(AndroidUseAssemblyStore), place all the assemblies in a single .blob file.
/// If using $(AndroidUseAssemblyStore), place all the assemblies in a single assembly store file.
/// </summary>
public class CreateAssemblyStore : AndroidTask
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"classes.dex": {
"Size": 397616
},
"lib/arm64-v8a/libassemblies.arm64-v8a.blob.so": {
"lib/arm64-v8a/libassembly-store.so": {
"Size": 3124664
},
"lib/arm64-v8a/libclrjit.so": {
Expand Down Expand Up @@ -75,4 +75,4 @@
}
},
"PackageSize": 9049893
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"kotlin/reflect/reflect.kotlin_builtins": {
"Size": 2396
},
"lib/arm64-v8a/libassemblies.arm64-v8a.blob.so": {
"lib/arm64-v8a/libassembly-store.so": {
"Size": 14221080
},
"lib/arm64-v8a/libclrjit.so": {
Expand Down Expand Up @@ -2286,4 +2286,4 @@
}
},
"PackageSize": 22619078
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ string Generate (string baseOutputDirectory, AndroidTargetArch arch, List<Assemb
Directory.CreateDirectory (outputDir);

uint infoCount = (uint)infos.Count;
string storePath = Path.Combine (outputDir, androidAbi, $"assemblies.{androidAbi}.blob.so");
string storePath = Path.Combine (outputDir, "assembly-store.so");
var index = new List<AssemblyStoreIndexEntry> ();
var descriptors = new List<AssemblyStoreEntryDescriptor> ();
ulong namesSize = 0;
Expand Down
8 changes: 1 addition & 7 deletions src/native/clr/include/constants.hh
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,8 @@ namespace xamarin::android {
private:
static constexpr size_t split_config_abi_apk_name_size = calc_size (split_config_prefix, android_abi, split_config_extension);

static constexpr std::string_view assembly_store_prefix { "libassemblies." };
static constexpr std::string_view assembly_store_extension { ".blob" };
static constexpr size_t assembly_store_file_name_size = calc_size (assembly_store_prefix, android_lib_abi, assembly_store_extension, dso_suffix);
static constexpr auto assembly_store_file_name_array = concat_string_views<assembly_store_file_name_size> (assembly_store_prefix, android_lib_abi, assembly_store_extension, dso_suffix);

public:
// .data() must be used otherwise string_view length will include the trailing \0 in the array
static constexpr std::string_view assembly_store_file_name { assembly_store_file_name_array.data () };
static constexpr std::string_view assembly_store_file_name { "libassembly-store.so" };

static constexpr auto split_config_abi_apk_name = concat_string_views<split_config_abi_apk_name_size> (split_config_prefix, android_abi, split_config_extension);
static constexpr std::string_view base_apk_name = { "/base.apk" };
Expand Down
12 changes: 3 additions & 9 deletions src/native/mono/monodroid/embedded-assemblies.hh
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,11 @@ namespace xamarin::android::internal {
static constexpr std::string_view dso_suffix { ".so" };

static constexpr std::string_view apk_lib_prefix = assemblies_prefix; // concat_const (apk_lib_dir_name, zip_path_separator, SharedConstants::android_lib_abi, zip_path_separator);
static constexpr std::string_view assembly_store_prefix { "libassemblies." };
static constexpr std::string_view assembly_store_extension { ".blob" };

static constexpr size_t assembly_store_file_name_size = calc_size (assembly_store_prefix, SharedConstants::android_lib_abi, assembly_store_extension, dso_suffix);
static constexpr auto assembly_store_file_name_array = concat_string_views<assembly_store_file_name_size> (assembly_store_prefix, SharedConstants::android_lib_abi, assembly_store_extension, dso_suffix);
static constexpr std::string_view assembly_store_file_name { "libassembly-store.so" };

// .data() must be used otherwise string_view length will include the trailing \0 in the array
static constexpr std::string_view assembly_store_file_name { assembly_store_file_name_array.data () };

static constexpr size_t assembly_store_file_path_size = calc_size(apk_lib_dir_name, zip_path_separator, SharedConstants::android_lib_abi, zip_path_separator, assembly_store_prefix, SharedConstants::android_lib_abi, assembly_store_extension, dso_suffix);
static constexpr auto assembly_store_file_path_array = concat_string_views<assembly_store_file_path_size> (apk_lib_dir_name, zip_path_separator, SharedConstants::android_lib_abi, zip_path_separator, assembly_store_prefix, SharedConstants::android_lib_abi, assembly_store_extension, dso_suffix);
static constexpr size_t assembly_store_file_path_size = calc_size(apk_lib_dir_name, zip_path_separator, SharedConstants::android_lib_abi, zip_path_separator, assembly_store_file_name);
static constexpr auto assembly_store_file_path_array = concat_string_views<assembly_store_file_path_size> (apk_lib_dir_name, zip_path_separator, SharedConstants::android_lib_abi, zip_path_separator, assembly_store_file_name);
// .data() must be used otherwise string_view length will include the trailing \0 in the array
static constexpr std::string_view assembly_store_file_path { assembly_store_file_path_array.data () };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ string GetArchPath (AndroidTargetArch arch, string? root = null)
root = LibDirName;
}
parts.Add (abi);
parts.Add (GetBlobName (abi));
parts.Add ("libassembly-store.so");

return MonoAndroidHelper.MakeZipArchivePath (root, parts);
}
Expand All @@ -82,8 +82,6 @@ public StoreReader_V2 (Stream store, string path)
};
}

static string GetBlobName (string abi) => $"libassemblies.{abi}.blob.so";

protected override ulong GetStoreStartDataOffset () => elfOffset;

protected override bool IsSupported ()
Expand Down
6 changes: 3 additions & 3 deletions tools/assembly-store-reader-mk2/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ static int Main (string[] args)
" where each BLOB_PATH can point to:",
" * aab file",
" * apk file",
" * index store file (e.g. base_assemblies.blob or assemblies.arm64_v8a.blob.so)",
" * arch store file (e.g. base_assemblies.arm64_v8a.blob)",
" * index store file (e.g. base_assemblies.blob or libassembly-store.so)",
" * arch store file (e.g. base_assemblies.blob)",
" * store manifest file (e.g. base_assemblies.manifest)",
" * store base name (e.g. base or base_assemblies)",
"",
" In each case the whole set of stores and manifests will be read (if available). Search for the",
" various members of the store set (common/main store, arch stores, manifest) is based on this naming",
" convention:",
"",
" {BASE_NAME}[.ARCH_NAME].{blob|blob.so|manifest}",
" {BASE_NAME}[.ARCH_NAME].{blob|so|manifest}",
"",
" Whichever file is referenced in `BLOB_PATH`, the BASE_NAME component is extracted and all the found files are read.",
" If `BLOB_PATH` points to an aab or an apk, BASE_NAME will always be `assemblies`",
Expand Down
Loading