aapt For only one string and one integer in 2 configs

For only one string and one integer in 2 configs:

values/string.xml:

<resources>
    	<string name="app_name">my app1</string>
    	<integer name="num">123</integer>
</resources>

values-zh/string.xml:

<resources>
    	<string name="app_name">系统</string>
</resources>

bash:

m  out/host/linux-x86/bin/aapt2 ;  cp   /home/andy/aosp13/out/host/linux-x86/bin/aapt  /home/andy/aosp13/out/host/linux-x86/bin/aapt2   /home/andy/Android/Sdk/build-tools/34.0.0/;  aapt2  link  -o output.ap_  --manifest /home/andy/Desktop/dongganapp2/app/src/main/AndroidManifest.xml    -I   ~/Android/Sdk/platforms/android-34/android.jar  -R  /home/andy/Desktop/dongganapp2/app/src/main/values_strings.arsc.flat      /home/andy/Desktop/dongganapp2/app/src/main/values-zh_strings.arsc.flat           --auto-add-overlay

TableFlattener#buffer_ (type is BigBuffer) size : 836

total size = ResTable_header(12) + StringPool(56) + Package_buffer(768) = 836

Package_buffer = ResTable_package(288) + type_pool_(72) + key_pool(56) + type_buffer(228)(string)+type_buffer(124)(integer)= 768

string type:

type_buffer = ResTable_typeSpec(16) + num_entries*4(1) + FlattenConfig(104) * 2 = 228

FlattenConfig = ResTable_type(84) + values_buffer(16) + num_total_entries * 4 = 104

integer type :

type_buffer = ResTable_typeSpec(16) + num_entries*4(1) + FlattenConfig(104) = 124

FlattenConfig = ResTable_type(84) + values_buffer(16) + num_total_entries * 4 = 104

ResTable_header:

/**
 * Header for a resource table.  Its data contains a series of
 * additional chunks:
 *   * A ResStringPool_header containing all table values.  This string pool
 *     contains all of the string values in the entire resource table (not
 *     the names of entries or type identifiers however).
 *   * One or more ResTable_package chunks.
 *
 * Specific entries within a resource table can be uniquely identified
 * with a single integer as defined by the ResTable_ref structure.
 */
struct ResTable_header
{
    struct ResChunk_header header;

    // The number of ResTable_package structures.
    uint32_t packageCount;
};
  • 9
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值