Making an app in the Android Source compile into system/app instead of data/app?

岁酱吖の 提交于 2019-12-04 21:16:30

问题


I'm compiling an Android ROM from source, and I have several apps that compile, but into data/app on the phone. They're uninstallable through the phone settings. I want them to be impossible to uninstall from the phone, and to compile into system/app instead of data/app.

Any advice?

edit:typo


回答1:


Add:

LOCAL_MODULE_PATH := system/app
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_CERTIFICATE := platform



回答2:


Here is an example of mk file that you can use. In my case the application is then build into system/app:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := package_name
LOCAL_CERTIFICATE := platform

include $(BUILD_PACKAGE)

# Use the folloing include to make our test app
include $(call all-makefiles-under,$(LOCAL_PATH))



回答3:


With cm_10.2, I added my app into packages/apps and by default, mm built it into /data/app. I wanted it into system/app. It worked by adding this into Android.mk :

LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)

But I'm not sure if it's a clean way to proceed since I almost found nobody doing that.




回答4:


LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
LOCAL_CERTIFICATE := platform

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := MyTestApp

LOCAL_PROGUARD_ENABLED := disabled
LOCAL_PRIVILEGED_MODULE := true

LOCAL_STATIC_JAVA_LIBRARIES := libarity android-support-v4

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))


来源:https://stackoverflow.com/questions/10148171/making-an-app-in-the-android-source-compile-into-system-app-instead-of-data-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!