问题

执行 adb remount 时提示 failed

$ adb root
restarting adbd as root

$ adb remount
Binder ioctl to enable oneway spam detection failed: Invalid argument
remount succeeded

分析

AOSP S 中 ProcessState.cpp 包含该报错信息,可以查看以下两个文件:

status_t ProcessState::enableOnewaySpamDetection(bool enable) {
    uint32_t enableDetection = enable ? 1 : 0;
    if (ioctl(mDriverFD, BINDER_ENABLE_ONEWAY_SPAM_DETECTION, &enableDetection) == -1) {
        ALOGI("Binder ioctl to enable oneway spam detection failed: %s", strerror(errno));
        return -errno;
    }
    return NO_ERROR;
}

 总结

1. 这个 remount (enableOnewaySpamDetection)的问题是在S(Android 12)才开始加入的。

2. 虽然 "enable oneway spam detection" 报错,但是不影响 remount 成功。
只是单向垃圾邮件检测启用存在问题。(待学习)
     

   

另一种remount失败情形


 一种某些机器可用的解决方案

#首先在Settings->system->Developer options 选择OEM unlocking,
adb reboot bootloader # 然后运行命令,进入fastboot
fastboot flashing unlock # 根据提示操作,注意,unlock 之后再次启动时手机会自动擦除/data 分区
fastboot reboot

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐