diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000..79ded22 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,107 @@ +# Xiaomi HyperOS BootLoader Bypass + +![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![English](https://img.shields.io/badge/English-brightgreen?style=for-the-badge)](README.md) + +利用漏洞绕过小米 HyperOS 对 BootLoader 解锁账户绑定限制社区等级的 PoC。 + +您可随时向本项目提出改进方案 :) + +## 💘 php-adb + +本项目使用了 [php-adb](https://github.com/MlgmXyysd/php-adb) 运行库。 + +## ☕ 支持开发 + +✨ 如果您喜欢我的项目,可以请我喝咖啡: + + - [爱发电](https://afdian.net/@MlgmXyysd) + - [PayPal](https://paypal.me/MlgmXyysd) + - [Patreon](https://www.patreon.com/MlgmXyysd) + +## ⚠️ 警告 + +解锁 BootLoader 后,你可能会遇到以下情况: + +- 软件或硬件无法正常工作,甚至永久性损坏。 +- 设备中存储的数据丢失。 +- 信用卡被盗刷,或遭受其他经济损失。 + +如果您遇到上述任何情况,您应该自己承担所有责任,因为这是您在解锁 BootLoader 时可能遇到的风险。这显然不能涵盖所有风险。我们已经警告过您了。 + +- 保修丢失。根据小米提供的免责条款,这不仅是基础三包,您购买的一些额外延保(如 Mi Care 或碎屏险)也可能会丢失。 +- 像 Samsung Knox 那样的硬件级熔断。TEE 相关功能将永久损坏。除更换主板外,无法恢复。 +- 刷入第三方系统后出现功能异常,这可能是因为内核源代码闭源引起。 +- 设备或账号因为解锁 BootLoader 被小米封禁。 + +如果您遇到上述任何情况,请您自认倒霉。自从小米限制解锁 BootLoader 后,小米就一直在违背"极客"精神,甚至违背了 GPL。小米对 BootLoader 解锁的限制是无穷尽的,作为开发者,我们对此无能为力。 + +## 📲 前置要求 + +- 一个有效的设备: + - 一个未被封禁\*的小米、红米或 POCO 设备。 + - 设备正在运行官方版 HyperOS。 + - (2023/11/23 更新) 您的设备不会被小米强制验证账户资格。 +- 一个有效的 SIM 卡: + - \* 无法使用 SIM 卡的平板电脑除外。 + - SIM 卡不得处于停机或无服务状态。 + - SIM 卡需要能够连接到互联网。 + - 每张有效 SIM 卡在三个月内只能解锁 2 台设备。 +- 一个有效的小米账号: + - 一个未被封禁\*的小米账号。 + - 每个账号一个月只能解锁一部手机,一年只能解锁三部手机。 +- 您已阅读并理解上述 [警告](#%EF%B8%8F-警告)。 + +- \* 根据小米提供的解锁说明,某些账号和设备将被禁止使用解锁工具,这被称为"风控"。 + +## ⚙️ 使用教程 + +1. 从 [官方网站](https://www.php.net/downloads) 下载并安装适用于您操作系统的 PHP 8.0+。 +2. 在 `php.ini` 中启用 OpenSSL 扩展。 +3. 将 [php-adb](https://github.com/MlgmXyysd/php-adb) 中的 `adb.php` 放到目录中。 +4. 下载 [platform-tools](https://developer.android.com/studio/releases/platform-tools),并将其放入 `libraries`。*注意:Mac OS 需要将 `adb` 重命名为 `adb-darwin`。 +5. 打开终端,使用 PHP 解释器执行 [脚本](bypass.php)。 + +- p.s. Releases 已将所需文件和一键脚本打包。 + +6. 多次点击`设置 - 关于手机 - MIUI 版本`启用`开发者选项`。 +7. 在`设置 - 附加设置 - 开发者选项`中启用`OEM 解锁`、`USB 调试`和`USB 调试(安全设置)`。 +8. 登录一个_有效_\*的小米账号。 +9. 通过有线方式将设备连接到电脑。 +10. 选中`始终允许来自此计算机的调试`,然后单击`确定`。 + +- \* 请参阅上文的 "[前置要求](#-前置要求)"。 + +11. 等待并按脚本提示操作。 +12. 绑定成功后,您可以使用 [官方解锁工具](https://www.miui.com/unlock/index.html) 查看需要等待的时间。 +13. 在等待期间,请正常使用设备,保持 SIM 卡插入,不要登出小米账号或关闭"查找我的手机",不要重新绑定设备,直到成功解锁。设备将每隔一段时间自动向服务器发送 `HeartBeat` 数据包。 + +## 📖 漏洞分析 + +- 维修中... + +## 🔖 FAQ + +- Q: 为什么解锁工具仍然提醒我等待 168/360(或更长)小时? +- A: 根据原理,该 PoC 只绕过了小米为 HyperOS 额外添加的限制。您仍然需要遵循 MIUI 的限制。 + +- Q: 设备显示 "验证失败,请稍后再试"。 +- A: 这是正常现象,设备端的绑定请求已被脚本拦截。实际绑定结果以脚本提示为准。 + +- Q: 绑定失败,错误代码为 `401`。 +- A: 您的小米账号凭据已过期,您需要在设备中登出账号并重新登录。 + +- Q: 绑定失败,错误代码为 `20086`。 +- A: 您的设备凭据已过期,您可能需要重新启动设备。 + +- Q: 绑定失败,错误代码为 `20090` 或 `20091`。 +- A: 设备的 `Security Device Credential Manager` 功能已损坏,请联系售后服务寻求支持。 + +- Q: 绑定失败,错误代码为 `30001`。 +- A: 您的设备已被小米强制验证账户资格。小米早就抛弃了"极客"精神,我们对此无能为力。 + +- Q: 绑定失败,错误代码为 `86015`。 +- A: 服务器拒绝了本次绑定请求,请重试。 + +## ⚖️ 协议 + +无许可证,您只被允许使用本项目。未经许可,不得删除或更改本软件的所有版权(以及链接等)。本项目所有权利归 [MeowCat Studio](https://github.com/MeowCat-Studio)、[Meow Mobile](https://github.com/Meow-Mobile) 和 [NekoYuzu](https://github.com/MlgmXyysd) 所有。 diff --git a/README.md b/README.md index dba8b9c..23d995d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Xiaomi BootLoader Bypass +# Xiaomi HyperOS BootLoader Bypass ![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![中文文档](https://img.shields.io/badge/中文文档-brightgreen?style=for-the-badge)](README-zh.md) @@ -51,7 +51,7 @@ If you're experiencing any of the above, consider yourself damned. Ever since Xi - Each account can only unlock 1 phone in a month and 3 phones in a year period. - You have read and understood the [Warning](#%EF%B8%8F-warning) above. -\* According to the unlocking instructions provided by Xiaomi, it will prohibit some accounts and devices from using the unlocking tool, which is called "risk control". +- \* According to the unlocking instructions provided by Xiaomi, it will prohibit some accounts and devices from using the unlocking tool, which is called "risk control". ## ⚙️ How to use @@ -69,22 +69,24 @@ If you're experiencing any of the above, consider yourself damned. Ever since Xi 9. Connect phone to PC via wired interface. 10. Check `Always allow from this computer` and click `OK`. -\* See "[Unlocking Requirements](#-Unlocking-requirements)" above. +- \* See "[Unlocking Requirements](#-Unlocking-requirements)" above. 11. Wait and follow the prompts of script. 12. After successful binding, you can use the [official unlock tool](https://en.miui.com/unlock/index.html) to check the time you need to wait. +13. During the waiting period, please use the device normally, keep the SIM card inserted, do not log out of your account or turn off `Find My Phone`, and do not re-bind the device until it is successfully unlocked. The device will automatically send `HeartBeat` packets to the server every once in a while. ## 📖 Workaround -- [52 Pojie]() -- [My Blog]() -- [My Blog (English)]() +- Undergoing maintenance... ## 🔖 FAQs - Q: Why does the unlock tool still remind me to wait 168/360 (or more) hours? - A: By principle, this PoC only bypasses the restrictions added for HyperOS. You still need to comply with the restrictions for MIUI. +- Q: The device shows `Couldn't verify, wait a minute or two and try again`. +- A: This is normal, the binding request on the device side has been blocked by our script. The actual binding result is subject to the script prompt. + - Q: Binding failed with error code `401`. - A: Your Xiaomi account credentials have expired, you need to log out and log in again in your device. @@ -97,6 +99,9 @@ If you're experiencing any of the above, consider yourself damned. Ever since Xi - Q: Binding failed with error code `30001`. - A: Your device has been forced to verify the account qualification by Xiaomi. Xiaomi lost its 'geek' spirit a long time ago, and there's nothing we can do about it. +- Q: Binding failed with error code `86015`. +- A: The server has rejected this bind request, please try again. + ## ⚖️ License No license, you are only allowed to use this project. All copyright (and link, etc.) in this software is not allowed to be deleted or changed without permission. All rights are reserved by [MeowCat Studio](https://github.com/MeowCat-Studio), [Meow Mobile](https://github.com/Meow-Mobile) and [NekoYuzu](https://github.com/MlgmXyysd). diff --git a/bypass.php b/bypass.php index 6a95f74..330dfe5 100644 --- a/bypass.php +++ b/bypass.php @@ -328,7 +328,8 @@ logf("Refactoring parameters..."); $data = json_decode(decryptData($args), true); -$data["rom_version"] = str_replace("V816", "V14", $data["rom_version"]); +// V816 is the special identity for HyperOS in MIUI version +$data["rom_version"] = str_replace("V816", "V14", decryptData($args)); $data = json_encode($data); $sign = signData($data);