Android10(Q) GMS 全家桶移植

本文详细介绍如何在Android设备上集成Google Mobile Services (GMS),包括解压GMS包、修改编译配置文件以及必要的参数调整,确保设备能够顺利烧录并支持GMS服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GG301S.md.png
GG3B6g.md.png

1、将平台厂商提供的 GMS 包解压后所有文件扔到 vendor/google/ 目录下,没有 google文件夹自己创建下

GG8GgU.png

2、修改如下文件,编译烧写

device/mediatek/common/BoardConfig.mk

@@ -201,7 +201,8 @@ ifeq ($(BUILD_GMS),yes)
   ifeq ($(strip $(MTK_AB_OTA_UPDATER)), yes)
     DONT_DEXPREOPT_PREBUILTS := false
   else
-    DONT_DEXPREOPT_PREBUILTS := true
+    # DONT_DEXPREOPT_PREBUILTS := true
+    DONT_DEXPREOPT_PREBUILTS := false
   endif
 else
   ifeq ($(TARGET_BUILD_VARIANT),userdebug)

device/mediatek/common/device.mk

@@ -927,7 +927,8 @@ ifeq ($(strip $(BUILD_GMS)), yes)
 # ifeq ($(strip $(BUILD_AGO_GMS)), yes)
 # $(call inherit-product-if-exists, vendor/go-gms/products/gms.mk)
 # else
-$(call inherit-product-if-exists, vendor/google/gms.mk)
+# $(call inherit-product-if-exists, vendor/google/gms.mk)
+$(call inherit-product-if-exists, vendor/google/products/gms.mk)
 # endif

device/mediatek/common/device.mk
device/mediatek/system/common/device.mk
两个地方都一样,直接注释

@@ -3875,33 +3875,35 @@ endif
 # From Android Q, GMS devices must preload Google signed Mainline module release
 ifeq ($(BUILD_GMS), yes)
     # Mainline module overlay
+    # PRODUCT_PACKAGES += \
+    #     GoogleExtServicesConfigOverlay \
+    #     GooglePermissionControllerOverlay \
+    #     GooglePermissionControllerFrameworkOverlay
+
+    # PRODUCT_PACKAGE_OVERLAYS += device/mediatek/common/overlay/mainline
+
+    # # Mainline common and must APK
+    # PRODUCT_PACKAGES += \
+    #     GoogleExtServicesPrebuilt \
+    #     ModuleMetadataGooglePrebuilt \
+    #     GooglePermissionControllerPrebuilt
+
+    # # Mainline other APK dependent on A-Go configuration
+    # ifneq ($(strip $(MTK_GMO_RAM_OPTIMIZE)), yes)
+    #     PRODUCT_PACKAGES += \
+    #         GoogleDocumentsUIPrebuilt\
+    #         GoogleCaptivePortalLogin\
+    #         GoogleNetworkStack\
+    #         GoogleNetworkPermissionConfig
+    #     PRODUCT_MAINLINE_SEPOLICY_DEV_CERTIFICATES := vendor/partner_modules/NetworkStackPrebuilt
+    # else
+    #     PRODUCT_PACKAGES += \
+    #         InProcessNetworkStack \
+    #         PlatformCaptivePortalLogin \
+    #         PlatformNetworkPermissionConfig
+    # endif
 
     ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),29),)
         # FBE device can support updatable APEX

device/mediateksample/编译项目名字/ProjectConfig.mk

@@ -88,6 +88,9 @@ MTK_AAL_SUPPORT = no
 MTK_AB_OTA_UPDATER = no
 MTK_AEE_SUPPORT = yes
 MTK_AGPS_APP = yes
+#for GMS interface
+BUILD_GMS=yes
+BUILD_GMS_WITH_FASTPASS=yes
 MTK_AIV_SUPPORT = no

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cczhengv

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值