AOSP13 - Copying files to /data during build time - IMPOSSIBLE!

402 views
Skip to first unread message

Settler Agent

unread,
Oct 5, 2023, 10:50:37 AM10/5/23
to Android Building
Hi everyone!

Target/Variant: android 13 .0 / treble_arm64_bvN

Issue: Copying files to /data/data or /data/media during build so they're visible to AOSP File Manager after boot.

Documented Solution: I first copied my files folder to /system during build with: PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*,files_folder,system/files_folder) (this works)

Then I copy a file from /system/files_folder to /data/data or /data/media by adding this to system/core/rootdir/init.rc in the post-fs-data section:

copy /system/files_folder/file.txt /data/media/file.txt (this works too)

Inside AOSP, with a root file explorer, I can see the files are copied correctly, but don't show up in the AOSP File Manager at Android/data , Android/media or Android/obb


Issue 1.1: Installing APK (Magisk App) to /data during build

Documented Solution: Adding LOCAL_MODULE_PATH := $(TARGET_OUT_DATA) to the Android.mk of the app is supposedly the most common way to install apks in /data.

But after including the above code, the app is not visible in the launcher, and no install files can be found anywhere. (Without the LOCAL_MODULE_PATH line it installs fine in /system)

Any tips or hints would be awesome. Thanks!

Reply all
Reply to author
Forward
0 new messages