Skip to content

补充一点,5.x Dex文件个不能数超过100个限制的问题 #9

@0x000-0

Description

@0x000-0

根据5.x 的源码知道, classses99.dex 之后都不加载
运行会出现 ClassDefnotFound的问题。

dex_files->push_back(dex_file.release());
size_t i = 2;
 
while (i < 100) {
--
  | std::string name = StringPrintf("classes%zu.dex", i);
  | std::string fake_location = location + kMultiDexSeparator + name;
  | std::unique_ptr<const DexFile> next_dex_file(Open(zip_archive, name.c_str(), fake_location,
  | error_msg, &error_code));
  | if (next_dex_file.get() == nullptr) {
  | if (error_code != ZipOpenErrorCode::kEntryNotFound) {
  | LOG(WARNING) << error_msg;
  | }
  | break;
  | } else {
  | dex_files->push_back(next_dex_file.release());
  | }
  |  
  | i++;
  | }
  |  
  | return true;
  | }

push_back 只执行了99次,文件里有classes100.dex的时候,这个就被丢掉了
别问我为什么知道,脸上带着淡然看破的微笑

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions