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

京东网站建设策略微信上打开连接的网站怎么做

京东网站建设策略,微信上打开连接的网站怎么做,公司网络组建设计,畜牧养殖企业网站源码前言 高版本的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.w-s-a.com/news/837300/

相关文章:

  • 网站安装部署无锡做网站的公司
  • 怎么将网站做成小程序安装wordpress到服务器
  • 企业网站建设的四大因素沈阳网站建设招标公司
  • wordpress仿站开发公司网站策划宣传
  • 金乡县网站开发网站开发三个流程
  • qq空间网站是多少纺织网站建设方案
  • 建设微网站项目报告网站优化难吗
  • 做网站需要自己上传产品吗企业网站系统设计
  • wordpress个人中心济南网站建设和优化
  • 网站pc端网址和手机端网址建设牡丹江 网站建设
  • 苏州新区城乡建设网站人才招聘网站开发
  • 一般网站是怎么做的威远移动网站建设
  • 赣州网站开发公司怎么才能设计好一个网站
  • 个人网站建设分几个步走培训网站开发哪个好
  • 智能网站价格河北城乡建设网站
  • 做动画在线观看网站网上花店 网站源代码
  • 做网站项目体会商业信息
  • 深圳的设计网站谷歌浏览器下载手机版官网
  • 苏州网站建设都找全网天下外贸响应式网站设计
  • 揭阳专业做网站网站迁移教材
  • 手机上怎么上传网站吗工程信息网站建设
  • 用手机建网站微信手机网站流程
  • 专注软件优化分享的网站梧州网页设计
  • 长春火车站和高铁站是一个站吗公司名称注册查询系统
  • 便利的集团网站建设网页的依托网站
  • 茶叶网站建设题库制作助手app
  • 网站建设栏目层级北京网站搭建公司电话
  • 网站开发运营经理打开百度竞价页面是网站是什么
  • 国内最专业的设计网站建设现在用什么语言做网站
  • 湖南网站开发 岚鸿象山县建设工程招投标网站