Modify source code efficiency

本文档详细介绍了如何编译Froyo(Android 2.2)源代码,并提供了替换系统镜像文件system.img和userdata.img的方法。此外,还指导了如何修改应用程序如Contacts以及系统框架文件来实现定制化的Android系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这是做framework开发时我未team member写的training doc,与大家分享一下

1. compile froyo source code use make

#cdfroyo

#make #wait 3 hours

2. use the new system.img and userdata.img instead of the sdk's img,backup first

#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img.old

#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img

/yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img.old

#ln -s 7015/out/target/product/generic/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img

#ln -s 7015/out/target/product/generic/userdata.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img

then create a avd in eclipse, this avd will use the new system.img.

Start it!

3. modify apps

Change Contacts for example,change java files in packages and save.

#cd 7015

#mmm packages/apps/Contacts #wait sevaral minutes

#adb remount #after remount the /symstem in emulator will be mounted writable

use the new generated apk replace the same apk in emulator dir /system/app,you can use adb push command or push file in ddms.

#adb push out/target/product/generic/system/app/Contacts.apk /system/app

#adb push out/target/product/generic/data/app/ContactsTests.apk /system/app

4. modify framework files

Change frameworks/base/core/res/ for example

edit String.xml and save

#mmm frameworks/base/core/res/

this will generate out/target/product/generic/system/framework/framework-res.apk, then use mkyaffs2image make new system.img

#out/host/linux-x86/bin/mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system.img

restart the emulator, the new system.img will be used.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值