更改开机画面有两种情况:
开机时会检查mZipFileName是否为空,为空则显示frameworks\base\core\res\assets\images目录下的图片,否则显示手机的“/system/media/”目录下找到bootanimation.zip
// frameworks\base\cmds\bootanimation\BootAnimation.cpp
bool BootAnimation::threadLoop()
{
bool r;
// We have no bootanimation file, so we use the stock android logo
// animation.
if (mZipFileName.isEmpty()) {
r = android();
} else {
r = movie();
}
eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(mDisplay, mContext);
eglDestroySurface(mDisplay, mSurface);
mFlingerSurface.clear();
mFlingerSurfaceControl.clear();
eglTerminate(mDisplay);
eglReleaseThread();
IPCThreadState::self()->stopProcess();
return r;
}
1.找到frameworks\base\core\res\assets\images下面的图片,是原生系统自带的,替换图片,更改代码动态效果。
2.手机的“/system/media/”目录下找到bootanimation.zip,解压后可以看到如下文件目录:
如何制作bootanimation.zip可参考:
https://blog.csdn.net/zhaoqi2617/article/details/70170387
https://blog.csdn.net/qq_34744658/article/details/105676546
即更改完后,push到手机系统里,但是如何将bootanimation.zip在编译系统后刷机时就集成进去?
参考连接:
https://blog.csdn.net/aaa2832/article/details/7753387