将预构建的 APK 添加到 Android AOSP system.img
我正在从源代码构建 AOSP。我想做的是在生成的 system.img 中包含一些预构建的文件作为 make 过程的一部分。我试图找到创建 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将自定义文件添加到
system.img
的一个好方法是将它们添加到vendor/your_name/product_you_want_to_add_them/proprietary/your_files_go_here
下,并添加一个名为的自定义 make 文件设备-产品名称.mk
。完成后,只需定义要从专有文件夹及其内部复制哪些文件(例如,添加
vendor/samsung/crespo/device-vendor.mk
添加以调用您的设备 make 文件)。A good way of adding custom files to the
system.img
is to add them undervendor/your_name/product_you_want_to_add_them/proprietary/your_files_go_here
and add a custom make file calleddevice-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).只需将源代码放入 Packages/apps 目录中,然后确保您的项目与 apps 目录中的其他项目一样具有正确的 make 文件。您将预构建包完成android构建后。
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.
要将预构建文件添加到构建中,请找到一个对您的项目有意义的 .mk 文件,并将该文件添加到 PRODUCT_COPY_FILE 下。看起来
使用单独的供应商树遵循了良好的域驱动原则……但对于单个二进制文件来说可能有点过大了。检查您已经使用的 makefile,通常已经添加了预构建的 apk,您可以使用它们。
device
和现有的vendor
树是开始寻找的好地方。在我看来,维护一个全新的项目并不是一件可以掉以轻心的事情。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
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 existingvendor
trees are good places to start looking. Maintaining an entirely new project is not something to be taken lightly, in my opinion.如果要在system.img中添加程序,请转到供应商,然后转到运营商,然后转到应用程序并输入应用程序内的文件
如果使用roms修改程序,程序名为rom helper,它修改prmission为0755,修改UserID 2000,从而将apk添加到rom中
If you want to add programs in the system.img, go to the vendor, then go to the operator, then go the app and enter the files inside the app
If you use the roms modification program, the program name is rom helper, it modifies prmission to 0755, and it modifies UserID 2000, thus adding the apk to rom