7

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

Patches
  • 1,423
  • 2
  • 12
  • 11
  • I don't have a ton of experience compiling apps with a ROM, but I do know you need to sign the apps with the system signature to make them system apps. Does the following link do the trick? http://stackoverflow.com/questions/3635101/how-to-sign-android-app-with-system-signature – Austyn Mahoney Apr 13 '12 at 21:00
  • Giving it a shot. I added it to the tag, hope that's the right place. Edit: OOPS adding it to the tag and retrying – Patches Apr 13 '12 at 21:08
  • You also need to sign the app with the right key, not just add that value to the manifest. – Austyn Mahoney Apr 13 '12 at 21:20
  • I'm trying to sign the app by setting LOCAL_CERTIFICATE := system in Android.mk for my app, but now it's not installing the app at all – Patches Apr 13 '12 at 21:30
  • 1
    I'm afraid make files are out of my expertise comfort zone. Someone else may be able to help you there. – Austyn Mahoney Apr 13 '12 at 21:36

4 Answers4

3

Add:

LOCAL_MODULE_PATH := system/app
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_CERTIFICATE := platform
Justin Buser
  • 2,813
  • 25
  • 32
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))
Yury
  • 20,618
  • 7
  • 58
  • 86
  • In android building all default application goes into system/app what if i want to send them in data/app ? – Jeegar Patel Aug 16 '12 at 08:55
  • please see my quetsion http://stackoverflow.com/questions/11984572/making-an-app-in-the-android-source-compile-into-data-app-instead-of-system-app – Jeegar Patel Aug 16 '12 at 09:47
0

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.

Alex
  • 2,893
  • 25
  • 24
0
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))
SAURABH_12
  • 2,262
  • 1
  • 19
  • 19