Chinaunix首页 | 论坛 | 博客
  • 博客访问: 70710
  • 博文数量: 83
  • 博客积分: 1320
  • 博客等级: 中尉
  • 技术积分: 805
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-20 14:54
文章分类

全部博文(83)

文章存档

2010年(83)

我的朋友

分类:

2010-08-20 19:10:37

可以定制bootanimation.zip,此文件放在两个位置: /data/local 或者/system/media,系统默认先去/system/media找。

动画是由系列图片连续刷屏实现的:

bootanimation.zip文件是zip压缩文件,压缩方式要求是存储压缩,包含一个文件和两个目录:

    1.
动画属性描述文件:desc.txt
    2.
第一阶段动画图片目录:part0
    3.
第二阶段动画图片目录:part1

desc.txt
文件内容:
    480 427 30
    p 1 0 part0
    p 0 10 part1
   
desc.txt
文件分析:
    480  427   30
     
       帧数
      p         1              0                      part0
   
标志符 循环次数 阶段切换间隔时间  对应目录名
      p         0             10                     part1
   
标志符 循环次数 阶段切换间隔时间  对应目录名

    ==================
   
标志符:
        
必须是: p

   
循环次数:
        0 :
表示本阶段无限循环

   
阶段切换间隔时间:
        
单位是一个帧的持续时间,比如帧数是30,那么帧的持续时间就是1/30 = 33.3毫秒。
        
阶段切换间隔时间期间开机动画进程进入休眠,把CPU时间让给初始化系统使用。
        
也就是间隔长启动会快,但会影响动画效果。

part0
part1目录内包含的是两个动画的系列图片,图片为PNG格式。

系列图片文件的加载刷新按文件名的名称排序。

The statup animation means the one you see before the launcher application comes out.
It was a line with a red point goes from left to right again and again before, in Android 1.0. Currently, on cupcake, it’s a text string, “ANDROID”, with shine goes from left to right.
I found someone add an advertisement logo to that animation in a customized rom. So I studied how to remove that, or make a new one by myself.
Finally, I found it out. There are 2 pictures under
frameworks/base/core/res/assets/images:
android-logo-mask.png
android-logo-shine.png

The 1st one is the background. Then, you can edit it with picture editor, like add your own name on it.
Well, after edited it, you need to build framework-res out, with command “make framework-res”. Then, you will get a new framework-res.apk. But usually, you can not use this file to replace the one in the rom/firmware for real devices, like G1, G2. Since, some resources are not under the same version.
What I do is pull out the original framework-res.apk from the rom. Unzip both this framework-res.apk and the one I made by myself. Replace the 2 pictures under assests/images with the one I made before. Notice, you can not replace the files with the PNG files you edited, but not compiled.
Then zip out framework-res.apk again, and sign with SignApk tool. Now you can use the new framework-res.apk to replace the original one.

阅读(521) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~