問題一,在android源碼中添加本身的app源碼,並可以編譯,只須要把app源碼拷貝到packages/apps/ 下面,裏面須要添加一個android.mk 文件,可一看其餘app 寫出android.mk
java
我這樣寫的android
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := blacklist
#LOCAL_SDK_VERSION := current
#LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)
# Use the folloing include to make our test apk.
#include $(call all-makefiles-under,$(LOCAL_PATH))app
這樣就能夠採用mmm命令進行編譯,而且編譯過生成的apk和其餘apk在一個文件夾下,成爲系統應用ide
這個app實現添加禁止安裝app的包名,而後同過contentprovider工packageinstaller查詢,這樣就能夠實現禁止安裝的做用。源碼