android 7.0 添加google play
1.需要去谷歌官网下载google play的本地升级包。
2.解压需要解压3次,先unzip file.zip解压整包,在用lunzip解压tar.lz文件的外面一层,在解压一次解压tar文件,获得需要的库,apk,jar,xml。
3.需要在android的源代码下新建一个文件夹。
4.在下载google play的本地升级包解压出来的apk,jar,xml文件按照对应的方式放好(netxeon是我新建的文件夹)。
new file: netxeon/google/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk
new file: netxeon/google/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk
new file: netxeon/google/app/GoogleTTS/GoogleTTS.apk
new file: netxeon/google/app/GoogleTTS/lib/armeabi-v7a/libtts_android.so
new file: netxeon/google/app/GoogleTTS/lib/armeabi-v7a/libtts_android_neon.so
new file: netxeon/google/etc/permissions/com.google.android.dialer.support.xml
new file: netxeon/google/etc/permissions/com.google.android.maps.xml
new file: netxeon/google/etc/permissions/com.google.android.media.effects.xml
new file: netxeon/google/etc/permissions/tablet_core_hardware.xml
new file: netxeon/google/etc/preferred-apps/google.xml
new file: netxeon/google/etc/sysconfig/google.xml
new file: netxeon/google/framework/com.google.android.dialer.support.jar
new file: netxeon/google/framework/com.google.android.maps.jar
new file: netxeon/google/framework/com.google.android.media.effects.jar
new file: netxeon/google/framework/com.google.widevine.software.drm.jar
new file: netxeon/google/lib/libjni_latinimegoogle.so
new file: netxeon/google/priv-app/ConfigUpdater/ConfigUpdater.apk
new file: netxeon/google/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk
new file: netxeon/google/priv-app/GoogleFeedback/GoogleFeedback.apk
new file: netxeon/google/priv-app/GoogleLoginService/GoogleLoginService.apk
new file: netxeon/google/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk
new file: netxeon/google/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk
new file: netxeon/google/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk
new file: netxeon/google/priv-app/Phonesky/Phonesky.apk
new file: netxeon/google/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libAppDataSearch.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libNearbyApp.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libWhisper.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libconscrypt_gmscore_jni.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_base.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_support.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgmscore.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgoogle-ocrclient-v3.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libjgcastservice.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libleveldbjni.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libsslwrapper_jni.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libtango_utility_lib.so
new file: netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libwearable-selector.so
5.在
去android.mk文件,将添加的google play文件拷贝到system目录下
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GoogleFeedback/GoogleFeedback.apk:system/priv-app/GoogleFeedback/GoogleFeedback.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk:system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/Phonesky/Phonesky.apk:system/priv-app/Phonesky/Phonesky.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk:system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk:system/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk:system/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk:system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/ConfigUpdater/ConfigUpdater.apk:system/priv-app/ConfigUpdater/ConfigUpdater.apk \
+ $(LOCAL_PATH)/netxeon/google/priv-app/GoogleLoginService/GoogleLoginService.apk:system/priv-app/GoogleLoginService/GoogleLoginService.apk \
+ $(LOCAL_PATH)/netxeon/google/app/GoogleTTS/GoogleTTS.apk:system/app/GoogleTTS/GoogleTTS.apk \
+ $(LOCAL_PATH)/netxeon/google/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk:system/app/GoogleCalendarSyncAdapter/GoogleCalendarSyncAdapter.apk \
+ $(LOCAL_PATH)/netxeon/google/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk:system/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk \
+ $(LOCAL_PATH)/netxeon/google/etc/preferred-apps/google.xml:system/etc/preferred-apps/google.xml \
+ $(LOCAL_PATH)/netxeon/google/etc/permissions/com.google.android.media.effects.xml:system/etc/permissions/com.google.android.media.effects.xml \
+ $(LOCAL_PATH)/netxeon/google/etc/permissions/com.google.android.maps.xml:system/etc/permissions/com.google.android.maps.xml \
+ $(LOCAL_PATH)/netxeon/google/etc/permissions/com.google.android.dialer.support.xml:system/etc/permissions/com.google.android.dialer.support.xml \
+ $(LOCAL_PATH)/netxeon/google/etc/permissions/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml \
+ $(LOCAL_PATH)/netxeon/google/etc/sysconfig/google.xml:system/etc/sysconfig/google.xml \
+ $(LOCAL_PATH)/netxeon/google/framework/com.google.android.maps.jar:system/framework/com.google.android.maps.jar \
+ $(LOCAL_PATH)/netxeon/google/framework/com.google.android.media.effects.jar:system/framework/com.google.android.media.effects.jar \
+ $(LOCAL_PATH)/netxeon/google/framework/com.google.android.dialer.support.jar:system/framework/com.google.android.dialer.support.jar \
+ $(LOCAL_PATH)/netxeon/google/framework/com.google.widevine.software.drm.jar:system/framework/com.google.widevine.software.drm.jar \
+ $(LOCAL_PATH)/netxeon/google/lib/libjni_latinimegoogle.so:system/lib/libjni_latinimegoogle.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgmscore.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgmscore.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libWhisper.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libWhisper.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgoogle-ocrclient-v3.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgoogle-ocrclient-v3.s
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_support.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_support.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libconscrypt_gmscore_jni.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libconscrypt_gmscore_j
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libNearbyApp.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libNearbyApp.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libsslwrapper_jni.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libsslwrapper_jni.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libjgcastservice.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libjgcastservice.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libwearable-selector.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libwearable-selector.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_base.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libgcastv2_base.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libAppDataSearch.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libAppDataSearch.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libleveldbjni.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libleveldbjni.so \
+ $(LOCAL_PATH)/netxeon/google/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libtango_utility_lib.so:system/priv-app/PrebuiltGmsCore/lib/armeabi-v7a/libtango_utility_lib.so \
+ $(LOCAL_PATH)/netxeon/google/app/GoogleTTS/lib/armeabi-v7a/libtts_android.so:system/app/GoogleTTS/lib/armeabi-v7a/libtts_android.so \
+ $(LOCAL_PATH)/netxeon/google/app/GoogleTTS/lib/armeabi-v7a/libtts_android_neon.so:system/app/GoogleTTS/lib/armeabi-v7a/libtts_android_neon.so
6.最后需要去
build/core/Makefile 将不需要的脚本去掉。
+#define check-product-copy-files
+#$(if $(filter %.apk, $(call word-colon, 2, $(1))),$(error \
+# Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))
+#endef
修改6步完成修改!!!
注意一定要将tablet_core_hardware.xml 添加进去,不添加的话,没办法获取到下载排行列表。