diff --git a/opt/optimize_resources/OptimizeResources.cpp b/opt/optimize_resources/OptimizeResources.cpp index 62a6fbf9e76..18680cfa247 100644 --- a/opt/optimize_resources/OptimizeResources.cpp +++ b/opt/optimize_resources/OptimizeResources.cpp @@ -403,6 +403,7 @@ void remap_resource_class_clinit( std::vector filtered_op_data_entries; uint16_t header_entry = *(op_data->data()); + int deleted_array_element_count = 0; auto array_ints = get_fill_array_data_payload(op_data); for (uint32_t entry_x : array_ints) { if (entry_x > PACKAGE_RESID_START) { @@ -419,6 +420,8 @@ void remap_resource_class_clinit( if (c_name.find("R$styleable") != std::string::npos) { filtered_op_data_entries.push_back(0); filtered_op_data_entries.push_back(0); + } else { + ++deleted_array_element_count; } } } else { @@ -615,7 +618,7 @@ void OptimizeResourcesPass::run_pass(DexStoresVector& stores, PassManager& mgr) { std::string zip_dir; conf.get_json_config().get("apk_dir", "", zip_dir); - always_assert(!zip_dir.empty()); + always_assert(zip_dir.size()); // 1. Get all known resource ID's from either resources.pb(AAB) or // resources.arsc(APK) file. diff --git a/test/integ/TypeAnalysisRemoveRedundantCmp.cpp b/test/integ/TypeAnalysisRemoveRedundantCmp.cpp index 6048b356ca7..5d8d0d28512 100644 --- a/test/integ/TypeAnalysisRemoveRedundantCmp.cpp +++ b/test/integ/TypeAnalysisRemoveRedundantCmp.cpp @@ -48,12 +48,16 @@ TEST_F(TypeAnalysisTransformTest, MethodHasNoEqDefined) { DexMethod::get_method( "LTypeAnalysisRemoveRedundantCmp;.getYy:()Ljava/lang/String;") ->as_def(); + bool found_cmpz = false; auto codey = y_method->get_code(); ASSERT_NE(nullptr, codey); auto jj = InstructionIterable(y_method->get_code()); auto end2 = jj.end(); for (auto it = jj.begin(); it != end2; ++it) { auto insn = it->insn; + if (insn->opcode() == OPCODE_IF_EQZ || insn->opcode() == OPCODE_IF_NEZ) { + found_cmpz = true; + } } } diff --git a/tools/redex-tool/Verifier.cpp b/tools/redex-tool/Verifier.cpp index e35fd34a69e..96a0f349333 100644 --- a/tools/redex-tool/Verifier.cpp +++ b/tools/redex-tool/Verifier.cpp @@ -127,6 +127,10 @@ void verify(DexStoresVector& stores) { } build_refs(scope, class_refs); } + int references = 0; + for (const auto& refs : class_refs) { + references += (int)refs.second.size(); + } // Build allowed stor (references) map allowed_store_map_t allowed_store_map;