bugreport命令、dumpstate服务
来源:互联网 发布:金蝶软件引出数据失败 编辑:程序博客网 时间:2024/05/08 14:10
android 5.0 源码
1、/system/core/rootdir/Init.rc
service dumpstate /system/bin/dumpstate -s =》linux服务进程
class main
socket dumpstate stream 0660 shell log
disabled
oneshot
2、对应/framework/native/cmds/dumpstate/Dumpstate.c
int main(int argc, char *argv[]) {
......
if (getuid() != 0) {
// Old versions of the adb client would call the dumpstate command directly. Newer clients call /system/bin/bugreport instead.
// If we detect we're being called incorrectly, then exec the correct program.
return execl("/system/bin/bugreport", "/system/bin/bugreport", NULL);
}
......
dumpstate();
/* tell activity manager we're done */ =》广播通知AM,已经结束?
if (do_broadcast && use_outfile && do_fb) {
run_command(NULL, 5, "/system/bin/am", "broadcast", "--user", "0",
"-a", "android.intent.action.BUGREPORT_FINISHED",
"--es", "android.intent.extra.BUGREPORT", path,
"--es", "android.intent.extra.SCREENSHOT", screenshot_path,
"--receiver-permission", "android.permission.DUMP", NULL);
}
......
}
/* dumps the current system state to stdout */
static void dumpstate() { ...... }
3、对应/framework/native/cmds/bugreport/Bugreport.c
说明,bugreport命令,是在dumpstate服务外面包装了一层,通过socket连接dumpstate服务。
int main(int argc, char *argv[]) {
......
/* start the dumpstate service */
property_set("ctl.start", "dumpstate");
/* socket will not be available until service starts */
for (i = 0; i < 20; i++) {
s = socket_local_client("dumpstate",
ANDROID_SOCKET_NAMESPACE_RESERVED,
SOCK_STREAM);
if (s >= 0)
break;
/* try again in 1 second */
sleep(1);
}
......
}
参考:
http://blog.csdn.net/kevinx_xu/article/details/26253969
http://blog.csdn.net/chenzhiqin20/article/details/12506227
- bugreport命令、dumpstate服务
- dumpstate命令
- bugreport
- bugreport
- android bugreport.
- android bugreport. .
- 分析bugreport
- Android dumpstate 工具解析
- Android dumpstate 工具解析
- Android dumpstate 工具解析
- Android之dumpstate
- Android dumpstate 工具解析
- Android dumpstate 工具解析
- Android dumpstate 工具解析
- Android学习系列(29)--App调试的几个命令实践 bugreport
- writing dumpstate to file android
- dumpstate uid 由root-->shell
- Android Log Analysis bugreport
- 动态规划7_0-1背包
- 【SICP练习】117 练习3.44
- 冒泡排序1
- Layout_weight
- DWZ的表格行单击或者双击事件
- bugreport命令、dumpstate服务
- 转 numpy 矩阵运算[转]
- oracle 之 rownum rowid
- css06
- geohash算法求周围8个字符串 求助
- 用JMeter模拟5万用户的访问量
- .NET2.0升级.NET4.0 报未找到ORACLE组件
- Cassandra与mycat的特点分析比较
- 【SICP练习】118 练习3.45【待完成】