Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add prebuilt APKs to Android AOSP system.img

I'm building AOSP from source. What I would like to do is to include a few prebuilt files in the generated system.img as part of the make process. I'm trying to find the actual file that creates the system.img and add a few lines there. Any idea?

Thank you in advance.

like image 972
Erez A. Korn Avatar asked Dec 05 '11 15:12

Erez A. Korn


People also ask

How do I import an APK into Android Studio?

Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK. Android Studio then displays the unpacked APK files, similar to figure 1.


3 Answers

A good way of adding custom files to the system.img is to add them under vendor/your_name/product_you_want_to_add_them/proprietary/your_files_go_here and add a custom make file called device-product_name.mk.

After that's done, just define which files are to be copied from the proprietary folder and inside (e.g. vendor/samsung/crespo/device-vendor.mk add to call your device make file).

like image 102
GiantDwarf Avatar answered Oct 18 '22 01:10

GiantDwarf


Just put your source code to the Packages/apps directory,then make sure your project has a correct make file like other project in the apps directory.You will make the package prebuilt after finish the android build.

like image 27
dreamtale Avatar answered Oct 18 '22 01:10

dreamtale


To add a prebuilt file to a build, find a .mk file which makes sense for your project and add the file under PRODUCT_COPY_FILE. It looks like this

 PRODUCT_COPY_FILE += your/build/tree/$FILE:path/to/location/on/device/$FILE

Using a separate vendor tree is following good domain-driven principles...but is perhaps overkill for a single binary. Examine the makefiles you already use, there is often prebuilt apks already being added that you can piggyback on. device and existing vendor trees are good places to start looking. Maintaining an entirely new project is not something to be taken lightly, in my opinion.

like image 2
mateor Avatar answered Oct 18 '22 02:10

mateor