解压静态库.a文件
2015-11-25 11:28
211 查看
首先先准备一个静态库.a文件,比如叫staticLibrary.a,放在桌面的test目录里。
首先先
可以看到该文件包含两种arch,分别是armv7和arm64。
由于下面抽离object的时候必须是要单一的库,所以这里我们之抽出armv7并命名为v7.a:
这时候应该在test目录下多了一个v7.a文件。
你会发现会多出一些.o文件
比如刚才多出来了一个View.o文件,使用以下命令进行获取:
OK 去看一下view.m文件吧
分离arch
首先先file一下staticLibrary.a,看一下该文件包含几种arch。
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">~ cd Desktop/test test ls staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span> test <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">file</span> staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span> staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span>: Mach-O universal binary <span class="hljs-operator" style="box-sizing: border-box;">with</span> <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> architectures staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> architecture armv7): current ar archive <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">random</span> library staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> architecture arm64): current ar archive <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">random</span> library</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li></ul>
可以看到该文件包含两种arch,分别是armv7和arm64。
由于下面抽离object的时候必须是要单一的库,所以这里我们之抽出armv7并命名为v7.a:
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">lipo staticLibrary.<span class="hljs-operator" style="box-sizing: border-box;">a</span> -thin armv7 -output v7.<span class="hljs-operator" style="box-sizing: border-box;">a</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
这时候应该在test目录下多了一个v7.a文件。
抽离.a文件的object
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">ar -x v7.<span class="hljs-operator" style="box-sizing: border-box;">a</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
你会发现会多出一些.o文件
获取文件
比如刚才多出来了一个View.o文件,使用以下命令进行获取:<code class="hljs avrasm has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">nm View<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.o</span> > view<span class="hljs-preprocessor" style="color: rgb(68, 68, 68); box-sizing: border-box;">.m</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
OK 去看一下view.m文件吧
相关文章推荐
- 如何使用免费控件将Word表格中的数据导入到Excel中
- 如何用Fiddler对Android应用进行抓包
- C#中 += (s, e) => 这些字符什么意思
- mysql 对取当前日期周一和周日语句的详细解析
- python基础知识小结之集合
- java上转型
- 【NCRE项目】C#实现TabControl切换打开不同文件夹
- QSettings 与中文(反斜杠 转义)
- CentOS安装Code::Blocks
- GCD实现倒计时
- php工程师的发展
- Android端百度地图API使用详解
- jedispool 连 redis 高并发卡死 解决方案
- Android官方文档阅读之旅——Animation and Graphics Overview 动画与图形概述
- kphp框架学习之html5的video视频标签学习总结
- PHP5 mcrypt php5enmod
- PhoneGap/Cordova 远程页面无法访问
- group by 多个条件进行分组
- 任务时间表问题
- Jackson框架提供的JsonGenerator ObjectMapper以及JSONObject 、JSONArray学习