From 7142d8e0c0c2a81bb55180b4e19386adca405c50 Mon Sep 17 00:00:00 2001 From: qiyinxi Date: Wed, 11 Nov 2026 02:32:03 +0100 Subject: [PATCH] =?UTF-8?q?Google=20Play=20=E5=95=86=E5=BA=97=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E5=85=88=E8=AE=B2=E7=AE=A1=E7=90=86=E5=99=A8=E5=92=8C?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=A1=8C=EF=BC=8C=E6=89=8B=E5=8A=A8=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=94=B9=E4=BD=9C=E5=A4=87=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 页面和侧栏标题改成「Google Play 商店」,去掉「以后打算做」一句;五个文件的 SHA-256 放进表里;写明管理器不认手动装的;登记设备先讲「复制 GSF ID」;英文页一起改。 Refs ModAVD/ModAVD#143 --- docs/.vitepress/config.mts | 2 +- docs/en/guide/playstore.md | 139 +++++++++++++++++++++++++------------ docs/guide/playstore.md | 139 +++++++++++++++++++++++++------------ 3 files changed, 187 insertions(+), 93 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 6152775..9935ef5 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -13,7 +13,7 @@ const guide: Page[] = [ ['/guide/', '这是什么', 'What is ModAVD'], ['/guide/install', '安装', 'Install'], ['/guide/upgrade', '升级', 'Upgrade'], - ['/guide/playstore', '自己装 Google Play 商店', 'Installing the Google Play Store yourself'], + ['/guide/playstore', 'Google Play 商店', 'Google Play Store'], ['/guide/changes', '和官方模拟器有什么不同', 'How ModAVD differs from the official emulator'], ['/guide/feedback', '反馈问题', 'Report a problem'], ['/guide/false-positive', '杀毒软件误报怎么办', 'What to do when antivirus software flags ModAVD'], diff --git a/docs/en/guide/playstore.md b/docs/en/guide/playstore.md index 2121b8f..0b053e6 100644 --- a/docs/en/guide/playstore.md +++ b/docs/en/guide/playstore.md @@ -1,28 +1,102 @@ -# Installing the Google Play Store yourself +# Google Play Store -ModAVD runs Google's "Google APIs" Android 14 system image. It comes with Google Play services but without the Play Store. If you need to download a game from the Play Store or sign in to a Google account through the store, this page shows how to put the store from Google's official "Google Play" image into your own instance. The manager is meant to offer this as an option when you create an instance later; until then, use this page. +ModAVD runs Google's "Google APIs" Android 14 system image. It comes with Google Play services but without the Play Store. If you need to download a game from the Play Store or sign in to a Google account through the store, you can add the store from Google's official "Google Play" image to an instance. Since ModAVD 0.38.2 (manager 0.5.0), both the manager and the command line can do it. New instances come without the store; add it to the ones that need it. ::: warning Read the risks first See [Risks](#risks) at the end of this page. Use a new instance for this; don't try it first on an instance that holds game data you care about. ::: +## With the manager + +The instance needs the execution bridge (any instance created without `--no-bridge` has it; see [How it relates to the bridge and the host IME](#how-it-relates-to-the-bridge-and-the-host-ime)). + +1. In the instance card's 「更多操作」 (More actions) menu, choose 「补全 Google Play 商店…」 (Add Google Play Store). +2. If the root folder does not have the five files from [the table below](#what-gets-installed) yet, the manager first takes you to the 「Google Play 商店服务」 (Google Play Store services) item of 「电脑检查」 (PC check). Pick one: + - 「下载…」 (Download): after you accept the license agreement, it downloads Google's official Play image (about 1.5 GB), keeps only the five files and deletes the rest; + - 「使用我自己的文件…」 (Use my own files): import Google's official image zip `x86_64-34_r14.zip`, or the five files themselves. + + When you fetch components for the first time (「补全组件」, Fetch components, in the PC check), you can also tick 「同时补全 Google Play 商店服务」 (Also fetch the Google Play Store services) right away. Once the five files are in the root folder, every instance uses that one copy. +3. Go back to the instance's 「更多操作」 menu and choose 「补全 Google Play 商店…」 again. The manager asks first, then cold-boots the instance once and puts the files in; an instance that was off is shut down again afterwards. +4. Open "Play Store" from the app list in the instance's window and tap "Sign in". If you reach Google's sign-in page, the store is installed. Read [Register the device](#register-the-device) before you sign in. + +- Once it is installed, the instance's 「更多操作」 menu shows 「移除 Google Play 商店…」 (Remove Google Play Store) and 「复制 GSF ID」 (Copy GSF ID). +- Once the instance is online, the store updates itself and Play services to the latest versions, which downloads a few hundred MB. The store closes itself when that update is installed; open it again a minute or two later. + +## With the command line + +In the ModAVD folder, use `tools\modavd.exe`. `` is the instance number. + +```powershell +# put the five files in the root folder, either way +.\tools\modavd.exe components fetch --play-store # download (asks for the license) +.\tools\modavd.exe components import-playstore # your own files + +# put the store into an instance +.\tools\modavd.exe playstore install # cold-boots once +.\tools\modavd.exe playstore status # check the result (the instance must be running) +.\tools\modavd.exe playstore gsfid # print the GSF ID, for registering the device +.\tools\modavd.exe playstore uninstall # remove it, cold-boots once +``` + +- `components import-playstore` takes Google's `x86_64-34_r14.zip` or the five files (any names). Each is checked against its size and SHA-256; anything that doesn't match is refused and nothing changes. +- Without the execution bridge, or without the five files in the root folder, `playstore install` fails before the instance is touched. +- `components fetch --play-store` fetches only the store's five files; `components fetch` without it fetches only adb and the system image. + ## What gets installed Five files are taken from Google's official `system-images;android-34;google_apis_playstore;x86_64` r14 and placed into the instance's own system overlay. That image is the same Android version and the same build cycle as the image ModAVD uses now. -| File | What it is | -|---|---| -| `/product/priv-app/Phonesky/Phonesky.apk` | The Play Store | -| `/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk` | Google Play services, replaced by the copy signed with the same key as the store (same version, 23.18.18) | -| `/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk` | Google Services Framework (GSF), likewise | -| `/product/priv-app/PartnerSetupPrebuilt/PartnerSetupPrebuilt.apk` | Google Partner Setup, likewise; without it, it keeps crashing in the background | -| `/product/etc/security/fsverity/play_store_fsi_cert.der` | The store's fs-verity certificate | +| File | What it is | SHA-256 | +|---|---|---| +| `/product/priv-app/Phonesky/Phonesky.apk` | The Play Store | `2616771999b1cde77fd000ae17a43784dded1f76b21ec12881137c84d5313dd2` | +| `/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk` | Google Play services, replaced by the copy signed with the same key as the store (same version, 23.18.18) | `63aaf087cdfad32fd9eca45f36966afe2f44db7e125e099f3e344ca99cee13c2` | +| `/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk` | Google Services Framework (GSF), likewise | `58999d24e4dbdde61f90b59a89c86edabc69e0908ddaaa2742091493d7e3b975` | +| `/product/priv-app/PartnerSetupPrebuilt/PartnerSetupPrebuilt.apk` | Google Partner Setup, likewise; without it, it keeps crashing in the background | `20190a60924f36baae9ef9b7687691c445dd9a764b42c4751474293baf5ea15c` | +| `/product/etc/security/fsverity/play_store_fsi_cert.der` | The store's fs-verity certificate | `37aabd485044e3af6d84755268faf8392e226ca0d188be6a80335525ce0ec6ff` | The image's own license-check placeholder, `/product/app/LicenseChecker`, is also hidden: its package name is `com.android.vending` too, and it would clash with the store. -For why Play services has to be replaced as well, and why a plain `adb install` doesn't work, see [Why it is done this way](#why-it-is-done-this-way). +The manager and the command line check the size and SHA-256 of each of the five files before putting them in. For why Play services has to be replaced as well, and why a plain `adb install` doesn't work, see [Why it is done this way](#why-it-is-done-this-way). + +## Register the device + +ModAVD instances aren't devices certified by Google. If signing in, or using Google apps afterwards, is refused with a message that the device isn't Play Protect certified, register the instance's GSF ID with your Google account: + +1. Get the GSF ID. With the instance running and online, choose 「复制 GSF ID」 (Copy GSF ID) in its 「更多操作」 menu, or run `.\tools\modavd.exe playstore gsfid`. It gives the ID in decimal and in hexadecimal; enter whichever the registration page asks for. If there is no ID yet, leave the network on for a minute or two and try again. For a manual install, use `playstore.sh gsfid` from [Manual install](#manual-install). +2. On the PC, open in a browser, sign in with the Google account you will use in the instance, enter the GSF ID and submit it. +3. Give the registration a while to take effect, shut the instance down and start it again, then sign in. + +- Each instance has its own GSF ID and needs its own registration. Clearing the data of "Google Services Framework" or recreating the instance gives it a new ID, which has to be registered again. +- Registration only lets Google apps work; the store still shows the device as uncertified. + +## How it relates to the bridge and the host IME + +- **Host IME**: an ordinary app, not affected. +- **Execution bridge**: the store and the bridge both live in the instance's system overlay, each with its own files. With the store installed, `bridge verify` still passes and the post-boot setup still runs. +- **The store depends on the writable-system boot that the bridge brings**: + - Instances created with `--no-bridge` can't take the store; in the manager, 「补全 Google Play 商店…」 is greyed out for them and says the bridge is required. + - Don't remove the bridge from an instance with the store. Without the bridge the instance boots from Google's original image again, the store is gone, and mismatched updates are left behind in the system. If the manager installed the store, `bridge uninstall` refuses until you remove the store. If you installed it by hand, the manager doesn't know about it and doesn't stop you (see [Manual install](#manual-install)); remove the store yourself first, as in [Manual uninstall](#manual-uninstall). +- **Upgrading ModAVD**: as long as the system image version stays the same, the instance's overlay is left alone, so the store stays, like the bridge, and needs no reinstall. +- **A different system image version**: the files, offsets and checksums on this page are for r14 only; each manager version carries the files for its own image. If a later ModAVD moves to another image version, follow the documentation of that version. + +## Uninstall + +In the instance's 「更多操作」 menu, choose 「移除 Google Play 商店…」 (Remove Google Play Store), or run `.\tools\modavd.exe playstore uninstall`. The manager disables the store first, removes the updates the store installed for itself, Play services and GSF and the files that were put in, cold-boots once, and brings the image's placeholder back. + +- Afterwards Play services is back to the image's 23.18, with its data kept. Updates the store installed for other apps (Android System WebView, for example) stay. +- The five files in the root folder are not deleted; the next install uses them. +- A Google account you signed in with stays in the instance. To remove it, use "Passwords & accounts" in Android's settings. +- For a manual install the menu has no 「移除 Google Play 商店…」; use [Manual uninstall](#manual-uninstall). + +## Manual install + +If the manager and the command line don't work for you, you can install the store by hand with the steps below. It puts in the same five files at the same places. -## Before you start +::: warning The manager doesn't recognize a manual install +The manager only knows a store it installed itself (recorded in the instance's `mas-avd.json`). A store you install by hand is invisible to it: the instance card's menu still shows 「补全 Google Play 商店…」 (Add Google Play Store), there is no 「移除 Google Play 商店…」 (Remove) or 「复制 GSF ID」 (Copy GSF ID), and `bridge uninstall` is not blocked. For a manual install, use the script's `gsfid` to register the device and [Manual uninstall](#manual-uninstall) to remove it. +::: + +### Before you start - ModAVD 0.36.0 or newer, and an instance with the arm64 execution bridge (any instance created without `--no-bridge`). Only instances with the bridge boot with a writable system, which is what lets the store in. - About 5 GB of temporary space on the PC (1.5 GB zip, 3.1 GB `system.img`) and about 3.5 GB free on the instance's data disk for temporary files. You can delete both afterwards. @@ -35,7 +109,7 @@ $dl = 'D:\gplay' # a folder for the downloads, English letters and digits onl New-Item -ItemType Directory -Force $dl | Out-Null ``` -## 1. Download the Play image and check it +### 1. Download the Play image and check it ```powershell curl.exe -L -o "$dl\x86_64-34_r14.zip" https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-34_r14.zip @@ -46,7 +120,7 @@ curl.exe -L -o "$dl\x86_64-34_r14.zip" https://dl.google.com/android/repository/ - `googledownloads.cn/android/repository/` or `mirrors.cloud.tencent.com/AndroidSDK/` in place of `dl.google.com/android/repository/` serve the same file. - The image is covered by Google's Android Software Development Kit License Agreement, the one fetching the components shows and keeps in `downloads\android-sdk-license.txt`. -## 2. Extract system.img +### 2. Extract system.img ```powershell tar -xf "$dl\x86_64-34_r14.zip" -C $dl x86_64/system.img @@ -54,7 +128,7 @@ tar -xf "$dl\x86_64-34_r14.zip" -C $dl x86_64/system.img This gives `$dl\x86_64\system.img`, 3,101,687,808 bytes. -## 3. Create the install script +### 3. Create the install script Copy and run the whole block; it writes `playstore.sh` into `$dl`. The script runs as root inside the instance: it mounts two partitions of `system.img` read-only, checks the SHA-256 of the five files, and only then copies them into the instance. @@ -176,7 +250,7 @@ esac [IO.File]::WriteAllText("$dl\playstore.sh", $sh.Replace("`r`n", "`n")) ``` -## 4. Install it into the instance +### 4. Install it into the instance ```powershell .\tools\modavd.exe start $i @@ -196,7 +270,7 @@ Then shut the instance down and start it again: the new files take effect after .\tools\modavd.exe start $i --window ``` -## 5. Check the result +### 5. Check the result ```powershell .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh status" @@ -216,28 +290,11 @@ com.android.vending: package:/product/priv-app/Phonesky/Phonesky.apk After a while the last line may show `/data/app/...` instead: the store has updated itself over the network, which is fine. -Then open "Play Store" from the app list in the instance's window and tap "Sign in". If you reach Google's sign-in page, the store is installed. Read the next section before you sign in. +Then open "Play Store" from the app list in the instance's window and tap "Sign in". If you reach Google's sign-in page, the store is installed. Read [Register the device](#register-the-device) above before you sign in. - Once the instance is online, the store updates Play services to the latest version right away. The store closes itself when that update is installed; open it again a minute or two later. -## 6. Register the device - -ModAVD instances aren't devices certified by Google. If signing in, or using Google apps afterwards, is refused with a message that the device isn't Play Protect certified, register the instance's GSF ID with your Google account: - -1. Get the GSF ID: - - ```powershell - .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh gsfid" - ``` - - It prints the ID in decimal and in hexadecimal; enter whichever the registration page asks for. If there is no ID yet, leave the network on for a minute or two and try again. -2. On the PC, open in a browser, sign in with the Google account you will use in the instance, enter the GSF ID and submit it. -3. Give the registration a while to take effect, shut the instance down and start it again, then sign in. - -- Each instance has its own GSF ID and needs its own registration. Clearing the data of "Google Services Framework" or recreating the instance gives it a new ID, which has to be registered again. -- Registration only lets Google apps work; the store still shows the device as uncertified. - -## 7. Delete the temporary files +### 6. Delete the temporary files ```powershell .\tools\modavd.exe shell $i "rm /data/local/tmp/playstore/system.img" @@ -247,17 +304,7 @@ Remove-Item "$dl\x86_64" -Recurse - Keep `playstore.sh` in the instance; uninstalling needs it, and it is small. - Keep the zip if you want to install the store into other instances; otherwise delete it. -## How it relates to the bridge and the host IME - -- **Host IME**: an ordinary app, not affected. -- **Execution bridge**: the store and the bridge both live in the instance's system overlay, each with its own files. With the store installed, `bridge verify` still passes and the post-boot setup still runs. -- **The store depends on the writable-system boot that the bridge brings**: - - Don't run `bridge uninstall` on an instance with the store. Without the bridge the instance boots from Google's original image again, the store is gone, and mismatched updates are left behind in the system. To remove the bridge, remove the store first (next section). - - Instances created with `--no-bridge` can't take the store. -- **Upgrading ModAVD**: as long as the system image version stays the same, the instance's overlay is left alone, so the store stays, like the bridge, and needs no reinstall. -- **A different system image version**: the files, offsets and checksums on this page are for r14 only. If a later ModAVD moves to another image version, follow the documentation of that version. - -## Uninstall +### Manual uninstall ```powershell .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh uninstall" diff --git a/docs/guide/playstore.md b/docs/guide/playstore.md index bfd57a0..3b25e2c 100644 --- a/docs/guide/playstore.md +++ b/docs/guide/playstore.md @@ -1,28 +1,102 @@ -# 自己装 Google Play 商店 +# Google Play 商店 -ModAVD 用的系统镜像是 Google 的「Google APIs」版 Android 14,自带 Google Play 服务,但没有 Play 商店。要从 Play 商店下载游戏、在商店里登录 Google 账号的,可以照这一页,把 Google 官方「Google Play」版镜像里的商店装进自己的实例。管理器以后打算做成新建实例时可选,在那之前先用这个办法。 +ModAVD 用的系统镜像是 Google 的「Google APIs」版 Android 14,自带 Google Play 服务,但没有 Play 商店。要从 Play 商店下载游戏、在商店里登录 Google 账号的,可以给实例补上 Google 官方「Google Play」版镜像里的商店。ModAVD 0.38.2(管理器 0.5.0)起,管理器和命令行都能做;新建的实例不带商店,要用的实例再补。 ::: warning 先看风险 见本页最后的[风险](#风险)。建议新建一台实例专门来装,不要先在存着重要游戏数据的实例上试。 ::: +## 用管理器装 + +实例要有执行桥(新建时没加 `--no-bridge` 就是带的,见[和执行桥、宿主输入法的关系](#和执行桥、宿主输入法的关系))。 + +1. 在实例卡片的「更多操作」里点「补全 Google Play 商店…」。 +2. 根目录还没有[下面表里](#装的是什么)那五个文件时,管理器会先带你到「电脑检查」的「Google Play 商店服务」一项,二选一: + - 点「下载…」:同意许可协议后下载 Google 官方的 Play 版镜像(约 1.5 GB),只取出五个文件,其余删掉; + - 点「使用我自己的文件…」:导入 Google 官方的镜像压缩包 `x86_64-34_r14.zip`,或者那五个文件本身。 + + 第一次补全组件(电脑检查里的「补全组件」)时,也可以直接勾上「同时补全 Google Play 商店服务」。五个文件在根目录里放好以后,每台实例都用这一份。 +3. 回到实例的「更多操作」,再点「补全 Google Play 商店…」。管理器会先问一下,然后把实例冷启动一次,把文件放进去;原来没开的实例做完会再关上。 +4. 在实例窗口的应用列表里打开「Play Store」(中文界面叫「Play 商店」),点「Sign in」,能进到 Google 的登录页就装好了。登录前先看[登记设备](#登记设备)。 + +- 装好以后,实例的「更多操作」里变成「移除 Google Play 商店…」和「复制 GSF ID」。 +- 联网以后商店会把自己和 Play 服务更新到最新版,要下载几百 MB。更新装上的那一下商店会自己关掉,过一两分钟再打开就好。 + +## 用命令行装 + +在 ModAVD 文件夹里,用 `tools\modavd.exe`。`` 是实例编号。 + +```powershell +# 根目录补全五个文件,二选一 +.\tools\modavd.exe components fetch --play-store # 下载(会问许可协议) +.\tools\modavd.exe components import-playstore <压缩包或文件夹> # 用自己的文件 + +# 装进实例 +.\tools\modavd.exe playstore install # 冷启动一次 +.\tools\modavd.exe playstore status # 看装没装好(实例要开着) +.\tools\modavd.exe playstore gsfid # 打出 GSF ID,登记设备用 +.\tools\modavd.exe playstore uninstall # 移除,冷启动一次 +``` + +- `components import-playstore` 收 Google 官方的 `x86_64-34_r14.zip`,或者那五个文件(名字不限)。逐个核对大小和 SHA-256,对不上的一律拒收,什么也不改。 +- 实例没有执行桥,或者根目录还没有五个文件时,`playstore install` 在动实例之前就报错。 +- `components fetch --play-store` 只补全商店的五个文件;不带这个参数的 `components fetch` 只补全 adb 和系统镜像。 + ## 装的是什么 从 Google 官方的 `system-images;android-34;google_apis_playstore;x86_64` r14 里取五个文件,放进实例自己的系统覆盖层。这个镜像和 ModAVD 现在用的镜像是同一个安卓版本、同一期构建。 -| 文件 | 是什么 | -|---|---| -| `/product/priv-app/Phonesky/Phonesky.apk` | Play 商店 | -| `/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk` | Google Play 服务,换成和商店同一个签名的那份(版本不变,都是 23.18.18) | -| `/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk` | Google 服务框架(GSF),同上 | -| `/product/priv-app/PartnerSetupPrebuilt/PartnerSetupPrebuilt.apk` | Google 合作伙伴设置,同上;不换的话它在后台反复崩溃 | -| `/product/etc/security/fsverity/play_store_fsi_cert.der` | 商店用的 fs-verity 证书 | +| 文件 | 是什么 | SHA-256 | +|---|---|---| +| `/product/priv-app/Phonesky/Phonesky.apk` | Play 商店 | `2616771999b1cde77fd000ae17a43784dded1f76b21ec12881137c84d5313dd2` | +| `/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk` | Google Play 服务,换成和商店同一个签名的那份(版本不变,都是 23.18.18) | `63aaf087cdfad32fd9eca45f36966afe2f44db7e125e099f3e344ca99cee13c2` | +| `/system_ext/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk` | Google 服务框架(GSF),同上 | `58999d24e4dbdde61f90b59a89c86edabc69e0908ddaaa2742091493d7e3b975` | +| `/product/priv-app/PartnerSetupPrebuilt/PartnerSetupPrebuilt.apk` | Google 合作伙伴设置,同上;不换的话它在后台反复崩溃 | `20190a60924f36baae9ef9b7687691c445dd9a764b42c4751474293baf5ea15c` | +| `/product/etc/security/fsverity/play_store_fsi_cert.der` | 商店用的 fs-verity 证书 | `37aabd485044e3af6d84755268faf8392e226ca0d188be6a80335525ce0ec6ff` | 另外把镜像自带的许可证检查占位应用 `/product/app/LicenseChecker` 藏起来:它的包名也是 `com.android.vending`,不藏会和商店撞。 -为什么要连 Play 服务一起换、为什么不能直接 `adb install`,见[为什么要这样装](#为什么要这样装)。 +管理器和命令行放进去之前,会逐个核对这五个文件的大小和 SHA-256。为什么要连 Play 服务一起换、为什么不能直接 `adb install`,见[为什么要这样装](#为什么要这样装)。 + +## 登记设备 + +ModAVD 的实例不是 Google 认证过的设备。登录时或登录后提示「设备未经 Play 保护机制认证」、不让用 Google 应用的,要把这台实例的 GSF ID 登记到你的 Google 账号: + +1. 取 GSF ID。实例开着、联网,在实例的「更多操作」里点「复制 GSF ID」;命令行用 `.\tools\modavd.exe playstore gsfid`。会给出十进制和十六进制两种写法,登记页要哪种就填哪种。提示还没有 ID 的,开着网等一两分钟再试。手动装的实例用[手动安装](#手动安装)里的 `playstore.sh gsfid`。 +2. 在电脑的浏览器里打开 ,用要在实例里登录的那个 Google 账号登录,填入 GSF ID,提交。 +3. 等一会儿让登记生效,把实例关机再开机,再去登录。 + +- 每台实例的 GSF ID 不一样,每台都要登记。清除「Google 服务框架」的数据或者重建实例以后 ID 会变,要重新登记。 +- 登记只是让 Google 应用能用,商店里照样显示设备未认证。 + +## 和执行桥、宿主输入法的关系 + +- **宿主输入法**:是普通应用,不受影响。 +- **执行桥**:商店和桥都在实例的系统覆盖层里,各放各的文件。装了商店以后 `bridge <编号> verify` 照常通过,开机后的设置也照常做。 +- **商店离不开桥带来的可写系统镜像开机**: + - 用 `--no-bridge` 新建的实例装不了;管理器里这样的实例,「补全 Google Play 商店…」是灰的,提示要执行桥。 + - 装了商店的实例不要卸执行桥:卸了桥,实例就改回用 Google 的原始镜像开机,商店没了,系统里还会留下不配套的更新。管理器装的,`bridge <编号> uninstall` 会拒绝,要先移除商店;手动装的,管理器不认,不会拦(见[手动安装](#手动安装)),要自己先照[手动卸载](#手动卸载)卸掉商店再卸桥。 +- **升级 ModAVD**:系统镜像版本不变时,实例的覆盖层不动,商店和执行桥一样留着,不用重装。 +- **换系统镜像版本**:这一页的文件、偏移和校验值只对 r14 有效;管理器每个版本带的是它那一版对应的文件。以后 ModAVD 换了镜像版本,以那时的文档为准。 + +## 卸载 + +在实例的「更多操作」里点「移除 Google Play 商店…」,或者用命令行 `.\tools\modavd.exe playstore uninstall`。管理器会先停用商店,去掉商店、Play 服务、GSF 从商店装的更新和放进去的文件,冷启动一次,再把镜像自带的占位应用恢复。 + +- 卸完以后 Play 服务回到镜像自带的 23.18,数据保留。商店给别的应用装过的更新(比如 Android System WebView)会留着。 +- 根目录里的五个文件不删,下次再补全时直接用。 +- 已经登录的 Google 账号会留在实例里,不想留就在安卓设置的「Passwords & accounts」(中文界面叫「密码和帐号」)里删掉。 +- 手动装的,管理器的菜单里没有「移除」,照[手动卸载](#手动卸载)做。 + +## 手动安装 + +管理器和命令行用不了时,可以照下面的步骤自己装。装的是同样的五个文件,放在同样的位置。 -## 开始前确认 +::: warning 管理器不认手动装的 +管理器只认自己装的商店(记在实例的 `mas-avd.json` 里),照这里手动装的它看不出来:实例卡片的菜单里还是「补全 Google Play 商店…」,没有「移除」和「复制 GSF ID」,`bridge <编号> uninstall` 也不拦。手动装的,登记设备用下面脚本的 `gsfid`,卸载照[手动卸载](#手动卸载)做。 +::: + +### 开始前确认 - ModAVD 0.36.0 或更新,实例带 arm64 执行桥(新建时没加 `--no-bridge` 就是带的)。只有带桥的实例按可写系统镜像开机,商店才放得进去。 - 电脑上要有约 5 GB 临时空间(压缩包 1.5 GB,解出来的 `system.img` 3.1 GB);实例的数据盘要有约 3.5 GB 空间放临时文件。装完都可以删。 @@ -35,7 +109,7 @@ $dl = 'D:\gplay' # 放下载文件的文件夹,路径只用英文 New-Item -ItemType Directory -Force $dl | Out-Null ``` -## 1. 下载 Play 版镜像并核对 +### 1. 下载 Play 版镜像并核对 ```powershell curl.exe -L -o "$dl\x86_64-34_r14.zip" https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-34_r14.zip @@ -46,7 +120,7 @@ curl.exe -L -o "$dl\x86_64-34_r14.zip" https://dl.google.com/android/repository/ - 把 `dl.google.com/android/repository/` 换成 `googledownloads.cn/android/repository/` 或 `mirrors.cloud.tencent.com/AndroidSDK/`,也能下到同一个文件。 - 这个镜像受 Google《Android 软件开发套件许可协议》约束,就是补全组件时显示、存在 `downloads\android-sdk-license.txt` 里的那一份。 -## 2. 解出 system.img +### 2. 解出 system.img ```powershell tar -xf "$dl\x86_64-34_r14.zip" -C $dl x86_64/system.img @@ -54,7 +128,7 @@ tar -xf "$dl\x86_64-34_r14.zip" -C $dl x86_64/system.img 得到 `$dl\x86_64\system.img`,3,101,687,808 字节。 -## 3. 生成安装脚本 +### 3. 生成安装脚本 整段复制运行,会在 `$dl` 里生成 `playstore.sh`。它在实例里用 root 运行:只读挂上 `system.img` 里的两个分区,核对五个文件的 SHA-256,对上了才放进实例。 @@ -176,7 +250,7 @@ esac [IO.File]::WriteAllText("$dl\playstore.sh", $sh.Replace("`r`n", "`n")) ``` -## 4. 装进实例 +### 4. 装进实例 ```powershell .\tools\modavd.exe start $i @@ -196,7 +270,7 @@ esac .\tools\modavd.exe start $i --window ``` -## 5. 确认装好了 +### 5. 确认装好了 ```powershell .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh status" @@ -216,28 +290,11 @@ com.android.vending: package:/product/priv-app/Phonesky/Phonesky.apk 最后一行过一会儿可能变成 `/data/app/...`:那是商店联网后自己更新了,正常。 -然后在实例窗口的应用列表里打开「Play Store」(中文界面叫「Play 商店」),点「Sign in」,能进到 Google 的登录页就装好了。登录前先看下一节。 +然后在实例窗口的应用列表里打开「Play Store」(中文界面叫「Play 商店」),点「Sign in」,能进到 Google 的登录页就装好了。登录前先看上面的[登记设备](#登记设备)。 - 开机联网后,商店会马上把 Play 服务更新到最新版。更新装上的那一下商店会自己关掉,过一两分钟再打开就好。 -## 6. 登记设备 - -ModAVD 的实例不是 Google 认证过的设备。登录时或登录后提示「设备未经 Play 保护机制认证」、不让用 Google 应用的,要把这台实例的 GSF ID 登记到你的 Google 账号: - -1. 取 GSF ID: - - ```powershell - .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh gsfid" - ``` - - 会打出十进制和十六进制两种写法,登记页要哪种就填哪种。提示还没有 ID 的,开着网等一两分钟再试。 -2. 在电脑的浏览器里打开 ,用要在实例里登录的那个 Google 账号登录,填入 GSF ID,提交。 -3. 等一会儿让登记生效,把实例关机再开机,再去登录。 - -- 每台实例的 GSF ID 不一样,每台都要登记。清除「Google 服务框架」的数据或者重建实例以后 ID 会变,要重新登记。 -- 登记只是让 Google 应用能用,商店里照样显示设备未认证。 - -## 7. 删掉临时文件 +### 6. 删掉临时文件 ```powershell .\tools\modavd.exe shell $i "rm /data/local/tmp/playstore/system.img" @@ -247,17 +304,7 @@ Remove-Item "$dl\x86_64" -Recurse - 实例里的 `playstore.sh` 留着,卸载时还要用,它很小。 - 压缩包要给别的实例装就留着,不要了就删掉。 -## 和执行桥、宿主输入法的关系 - -- **宿主输入法**:是普通应用,不受影响。 -- **执行桥**:商店和桥都在实例的系统覆盖层里,各放各的文件。装了商店以后 `bridge <编号> verify` 照常通过,开机后的设置也照常做。 -- **商店离不开桥带来的可写系统镜像开机**: - - 不要对装了商店的实例运行 `bridge <编号> uninstall`。卸了桥,实例就改回用 Google 的原始镜像开机,商店没了,系统里还会留下不配套的更新。要卸桥,先照下一节卸掉商店。 - - 用 `--no-bridge` 新建的实例装不了。 -- **升级 ModAVD**:系统镜像版本不变时,实例的覆盖层不动,商店和执行桥一样留着,不用重装。 -- **换系统镜像版本**:这一页的文件、偏移和校验值只对 r14 有效。以后 ModAVD 换了镜像版本,以那时的文档为准。 - -## 卸载 +### 手动卸载 ```powershell .\tools\modavd.exe shell $i "su 0 sh /data/local/tmp/playstore/playstore.sh uninstall"