Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tyzero opened this issue Mar 6, 2018 · 1 comment
Open

Comments

@tyzero
Copy link

tyzero commented Mar 6, 2018

根据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的时候,这个就被丢掉了
别问我为什么知道,脸上带着淡然看破的微笑

@tyzero
Copy link
Author

tyzero commented Mar 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant