插桩介绍

例如App有这样的网络请求代码,通常如果需要收集网络请求的信息,需要在源代码层面进行打点:

URL url = new URL("<http://www.example.com/comment>");
// 打点,建连前
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// 打点,建连后
connection.setDoOutput(true);
connection.setRequestMethod("POST");
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
// 打点,返回数据读完后

DEX插桩是基于一定规则,自动在DEX汇编代码层进行代码打点(自动插入汇编)。上述例子中DEX插桩会寻找 openConnection() 函数调用,然后自动插入DEX代码达到和源代码打点相同的效果。DEX插桩是Appetizer自主研发的核心技术,具有以下优点:

三种插桩方式

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/71dd317a-6b22-469e-8dbb-6f9a5502a513/Untitled.png

python -m pip install -r requirements.txt
python insights.py login <username> <password>
python insights.py process <apk> <processed_apk>

插桩包状态栏提示

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b29074d4-2ed6-46dc-8809-b9775a3a3d38/notification.png