Compiling android - trying to add XML files to /system/etc/permissions - Android Q&A, Help & Troubleshooting

I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.

Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.

Related

[Q] Building a specific apk from CM7 sources

i was trying to build framework-res.apk
i went into android_frameworks_base/core/res from terminal
theres an Android.mk file there:
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_PACKAGE_NAME := framework-res
LOCAL_CERTIFICATE := platform
# Tell aapt to create "extending (non-application)" resource IDs,
# since these resources will be used by many apps.
LOCAL_AAPT_FLAGS := -x
LOCAL_MODULE_TAGS := optional
# Install this alongside the libraries.
LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)
# Create package-export.apk, which other packages can use to get
# PRODUCT-agnostic resource data like IDs and type definitions.
LOCAL_EXPORT_PACKAGE_RESOURCES := true
include $(BUILD_PACKAGE)
# define a global intermediate target that other module may depend on.
.PHONY: framework-res-package-target
framework-res-package-target: $(LOCAL_BUILT_MODULE)
and then i did
make framework-res
make: *** No rule to make target `framework-res'. Stop.
can u help me with the process? im just a beginner.

[NOOBFRIENDLY] [HOWTO] Create a device tree for MTD devices

What you will need
Windows or Ubuntu
A couple months knowledge about linux and android
Common sense
Notepad ++ (if on windows)
An MTD rooted android phone or tablet
NOTICE: This guide probably will NOT build a rom with no bugs, it will only give you a place to start. You will have to fix the bugs on your own. I will be referring devicename to your phones model id (my phone is samsung conquer 4g and its model id is SPH-D600) I will also be referring manufacturer to your manufacturer (duh!) and source to the source you are trying to build (CyanogenMod, aosp, etc.). As far as I know this only works for CyanogenMod 7.2 and AOSP GB.
First you might want to find out what device is closest to yours (same cpu (arm7, arm6, etc) and platform (msm7k, msm7x30, etc.) and grab its device tree for whatever rom you want to compile. It may have more fixes.
Create a folder where you want with your devices name (mine is SPH-D600). Inside create a files folder and these files
AndroidBoard.mk
AndroidProducts.mk
BoardConfig.mk
devicename.mk
extract-files.sh
proprietary-files.txt
recovery.fstab
setup-makefiles.sh
system.prop
vendorsetup.sh
Look for devicename inside the codes you are pasting
Open up AndroidBoard.mk and paste this:
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := init.devicename.sh
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.devicename.sh
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := ueventd.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/ueventd.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lpm.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/lpm.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.lpm.sh
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.lpm.sh
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.devicename.rc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := SCRIPT
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/
LOCAL_SRC_FILES := /files/init.devicename.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
# include the non-open-source counterpart to this file
-include vendor/samsung/chief/AndroidBoardVendor.mk
These files are in your ramdisk in your boot.img. Use a boot.img unpacker to get these files and paste them in the files folder. Replace devicename with your phones device name. If you do not have one of these files than just erase it from the mk file.
Next open AndroidProducts.mk and paste this:
Code:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/devicename.mk
Next is BoardConfig.mk, You will have to do some research to get these. This is where the cousin devices tree will come in handy. Paste this:
Code:
# inherit from the proprietary version
-include vendor/samsung/devicename/BoardConfigVendor.mk
(get most of this from build.prop)
# Board General info
TARGET_BOOTLOADER_BOARD_NAME := devicename
TARGET_BOARD_PLATFORM := platform
BOARD_HAS_NO_SELECT_BUTTON := true
TARGET_CPU_ABI := cpu
TARGET_CPU_ABI2 := cpu2
TARGET_ARCH_VARIANT := cpu-a-neon
ARCH_ARM_HAVE_TLS_REGISTER := ?
BOARD_USES_QCOM_HARDWARE := ?
BOARD_USES_QCOM_GPS := ?
BOARD_USES_QCOM_LIBS := ?
BOARD_USES_QCOM_LIBRPC := ?
BOARD_USE_QCOM_PMEM := ?
(i cant figure this one out, please pm me if you find it out)
# ril
# audio
HAVE_HTC_AUDIO_DRIVER := ?
BOARD_USES_GENERIC_AUDIO := ?
TARGET_PROVIDES_LIBAUDIO := ?
(get this information from system/etc and /modules)
# wifi
BOARD_WPA_SUPPLICANT_DRIVER := ?
WPA_SUPPLICANT_VERSION := ?
BOARD_WLAN_DEVICE := ?
WIFI_DRIVER_FW_PATH_STA := "/system/etc/wifi/?"
WIFI_DRIVER_FW_PATH_AP := "/system/etc/wifi/?"
WIFI_DRIVER_MODULE_NAME := "?"
WIFI_DRIVER_MODULE_PATH := "/lib/modules/?"
WIFI_DRIVER_MODULE_ARG := "firmware_path=/system/etc/wifi/? nvram_path=/system/etc/wifi/?"
(get this from system/etc)
# video
BOARD_EGL_CFG := device/manufacturer/devicename/files/?
TARGET_BOARD_PLATFORM_GPU := ?
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_BCM := ?
(get this from your boot.img unpacking)
# kernel
BOARD_KERNEL_CMDLINE := ?
BOARD_KERNEL_BASE := ?
BOARD_KERNEL_PAGESIZE := ?
TARGET_PREBUILT_KERNEL := devicemanufacturer/devicename/kernel
# Partitioning setup (fix this up by examining /proc/mtd on a running device)
BOARD_BOOTIMAGE_PARTITION_SIZE := ?
BOARD_RECOVERYIMAGE_PARTITION_SIZE := ?
BOARD_SYSTEMIMAGE_PARTITION_SIZE := ?
BOARD_USERDATAIMAGE_PARTITION_SIZE := ?
BOARD_FLASH_BLOCK_SIZE := ?
## PARTITION LAYOUT/INFO ##
BOARD_DATA_DEVICE := /dev/block/mtdblock?
BOARD_DATA_FILESYSTEM := ?
BOARD_DATA_FILESYSTEM_OPTIONS := rw,nosuid,nodev,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_SYSTEM_DEVICE := /dev/block/mtdblock?
BOARD_SYSTEM_FILESYSTEM := ?
BOARD_SYSTEM_FILESYSTEM_OPTIONS := rw,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_CACHE_DEVICE := /dev/block/mtdblock?
BOARD_CACHE_FILESYSTEM := ?
BOARD_CACHE_FILESYSTEM_OPTION := rw,nosuid,nodev,noatime,nodiratime 0 0 (the permissions, replace these with your devices)
BOARD_MISC_DEVICE := /dev/block/mtdblock?
BOARD_BOOT_DEVICE := /dev/block/mtdblock?
BOARD_RECOVERY_DEVICE := /dev/block/mtdblock?
TARGET_USERIMAGES_USE_EXT4 := ?
BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/vold/?
# recovery
BOARD_RECOVERY_HANDLES_MOUNT := true
BOARD_CUSTOM_GRAPHICS:= graphics.c (you might need this so check for it in your recovery source)
# JIT / Optimizations
WITH_DEXPREOPT := true
JS_ENGINE := v8
TARGET_SPECIFIC_HEADER_PATH += device/manufacturer/devicename/files
TARGET_RELEASETOOL_OTA_FROM_TARGET_SCRIPT :=
next is devicename.mk use common sense in this one (chief is now devicename for this one)
Code:
$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
# The gps config appropriate for this device
$(call inherit-product, device/common/gps/gps_us_supl.mk)
# Inherit some common cyanogenmod stuff.
(may or may not have to use this)
$(call inherit-product, vendor/source/products/common_full.mk)
$(call inherit-product-if-exists, vendor/samsung/chief/chief-vendor.mk)
DEVICE_PACKAGE_OVERLAYS += device/samsung/chief/overlay
ifeq ($(TARGET_PREBUILT_KERNEL),)
LOCAL_KERNEL := device/samsung/chief/kernel
else
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif
PRODUCT_COPY_FILES += \
$(LOCAL_KERNEL):kernel
PRODUCT_PACKAGES += \
hostap \
librs_jni \
gralloc.msm7k \
overlay.default \
screencap \
libOmxCore \
libOmxVenc \
libOmxVdec \
com.android.future.usb.accessory \
hostapd
PRODUCT_PACKAGES += \
sensors.default \
lights.msm7k
#kernel modules
PRODUCT_COPY_FILES += \
device/samsung/chief/files/lib/modules/bthid.ko:root/lib/modules/bthid.ko \
device/samsung/chief/files/lib/modules/cmc7xx_sdio.ko:root/lib/modules/cmc7xx_sdio.ko \
device/samsung/chief/files/lib/modules/dhd.ko:root/lib/modules/dhd.ko \
device/samsung/chief/files/lib/modules/qce.ko:root/lib/modules/qce.ko \
device/samsung/chief/files/lib/modules/qcedev.ko:root/lib/modules/qcedev.ko \
device/samsung/chief/files/system/lib/libdiag.so:system/lib/libdiag.so \
device/samsung/chief/files/lib/modules/qcrypto.ko:root/lib/modules/qcrypto.ko
# Fix Logcat / Misc
PRODUCT_COPY_FILES += \
device/samsung/chief/files/logcat:system/bin/logcat \
vendor/samsung/chief/proprietary/lib/libgsl.so:system/lib/libgsl.so
# system/etc/init's
PRODUCT_COPY_FILES += \
device/samsung/chief/init.cdma-pppd:system/etc/init.cdma-ppd \
device/samsung/chief/init.gprs-pppd:system/etc/init.gprs-ppd \
device/samsung/chief/init.qcom.bt.sh:system/etc/init.qcom.bt.sh \
device/samsung/chief/init.qcom.coex.sh:system/etc/init.qcom.coex.sh \
device/samsung/chief/init.qcom.fm.sh:system/etc/init.qcom.fm.sh \
device/samsung/chief/init.qcom.sdio.sh:system/etc/init.qcom.sdio.sh \
device/samsung/chief/init.qcom.wifi.sh:system/etc/init.qcom.wifi.sh \
device/samsung/chief/files/SPH-D600.rle:root/SPH-D600.rle \
device/samsung/chief/files/charging.rle:root/charging.rle
# wifi files
PRODUCT_COPY_FILES += \
device/samsung/chief/files/egl.cfg:system/lib/egl/egl.cfg \
device/samsung/chief/files/system/etc/wifi/bcm4329_sta.bin:/system/etc/wifi/bcm4329_sta.bin \
device/samsung/chief/files/system/etc/wifi/bcm4329_aps.bin:/system/etc/wifi/bcm4329_aps.bin \
device/samsung/chief/files/system/etc/wifi/nvram_net.txt:system/etc/wifi/nvram_net.txt \
device/samsung/chief/files/system/etc/wifi/bcm4329_mfg.bin:/system/etc/wifi/bcm4329_mfg.bin \
device/samsung/chief/files/system/etc/wifi/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
device/samsung/chief/files/system/etc/dhcpcd/dhcpcd.conf:system/etc/dhcpcd/dhcpcd.conf \
device/samsung/chief/files/system/bin/BCM4329B1_002.002.023.0746.0871.hcd:system/bin/BCM4329B1_002.002.023.0746.0871.hcd
# video drivers
PRODUCT_COPY_FILES += \
device/samsung/chief/files/system/etc/firmware/vidc_720p_command_control.fw:/system/etc/firmware/vidc_720p_command_control.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_mp4_dec_mc.fw:/system/etc/firmware/vidc_720p_mp4_dec_mc.fw \
device/samsung/chief/files/system/etc/firmware/yamato_pfp.fw:/system/etc/firmware/yamato_pfp.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_h263_dec_mc.fw:/system/etc/firmware/vidc_720p_h263_dec_mc.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_mp4_enc_mc.fw:/system/etc/firmware/vidc_720p_mp4_enc_mc.fw \
device/samsung/chief/files/system/etc/firmware/yamato_pm4.fw:/system/etc/firmware/yamato_pm4.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_h264_dec_mc.fw:/system/etc/firmware/vidc_720p_h264_dec_mc.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_vc1_dec_mc.fw:/system/etc/firmware/vidc_720p_vc1_dec_mc.fw \
device/samsung/chief/files/system/etc/firmware/vidc_720p_h264_enc_mc.fw:/system/etc/firmware/vidc_720p_h264_enc_mc.fw
# misc firmware
PRODUCT_COPY_FILES += \
device/samsung/chief/files/system/etc/firmware/wlan/cfg.dat:system/etc/firmware/wlan/cfg.dat \
device/samsung/chief/files/system/etc/firmware/wlan/qcom_fw.bin:system/etc/firmware/wlan/qcom_fw.bin \
device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_fw.bin:system/etc/firmware/wlan/volans/WCN1314_qcom_fw.bin \
device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_wlan_nv.bin:system/etc/firmware/wlan/volans/WCN1314_qcom_wlan_nv.bin \
device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_cfg.dat:system/etc/firmware/wlan/volans/WCN1314_cfg.dat \
device/samsung/chief/files/system/etc/firmware/wlan/volans/WCN1314_qcom_cfg.ini:system/etc/firmware/wlan/volans/WCN1314_qcom_cfg.ini \
device/samsung/chief/files/system/bin/pppd_runner:system/bin/pppd_runner \
device/samsung/chief/files/system/bin/drexe:system/bin/drexe \
device/samsung/chief/files/system/etc/wifi/wifi.conf:system/etc/wifi/wifi.conf \
device/samsung/chief/files/system/etc/wifi/wl:system/etc/wifi/wl \
device/samsung/chief/files/system/etc/wifi/nvram_mfg.txt:system/etc/wifi/nvram_mfg.txt
# Telephony property for CDMA
PRODUCT_PROPERTY_OVERRIDES += \
ro.config.vc_call_vol_steps=15 \
ro.telephony.default_network=4 \
ro.com.google.clientidbase=android-sprint-us \
ro.cdma.home.operator.numeric=310120 \
ro.cdma.home.operator.alpha=Sprint \
net.cdma.pppd.authtype=require-pap \
net.cdma.pppd.user=user[SPACE]SprintNextel \
net.cdma.datalinkinterface=/dev/ttyCDMA0 \
net.interfaces.defaultroute=cdma \
net.cdma.ppp.interface=ppp0 \
net.connectivity.type=CDMA1 \
mobiledata.interfaces=ppp0,uwbr0 \
ro.telephony.ril_class=samsung \
ro.ril.samsung_cdma=true
# WiMAX Property setting for checking WiMAX interface
PRODUCT_PROPERTY_OVERRIDES += \
ro.wimax.interface=uwbr0 \
net.tcp.buffersize.wimax=4092,87380,1520768,4092,16384,1520768
# misc for now
PRODUCT_COPY_FILES += \
device/samsung/chief/files/system/etc/apns-conf.xml:system/etc/apns-conf.xml \
device/samsung/chief/files/system/vendor/lib/libsec-ril.so:system/vendor/lib/libsec-ril.so \
device/samsung/chief/files/system/bin/qmuxd:system/bin/qmuxd \
device/samsung/chief/files/system/bin/rmt_storage:system/bin/rmt_storage \
device/samsung/chief/files/system/bin/netmgrd:system/bin/netmgrd \
device/samsung/chief/files/system/bin/thermald:system/bin/thermald \
device/samsung/chief/files/system/bin/geomagneticd:system/bin/geomagneticd \
device/samsung/chief/files/system/bin/orientationd:system/bin/orientationd \
device/samsung/chief/files/system/bin/cnd:system/bin/cnd \
device/samsung/chief/files/system/bin/mfgloader:system/bin/mfgloader \
device/samsung/chief/files/system/bin/wlandutservice:system/bin/wlandutservice \
device/samsung/chief/files/system/bin/btld:system/bin/btld \
vendor/cyanogen/prebuilt/mdpi/media/bootanimation.zip:system/media/bootanimation.zip \
device/samsung/chief/files/system/etc/01_qcomm_omx.cfg:system/etc/01_qcomm_omx.cfg \
device/samsung/chief/files/system/etc/cdma-carriers-conf.xml:system/etc/cdma-carriers-conf.xml \
device/samsung/chief/files/system/etc/loc_parameter.ini:system/etc/loc_parameter.ini \
device/samsung/chief/files/system/etc/media_profiles.xml:system/etc/media_profiles.xml \
device/samsung/chief/files/system/etc/wimax_boot.bin:system/etc/wimax_boot.bin \
device/samsung/chief/files/system/etc/wimaxfw.bin:system/etc/wimaxfw.bin \
device/samsung/chief/files/system/etc/wimaxloader.bin:system/etc/wimaxloader.bin \
device/samsung/chief/files/system/etc/thermald.conf:system/etc/thermald.conf
# These are the hardware-specific features
PRODUCT_COPY_FILES += \
frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
frameworks/base/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/base/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
frameworks/base/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
frameworks/base/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \
frameworks/base/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \
frameworks/base/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
frameworks/base/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
frameworks/base/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/base/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:system/etc/permissions/android.software.live_wallpaper.xml
$(call inherit-product, build/target/product/full.mk)
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
PRODUCT_PROPERTY_OVERRIDES := \
wifi.interface=eth0\
wifi.supplicant_scan_interval=15\
ril.subscription.types=NV
# Perfomance tweaks and misc
PRODUCT_PROPERTY_OVERRIDES += \
dalvik.vm.execution-mode=int:jit \
dalvik.vm.heapsize=48m \
persist.sys.use_dithering=1 \
ro.compcache.default=0
# Properties taken from build.prop
PRODUCT_PROPERTY_OVERRIDES += \
ro.setupwizard.mode=DISABLED \
ro.com.google.gmsversion=2.3_r9 \
ro.com.google.clientidbase=android-samsung \
ro.com.google.clientidbase.ms=android-sprint-us \
ro.com.google.clientidbase.yt=android-sprint-us \
ro.com.google.clientidbase.am=android-sprint-us \
ro.com.google.clientidbase.gmm=android-samsung
# Set region
PRODUCT_DEFAULT_LANGUAGE := en_US
PRODUCT_DEFAULT_REGION := US
# Chief uses medium-density artwork where available
PRODUCT_LOCALES += mdpi
PRODUCT_COPY_FILES += \
$(LOCAL_KERNEL):kernel
$(call inherit-product, build/target/product/full.mk)
PRODUCT_NAME := cyanogenmod_chief
PRODUCT_DEVICE := chief
PRODUCT_BRAND := samsung
PRODUCT_MODEL := SPH-D600
PRODUCT_MANUFACTURER := samsung
CDMA_GOOGLE_BASE := android-sprint-us
CDMA_CARRIER_ALPHA := Sprint
CDMA_CARRIER_NUMERIC := 310120
next extract-files.sh
Code:
BASE=../../../vendor/manufacturer/devicename/proprietary
rm -rf $BASE/*
for FILE in `egrep -v '(^#|^$)' proprietary-files.txt`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
adb pull /system/$FILE $BASE/$FILE
done
./setup-makefiles.sh
For propietary-files.txt put in the directories of the needed files. Example
Code:
lib/libsec-ril.so
lib/liboncrpc.so
bin/mm-abl-tes
etc.
next setup-makefiles.sh NOTICE: there will be coding such as $DEVICE do NOT replace this with your devices name. This code will be set with what ever you put in the beginning.
Code:
#!/bin/sh
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
DEVICE=devicename
VENDOR=manufacturer
OUTDIR=vendor/$VENDOR/$DEVICE
MAKEFILE=../../../$OUTDIR/$DEVICE-vendor-blobs.mk
mkdir -p ../../../vendor/$VENDOR/$DEVICE
(cat << EOF) > $MAKEFILE
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
# Prebuilt libraries that are needed to build open-source libraries
#$OUTDIR/proprietary/lib/libcamera.so:obj/lib/libcamera.so \\
#$OUTDIR/proprietary/lib/libcameraservice.so:obj/lib/libcameraservice.so \\
#$OUTDIR/proprietary/lib/libcamera_client.so:obj/lib/libcamera_client.so \\
#$OUTDIR/proprietary/lib/liboemcamera.so:obj/lib/liboemcamera.so \\
PRODUCT_COPY_FILES += \\
$OUTDIR/proprietary/lib/libaudioalsa.so:obj/lib/libaudioalsa.so \\
EOF
LINEEND=" \\"
COUNT=`cat proprietary-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
COUNT=`expr $COUNT - 1`
if [ $COUNT = "0" ]; then
LINEEND=""
fi
echo " $OUTDIR/proprietary/$FILE:system/$FILE$LINEEND" >> $MAKEFILE
done
(cat << EOF) > ../../../$OUTDIR/$DEVICE-vendor.mk
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
# Live wallpaper packages
PRODUCT_PACKAGES := \\
LiveWallpapers \\
LiveWallpapersPicker
# Publish that we support the live wallpaper feature.
PRODUCT_COPY_FILES := \\
packages/wallpapers/LivePicker/android.software.live_wallpaper.xml:/system/etc/permissions/android.software.live_wallpaper.xml
# Pick up overlay for features that depend on non-open-source files
DEVICE_PACKAGE_OVERLAYS := vendor/$VENDOR/$DEVICE/overlay
\$(call inherit-product, vendor/$VENDOR/$DEVICE/$DEVICE-vendor-blobs.mk)
EOF
(cat << EOF) > ../../../$OUTDIR/BoardConfigVendor.mk
# Copyright (C) 2011 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
USE_CAMERA_STUB := ?
EOF
Next is system.prop, this is basically the props for your device in build.prop
Code:
#
# system.prop for devicename
#
rild.libpath=/system/vendor/lib/?
rild.libargs= ?
Finally vendorsetup.sh
Code:
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file is executed by build/envsetup.sh, and can use anything
# defined in envsetup.sh.
#
# In particular, you can add lunch options with the add_lunch_combo
# function: add_lunch_combo generic-eng
add_lunch_combo source_devicename-eng
There you go! It may have been a lot of work but its worth it. If you have any questions comment them.
Nice work
I gues i put you´re link in my thread later on here:
forum.xda-developers.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. I´m a bit alone on building for my new device haha.
I´m changing the files i need in proprietary-files.txt at the moment.
I´ḿ a bit unsure what files to use.. Use the file from CM ore use the original file.
For example bin/vold use the one that CM gives ore the original device files.
To make my cwm recovery work i did have to use the original init file.
[email protected] said:
Nice work
I gues i put you´re link in my thread later on here:
forum.xda-developers.com/showthread.php?t=1935162
I did make a working recovery but iḿ still stuk building a working rom. I´m a bit alone on building for my new device haha.
I´m changing the files i need in proprietary-files.txt at the moment.
I´ḿ a bit unsure what files to use.. Use the file from CM ore use the original file.
For example bin/vold use the one that CM gives ore the original device files.
To make my cwm recovery work i did have to use the original init file.
Click to expand...
Click to collapse
Thank you. Propietary files are the files in your device not cm. These files include ril files for service and necessary video files to play videos and games. They are pulled from your device when you do ./extract-files.sh on ubuntu. I will add explanations for everything in a little bit.
itzdarockz said:
Thank you. Propietary files are the files in your device not cm. These files include ril files for service and necessary video files to play videos and games. They are pulled from your device when you do ./extract-files.sh on ubuntu. I will add explanations for everything in a little bit.
Click to expand...
Click to collapse
That part about the Propietary files i know.
I just have a hard time finding out what my Propietary files are.
What do i do for this file: etc/media_profiles.xml
At the moment i take the 1 from the device. But cm will build it when if l dont include it..
And many files im nut sure if in the lib dir and sow on.
[email protected] said:
That part about the Propietary files i know.
I just have a hard time finding out what my Propietary files are.
What do i do for this file: etc/media_profiles.xml
At the moment i take the 1 from the device. But cm will build it when if l dont include it..
And many files im nut sure if in the lib dir and sow on.
Click to expand...
Click to collapse
You wouldnt include media_profiles. Try finding a device tree for a device close to urs and see what you may need.
itzdarockz said:
You wouldnt include media_profiles. Try finding a device tree for a device close to urs and see what you may need.
Click to expand...
Click to collapse
I´ll will do that.
hey there mate, thanks for this info,,, would this be current for latest cm???
Great info, thx
itzdarockz said:
What you will need
Windows or Ubuntu
A couple months knowledge about linux and android
Common sense
Notepad ++ (if on windows)
An MTD rooted android phone or tablet
There you go! It may have been a lot of work but its worth it. If you have any questions comment them. I will not be fixing your bugs though. If you find any mistakes please PM them to me. Thank you.
Click to expand...
Click to collapse
Hey mate thanks for this......however I ran into a problem I am making a rom and I did change ro.custom.build.version @ build.prop but changes are not there.....other changes I made to model and rest are reflecting but this particular isnt changing...any idea....??? thanks in advance
godofgeeks said:
Hey mate thanks for this......however I ran into a problem I am making a rom and I did change ro.custom.build.version @ build.prop but changes are not there.....other changes I made to model and rest are reflecting but this particular isnt changing...any idea....??? thanks in advance
Click to expand...
Click to collapse
Maybe try putting ro.modversion that worked for me, if it doesnt work you can just unzip the rom and put that in the #additional properties
itzdarockz said:
Maybe try putting ro.modversion that worked for me, if it doesnt work you can just unzip the rom and put that in the #additional properties
Click to expand...
Click to collapse
When i compile , i get this :
Code:
Trying dependencies-only mode on a non-existing device tree?
how to fix ?
dadroid98 said:
When i compile , i get this :
Code:
Trying dependencies-only mode on a non-existing device tree?
how to fix ?
Click to expand...
Click to collapse
It will usually say this in my experience if you are using a non-official device tree, for example one you created from scratch using this guide. I wouldn't worry about it unless it results in a compiling error in the process.
shimp208 said:
It will usually say this in my experience if you are using a non-official device tree, for example one you created from scratch using this guide. I wouldn't worry about it unless it results in a compiling error in the process.
Click to expand...
Click to collapse
Why _?
dadroid98 @ dadroid98 - F3P : ~ / cm9 $ make - jx otapackage
make: the "- j" requires an argument integrated positive
Usage: make [ options] [target ] ...
options:
**-b,- m Ignored for compatibility
**-B , - always -make Generates all targets unconditionally
**-C DIRECTORY , - directory = DIRECTORY
******************************Change to DIRECTORY before doing anything.
**-d show a lot of debugging information.
**- debug [= FLAGS ] Show different types of debugging information.
**-e, - environment -overrides
******************************The environment variables override the makefile.
**-f FILE , - file = FILE , - makefile = FILE
******************************Read FILE as a makefile .
**-h, - help Show this message and exit .
**-i , - ignore -errors Ignore errors command .
**-I DIRECTORY , - include-dir = DIRECTORY
******************************Search DIRECTORY for included makefiles .
**-j [N] , - jobs [ = N] Allow N jobs at once ; infinite if not specified the topic.
**- k, - keep -going Continue running when it is not possible to create some goals.
**-l [N] , - load- average [= N] , - max -load [= N]
******************************Not start multiple processes unless the workload is not under N.
**-L, - check- symlink -times Use the latest mtime between symlinks and target .
**-n, - just- print , - dry-run , - recon
******************************Do not execute any command, the print only .
**-o FILE , - old- file = FILE , - assume -old = FILE
******************************Consider FILE to be very old and does not re-run make.
**-p, - print- data-base Print the internal database to make.
**- q, - question not execute any command , the exit status indicates if it is out of date.
**-r , - no- builtin -rules Disable the internal implicit rules .
**-R , - no- builtin -variables Disable the settings of the internal variables .
**-s, - silent, - quiet Do not display the commands .
**-S , - no- keep- going, - stop
****************************Disable the-k option .
**-t, - touch Touch Runs the objectives instead of recreating them.
**-v, - version Print the version number of make and exit.
**-w , - print- directory Print the current directory.
**- no- print- directory Turn off -w , even if it was turned on implicitly .
**-W FILE , - what-if = FILE , - new- file = FILE , - assume -new = FILE
******************************Consider FILE as brand new.
**- warn - undefined -variables Warn when an undefined variable is referenced .
This program has been compiled for x86_64 -pc -linux -gnu
Report bugs to <[email protected]>
dadroid98 said:
Why _?
dadroid98 @ dadroid98 - F3P : ~ / cm9 $ make - jx otapackage
make: the "- j" requires an argument integrated positive
Usage: make [ options] [target ] ...
options:
**-b,- m Ignored for compatibility
**-B , - always -make Generates all targets unconditionally
**-C DIRECTORY , - directory = DIRECTORY
******************************Change to DIRECTORY before doing anything.
**-d show a lot of debugging information.
**- debug [= FLAGS ] Show different types of debugging information.
**-e, - environment -overrides
******************************The environment variables override the makefile.
**-f FILE , - file = FILE , - makefile = FILE
******************************Read FILE as a makefile .
**-h, - help Show this message and exit .
**-i , - ignore -errors Ignore errors command .
**-I DIRECTORY , - include-dir = DIRECTORY
******************************Search DIRECTORY for included makefiles .
**-j [N] , - jobs [ = N] Allow N jobs at once ; infinite if not specified the topic.
**- k, - keep -going Continue running when it is not possible to create some goals.
**-l [N] , - load- average [= N] , - max -load [= N]
******************************Not start multiple processes unless the workload is not under N.
**-L, - check- symlink -times Use the latest mtime between symlinks and target .
**-n, - just- print , - dry-run , - recon
******************************Do not execute any command, the print only .
**-o FILE , - old- file = FILE , - assume -old = FILE
******************************Consider FILE to be very old and does not re-run make.
**-p, - print- data-base Print the internal database to make.
**- q, - question not execute any command , the exit status indicates if it is out of date.
**-r , - no- builtin -rules Disable the internal implicit rules .
**-R , - no- builtin -variables Disable the settings of the internal variables .
**-s, - silent, - quiet Do not display the commands .
**-S , - no- keep- going, - stop
****************************Disable the-k option .
**-t, - touch Touch Runs the objectives instead of recreating them.
**-v, - version Print the version number of make and exit.
**-w , - print- directory Print the current directory.
**- no- print- directory Turn off -w , even if it was turned on implicitly .
**-W FILE , - what-if = FILE , - new- file = FILE , - assume -new = FILE
******************************Consider FILE as brand new.
**- warn - undefined -variables Warn when an undefined variable is referenced .
This program has been compiled for x86_64 -pc -linux -gnu
Report bugs to <[email protected]>
Click to expand...
Click to collapse
You need to specify the number of jobs so the command syntax should be something such as:
Code:
make - j4 otapackage
Not make - jx otapackage, you must specify the number of jobs and can't leave it as an x option.
shimp208 said:
You need to specify the number of jobs so the command syntax should be something such as:
Code:
make - j4 otapackage
Not make - jx otapackage, you must specify the number of jobs and can't leave it as an x option.
Click to expand...
Click to collapse
ok i understand
dadroid98 said:
ok i understand
Click to expand...
Click to collapse
Glad I could help you out, let me know if you have any further questions I'll be happy to help you out best I can.
Sent from my SCH-I535 using XDA Premium 4 mobile app
shimp208 said:
Glad I could help you out, let me know if you have any further questions I'll be happy to help you out best I can.
Sent from my SCH-I535 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Ok thanks a lot !!!
Now I got. zip file of the rom but remains on bootanimation ... I thought I'd take a Logcat but ...
[email protected]:~$ adb devices
List of devices attached
EDIT ---
i have solved adding this on build.prop
persist.service.adb.enable=1
.. Now i can get logcat ...
@shimp208
Will this method will work on Samsung galxy grand quattro
lols21.10 said:
@shimp208
Will this method will work on Samsung galxy grand quattro
Click to expand...
Click to collapse
The method in this guide for creating a new device tree should work on your device. After looking through the Galaxy Grand Quattro development sections here on XDA, rather then creating a new device tree from scratch I would recommend taking a look a this developers github and seeing if they already have a device tree for your device as they have a build of CM11 in the Galaxy Grand Quattro Orginal Development section. If you can't find it on their github a polite message, inquiring about what device tree they used should be fine. Let me know if you still have questions.

Compiling android - trying to add XML files to /system/etc/permissions

I'm compiling android from source. I've set up the environment, and tested the builds. Everything works fine.
My current objective is to add 10 custom xml files to /system/etc/permissions. I've tried modifying the Android.mk file in frameworks/base/data/etc to include the files, but the additions aren't appearing in the compiled system. What's strange is that the default files that were in the same folder and already in the makefile appear, so the makefile seems to be read and parsed at compile.
This is the code I'm using:
Code:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]default_file_already_present.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := [B]my_custom_file.xml[/B]
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
For some reason, my_custom_file is not added, while the default_file_already_present is. Any ideas?
I've searched around, but can't find any decent documentation. I feel like I’m very close, so any help is much appreciated!
tl;dr - Adding files to system partition with makefile partially fails.
Solution!
For those who also run in to this problem:
As per Jean-Baptiste Quéru's post on a google group;
The Android makefiles are essentially split into 2 primary categories,
parsed in this order.
-the product definitions, which specify what modules need to be
installed for each product.
-the module definition, which specify how to build each module.
The build system protects itself against situation where you modify
the product definition from a module definition. PRODUCT_COPY_FILES is
part of the product definition, and can't be modify from a module
definition.
JBQ
Click to expand...
Click to collapse
What this means is that in order to copy files as is to the system image, we need to use product definitions.
What I did was first run ./build/envsetup.sh, in order to get access to commands like mgrep, etc.
I noticed that in frameworks/base/data/keyboards there was a keyboards.mk file, which got included correctly.
I made a copy and modifies it to suit my needs:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
blah blah blah...
#
# This is the list of custom permissions to be injected in /system/etc/permissions
permissionsfiles := \
android.hardware.camera.front.xml \
android.hardware.usb.accessory.xml \
android.hardware.usb.host.xml \
android.hardware.wifi.direct.xml \
android.hardware.wifi.xml \
android.software.sip.voip.xml \
com.google.android.maps.xml \
com.google.android.media.effects.xml \
com.google.widevine.software.drm.xml \
handheld_core_hardware.xml \
platform_plus.xml \
features.xml
PRODUCT_COPY_FILES := $(foreach file,$(permissionsfiles),\
frameworks/base/data/etc/$(file):system/etc/permissions/$(file))
I ran "mgrep keyboards" and noted which makefiles included the keyboards.mk file, then I opened each file and duplicated that line, modifying it to instead include my custom_permissions.mk located in frameworks/base/data/etc/.
I compiled and the files were all there.
Hope this helps.

Frameworks: base to native to base

Many people, even me, faced the following error during compilation of ROM sources:
make: *** No rule to make target `frameworks/native/data/etc/android.hardware.camera.xml', needed by `out/target/product/*/system/etc/permissions/android.hardware.camera.xml'. Stop.
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/samsung/*/cm.mk]]: "frameworks/native/build/phone-hdpi-512-dalvik-heap.mk" does not exist. Stop.
These are just two. But many errors are similar to this as the packages are different but pointer location reference is the same. Here's the following that you can do to stop the error.
change all references from frameworks/base to frameworks/native
cat `grep -r "frameworks/base" ./*` | sed 's/frameworks\/base/frameworks\/native/'
The above command really works but takes a longer time and it is not 100% guaranteed that it will link the files properly!
(or)
grep -r "frameworks" *
I never tested this!
If trying to convert native to base, go the device tree to cm.mk or where the error is pointed.
If that file doesn't have any location, search in the include files.
Example:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/samsung/device/device.mk)
# Device identifier. This must come after all inclusions
PRODUCT_DEVICE := kdevice
PRODUCT_NAME := cm_device
PRODUCT_BRAND := samsung
PRODUCT_MODEL := device
PRODUCT_MANUFACTURER := samsung
PRODUCT_RELEASE_NAME := device
# Bootanimation
TARGET_SCREEN_HEIGHT := 800
TARGET_SCREEN_WIDTH := 480
The above cm.mk doesn't have any value but it includes two files.
Search in the included file which here is:
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
$(call inherit-product, device/samsung/device/device.mk)
In one of the file, there must be pointer location. So search for it.
# Hardware features available on this device
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
Change the above code which contains frameworks/native to frameworks/base by find and replace option in text editor.
This method is very easy and takes up no time to work.
Save the file and you are done.
I personally solved the error by this method!
Hope it helps you too!

[PixelExperience] Add own app as system app in custom build

hi, i want to build my custom rom from the source of PixelExperience with my app included as system app.
I already built the rom and flashed it with success on my asus x00dt.
what i tried to include my app as system app on the rom:
- added folder ./packages/apps/MyApp
- copied my.awesome.app.apk to folder
- created Android.mk in same folder with following content
Makefile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := MyApp
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := my.awesome.app.apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)
when i build and flash the rom the app is "not installed". but i can see the folder and app under /system/app
also when i run "pm list packages" i dont see it in the list.
Could you guys help me adding the app to my custom rom?
EDIT:
I also created an entry in build\make\target\product\handheld_product.mk
PRODUCT_PACKAGES += \
MyApp
i could not find core.mk or common.mk which was mentioned in other posts (here: https://stackoverflow.com/questions/10579827/how-do-i-add-apks-in-an-aosp-build)
EDIT 2:
Seems like a signing issue. If i dont sign my app and use LOCAL_CERTIFICATE := platform it works.

Categories

Resources