android-smack
来源:互联网 发布:二分查找法的算法过程 编辑:程序博客网 时间:2024/06/05 14:50
android 的源码代码是android4.04
下载jdk6.编写jdk.sh脚本如下:
- export JAVA_HOME=/home/hj/jdk6/jdk1.6.0_38
- export JAVA_BIN=/home/hj/jdk6/jdk1.6.0_38/bin
- export PATH=$JAVA_HOME/bin:$PATH
- export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
- setsebool allow_execstack=1
source ./jdk.sh
下载内核
git clone https://android.googlesource.com/kernel/goldfish.gitgit branch -rgit chechout remotes/origin/android-goldfish-2.6.29
patch -p1 < yaffs_xattr.patch
编译内核,支持smack
$ export ARCH=arm$ export SUBARCH=arm$ export CROSS_COMPILE=arm-eabi-
make goldfish_armv7_defconfig (注意不是goldfish_defconfig)
make menuconfig
vim security/smack/Kconfig (可以看到smack的依赖关系)
Symbol: SECURITY_SMACK [=n] (第四个选) │
│ Prompt: Simplified Mandatory Access Control Kernel Support │
│ Defined at security/smack/Kconfig:1 │
│ Depends on: NETLABEL && SECURITY_NETWORK │
│ Location: │
│ -> Security options
Symbol: NETLABEL [=n] (第二个选) │
│ Prompt: NetLabel subsystem support │
│ Defined at net/netlabel/Kconfig:5 │
│ Depends on: NET && INET && SECURITY │
│ Location: │
│ -> Networking support (NET [=y]) │
│ -> Networking options │
│ -> TCP/IP networking (INET [=y])
Symbol: NET [=y] │
│ Prompt: Networking support │
│ Defined at net/Kconfig:5 │
│ Selected by: SCSI_NETLINK
Symbol: INET [=y] │
│ Prompt: TCP/IP networking │
│ Defined at net/Kconfig:35 │
│ Depends on: NET │
│ Location: │
│ -> Networking support (NET [=y]) │
│ -> Networking options
Symbol: SECURITY [=n] (第一个选) │
│ Prompt: Enable different security models │
│ Defined at security/Kconfig:42 │
│ Depends on: SYSFS │
│ Location: │
│ -> Security options
Symbol: SECURITY_NETWORK [=n] (第三个选) │
│ Prompt: Socket and Networking Security Hooks │
│ Defined at security/Kconfig:62 │
│ Depends on: SECURITY │
│ Location: │
│ -> Security options
yaffs2_xattr的属性加入
yaffs_xattr和yaffs_security_labels。这些配置比较简单,都一起,不用乱找。在miscellaneous filesystem中。
make -j2
制作启动模拟器脚本
- export ANDROID_PRODUCT_OUT=/home/hj/code/yaomingyue_android404/android-4.0.4/out/target/product/generic
- export PATH=$PATH:/home/hj/code/yaomingyue_android404/android-4.0.4/out/host/linux-x86/bin
- emulator -shell-serial stdio -qemu -s -append security=smack -partition-size 256
adb shell 进入android模拟器执行脚本
- mount -o remount,rw /
- mkdir /smack
- mount -t smackfs smackfs /smack
- export PATH=/data/smack_utils:$PATH
这下可以打标签测试了:电话本位置 /data/data/com.android.providers.contacts/databases/contacts2.db
chsmack -a other contacts2.db 不能访问电话本了
chsmack -a _ contacts2.db 恢复访问电话本
echo ^ > /smack/ambient 不能上网
- Android smack
- android-smack
- Smack for Android
- Android openfire smack 源码
- Android openfire smack 源码
- Android smack send emoji
- Android+Smack+Openfire
- Android Studio 使用smack
- Android版的Smack:aSmack
- Android版的Smack:aSmack
- 用Smack开发Android即时通讯
- Smack-Android客户端入门一
- smack android集成问题记录
- smack
- smack
- smack
- Smack
- smack
- 查找目录下的所有文件中是否含有某个字符串 linux
- OpenCv学习(一) OpenCv2.4.4在VS2010中的配置
- Head First 设计模式——观察者模式(Observer Pattern) 之二
- oracle的后台进程杀掉会有什么影响
- 《TCP/IP协议详解》第十章 动态选路协议
- android-smack
- Java守护线程-没什么意义
- expect的基本用法
- 算法转载链接
- ObjC学习1-传说中的黑苹果及开发基础学习
- 关于使用vim的小技巧 (O命令延时)
- javaWeb使用servlet并且连接数据库向数据库插入数据
- 第38天的交易(2013-5-13)(-100)(-10.8)
- 流量工程与光网路