标签:android style blog http java color
1, 如何将带源码的 APK 预置进系统?
2, 如何将无源码的APK预置进系统?
3, 如何预置APK使得用户可以卸载,恢复出厂设置时不能恢复?
4, 如何预置APK使得用户可以卸载,并且恢复出厂设置时能够恢复?
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := Test include $(BUILD_PACKAGE)4) 打开文件 build/target/product/${Project}.mk (其中 ${Project} 表示工程名)
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed LOCAL_MODULE := Test LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_CERTIFICATE := PRESIGNED include $(BUILD_PREBUILT)
4) 打开文件 build/target/product/${Project}.mk (其中 ${Project} 表示工程名)
将 Test 添加到 PRODUCT_PACKAGES 里面。
5) 将从Test.apk解压出来的 so库拷贝到alps/vendor/mediatek/${Project}/artifacts/out/target/product/${Project}/system/lib/目录下,若无 so 库,则去掉此步;
6) 重新 build 整个工程
注:Google在KK上修改protection Level为System的permission控管机制
如果App使用System Level的permission,需要預置到/system/priv-app底下 (原在/system/app)。
举例来讲:
关于获取副SD卡的写入权限的案例,App需要在AndroidManifest.xml宣告WRITE_MEDIA_STORAGE permission获取副卡的写入权限
(Ref: KK/alps/frameworks/base/core/res/AndroidManifest.xml)
已知android.permission.WRITE_MEDIA_STORAGE属于SystemOrSignature level的permission,定义如下:
KK上,您需要采用以下方法,获取该permission:
修改Android.mk,增加LOCAL_PRIVILEGED_MODULE := true,以声明app需要放在/system/priv-app下。
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed LOCAL_MODULE := Test LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_CERTIFICATE := PRESIGNED <span style="color:#ff0000;">LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)</span> include $(BUILD_PREBUILT)
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed LOCAL_MODULE := Test LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_CERTIFICATE := PRESIGNED <span style="color:#ff0000;">LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/operator/app</span> include $(BUILD_PREBUILT)3) 打开文件 build/target/product/${Project}.mk (其中 ${Project} 表示工程名), 将 Test 添加到 PRODUCT_PACKAGES 里面
如何预置Android 手机 APK,布布扣,bubuko.com
标签:android style blog http java color
原文地址:http://blog.csdn.net/wjky2014/article/details/38042945