OnePlus One/ OnePlus 1/ 一加1代 国航 刷 LineageOS 18.1 报错解决方法

我这台到手的时候是安卓4的系统,我直接按照LineageOS官网教程进行操作遇到了如下问题。(不知道更新到官方安卓6.0氢系统再刷成LineageOS会不会出同样的问题)

按照官方教程,当进行到sideload 固件压缩包(lineage-18.1-20221115-nightly-bacon-signed.zip )的时候会出现错误信息 error status 1, 意思是要安装的安卓版本低于已有版本。我在网上搜了下没发现一加1出现过这个问题,我猜可能是因为LineageOS在开发时都是在氧OS的基础上刷机的,我手机上的是氢OS所以出现了这个问题。

于是我在一加英文官网https://www.oneplus.com/support/softwareupgrade/details?code=PM1574156029809下载了氧OS的ROM。然后用sideload的方式尝试安装,出现报错信息:error 7 安装包是给OnePlus用的不是给A0001用的

解决方法如下:不要解压氧OS的压缩包,用WinRAR直接打开压缩包,在里边找到名为updater-script的文件。尝试用记事本直接打开,发现无法修改。先把这个文件拖出到桌面上,再用记事本打开删除第一行代码。保存后把文件再拖回到WinRAR窗口中原路径下覆盖掉原文件。重新sideload修改后的氧OS的压缩包,应该就可以顺利安装了。

安装氧OS后打开USB调试,发现不论是重新插拔usb线还是重启手机都不出现信任此电脑的对话框,adb也识别不到手机。只能打开WiFi调试功能,用adb connect x.x.x.x:5555 (手机的IP地址)连接手机进行操作。接下来按照LineageOS官方教程从头开始就能成功刷机了。进入到fastboot后就可以用usb线运行adb操作了。在刷机操作过程中adb可能会报错说有多个设备,请指定用哪个设备。这时就要在adb后加-s来指定用那个设备,先adb devices显示设备代码,再在adb命令后加-s 设备代码(像这样 adb -s xxxxxx sideload /path/to/*.zip )。

PS:我其实是使用TWRP安装的氧OS,因为当出现error 7 的时候我以为是LineageOS的recovery有问题。所以我又刷了TWRP,试了下发现还是同样的报错,我才去找了error 7的解决方法。

Flipper Zero “Transmission is blocked” Unlock Sub-GHz region restriction by compiling your own firmware

For firmware version: stable 0.71.1

Use the Docker container of the Flipper Zero toolchain as the compile environment.

docker pull flipperdevices/flipperzero-toolchain
docker run -it flipperdevices/flipperzero-toolchain bash

Get the official Flipper Zero firmware source code.

git clone https://github.com/flipperdevices/flipperzero-firmware.git

Get into the directory

cd flipperzero-firmware

Two files are needed to be modified to unlock region tx restrictions:

First, in ./assets/resources/subghz/assets you need to create a file named as Settings_User. Just copy the same file from the Rogue Master repo.

Rogue Master firmware repository

https://github.com/RogueMaster/flipperzero-firmware-wPlugins
wget -P ./assets/resources/subghz/assets https://github.com/RogueMaster/flipperzero-firmware-wPlugins/raw/420/assets/resources/subghz/assets/setting_user.txt

Second, the file named furi_hal_subghz.c located in ./firmware/targets/f7/furi_hal. In the code block beginning from line 278, comment out the “if” line by adding “//” at the beginning.

bool furi_hal_subghz_tx() {
// if(furi_hal_subghz.regulation != SubGhzRegulationTxRx) return false;
furi_hal_spi_acquire(&furi_hal_spi_bus_handle_subghz);
cc1101_switch_to_tx(&furi_hal_spi_bus_handle_subghz);
furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz);
return true;
}

But there is no vim or nano in this container, so you need to edit it on the host machine.

mv firmware/targets/f7/furi_hal/furi_hal_subghz.c firmware/targets/f7/furi_hal/furi_hal_subghz.c.backup
#detach from container press ctrl+p then ctrl+q
#on host machine
docker ps
docker cp container_id:/flipperzero-firmware/firmware/targets/f7/furi_hal/flipper-z-f7-full-local.dfu.backup ./
mv furi_hal_subghz.c.backup furi_hal_subghz.c
#edit furi_hal_subghz.c as mentioned
docker cp ./furi_hal_subghz.c container_id:/flipperzero-firmware/firmware/targets/f7/furi_hal
#go back to conainer
docker attach container_id

Run command ./fbt to compile the firmware. When finished you will find the firmware file in ./dist directory.

To copy the firmware from the container to the host machine, run this command on the host machine.

docker cp container_id:/flipperzero-firmware/dist/f7-D/flipper-z-f7-full-local.dfu ./

Reference

Flipper zero: Build your own firmware!

Youtube Channel MugAMuggle