Skip to content

Commit a9e0c18

Browse files
committed
Cleanup
1 parent 796f4ca commit a9e0c18

File tree

5 files changed

+2
-50
lines changed

5 files changed

+2
-50
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ public class BuildApk : AndroidTask
9999

100100
public string CheckedBuild { get; set; }
101101

102-
public string RuntimeConfigBinFilePath { get; set; }
103-
104102
public bool UseAssemblyStore { get; set; }
105103

106104
public string ZipFlushFilesLimit { get; set; }
@@ -224,7 +222,6 @@ void ExecuteWithAbi (DSOWrapperGenerator.Config dsoWrapperConfig, string [] supp
224222
apk.Flush ();
225223
}
226224

227-
// AddRuntimeConfigBlob (apk);
228225
AddRuntimeLibraries (apk, supportedAbis);
229226
apk.Flush();
230227
AddNativeLibraries (files, supportedAbis);
@@ -409,27 +406,9 @@ static Regex FileGlobToRegEx (string fileGlob, RegexOptions options)
409406
return new Regex (sb.ToString (), options);
410407
}
411408

412-
void AddRuntimeConfigBlob (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk)
413-
{
414-
// We will place rc.bin in the `lib` directory next to the blob, to make startup slightly faster, as we will find the config file right after we encounter
415-
// our assembly store. Not only that, but also we'll be able to skip scanning the `base.apk` archive when split configs are enabled (which they are in 99%
416-
// of cases these days, since AAB enforces that split). `base.apk` contains only ABI-agnostic file, while one of the split config files contains only
417-
// ABI-specific data+code.
418-
if (!String.IsNullOrEmpty (RuntimeConfigBinFilePath) && File.Exists (RuntimeConfigBinFilePath)) {
419-
foreach (string abi in SupportedAbis) {
420-
// Prefix it with `a` because bundletool sorts entries alphabetically, and this will place it right next to `assemblies.*.blob.so`, which is what we
421-
// like since we can finish scanning the zip central directory earlier at startup.
422-
string inArchivePath = MakeArchiveLibPath (abi, "libarc.bin.so");
423-
string wrappedSourcePath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, MonoAndroidHelper.AbiToTargetArch (abi), RuntimeConfigBinFilePath, Path.GetFileName (inArchivePath));
424-
AddFileToArchiveIfNewer (apk, wrappedSourcePath, inArchivePath, compressionMethod: GetCompressionMethod (inArchivePath));
425-
}
426-
}
427-
}
428-
429409
void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary<AndroidTargetArch, Dictionary<string, CompressedAssemblyInfo>> compressedAssembliesInfo, string assemblyStoreApkName)
430410
{
431411
string sourcePath;
432-
AssemblyCompression.AssemblyData compressedAssembly = null;
433412
AssemblyStoreBuilder? storeBuilder = null;
434413

435414
if (UseAssemblyStore) {

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
292292

293293
<_AndroidFastDeployEnvironmentFiles Condition=" '$(_AndroidFastDeployEnvironmentFiles)' == '' And '$(EmbedAssembliesIntoApk)' == 'False' ">True</_AndroidFastDeployEnvironmentFiles>
294294
<_AndroidFastDeployEnvironmentFiles Condition=" '$(_AndroidFastDeployEnvironmentFiles)' == '' ">False</_AndroidFastDeployEnvironmentFiles>
295+
295296
<_AndroidCompressedAssembliesDir>$(IntermediateOutputPath)android\lz4</_AndroidCompressedAssembliesDir>
296297
</PropertyGroup>
297298

@@ -1871,7 +1872,7 @@ because xbuild doesn't support framework reference assemblies.
18711872
<PropertyGroup>
18721873
<_CompileToDalvikDependsOnTargets>
18731874
_CompileJava;
1874-
_RemoveRegisterAttribute;
1875+
_RemoveRegisterAttribute;
18751876
_CreateApplicationSharedLibraries;
18761877
_GetMonoPlatformJarPath;
18771878
_GetLibraryImports;
@@ -2110,7 +2111,6 @@ because xbuild doesn't support framework reference assemblies.
21102111
ProjectFullPath="$(MSBuildProjectFullPath)"
21112112
IncludeWrapSh="$(AndroidIncludeWrapSh)"
21122113
CheckedBuild="$(_AndroidCheckedBuild)"
2113-
RuntimeConfigBinFilePath="$(_BinaryRuntimeConfigPath)"
21142114
ExcludeFiles="@(AndroidPackagingOptionsExclude)"
21152115
IncludeFiles="@(AndroidPackagingOptionsInclude)"
21162116
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
@@ -2152,7 +2152,6 @@ because xbuild doesn't support framework reference assemblies.
21522152
ProjectFullPath="$(MSBuildProjectFullPath)"
21532153
IncludeWrapSh="$(AndroidIncludeWrapSh)"
21542154
CheckedBuild="$(_AndroidCheckedBuild)"
2155-
RuntimeConfigBinFilePath="$(_BinaryRuntimeConfigPath)"
21562155
ExcludeFiles="@(AndroidPackagingOptionsExclude)"
21572156
IncludeFiles="@(AndroidPackagingOptionsInclude)"
21582157
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
@@ -2230,7 +2229,6 @@ because xbuild doesn't support framework reference assemblies.
22302229
ProjectFullPath="$(MSBuildProjectFullPath)"
22312230
IncludeWrapSh="$(AndroidIncludeWrapSh)"
22322231
CheckedBuild="$(_AndroidCheckedBuild)"
2233-
RuntimeConfigBinFilePath="$(_BinaryRuntimeConfigPath)"
22342232
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
22352233
ZipFlushSizeLimit="$(_ZipFlushSizeLimit)"
22362234
ExcludeFiles="@(AndroidPackagingOptionsExclude)"
@@ -2271,7 +2269,6 @@ because xbuild doesn't support framework reference assemblies.
22712269
ProjectFullPath="$(MSBuildProjectFullPath)"
22722270
IncludeWrapSh="$(AndroidIncludeWrapSh)"
22732271
CheckedBuild="$(_AndroidCheckedBuild)"
2274-
RuntimeConfigBinFilePath="$(_BinaryRuntimeConfigPath)"
22752272
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
22762273
ZipFlushSizeLimit="$(_ZipFlushSizeLimit)"
22772274
ExcludeFiles="@(AndroidPackagingOptionsExclude)"

src/native/monodroid/embedded-assemblies-zip.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ EmbeddedAssemblies::zip_load_entry_common (size_t entry_index, std::span<uint8_t
6363
}
6464
}
6565

66-
// if (application_config.have_runtime_config_blob && !runtime_config_blob_found) {
67-
// if (Util::ends_with (entry_name, SharedConstants::RUNTIME_CONFIG_BLOB_NAME)) {
68-
// runtime_config_blob_mmap = md_mmap_apk_file (state.file_fd, state.data_offset, state.file_size, entry_name.get ());
69-
// store_mapped_runtime_config_data (runtime_config_blob_mmap, entry_name.get ());
70-
// return false;
71-
// }
72-
// }
73-
7466
// assemblies must be 16-byte or 4-byte aligned, or Bad Things happen
7567
if (((state.data_offset & 0xf) != 0) || ((state.data_offset & 0x3) != 0)) {
7668
Helpers::abort_application (
@@ -266,7 +258,6 @@ EmbeddedAssemblies::zip_load_assembly_store_entries (std::span<uint8_t> const& b
266258
dynamic_local_string<SENSIBLE_PATH_MAX> entry_name;
267259
bool assembly_store_found = embedded_assembly_store_size != 0;
268260
if (assembly_store_found) {
269-
log_debug (LOG_ASSEMBLY, "Got embedded assembly store, size %zu", embedded_assembly_store_size);
270261
verify_assembly_store_and_set_info (embedded_assembly_store, "embedded");
271262
log_debug (LOG_ASSEMBLY, "Looking for DSOs in APK");
272263
} else {
@@ -365,7 +356,6 @@ EmbeddedAssemblies::zip_load_entries (int fd, const char *apk_name, [[maybe_unus
365356
};
366357

367358
std::unique_ptr<uint8_t[]> raw_data (new uint8_t[cd_size]);
368-
//auto raw_data = new uint8_t[cd_size];
369359
std::span<uint8_t> buf (raw_data.get (), cd_size);
370360
ssize_t nread = read (fd, buf.data (), static_cast<read_count_type>(buf.size ()));
371361
if (static_cast<size_t>(nread) != cd_size) [[unlikely]] {
@@ -386,8 +376,6 @@ EmbeddedAssemblies::zip_load_entries (int fd, const char *apk_name, [[maybe_unus
386376
} else {
387377
zip_load_individual_assembly_entries (buf, cd_entries, should_register, state);
388378
}
389-
390-
//delete[] raw_data;
391379
}
392380

393381
template<bool NeedsNameAlloc>

src/native/monodroid/embedded-assemblies.hh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ namespace xamarin::android::internal {
175175
runtime_config_blob_mmap.size = 0;
176176
}
177177

178-
bool have_runtime_config_blob () const noexcept
179-
{
180-
return application_config.have_runtime_config_blob && runtime_config_blob_mmap.area != nullptr;
181-
}
182-
183178
bool keep_scanning () const noexcept
184179
{
185180
return need_to_scan_more_apks;

src/native/monodroid/monodroid-glue.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,13 @@ MonodroidRuntime::create_domain (JNIEnv *env, jstring_array_wrapper &runtimeApks
714714

715715
gather_bundled_assemblies (runtimeApks, &user_assemblies_count, have_split_apks);
716716

717-
// if (embeddedAssemblies.have_runtime_config_blob ()) {
718717
if (embedded_runtime_config_size > 0) {
719718
size_t blob_time_index;
720719
if (FastTiming::enabled ()) [[unlikely]] {
721720
blob_time_index = internal_timing->start_event (TimingEventKind::RuntimeConfigBlob);
722721
}
723722

724723
runtime_config_args.kind = 1;
725-
// embeddedAssemblies.get_runtime_config_blob (runtime_config_args.runtimeconfig.data.data, runtime_config_args.runtimeconfig.data.data_len);
726724
runtime_config_args.runtimeconfig.data.data = reinterpret_cast<const char*>(embedded_runtime_config);
727725
runtime_config_args.runtimeconfig.data.data_len = static_cast<uint32_t>(embedded_runtime_config_size);
728726
monovm_runtimeconfig_initialize (&runtime_config_args, cleanup_runtime_config, nullptr);
@@ -1384,11 +1382,6 @@ MonodroidRuntime::Java_mono_android_Runtime_initInternal (JNIEnv *env, jclass kl
13841382

13851383
Logger::init_logging_categories (mono_log_mask_raw, mono_log_level_raw);
13861384

1387-
// log_warn (LOG_DEFAULT, "Embedded runtime config size: %zu", embedded_runtime_config_size);
1388-
// if (embedded_runtime_config_size > 0) {
1389-
// log_warn (LOG_DEFAULT, "First byte of embedded runtime config: 0x%x", embedded_runtime_config[0]);
1390-
// }
1391-
13921385
std::unique_ptr<char[]> mono_log_mask (mono_log_mask_raw);
13931386
std::unique_ptr<char[]> mono_log_level (mono_log_level_raw);
13941387

0 commit comments

Comments
 (0)