gpt4 book ai didi

java - Android Dex文件中的 'String count'是什么意思?

转载 作者:太空狗 更新时间:2023-10-29 16:16:13 25 4
gpt4 key购买 nike

来自 adt-21-preview DOC

Building

There's a new flag to force "jumbo mode" for dex which allows a larger number of strings in the dex files; set dex.force.jumbo=true in project.properties

我红了这个what-are-the-dex-method-and-string-limits-in-an-android-app同样,@SamWise 回答:

With jumbo dex on, the string reference limit is somewhere between 110K and 120K.

问题:

Dex 中的StringString reference 是什么?他们的意思是可变长度吗?例如,如果我要写:

private String foo = "fessy";

这是否意味着 string 是 3 或值长度,在我的例子中是 5?


子问题:

我使用了以下脚本 dex-method-counts计算方法 Count 但我没有找到任何引用来计算 String 计数。

请帮忙,

最佳答案

所有字符串常量都存储在 dex 文件中的单个排序列表中。然后通过该列表中的索引在 dex 文件中的其他地方引用这些字符串。

这些字符串索引一般是一个无符号的 32 位整数。就实际指令而言,有 2 条指令可以引用字符串:const-stringconst-string/jumbo。第一个采用 16 位字符串索引,第二个采用 32 位字符串索引。

所以,字符串的最大数量是 2^32 = 4294967296

关于java - Android Dex文件中的 'String count'是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26571728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com