androidmanifest.xml 解码工具又来一发
背景:
最近这几天在研究facebook的协议,但是facebook的采用 SSL Pinning 技术,正常通过fiddler是不能解开SSL观察协议。
听说facebook app在 manifest里面使用了android新的配置,<application android:networkSecurityConfig="@xml/network_security_config">
因此,特别想看看facebook apk的manifest,有没有这个新配置。
但是用apktool来分析facebook apk又报错,于是自己撸一个小工具吧。
官方针对 networkSecurityConfig 配置说明

简要说明,androidmanifest.xml二进制数据结构:
关于androidmanifest的定义基本在/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h 这个文件里
仔细看看这个文件发现androidmanifest文件结构很简单,不复杂。
androidmanifest.xml 头定义如下,共8个字节,后面就是独立的不同类型的chunk组成
/**
* Header that appears at the front of every data chunk in a resource.
*/
struct ResChunk_header
{
// Type identifier for this chunk. The meaning of this value depends
// on the containing chunk.
uint16_t type; // Size of the chunk header (in bytes). Adding this value to
// the address of the chunk allows you to find its associated data
// (if any).
uint16_t headerSize; // Total size of this chunk (in bytes). This is the chunkSize plus
// the size of any data associated with the chunk. Adding this value
// to the chunk allows you to completely skip its contents (including
// any child chunks). If this value is the same as chunkSize, there is
// no data associated with the chunk.
uint32_t size;
};
如 ResStringPool_header:
/** ********************************************************************
* String Pool
*
* A set of strings that can be references by others through a
* ResStringPool_ref.
*
*********************************************************************** */ /**
* Definition for a pool of strings. The data of this chunk is an
* array of uint32_t providing indices into the pool, relative to
* stringsStart. At stringsStart are all of the UTF-16 strings
* concatenated together; each starts with a uint16_t of the string's
* length and each ends with a 0x0000 terminator. If a string is >
* 32767 characters, the high bit of the length is set meaning to take
* those 15 bits as a high word and it will be followed by another
* uint16_t containing the low word.
*
* If styleCount is not zero, then immediately following the array of
* uint32_t indices into the string table is another array of indices
* into a style table starting at stylesStart. Each entry in the
* style table is an array of ResStringPool_span structures.
*/
struct ResStringPool_header
{
struct ResChunk_header header; // Number of strings in this pool (number of uint32_t indices that follow
// in the data).
uint32_t stringCount; // Number of style span arrays in the pool (number of uint32_t indices
// follow the string indices).
uint32_t styleCount; // Flags.
enum {
// If set, the string index is sorted by the string values (based
// on strcmp16()).
SORTED_FLAG = 1<<0, // String pool is encoded in UTF-8
UTF8_FLAG = 1<<8
};
uint32_t flags; // Index from header of the string data.
uint32_t stringsStart; // Index from header of the style data.
uint32_t stylesStart;
};
知道了定义,就可以很方便写一个工具来解开二进制的androidmanifest.xml,转成纯文本的androidmanifest.xml

果然在facebook里面发现了最新的安全配置 android:networkSecurityConfig。
它表示facebook是采用自己的根证书,防止中间人攻击。
因此fiddler是不能解开facebook的ssl协议,只能是patch so文件来达到这个目的了。
我的小工具:
使用的方法很简单,md 二进制androidmanifest.xml文件路径,即可以解开。
androidmanifest.xml 解码工具又来一发的更多相关文章
- [工具-004]如何从apk中提取AndroidManifest.xml并提取相应信息
跟上一篇类似,我们也需要对APK的一些诸如umengkey,ADkey,TalkingData进行验证,那么我们同样需要解压apk文件,然后提取其中的AndroidManifest.xml.然后解析x ...
- AndroidManifest.xml文件安全探索
本文作者:i春秋签约作家——icq8756c1a2 最近在做一些apk的安全检测,对AndroidManifest.xml文件进行了研究和探讨,介绍AndroidManifest.xml文件的作用和架 ...
- android-配置文件AndroidManifest.xml
AndroidManifest.xml 是每个android程序中必须的文件.它位于整个项目的根目录,描述了package中暴露的组件(activities, services, 等等),他们各自的实 ...
- 打开APK里的AndroidManifest.xml乱码
直接解压apk,打开AndroidManifest.xml显示乱码,因为这里面是二进制字符,和打开文件的编辑器无关.(也可以用ultraedit打开查看,有明文显示.只是看起来搜起来不是很方便而已) ...
- AndroidManifest.xml详解(上)
本文编辑整理自:http://blog.163.com/hero_213/blog/static/39891214201242835410742/ 一.关于AndroidManifest.xml ...
- Android学习笔记之AndroidManifest.xml文件解析(转)
//自已备注: <?xml version="1.0" encoding="utf-8"?>//说明了版本号,字符集 <manifest xm ...
- AndroidManifest.xml
一.关于AndroidManifest.xml AndroidManifest.xml 是每个android程序中必须的文件.它位于整个项目的根目录,描述了package中暴露的组件(activiti ...
- [转]AndroidManifest.xml文件详解
转自:http://www.cnblogs.com/greatverve/archive/2012/05/08/AndroidManifest-xml.html AndroidManifest.xml ...
- android基础知识13:AndroidManifest.xml文件解析
注:本文转载于:http://blog.csdn.net/xianming01/article/details/7526987 AndroidManifest.xml文件解析. 1.重要性 Andro ...
随机推荐
- CentOS下编译Lua使得其支持动态链接
在Linux下编译Lua时,我一般都是使用的make generic,这样编译没有什么问题,运行lua的程序也都OK,但是,这样在加载外部的C动态 链接库,却总是报下面的错误 dynamic libr ...
- spring bean-- autowired的正确用法
这两天用idea写spring注入的时候每一次 @Autowired Worker worker; 都会报黄,用过这个ide的都知道,说明你代码需要重构了. 然后提示的信息是 Spring Team ...
- 实现combobox模糊查询的时候报错 InvalidArgument=“0”的值对于“index”无效
因为要对combobox实现模糊查询,因为系统实现的匹配只能从左到右进行匹配,所以利用两个list来进行模糊匹配,主要代码如下: List<string> listOnit = new L ...
- 箭头函数中的this
箭头函数中的this 箭头函数根据外层(函数或者全局)作用域来决定this 这样this就像其他面向对象的语言,在哪里定义就指向哪里 function foo() { return (x) => ...
- tensorflow的reshape操作tf.reshape()
在处理图像数据的时候总会遇到输入图像的维数不符合的情况,此时tensorflow中reshape()就很好的解决了这个问题. 更为详细的可以参考官方文档说明: numpy.reshape reshap ...
- python常用函数 J
(1)join(iterable)/(2) join(str, str) (1)join()连接字符串数组.(2)os.path.join()将多个路径组合后返回. 例子:
- 【LeetCode】贪心 greedy(共38题)
[44]Wildcard Matching [45]Jump Game II (2018年11月28日,算法群衍生题) 题目背景和 55 一样的,问我能到达最后一个index的话,最少走几步. 题解: ...
- jenkins持续集成(一): 在Linux下的安装与配置
撸了今年阿里.网易和美团的面试,我有一个重要发现.......>>> 前提: 安装了JDK,并配置好环境变量:JAVA_HOME 安装了Maven,并配置好环境变量:MAVEN_HO ...
- 非阻塞套接字与IO多路复用(转,python实现版)
非阻塞:指在不能立刻得到结果之前,该函数不会阻塞当前线程,而会立刻返回.epoll工作在非阻塞模式时,才会发挥作用. 我们了解了socket之后已经知道,普通套接字实现的服务端的缺陷:一次只能服务一个 ...
- 请求体中需要的true和requests包put请求冲突了
python put请求,添加请求头 不知道怎么解决