这里先初步看一下做odex优化的几个地方,以后再补充详细过程
一、installd的变化
首先回忆一下在7.0中installd是如何启动的:
在installd.rc中:
service installd /system/bin/installd
class main
socket installd stream 600 system system
这里启动installd的同时还启动了一个socket,在installd.cpp中有获取这个socket的地方android_get_control_socket
由于已经过时,其它的不再说了,下面看看8.0中是如何启动的:
在installd.rc中:
service installd /system/bin/installd
class main
只是启动installd,进入installd看一下
[installd.cpp]
int main(const int argc, char *argv[]) {
return android::installd::installd_main(argc, argv);
}
static int installd_main(const int argc ATTRIBUTE_UNUSED, char *argv[]) {
……
if ((ret = InstalldNativeService::start()) != android::OK) {
SLOGE("Unable to start InstalldNativeService: %d", ret);
exit(1);
}
IPCThreadState::