光说不练非好汉,如今就让我们开启自己编译的系统測试!事实上懂得这些过程。就知道了Android手机系统定制的整个流程。现有的智能机都是使用Google的android开源的系统然后加入一些自己的东西。就成为公司的系统!
TaintDroid(Android)虚拟机上測试
我们前面讲了怎样编译,编译的成功的标识就是生成system.img文件,例如以下图:
sdk替换
拷贝system.img镜像文件,替换掉sdk中的镜像。例如以下图:
对于创建AVD非常easy,这里几张图就能够看懂。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
点击start就能够启动该虚拟机。
Api一定是调用18的,由于该接口是我们编译生成的system.img
执行TaintDroid!这里我对该应用进行了改动,使其能够生成日志文件!
已经測试成功。
TaintDroid(Android)在真机上測试
% cd ~/tdroid/tdroid-4.3_r1
% wget https://dl.google.com/dl/android/aosp/broadcom-maguro-jwr66y-5fa7715b.tgz
% tar -zxvf broadcom-maguro-jwr66y-5fa7715b.tgz
% ./extract-broadcom-maguro.sh # (view the license and then type "I ACCEPT")
...
% wget https://dl.google.com/dl/android/aosp/imgtec-maguro-jwr66y-b0a4a1ef.tgz
% tar -zxvf imgtec-maguro-jwr66y-b0a4a1ef.tgz
% ./extract-imgtec-maguro.sh # (view the license and then type "I ACCEPT")
...
% wget https://dl.google.com/dl/android/aosp/invensense-maguro-jwr66y-e0d2e531.tgz
% tar -zxvf invensense-maguro-jwr66y-e0d2e531.tgz
% ./extract-invensense-maguro.sh # (view the license and then type "I ACCEPT")
...
% wget https://dl.google.com/dl/android/aosp/nxp-maguro-jwr66y-d8ac2804.tgz
% tar -zxvf nxp-maguro-jwr66y-d8ac2804.tgz
% ./extract-nxp-maguro.sh # (view the license and then type "I ACCEPT")
...
% wget https://dl.google.com/dl/android/aosp/samsung-maguro-jwr66y-fb8f93b6.tgz
% tar -zxvf samsung-maguro-jwr66y-fb8f93b6.tgz
% ./extract-samsung-maguro.sh # (view the license and then type "I ACCEPT")
...
% wget https://dl.google.com/dl/android/aosp/widevine-maguro-jwr66y-c49927ce.tgz
% tar -zxvf widevine-maguro-jwr66y-c49927ce.tgz
% ./extract-widevine-maguro.sh # (view the license and then type "I ACCEPT")
建立buildspec.mk文件并输入下面内容!
% cd ~/tdroid/tdroid-4.3_r1
% edit/create buildspec.mk
# Enable core taint tracking logic (always add this)
WITH_TAINT_TRACKING := true # Enable taint tracking for ODEX files (always add this)
WITH_TAINT_ODEX := true # Enable taint tracking in the "fast" (aka ASM) interpreter (recommended)
WITH_TAINT_FAST := true # Enable additional output for tracking JNI usage (not recommended)
#TAINT_JNI_LOG := true # Enable byte-granularity tracking for IPC parcels
WITH_TAINT_BYTE_PARCEL := true
開始进行编译!
PRODUCT_PACKAGES += \
BasicDreams \
...
voip-common \
TaintDroidNotify
又一次编译
% . build/envsetup.sh
% lunch 12
% make clean
% make -j4
開始进行刷机
% fastboot oem unlock
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
进行刷机!
% cd out/target/product/maguro
% fastboot flash boot boot.img
% fastboot flash system system.img
% fastboot flash userdata userdata.img
例如以下图:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
总结
编译错误,刷机错误。反正一点一点调吧!整个过程走下来,至少还是能学点东西的!!
(驱动一定要符合手机,否则刷机的開始也是板砖的開始。变板之后再想恢复,对于google手机比較难。假设SD卡外置就相当简单,可我实验的机子都是内置的SD卡~~~)
。