您的位置:首页 > 移动开发 > Android开发

TaintDroid下载预编译(五):TaintDroid(Android)系统编译虚拟机和真机測试

2017-08-08 20:54 549 查看

光说不练非好汉,如今就让我们开启自己编译的系统測试!事实上懂得这些过程。就知道了Android手机系统定制的整个流程。现有的智能机都是使用Google的android开源的系统然后加入一些自己的东西。就成为公司的系统!

TaintDroid(Android)虚拟机上測试

我们前面讲了怎样编译,编译的成功的标识就是生成system.img文件,例如以下图:


sdk替换
拷贝system.img镜像文件,替换掉sdk中的镜像。例如以下图:



对于创建AVD非常easy,这里几张图就能够看懂。





点击start就能够启动该虚拟机。

Api一定是调用18的,由于该接口是我们编译生成的system.img

执行TaintDroid!这里我对该应用进行了改动,使其能够生成日志文件!



已经測试成功。

TaintDroid(Android)在真机上測试

在真机上比較复杂,须要下载驱动。我測试的手机是Galaxy Nexus i9250所下面载例如以下驱动
% 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
開始进行编译! 打开build/target/product/core.mk加入内容
PRODUCT_PACKAGES += \
BasicDreams \
...
voip-common \
TaintDroidNotify
又一次编译
% . build/envsetup.sh
% lunch 12
% make clean
% make -j4
開始进行刷机 首先对手机fastboot状态调成UNCLOSE
% fastboot oem unlock




进行刷机!
% cd out/target/product/maguro
% fastboot flash boot boot.img
% fastboot flash system system.img
% fastboot flash userdata userdata.img

例如以下图:
測试结果






至此。实验最终完毕了!

总结

看着图片非常easy,操作起来相当麻烦!

编译错误,刷机错误。反正一点一点调吧!整个过程走下来,至少还是能学点东西的!!

(驱动一定要符合手机,否则刷机的開始也是板砖的開始。变板之后再想恢复,对于google手机比較难。假设SD卡外置就相当简单,可我实验的机子都是内置的SD卡~~~) 祝大家学习愉快!











内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: