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

如何申请免费网站空间刚察县wap网站建设公司

如何申请免费网站空间,刚察县wap网站建设公司,微网站平台微网站建设方案模板,怎样登录建设银行官方网站很久没有记录了#xff0c;持之以恒做一件事#xff0c;需要一定的毅力呐#xff01; 最近遇到了一个需求#xff0c;要求恢复出厂设置保留内置sd卡下某个目录的文件。思来想去#xff0c;从驱动那边备份校准信号文件得到了一些思路。因为带通话设置的装置需要进行校准持之以恒做一件事需要一定的毅力呐  最近遇到了一个需求要求恢复出厂设置保留内置sd卡下某个目录的文件。思来想去从驱动那边备份校准信号文件得到了一些思路。因为带通话设置的装置需要进行校准我们会将校准的文件保存在/data下。具体做法呢在执行恢复出厂设置时将此文件copy到tmp分区然后在恢复完成时再次copy回/data分区。因为我们是备份文件夹所以我们需要对copy函数进行修改。下面贴出部分代码。 diff --git a/bootable/recovery/recovery.cpp b/bootable/recovery/recovery.cpp index 598840c..3693cf1 100644 --- a/bootable/recovery/recovery.cppb/bootable/recovery/recovery.cpp-111,6 111,8 static const char *OTA_FLAG_FILE /cache/recovery/last_ota_flag;#ifdef STK_BACKUP_OFFSET//要备份的文件夹 static const char *BACKUP_APK_PATH /system/third;//临时存储路径 static const char *TEMP_APK_BACKUP_PATH /tmp/third_app;#endif// Number of lines per page when displaying a file on screen-286,6 288,116 static int stk_copy_file(const char *src,const char *dstFilePath)printf(stk_copy_file end src%s,dst%s\n,src,dstFilePath);return 0;} //拷贝文件夹的主体函数 void error_quit(const char *msg) {perror(msg);//printf(something is error %s \n,msg); }void change_path(const char *path) {printf(Leave %s Successed . . .\n,getcwd(NULL,0));if(chdir(path)-1){error_quit(path);printf(chdir(path)-1 %s \n,path);return;}printf(Entry %s Successed . . .\n,getcwd(NULL,0)); }void _copy_file(const char *old_path,const char *new_path) {FILE *in,*out;size_t len;char buf[64];char *pgetcwd(NULL,0);if((infopen(old_path,rb))NULL){error_quit(old_path);printf((infopen(old_path %s \n,old_path);return;}change_path(new_path);if((outfopen(old_path,wb))NULL){error_quit(old_path);printf(outfopen(old_path %s \n,old_path);return;}while(!feof(in)){bzero(buf,sizeof(buf));lenfread(buf,1,sizeof(buf)-1,in);fwrite(buf,len,1,out);}fclose(in);fclose(out);change_path(p); }char *get_rel_path(const char *dir,const char *path) {char *rel_path;unsigned long d_len,p_len;d_lenstrlen(dir);p_lenstrlen(path);bzero(rel_path,d_lenp_len2);strncpy(rel_path,path,p_len);strncat(rel_path,/,sizeof(char));strncat(rel_path,dir,d_len);return rel_path; }void copy_dir(const char *old_path,const char *new_path) {DIR *dir;struct stat buf;struct dirent *dirp;char *pgetcwd(NULL,0);if((diropendir(old_path))NULL){error_quit(old_path);printf(diropendir(old_path) %s \n,old_path);return;}if(mkdir(new_path,0777)-1){error_quit(new_path);printf(mkdir(new_path %s \n,new_path);return;}change_path(old_path);while((dirpreaddir(dir))){if(strcmp(dirp-d_name,.)0 || strcmp(dirp-d_name,..)0)continue;if(stat(dirp-d_name,buf)-1){error_quit(stat);printf(stat(dirp-d_name %s \n,stat);return;}if(S_ISDIR(buf.st_mode)){copy_dir(dirp-d_name,get_rel_path(dirp-d_name,new_path));continue;}_copy_file(dirp-d_name,new_path);}closedir(dir);change_path(p); }#endif// command line args come from, in decreasing precedence:// - the actual command line-1326,6 1438,7 main(int argc, char **argv) {}#ifdef STK_BACKUP_OFFSET//在开始进入恢复出厂时进行一次拷贝copy_dir(BACKUP_APK_PATH,TEMP_APK_BACKUP_PATH);#endifdevice-StartRecovery();property_get(UserVolumeLabel, gVolume_label, );-1567,8 1680,11 main(int argc, char **argv) {finish_recovery(send_intent);#ifdef STK_BACKUP_OFFSET//在恢复出厂完成时我们再次将其拷贝回来copy_dir(TEMP_APK_BACKUP_PATH,BACKUP_APK_PATH);//赋予权限操作chmod(BACKUP_APK_PATH, 0666);chown(BACKUP_APK_PATH, 1000, 1000); // system system#endif#ifdef FOTA_UPDATE_SUPPORTif (perform_fota 1) {我们只要重点关注在finish_recovery(send_intent);与device-StartRecovery();这两个函数身上即可。我测试过直接从/mnt/sdcard下拷贝这样是不行的。因为在执行恢复出厂设置时这个分区此时还未挂载我通过代码让其先挂载但是无效。当然也可能在恢复出厂设置时我们所要备份的文件夹并不存在所以贴出代码片中的一些判空都进行了return。否则会无法开机串口log一直重复打印log。  如果各位有其他办法欢迎留言。有不对之处欢迎指出。
http://www.zqtcl.cn/news/720473/

相关文章:

  • 哪里有网站推广软件免费推广seo策略方法
  • 阿里云备案网站 网站名称怎么写京icp备案查询
  • 网站开发岗位思维导图alexa排名
  • 自适应网站建设济南济南网站建设公司
  • 巴州网站建设库尔勒网站建设钟爱网络杭州微信网站制作
  • 52做网站南京市住房城乡建设门户网站
  • 网站开发精品课程贵阳市白云区官方网站
  • seo整站优化服务会计培训班一般收费多少
  • 批量网站访问检测怎么做好手机网站开发
  • 深圳网站建设公司哪家比较好shortcodes wordpress
  • 网站内链越多越好嘛可以做3d电影网站
  • 企业网站需求文档微商引流客源最快的方法
  • 交互式网站备案业务网站在线生成
  • 自建网站百度个人网站如何在百度上做推广
  • 如何安装wordpress模板竞价网站做seo
  • 做论坛网站如何赚钱电子商务营销推广
  • 想要自己做一个网站怎么做济宁百度网站建设
  • 海会网络建设网站wordpress刷不出图片
  • 一个人做商城网站网站推广的几个阶段
  • 做国学类网站合法吗html5教程pdf下载
  • 云南省文化馆网站建设二级域名分发平台
  • 网站版面布局结构图网站收录批量查询
  • 网站开发手机模拟器常州到丹阳
  • 淮南医院网站建设班级网站开发报告
  • 东莞营销网站建设哪家好微信api接口
  • 凡科建站怎么导出网页wordpress视频采集插件
  • 个人介绍网站源码云主机上传网站
  • app推广平台网站系统登录入口
  • 做公司宣传册的网站成crm网
  • 新乡公司做网站军事新闻内容摘抄