如何使用 Android.mk 设置 applicationID

How to set applicationID using Android.mk

我有一个基于AOSP的自定义rom,我打算在基于Launcher3的系统应用程序上制作应用程序。 我想更改清单中指定的 App 的 packageName(或 applicationID)。

我可以在 gradle 构建时更改 appliationID。 但我不知道如何使用 Android.mk.

设置 applicationID

如何使用Android.mk设置applicationID?

更新:

我想使用 Android.MK 设置 applicationID,就像我使用 build.gradle 设置 applicationID 一样。

可以在 AndroidManifest.xml 和您的应用程序 类 中更改应用程序包名称。 Android.mk 不包含任何包名或 ApplicationID。它包含您要包含在源代码中的模块名称,并将其添加到构建配置中。

ApplicationID 应在 gradle 文件管理器

中设置

我认为没有办法(至少我知道)可以在 makefile 上指定 applicationId。

您总是可以尝试复制 gradle 所做的,即在构建的最后一步更改 AndroidManifest 中的包字段(在 R class 生成已经完成后使用原始包名称场)

阅读更多内容:https://developer.android.com/studio/build/application-id

One more thing to know: Although you may have a different name for the manifest package and the Gradle applicationId, the build tools copy the application ID into your APK's final manifest file at the end of the build. So if you inspect your AndroidManifest.xml file after a build, don't be surprised that the package attribute has changed. The package attribute is where Google Play Store and the Android platform actually look to identify your app; so once the build has made use of the original value (to namespace the R class and resolve manifest class names), it discards that value and replaces it with the application ID.