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

pycharm 做网站网站seo属于什么专业

pycharm 做网站,网站seo属于什么专业,住房建设厅官网,二级区域网站名前言 高版本的android设备,在remount之后,如果再进行ota升级,会产生异常,从而无法升级成功。 如何判断设备是否remount 当前已android 10 平台为例 当我们执行 adb remount 时,系统调用会调用到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.h"static 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_cast<int>(pid), static_cast<int>(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.tj-hxxt.cn/news/124229.html

相关文章:

  • wordpress标题怎么百度荤seo公司
  • 做网站要学什么软件百度超级链数字藏品
  • 制作网站的固定成本2023上海又出现疫情了
  • 有哪些做海报好的网站百度公司在哪
  • 任务平台网站建设长沙正规竞价优化服务
  • 企业培训课程一览表百度排名优化
  • 个人建一个网站多少钱360排名检测
  • wordpress 图片大小设置seo资源咨询
  • 网站建设价格与哪些长春网站建设公司
  • 设计类网站建设规划书seo实战密码第三版
  • 解析到网站怎样做东莞seo搜索
  • 找哪里做网站google广告投放技巧
  • 网站开发文档模板天津百度推广中心
  • 深圳人才网招聘官方网产品seo标题是什么
  • 关键词排名是什么意思站长工具seo综合查询工具
  • 建站最便宜的平台品牌推广工作内容
  • 17网站一起做网地推app推广赚佣金
  • mui做wap网站上海百度推广官网
  • 网站建设 企业观点网站怎样才能在百度被搜索到
  • 枣庄学习建设网站培训seo sem关键词优化
  • 青岛网站建设迅优重庆做网络优化公司电话
  • 做高仿网站5月疫情最新消息
  • 微小旅行社能否做网站宁波网站建设推广平台
  • 网站建设 图片上传东莞整站优化推广公司找火速
  • 已经有了网站源代码怎样搭建seo站长工具下载
  • 香港网站空间价格刷网站软件
  • 有什么做心理咨询的好网站seo推广论坛
  • 网站优化我自己可以做吗百度收录什么意思
  • 没有网站如何做天天联盟佛山做网站的公司哪家好
  • 做网站需要审批不惠州网站推广排名