void TypeErasurePass::run_pass(DexStoresVector& stores, ConfigFiles& conf, PassManager& mgr) { // Type mapping file ModelMerger::s_mapping_file = conf.metafile(m_merged_type_mapping_file); Model::s_outdir = conf.get_outdir(); // Setup Interdex plugin if any models. if (m_dex_sharding_model_specs.size() > 0) { interdex::InterDexRegistry* registry = static_cast<interdex::InterDexRegistry*>( PluginRegistry::get().pass_registry(interdex::INTERDEX_PASS_NAME)); std::function<interdex::InterDexPassPlugin*()> fn = [&]() -> interdex::InterDexPassPlugin* { return new TypeErasureInterDexPlugin(m_dex_sharding_model_specs, mgr); }; registry->register_plugin("TYPE_ERASURE_PLUGIN", std::move(fn)); } if (m_model_specs.empty()) { return; } auto scope = build_class_scope(stores); Model::build_interdex_groups(&conf); for (ModelSpec& model_spec : m_model_specs) { if (!model_spec.enabled) { continue; } handle_interface_as_root(model_spec, scope, stores); erase_model(model_spec, scope, mgr, stores, conf); } post_dexen_changes(scope, stores); }