Skip to content

Commit 6dea8da

Browse files
committed
Cleanup
1 parent c77feff commit 6dea8da

File tree

5 files changed

+2
-49
lines changed

5 files changed

+2
-49
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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ EmbeddedAssemblies::zip_load_entry_common (size_t entry_index, std::span<uint8_t
6161
}
6262
}
6363

64-
// if (application_config.have_runtime_config_blob && !runtime_config_blob_found) {
65-
// if (Util::ends_with (entry_name, SharedConstants::RUNTIME_CONFIG_BLOB_NAME)) {
66-
// runtime_config_blob_mmap = md_mmap_apk_file (state.file_fd, state.data_offset, state.file_size, entry_name.get ());
67-
// store_mapped_runtime_config_data (runtime_config_blob_mmap, entry_name.get ());
68-
// return false;
69-
// }
70-
// }
71-
7264
// assemblies must be 16-byte or 4-byte aligned, or Bad Things happen
7365
if (((state.data_offset & 0xf) != 0) || ((state.data_offset & 0x3) != 0)) {
7466
Helpers::abort_application (
@@ -264,7 +256,6 @@ EmbeddedAssemblies::zip_load_assembly_store_entries (std::span<uint8_t> const& b
264256
dynamic_local_string<SENSIBLE_PATH_MAX> entry_name;
265257
bool assembly_store_found = embedded_assembly_store_size != 0;
266258
if (assembly_store_found) {
267-
log_debug (LOG_ASSEMBLY, "Got embedded assembly store, size %zu", embedded_assembly_store_size);
268259
verify_assembly_store_and_set_info (embedded_assembly_store, "embedded");
269260
log_debug (LOG_ASSEMBLY, "Looking for DSOs in APK");
270261
} else {
@@ -381,8 +372,6 @@ EmbeddedAssemblies::zip_load_entries (int fd, const char *apk_name, [[maybe_unus
381372
} else {
382373
zip_load_individual_assembly_entries (buf, cd_entries, should_register, state);
383374
}
384-
385-
//delete[] raw_data;
386375
}
387376

388377
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
@@ -712,15 +712,13 @@ MonodroidRuntime::create_domain (JNIEnv *env, jstring_array_wrapper &runtimeApks
712712

713713
gather_bundled_assemblies (runtimeApks, &user_assemblies_count, have_split_apks);
714714

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

722721
runtime_config_args.kind = 1;
723-
// embeddedAssemblies.get_runtime_config_blob (runtime_config_args.runtimeconfig.data.data, runtime_config_args.runtimeconfig.data.data_len);
724722
runtime_config_args.runtimeconfig.data.data = reinterpret_cast<const char*>(embedded_runtime_config);
725723
runtime_config_args.runtimeconfig.data.data_len = static_cast<uint32_t>(embedded_runtime_config_size);
726724
monovm_runtimeconfig_initialize (&runtime_config_args, cleanup_runtime_config, nullptr);
@@ -1380,11 +1378,6 @@ MonodroidRuntime::Java_mono_android_Runtime_initInternal (JNIEnv *env, jclass kl
13801378

13811379
Logger::init_logging_categories (mono_log_mask_raw, mono_log_level_raw);
13821380

1383-
// log_warn (LOG_DEFAULT, "Embedded runtime config size: %zu", embedded_runtime_config_size);
1384-
// if (embedded_runtime_config_size > 0) {
1385-
// log_warn (LOG_DEFAULT, "First byte of embedded runtime config: 0x%x", embedded_runtime_config[0]);
1386-
// }
1387-
13881381
std::unique_ptr<char[]> mono_log_mask (mono_log_mask_raw);
13891382
std::unique_ptr<char[]> mono_log_level (mono_log_level_raw);
13901383

0 commit comments

Comments
 (0)