当前位置: 首页 > news >正文

黄岩做网站常州做网站的 武进

黄岩做网站,常州做网站的 武进,wordpress换了域名打不开了,外汇交易平台前言 高版本的android设备#xff0c;在remount之后#xff0c;如果再进行ota升级#xff0c;会产生异常#xff0c;从而无法升级成功。 如何判断设备是否remount 当前已android 10 平台为例 当我们执行 adb remount 时#xff0c;系统调用会调用到system/core/adb/dae…前言 高版本的android设备在remount之后如果再进行ota升级会产生异常从而无法升级成功。 如何判断设备是否remount 当前已android 10 平台为例 当我们执行 adb remount 时系统调用会调用到system/core/adb/daemon/remount_service.cpp /** Copyright (C) 2008 The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/#include errno.h #include fcntl.h #include string.h #include sys/types.h #include sys/wait.h #include unistd.h #include string#include adb.h #include adb_io.h #include adb_unique_fd.hstatic constexpr char kRemountCmd[] /system/bin/remount;static bool do_remount(int fd, const std::string cmd) {if (getuid() ! 0) {WriteFdExactly(fd, Not running as root. Try \adb root\ first.\n);return false;}auto pid fork();if (pid 0) {WriteFdFmt(fd, Failed to fork to %s: %s\n, kRemountCmd, strerror(errno));return false;}if (pid 0) {// child side of the forkdup2(fd, STDIN_FILENO);dup2(fd, STDOUT_FILENO);dup2(fd, STDERR_FILENO);execl(kRemountCmd, kRemountCmd, cmd.empty() ? nullptr : cmd.c_str(), nullptr);_exit(errno);}int wstatus 0;auto ret waitpid(pid, wstatus, 0);if (ret -1) {WriteFdFmt(fd, Failed to wait for %s: %s\n, kRemountCmd, strerror(errno));return false;} else if (ret ! pid) {WriteFdFmt(fd, pid %d and waitpid return %d do not match for %s\n,static_castint(pid), static_castint(ret), kRemountCmd);return false;}if (WIFSIGNALED(wstatus)) {WriteFdFmt(fd, %s terminated with signal %s\n, kRemountCmd,strsignal(WTERMSIG(wstatus)));return false;}if (!WIFEXITED(wstatus)) {WriteFdFmt(fd, %s stopped with status 0x%x\n, kRemountCmd, wstatus);return false;}if (WEXITSTATUS(wstatus)) {WriteFdFmt(fd, %s exited with status %d\n, kRemountCmd, WEXITSTATUS(wstatus));return false;}return true; }void remount_service(unique_fd fd, const std::string cmd) {const char* success do_remount(fd.get(), cmd) ? succeeded : failed;WriteFdFmt(fd.get(), remount %s\n, success); } 当前的思路时再执行do_remount 函数时添加一个persist变量来判断记录已经remount了并记录remount次数。 具体修改如下 #include unistd.h //add #include android-base/properties.h //add #include string ......static bool do_remount(int fd, const std::string cmd) {......//add std::string prop android::base::GetProperty(persist.sys.remount.count, 0);int count std::stoi(prop) 1;android::base::SetProperty(persist.sys.remount.count, std::to_string(count));// addreturn true; }获取状态remount状态 java import android.os.SystemProperties;public static final String PROP_REMOUNT_COUNT persist.sys.remount.count;/*** NULL* return device remount status*/public static boolean isRemounted(){return getRemountCount() 0;}/*** NULL* return get remount count Since first power up*/public static int getRemountCount(){return SystemProperties.getInt(PROP_ROOT_COUNT,0);}
http://www.hkea.cn/news/14291600/

相关文章:

  • 网站建设福州最好淘宝客网站必须备案吗
  • 建设网站需要了解什么互联网金融公司排名
  • 淘宝网网页版入口单页应用seo如何解决
  • 天津网站优化哪家快app制作需要学什么
  • 中国建设银行官网站e路护下载三亚网站制
  • 地方网站需要什么手续这两天发生的重大新闻
  • 可以进不良网站的浏览器wordpress 免登录发布
  • 网站模板的功能网页前端技术有哪些
  • wordpress主题添加字体设置公司网站seo怎么做
  • 网站开发 知乎罗湖网站建设公司乐云seo
  • wordpress建博客网站吗用cms做网站怎么样
  • 建站推广网站排名小区媒体网站建设
  • 长沙网站建设哪个好做网站需要监事吗
  • 门户网站开发框架百度推广一个月多少钱
  • 网站运营配置网页游戏排行榜前十名歌
  • 优质企业网站推广icp备案查询
  • 做网站的企业百度手机助手app下载安装
  • 莘县网站建设如何在电脑上做网站
  • 企业营销网站案例网站模版与模板的使用
  • net网站开发做手工简笔工程项目流程八个阶段
  • 班服定制的网站asp.net企业网站
  • 龙岩网站设计 信任推商吧做词site 危险网站
  • 培训网站模板免费济南手机网站开发
  • 注册公司网上申请入口网站上市企业网站设计
  • 腾网站建设网站流量超
  • 网站版本功能列表正规企业网站开发使用方法
  • 菏泽网站建设兼职学生网站建设的总结与评价
  • 中学网站建设工作实施方案wordpress 标签类别
  • 长沙网站建设服务商网站怎么做充值系统
  • 赣州市网站建设邢台手机网站建设报价