将预构建的 APK 添加到 Android AOSP system.img

发布于 2024-12-19 17:38:56 字数 123 浏览 0 评论 0原文

我正在从源代码构建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

幸福不弃 2024-12-26 17:38:56

将自定义文件添加到 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 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).

北笙凉宸 2024-12-26 17:38:56

只需将源代码放入 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.

欢烬 2024-12-26 17:38:56

要将预构建文件添加到构建中,请找到一个对您的项目有意义的 .mk 文件,并将该文件添加到 PRODUCT_COPY_FILE 下。看起来

 PRODUCT_COPY_FILE += your/build/tree/$FILE:path/to/location/on/device/$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

 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.

夜未央樱花落 2024-12-26 17:38:56

如果要在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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文