linux-based operating system with market share about 70% in smartphones.
and also available on tablets, smart TV, and PC.
linux kernel layer (内核层)
HAL, MM, security, power management, drivers and network
Native Libraries2
安卓核心库 下面的 Java libraries(Dalvik VM) (dex, dx)
App
system installed (/system/app) and user installed(/data/app)
/system/app: 例
% ll | more
-rw-r--r-- 1 0 0 176828 May 26 08:27 AccessControl.apk
-rw-r--r-- 1 0 0 77072 May 26 08:27 AccessControl.odex
-rw-r--r-- 1 0 0 7303660 May 26 08:27 AccuweatherPhone2013.apk
-rw-r--r-- 1 0 0 1354088 May 26 08:27 AccuweatherPhone2013.odex
-rw-r--r-- 1 0 0 440384 May 26 08:27 AlarmWidget.apk
-rw-r--r-- 1 0 0 47184 May 26 08:27 AlarmWidget.odex
-rw-r--r-- 1 0 0 5839152 May 26 08:27 AllShareCastPlayer.apk
-rw-r--r-- 1 0 0 43832 May 26 08:27 AllShareCastPlayer.odex
-rw-r--r-- 1 0 0 44180741 May 26 08:27 AllSharePlay15.apk
-rw-r--r-- 1 0 0 311326 May 26 08:27 AllshareControlShare.apk
-rw-r--r-- 1 0 0 30965 May 26 08:27 AllshareFileShare.apk
-rw-r--r-- 1 0 0 122056 May 26 08:27 AllshareFileShare.odex
-rw-r--r-- 1 0 0 273140 May 26 08:27 AllshareFileShareClient.apk
-rw-r--r-- 1 0 0 158520 May 26 08:27 AllshareFileShareClient.odex
-rw-r--r-- 1 0 0 726886 May 26 08:27 AllshareFileShareServer.apk
-rw-r--r-- 1 0 0 127296 May 26 08:27 AllshareFileShareServer.odex
-rw-r--r-- 1 0 0 499324 May 26 08:27 AllshareMediaServer.apk
-rw-r--r-- 1 0 0 541208 May 26 08:27 AllshareMediaServer.odex
-rw-r--r-- 1 0 0 855845 May 26 08:27 AllshareMediaShare.apk
-rw-r--r-- 1 0 0 383224 May 26 08:27 AllshareMediaShare.odex
-rw-r--r-- 1 0 0 16032 Jan 10 2013 ApplicationsProvider.apk
-rw-r--r-- 1 0 0 24760 May 26 08:27 ApplicationsProvider.odex
/data/app 例
/data/app # ll | more
-rw-r--r-- 1 1000 1000 51321456 Jun 22 12:34 air.com.adviceappgroup.hssen-1.apk
-rw-r--r-- 1 1000 1000 3484531 Sep 19 00:52 alexcrusher.just6weeks.full-1.apk
-rw-r--r-- 1 1000 1000 361900 Sep 19 00:49 com.alipay.android.app-1.apk
-rw-r--r-- 1 1000 1000 27807439 Sep 19 06:07 com.android.chrome-1.apk
-rw-r--r-- 1 1000 1000 3138225 Sep 18 13:51 com.anjuke.android.haozu-1.apk
-rw-r--r-- 1 1000 1000 11545898 Sep 18 13:52 com.baidu.BaiduMap-1.apk
-rw-r--r-- 1 1000 1000 22024612 Sep 20 13:53 com.blackbean.cnmeach-2.apk
-rw-r--r-- 1 1000 1000 2582062 Jan 1 2013 com.bst.ncr-1.apk
-rw-r--r-- 1 1000 1000 6698634 Jun 20 00:18 com.codegent.apps.learn.spanish-1.apk
-rw-r--r-- 1 1000 1000 6717596 Sep 19 06:09 com.google.android.apps.maps-1.apk
-rw-r--r-- 1 1000 1000 4223047 Sep 19 15:09 com.google.android.gm-1.apk
-rw-r--r-- 1 1000 1000 8180634 Sep 22 23:50 com.google.android.gms-2.apk
-rw-r--r-- 1 1000 1000 10692252 Sep 19 06:00 com.google.android.inputmethod.pinyin-1.apk
-rw-r--r-- 1 1000 1000 2321797 Sep 19 13:27 com.google.android.voicesearch-1.apk
-rw-r--r-- 1 1000 1000 2873408 Sep 19 08:59 com.hp.android.printservice-2.apk
-rw-r--r-- 1 1000 1000 9931928 Sep 18 13:49 com.ifeng.newvideo-2.apk
core code:
binder(IPC)
ashmem (shared memory mechanism)
logger
timestamps
peroformance/power:
wakelock
low-memory killer
cpu frequency governor
and much more 300 android patches for the kernel.
based on linux kernel
a user-based permission model(读写执行等权限)
process isolation(sandboxing)
externsible mechanism for secure ipc
mandatory application sandbox for all apps.
Secure IPC
contentproviders, intents, binder/IPC, local sockets, or the file system.
Application signing
based on Java's Jar specification.
application-defined and user-granted
app statically declare
no support for dynamic(run-time) granting of permissions(?)
special permissions:
文件:
/system/etc/permissions/platform.xml
This file is used to define the mappings between lower-level system
user and group IDs and the higher-level permission names managed
by the platform.
Be VERY careful when editing this file! Mistakes made here can open
big security holes.
android file-dectory structure
based on linux /dev, /proc, /sys
android added
/system read-only
/data read-write
/cache temp
boot
/init --> parse file(init.rc)
init.rc file:
# Backward compatibility
symlink /system/etc /etc
symlink /sys/kernel/debug /d
# Right now vendor lives on the same filesystem as system,
# but someday that may change.
symlink /system/vendor /vendor