dx StringId StringData的生成
来源:互联网 发布:腾讯游戏数据分析岗位 编辑:程序博客网 时间:2024/06/06 09:47
String Id的生成
131 sections =new Section[] {
132 header,stringIds, typeIds, protoIds, fieldIds, methodIds,
133 classDefs, wordData, typeLists, stringData, byteData,
134 classData, map };
com/android/dx/dex/file/StringIdsSection.java
100 public StringIdItem intern(Stringstring) {
101 return intern(new StringIdItem(new CstString(string)));
102 }
104 /**
105 * Interns an element into this instance.
106 *
107 * @param string {@code non-null;} the string to intern, as a constant
108 * @return {@code non-null;} the interned string
109 */
110 public StringIdItem intern(CstStringstring) {
111 return intern(new StringIdItem(string));
112 }
113
114 /**
115 * Interns an element into this instance.
116 *
117 * @param string {@code non-null;} the string to intern
118 * @return {@code non-null;} the interned string
119 */
120 public StringIdItem intern(StringIdItemstring) {
121 if (string == null) {
122 throw newNullPointerException("string == null");
123 }
124
125 throwIfPrepared();
126
127 CstStringvalue = string.getValue();
128 StringIdItem already = strings.get(value);
129
130 if (already != null) {
131 return already;
132 }
133
134 strings.put(value, string);
135 return string;
136 }
StringData的生成
492 privateByteArrayAnnotatedOutput toDex0(boolean annotate,
493 boolean verbose){
500 classDefs.prepare();
501 classData.prepare();
502 wordData.prepare();
503 byteData.prepare();
504 methodIds.prepare();
505 fieldIds.prepare();
506 protoIds.prepare();
507 typeLists.prepare();
508 typeIds.prepare();
509 stringIds.prepare();
510 stringData.prepare();
511 header.prepare();
Section.java
211 public final voidprepare() {
212 throwIfPrepared();
213 prepare0();
214 prepared = true;
215 }
com/android/dx/dex/file/UniformItemSection.java
69 protected final void prepare0(){
70 DexFile file = getFile();
71
72 orderItems();
73
74 for (Item one : items()) {
75 one.addContents(file);
76 }
77 }
com/android/dx/dex/file/StringIdItem.java
86 public void addContents(DexFilefile) {
87 if (data == null) {
88 // The string data hasn't yet beenadded, so add it.
89 MixedItemSection stringData =file.getStringData();
90 data = new StringDataItem(value);
91 stringData.add(data);
92 }
93 }
com/android/dx/dex/file/StringDataItem.java
37 public StringDataItem(CstString value) {
38 super(1, writeSize(value));
39
40 this.value = value;
41 }
42
43 /**
44 * Gets the write size for a given value.
45 *
46 *@param value {@code non-null;} the string value
47 * @return {@code >= 2}; the write size, in bytes
48 */
49 private static int writeSize(CstStringvalue) {
50 int utf16Size = value.getUtf16Size();
51
52 // The +1 is for the '\0' terminationbyte.
53 returnLeb128.unsignedLeb128Size(utf16Size)
54 + value.getUtf8Size() + 1;
55 }
- dx StringId StringData的生成
- 2dx下生成我的图片名字声明
- DX的两个Bug
- dx Classdef的写入
- dx 工具的使用
- eclipse的dx问题
- DX
- dx 生成 DEX文件流程分析
- 设置DX SDK的路径
- 游戏DX接管的研究
- DX几个图片格式的细节
- OpenGL 与 DX的争论
- OpenGL 与 DX的争论
- OpenGL 与 DX的争论
- DX锁屏后设备的恢复
- 2dx JniHelper的使用
- Dx 10 与 Dx 9 的一些技术区别
- [dx] 启用dx 和 基本绘制所需的步骤
- HTML5基础小结(二)——标签小例
- Android 实现自定义多级树控件和全选与反选的效果
- 排序算法之二----冒泡排序
- NSSplitView 左右滑动时,两边的Control同时改变大小
- 编程求一元二次方程
- dx StringId StringData的生成
- NYOJ-123士兵杀敌(四)【线段树】
- easyui datagrid中插入一行数据注意一点
- Selenium学习(一):FireFox怎么设置审查元素
- 近期开发工作的一点心得体会
- apache AH01630: client denied by server configuration错误解决方法
- 【Unix 网络编程】服务器网络编程模型——多线程并发模型
- 背包九讲笔记
- 仲享登录界面html 采用table实现布局