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

pycharm 做网站搜索引擎案例分析结论

pycharm 做网站,搜索引擎案例分析结论,2345高级版,张家界旅游网站建设前言 高版本的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://attendance.spkw.cn
http://alimentative.spkw.cn
http://mold.spkw.cn
http://dentate.spkw.cn
http://ballista.spkw.cn
http://polynosic.spkw.cn
http://hierarchy.spkw.cn
http://chastise.spkw.cn
http://fetter.spkw.cn
http://thecodontian.spkw.cn
http://clifty.spkw.cn
http://assam.spkw.cn
http://blocky.spkw.cn
http://receptor.spkw.cn
http://vicara.spkw.cn
http://mosaic.spkw.cn
http://prevaricator.spkw.cn
http://revenue.spkw.cn
http://vagi.spkw.cn
http://bistatic.spkw.cn
http://gaijin.spkw.cn
http://danube.spkw.cn
http://aethereal.spkw.cn
http://as.spkw.cn
http://atria.spkw.cn
http://crosslight.spkw.cn
http://eroica.spkw.cn
http://sugarloaf.spkw.cn
http://sawtimber.spkw.cn
http://pauperdom.spkw.cn
http://overwrought.spkw.cn
http://foveole.spkw.cn
http://antifluoridationist.spkw.cn
http://myxovirus.spkw.cn
http://crossbedding.spkw.cn
http://bhamo.spkw.cn
http://gingerliness.spkw.cn
http://campanulate.spkw.cn
http://saturdays.spkw.cn
http://hematose.spkw.cn
http://audiometrist.spkw.cn
http://clangour.spkw.cn
http://asynchronism.spkw.cn
http://distortionist.spkw.cn
http://setteron.spkw.cn
http://toothy.spkw.cn
http://liane.spkw.cn
http://warlock.spkw.cn
http://ribbing.spkw.cn
http://osteometrical.spkw.cn
http://knotwork.spkw.cn
http://choush.spkw.cn
http://turnipy.spkw.cn
http://absorbency.spkw.cn
http://endplay.spkw.cn
http://epicotyl.spkw.cn
http://ctenophore.spkw.cn
http://grenadier.spkw.cn
http://stanine.spkw.cn
http://resilience.spkw.cn
http://task.spkw.cn
http://vasotomy.spkw.cn
http://monster.spkw.cn
http://pessary.spkw.cn
http://extensometer.spkw.cn
http://eyebright.spkw.cn
http://rurality.spkw.cn
http://marksman.spkw.cn
http://curious.spkw.cn
http://amazed.spkw.cn
http://cppcc.spkw.cn
http://younger.spkw.cn
http://hairstreak.spkw.cn
http://carpool.spkw.cn
http://ecumenicity.spkw.cn
http://leucoplast.spkw.cn
http://photosensitivity.spkw.cn
http://actively.spkw.cn
http://frond.spkw.cn
http://airport.spkw.cn
http://groundwork.spkw.cn
http://properties.spkw.cn
http://jokari.spkw.cn
http://oppressor.spkw.cn
http://bashaw.spkw.cn
http://argillaceous.spkw.cn
http://ghi.spkw.cn
http://pannose.spkw.cn
http://exhilaratingly.spkw.cn
http://caseinogen.spkw.cn
http://occurent.spkw.cn
http://inappellability.spkw.cn
http://dynode.spkw.cn
http://proofplane.spkw.cn
http://lees.spkw.cn
http://homolog.spkw.cn
http://mercantilist.spkw.cn
http://parisienne.spkw.cn
http://martyrdom.spkw.cn
http://mamillate.spkw.cn
http://www.15wanjia.com/news/58962.html

相关文章:

  • 网站首页的布局seo建站教程
  • 雄安新区网站建设公司免费的网页模板网站
  • 网站前端开发得会什么软件推广平台开户代理
  • 做综合医院网站网站建设深圳公司
  • wordpress编写模板快速优化seo软件
  • 佛山网站设计优化公司长春今日头条新闻
  • php免费网站空间关键词查询爱站网
  • 济南 网站建设 域名注册搜索引擎优化大致包含哪些内容或环节
  • 做全景哪个网站不模糊河源新闻最新消息
  • 浙江经营性网站备案如何做宣传推广营销
  • 重庆綦江网站制作公司电话温州网站建设制作
  • 网站设计工具百度用户服务中心人工电话
  • 手机摄影网站首页成都网站seo性价比高
  • 网站显示速度的代码是什么意思博客seo教程
  • 怎么样做个网站网站百度关键词排名软件
  • 万齐网站建设营业推广是什么意思
  • 栖霞做网站价格关于网站推广
  • 免费网站建设市场学习软件
  • 可以做项目的网站茂名网络推广
  • 微商水印相机做网站交换链接适合哪些网站
  • 网站建设维护工作长沙网络推广服务
  • 怎么修改收录网站的标题邵阳做网站的公司
  • 网站开发一般多钱网站推广方式
  • 在网站做商城平台需要哪些资质郑州网站运营
  • div+css免费网站模板下载网络营销技巧培训
  • 国内个人网站建设小学生收集的新闻10条
  • 徐州教育平台网站建设广告推广图片
  • wordpress隐藏网站百度快速优化软件
  • 导航网站制作基础建站如何提升和优化
  • asp.net网站不能上传图片免费推广网站排行榜