Revert "Android: Make TrichromeLibrary.apk have no classes.dex"

This reverts commit b1e26665ad91606db1ade9fe8f021ef7dbbe879a.

Reason for revert:
Findit (https://goo.gl/kROfz5) identified this CL at revision b1e26665ad91606db1ade9fe8f021ef7dbbe879a as
the culprit for failures in the continuous build including:

Sample Failed Build: https://ci.chromium.org/b/8813697873572499617
Sample Failed Step: compile

If it is a false positive, please report it at https://bugs.chromium.org/p/chromium/issues/entry?status=Available&comment=Datastore+key+for+the+culprit+entity%3A+chromium.googlesource.com%2Fchromium%2Fsrc%2Frefs%2Fheads%2Fmain%2Fb1e26665ad91606db1ade9fe8f021ef7dbbe879a&labels=Test-Findit-Wrong&components=Tools%3ETest%3EFindIt&summary=Wrongly+blame+b1e26665ad91606db1ade9fe8f021ef7dbbe879a

Original change's description:
> Android: Make TrichromeLibrary.apk have no classes.dex
>
> Moves NativeLibraries class from the library to chrome/webview apks.
>
> This will allow better R8 optimization of the class, and should also
> hopefully result in better performance since the library should no
> longer need to be included in classloader lookups.
>
> Bug: 1319967
> Change-Id: I2c5908e6c575c9bce8c606506779e7db89f3269a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650992
> Reviewed-by: Richard Coles <torne@chromium.org>
> Reviewed-by: Peter Wen <wnwen@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1005425}

Change-Id: Ief1ae992169e351c2f70dcb6da8adb234e5106a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1319967
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3656342
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1005577}
NOKEYCHECK=True
GitOrigin-RevId: 293df39872b775e1223c86c1a6863f50f06c4fbc
diff --git a/android/rules.gni b/android/rules.gni
index 6c11994..1a9b373 100644
--- a/android/rules.gni
+++ b/android/rules.gni
@@ -2133,7 +2133,6 @@
   #     uncompressed in the APK. Must be unset or true if load_library_from_apk
   #     is set to true.
   #   uncompress_dex: Store final .dex files uncompressed in the apk.
-  #   omit_dex: If true, do not build or include classes.dex.
   #   strip_resource_names: True if resource names should be stripped from the
   #     resources.arsc file in the apk or module.
   #   strip_unused_resources: True if unused resources should be stripped from
@@ -2216,7 +2215,6 @@
           defined(invoker.is_base_module) && invoker.is_base_module
     }
 
-    _omit_dex = defined(invoker.omit_dex) && invoker.omit_dex
     _enable_multidex =
         !defined(invoker.enable_multidex) || invoker.enable_multidex
 
@@ -2360,13 +2358,12 @@
     _rebased_build_config = rebase_path(_build_config, root_build_dir)
     assert(_rebased_build_config != "")  # Mark as used.
 
-    _generate_buildconfig_java = !defined(invoker.apk_under_test) && !_omit_dex
+    _generate_buildconfig_java = !defined(invoker.apk_under_test)
     if (defined(invoker.generate_buildconfig_java)) {
       _generate_buildconfig_java = invoker.generate_buildconfig_java
     }
 
-    _generate_productconfig_java =
-        defined(invoker.product_config_java_packages) && !_omit_dex
+    _generate_productconfig_java = defined(invoker.product_config_java_packages)
 
     # JNI generation usually goes hand-in-hand with buildconfig generation.
     _generate_final_jni = _generate_buildconfig_java
@@ -2430,7 +2427,7 @@
       _incremental_apk_path = "${_final_apk_path_no_ext}_incremental.apk"
     }
 
-    if (!_incremental_apk && !_omit_dex) {
+    if (!_incremental_apk) {
       # Bundle modules don't build the dex here, but need to write this path
       # to their .build_config.json file.
       if (_proguard_enabled) {
@@ -2687,9 +2684,8 @@
     } else {
       _generate_native_libraries_java =
           (!_is_bundle_module || _is_base_module) &&
-          (_native_libs_deps != [] || _secondary_abi_native_libs_deps != [] ||
-           defined(invoker.static_library_provider)) &&
-          !_uses_static_library_synchronized_proguard && !_omit_dex
+          (_native_libs_deps != [] || _secondary_abi_native_libs_deps != []) &&
+          !_uses_static_library_synchronized_proguard
     }
     if (_generate_native_libraries_java) {
       write_native_libraries_java("${_template_name}__native_libraries") {
@@ -2698,17 +2694,7 @@
         # Do not add a dep on the generated_file target in order to avoid having
         # to build the native libraries before this target. The dependency is
         # instead captured via a depfile.
-        if (_uses_static_library) {
-          _prefix = get_label_info(invoker.static_library_provider,
-                                   "target_gen_dir") + "/" +
-                    get_label_info(invoker.static_library_provider, "name")
-          if (defined(invoker.static_library_provider_use_secondary_abi) &&
-              invoker.static_library_provider_use_secondary_abi) {
-            native_libraries_list_file = "${_prefix}.secondary_abi_native_libs"
-          } else {
-            native_libraries_list_file = "${_prefix}.native_libs"
-          }
-        } else if (_native_libs_deps != []) {
+        if (_native_libs_deps != []) {
           native_libraries_list_file = _shared_library_list_file
         } else {
           native_libraries_list_file = _secondary_abi_shared_library_list_file
@@ -2804,15 +2790,14 @@
                  ])
     }
 
+    _java_target = "${_template_name}__java"
+
     if (_is_bundle_module) {
       _add_view_trace_events =
           defined(invoker.add_view_trace_events) &&
           invoker.add_view_trace_events && enable_trace_event_bytecode_rewriting
     }
 
-    # We cannot skip this target when omit_dex = true because it writes the
-    # build_config.json.
-    _java_target = "${_template_name}__java"
     java_library_impl(_java_target) {
       forward_variables_from(invoker,
                              [
@@ -2944,7 +2929,7 @@
 
     if (_uses_static_library_synchronized_proguard) {
       _final_dex_target_dep = "${invoker.static_library_provider}__dexsplitter"
-    } else if ((_is_bundle_module && _proguard_enabled) || _omit_dex) {
+    } else if (_is_bundle_module && _proguard_enabled) {
       _final_deps += [ ":$_java_target" ]
     } else if (_incremental_apk) {
       if (defined(invoker.enable_proguard_checks)) {
@@ -3220,7 +3205,7 @@
         deps = _deps + [ ":$_build_config_target" ]
 
         if ((!_proguard_enabled || _incremental_apk) &&
-            enable_jdk_library_desugaring && !_omit_dex) {
+            enable_jdk_library_desugaring) {
           _all_jdk_libs = "//build/android:all_jdk_libs"
           deps += [ _all_jdk_libs ]
           jdk_libs_dex = get_label_info(_all_jdk_libs, "target_out_dir") +
@@ -3500,7 +3485,6 @@
                                "expected_libs_and_assets_base",
                                "generate_buildconfig_java",
                                "generate_final_jni",
-                               "generate_native_libraries_java",
                                "include_size_info",
                                "input_jars_paths",
                                "use_modern_linker",
@@ -3525,7 +3509,6 @@
                                "native_lib_placeholders",
                                "never_incremental",
                                "no_xml_namespaces",
-                               "omit_dex",
                                "png_to_webp",
                                "post_process_package_resources_script",
                                "processor_args_javac",
@@ -3550,7 +3533,6 @@
                                "srcjar_deps",
                                "static_library_dependent_targets",
                                "static_library_provider",
-                               "static_library_provider_use_secondary_abi",
                                "static_library_synchronized_proguard",
                                "target_sdk_version",
                                "testonly",
@@ -3650,7 +3632,6 @@
                                "load_library_from_apk",
                                "loadable_modules",
                                "product_config_java_packages",
-                               "main_component_library",
                                "manifest_package",
                                "max_sdk_version",
                                "min_sdk_version",
@@ -3679,7 +3660,6 @@
                                "short_resource_paths",
                                "srcjar_deps",
                                "static_library_provider",
-                               "static_library_provider_use_secondary_abi",
                                "static_library_synchronized_proguard",
                                "strip_resource_names",
                                "strip_unused_resources",