Sailfish + GFI + TWRP + MagiskRoot系统
-
镜像对应关系查找地址 地址 google 搜索 aosp codename -
下载Google sailfish镜像 版本 8.1.0 OPM1.171019.011 下载地址 下载链接google 搜索 google factory images -
下载好
sailfish使用 7z 进行解压7z x sailfish-opm1.171019.011-factory-56d15350.zip -
解压后进入解压目录 - > 解压 image-sailfish-opm1.171019.011.zip
cd sailfish-opm1.171019.011 # 解压镜像压缩包 7z x image-sailfish-opm1.171019.011.zip -
安装
tree,使用tree -NChfl | grep fastboot定位解压后的fastboot的位置apt install tree tree -NCfhl | grep fastboot > ./COMPILE/aosp810r1/out/host/linux-x86/bin/fastboot cd /COMPILE/aosp810r1/out/host/linux-x86/bin/ # 当前fastboot的版本号随着编译而生成,不会固定 ./fastboot --version -
替换
~/Desktop/COMPILE/aosp810r1/out/host/linux-x86/bin中的fastboot,替换fastboot 下载链接,我这里是fastboot8.1.0r1.zip,下载把fastboot解压到当前路径,修改fastboot权限chmod 777 fastboot -
将
fastboot加入系统路径vim ~/.bashrc # 在 .bashrc中添加 export Path=/root/Desktop/COMPILE/aosp810r1/out/host/linux-x86/bin:$PATH # 重新加载 .bashrc source ~/.bashrc # 使用fastboot检查是否生效 fastboot --version -
手机连接usb数据线,连入虚拟机中
-
保证手机有充足的电脑,将手机进行关机,按
音量-+电源键进入fastboot模式,进入后松开电源键->音量-, 保证Device是unlock状态操作提示:按音量键调整 start 状态,电源键进入
-
使用fastboot devices就可以查看到连接设备的信息
-
使用
./flash-all.sh命令进行刷机cd /root/Desktop/sailfish-opm1.171019.011 ./flash-all.sh温馨提示:如果使用./flash-all.sh 刷机停住好久不动,可强制退出。重新执行一次。
-
进入引导模式
-
引导完毕后,进入开发者模式:setting -> system -> about phone -> version (连续点击7次版本号)
-
进入打开者选项,开启开发者模式,进行相应配置,打开usb调试
-
下载
twrp和Magisk-v22.0.apk(root工具) twrp进入 TWRP 点击
Devices- > 搜索sailfish(手机型号) ,在下方提示框中会出现跳转地址,点击进去 选择 Primary (Americas)点击下载链接 twrp-3.3.0-0-sailfish.img 下载 下载链接
Magisk
- 进入
bootloader模式
```shell
adb reboot bootloader
```
-
push Magisk 到手机 sdcard中
adb push Magisk-v2* /sdcard/ -
刷入twrp,执行完命令后拔掉usb数据线
fastboot boot twrp-3.3.0-0sailfish.img -
之后手机会进入twrp
- 进入Settings,点击上方第三个图标 -> 关掉Enable screen timeout
- 语言可点击上方最后一个图标进行切换
- 返回最开始进入的页面,选中
install找到 push到手机的Magisk, 点击install image -> 滑动确认
-
连接数据线使用adb 获取root权限,解决WFIW连接无网络问题
adb shell su settings put global captive_portal_http_url https://www.google.cn/generate_204 settings put global captive_portal_https_url https://www.google.cn/generate_204 settings put global ntp_server 1.hk.pool.ntp.org reboot
Sailfish + AOSP + (APP root)Twrp + MagiskRoot
-
编译好的系统镜像都在
~/Desktop/COMPILE/aosp810r1/out/target/product/sailfish中 -
进行上方目录把其中的7个镜像拷贝 放入 sailfish镜像压缩包解压后的地方 eg:
/root/Desktop/sailfish-opm1.171019.011/image-sailfish-opm1.171019.011/, 把拷贝过来的镜像替换掉该目录中的镜像 -
选中该目录下所有的文件 -> 右键 Create Archive… 打包成 new.zip,打包好之后移至上层目录
-
修改
flash-all.sh脚本中的fastboot -w update 目标文件为我们打包好的 new.zip文件vim flash-all.sh # 修改最后一行fastboot -w update image-sailfish-opm1.171019.001.zip (把这个zip替换成我们压缩好的new.zip文件) -
手机进入fastboot
adb reboot bootloader # 进入fastboot,Android机器人躺着肚子打开界面,输入下方命令 ./flash-all.sh -
给手机调试权限,解决WIFI连接无网络问题
adb shell su settings put global captive_portal_http_url https://www.google.cn/generate_204 settings put global captive_portal_https_url https://www.google.cn/generate_204 settings put global ntp_server 1.hk.pool.ntp.org reboot