GMS Apps安装

本文列出的GMS Apps安装方式,需要root权限;对于非root手机,可以使用Go安装器/HiGoPlay服务框架安装器(可从 应用宝 下载)安装。

安装步骤如下,

1. 从 The Open GApps Project 下载GMS所用的package。
    其中需要选择 Platform、Android版本、GMS package配置(Variant), 根据自己的需要下载至本地;

2. 解压gapps安装包;编写PC端执行脚本,将GMS Core内容push到android机台中。
    (注意:GApps默认是在recovery下面执行的,需要先安装第三方的recovery image如CW/TWRP,不过这里我们没有采用这种方式,而是通过PC push)
    执行命令如下:./my_install_debug.sh  ./open_gapps-arm64-11.0-nano-20220215/
    my_install_debug.sh脚本如下(注意:GApps下面的内容没有push):

#!/bin/bash	

# sudo apt-get install lzip
c_path=$(dirname "$0")
my_path=$1

core_path=${my_path}Core

gms_path=$c_path/GMS

if [ ! -d $gms_path ] ; then
	mkdir $gms_path
fi

for file in ` ls $core_path `
do
	echo $file
	# 1. unzip *.lz
	if [ -f $core_path/$file ] && [ "${file##*.}"x = "lz"x ] ; then
		echo $file
		lzip -d $core_path/$file
	fi

	# 2. unzip *.tar
	if [ -f $core_path/$file ] && [ "${file##*.}"x = "tar"x ] ; then
		echo $file
		tar -xvf $core_path/$file -C $core_path
	fi

	# 3. move files
	if [ -d $core_path/$file ] ; then
		echo $core_path/$file 
		find $core_path/$file -name "app" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "priv-app" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "defaultetc-common" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "defaultframework-common" -type d -exec cp -rf {} $gms_path \;
		rm -rf $core_path/$file
	fi

done

#adb root
adb disable-verity
#adb reboot
#echo "reboot, wait for device online..."

echo "adb root..."
adb root
sleep 1
echo "adb remount..."
adb remount
sleep 5

adb push $gms_path/priv-app /system/
adb push $gms_path/app /system/
#adb push $gms_path/etc /system/
#adb push $gms_path/framework /system/

adb push $gms_path/defaultetc-common/common/etc/default-permissions /system/etc/
adb push $gms_path/defaultetc-common/common/etc/permissions/. /system/etc/permissions/
adb push $gms_path/defaultetc-common/common/etc/preferred-apps/ /system/etc/
adb push $gms_path/defaultetc-common/common/etc/sysconfig/. /system/etc/sysconfig/

adb push $gms_path/defaultframework-common/common/etc/permissions/. /system/etc/permissions/
adb push $gms_path/defaultframework-common/common/framework/. /system/framework/

echo "push done, waiting for reboot..."

adb reboot

参考资料:Android 安装 GMS 方法_fangrui2005的博客-CSDN博客_gms包安装

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值