天天看點

Google Apps – Framework, Phonesky, GmsCore w/ AOSP Build.

Useful links:

Android.mk File syntax specification

AOSPforNexus5

—————————–

1.) The purpose of this article is to have basic play services embedded into AOSP.

b.) Simply put, minimum shell to get it going. None of that factory images bloat.

2.) During your play services account setup, play may crash once or twice.

b.) It’s a hint to restart the phone for possibly updates to take place.

—————————–

According to the link above, three files are necessary to get Play Store going, to add an account then you can install whatever you wish.

GmsCore.apk

Phonesky.apk

GoogleServicesFramework.apk

The files above can be found on any of the latest 5.1 Gapps available on the internet.

GmsCore.apk was originally ‘PrebuiltGmsCore.apk‘. Just rename it.

Let’s go to ‘~/workingDir‘ folder: Based from the AOSP build.

$ cd ~/workingDir

Go to ‘device/lge/hammerhead‘ and let’s gedit ‘full_hammerhead.mk‘ – don’t forget to make a copy of it first.

$ gedit full_hammerhead.mk

-Let’s add ‘$(call inherit-product-if-exists, vendor/gapp/hammerhead/device-vendor.mk)‘ right after ‘$(call inherit-product-if-exists, vendor/lge/hammerhead/device-vendor.mk)‘

-Save, exit the file.

Go back to ‘~/workingDir. Browse to ‘vendor/‘. Make a folder ‘gapp/‘ then ‘hammerhead/‘ then create a file ‘device-vendor.mk‘

$ mkdir gapp

$ cd gapp

$ mkdir hammerhead

$ cd hammerhead

$ touch device-vendor.mk

Edit ‘device-vendor.mk‘ add the following inside the file:$ gedit device-vendor.mk

PRODUCT_PACKAGES += \

Phonesky GoogleServicesFramework GmsCore

You should still be inside ‘hammerhead‘ folder. Create a ‘proprietary‘ folder then browse it. Create a file ‘Android.mk‘

$ mkdir proprietary

$ cd proprietary

$ touch Android.mk

$ gedit Android.mk

——————-INSERT THE FOLLOWING INSIDE—————————

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_MODULE := Phonesky

LOCAL_MODULE_TAGS := optional

LOCAL_BUILT_MODULE_STEM := package.apk

LOCAL_MODULE_OWNER := google

LOCAL_MODULE_CLASS := APPS

LOCAL_PRIVILEGED_MODULE := true

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_CERTIFICATE := PRESIGNED

include $(BUILD_PREBUILT)

include $(CLEAR_VARS)

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_MODULE := GmsCore

LOCAL_MODULE_TAGS := optional

LOCAL_BUILT_MODULE_STEM := package.apk

LOCAL_MODULE_OWNER := google

LOCAL_MODULE_CLASS := APPS

LOCAL_PRIVILEGED_MODULE := true

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_CERTIFICATE := PRESIGNED

include $(BUILD_PREBUILT)

include $(CLEAR_VARS)

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_MODULE := GoogleServicesFramework

LOCAL_MODULE_TAGS := optional

LOCAL_BUILT_MODULE_STEM := package.apk

LOCAL_MODULE_OWNER := google

LOCAL_MODULE_CLASS := APPS

LOCAL_PRIVILEGED_MODULE := true

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_CERTIFICATE := PRESIGNED

include $(BUILD_PREBUILT)

——————-END INSERT —————————

Save, exit the file.

This is where you want to make sure the three files are in the same ‘proprietary‘ folder.

$ cp GoogleServicesFramework.apk ~/workingDir/vendor/gapp/hammerhead/proprietary

$ cp Phonesky.apk ~/workingDir/vendor/gapp/hammerhead/proprietary

$ cp GmsCore.apk ~/workingDir/vendor/gapp/hammerhead/proprietary

Back out to ‘~/workingDir‘

$ cd ~/workingDir

$ make clean <<– You can ignore this step, the build will be done quicker.

$ . build/envsetup.sh

$ lunch aosp_hammerhead-user or $ lunch aosp_hammerhead-userdebug

$ make -jN <<– N==# of cpus chosen for vm.

-Flash the new files in bootloader and test play services on your new build/rebuild.

原文位址: https://dcrin3.com/unscrambled/?p=931

繼續閱讀