[Bugfix][T106BUG-18][T106BUG-11]merge sim patch

    Only Configure:No
    Affected branch:master
    Affected module:No
    Is it affected on both ZXIC and MTK: only ZXIC
    Self-test: Yes
    Doc Update: No

Change-Id: I52cffab83c99392b55772b0d7a9dcb441a18d0b7
diff --git a/ap/app/zte_comm/nvserver/nvserver.c b/ap/app/zte_comm/nvserver/nvserver.c
index 9fa611e..c32915c 100755
--- a/ap/app/zte_comm/nvserver/nvserver.c
+++ b/ap/app/zte_comm/nvserver/nvserver.c
@@ -31,73 +31,76 @@
 file,char*key,char*value);static int nvunset(char*file,char*key);static int 
 nvclear(char*file);static int nvreset(char*file);static int nvcommit(char*file);
 T_NV_NODE*nv_list;int nvserver_main(int argc,char*argv[]){int msgId=
-(0xd36+3128-0x196e);T_NV_MSG_INFO rcvBuf;T_NV_MSG_RESULT sndBuf;struct msqid_ds 
-msgInfo;prctl(PR_SET_NAME,"\x6e\x76\x73\x65\x72\x76\x65\x72",(0x90c+6054-0x20b2)
-,(0x73+4086-0x1069),(0xe64+5132-0x2270));memset(&rcvBuf,(0x139c+3214-0x202a),
-sizeof(rcvBuf));memset(&sndBuf,(0x1a+1727-0x6d9),sizeof(sndBuf));memset(&msgInfo
-,(0x1eb2+1153-0x2333),sizeof(msgInfo));msgId=msgget(MODULE_ID_NV,IPC_CREAT|
-(0xe5d+650-0xf67));if(-(0x16e1+1469-0x1c9d)==msgId){printf(
+(0x12f7+3751-0x219e);T_NV_MSG_INFO rcvBuf;T_NV_MSG_RESULT sndBuf;struct msqid_ds
+ msgInfo;prctl(PR_SET_NAME,"\x6e\x76\x73\x65\x72\x76\x65\x72",
+(0x1b19+3016-0x26e1),(0x1537+569-0x1770),(0x104f+123-0x10ca));memset(&rcvBuf,
+(0x11f1+2613-0x1c26),sizeof(rcvBuf));memset(&sndBuf,(0x13ed+2776-0x1ec5),sizeof(
+sndBuf));memset(&msgInfo,(0x124+6019-0x18a7),sizeof(msgInfo));msgId=msgget(
+MODULE_ID_NV,IPC_CREAT|(0x1d84+2640-0x2654));if(-(0x159b+1393-0x1b0b)==msgId){
+printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x6d\x73\x67\x67\x65\x74\x20\x6d\x73\x67\x49\x64\x20\x66\x61\x69\x6c\x2c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
-,errno);return-(0xa83+3015-0x1649);}if(-(0x1102+2280-0x19e9)!=msgctl(msgId,
-IPC_STAT,&msgInfo)){msgInfo.msg_qbytes=262144;if(-(0x1f20+732-0x21fb)==msgctl(
+,errno);return-(0x1053+3811-0x1f35);}if(-(0x57b+4811-0x1845)!=msgctl(msgId,
+IPC_STAT,&msgInfo)){msgInfo.msg_qbytes=262144;if(-(0x186f+926-0x1c0c)==msgctl(
 msgId,IPC_SET,&msgInfo))printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x6d\x73\x67\x63\x74\x6c\x20\x6d\x73\x67\x49\x64\x20\x66\x61\x69\x6c\x2c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
-,errno);}if(nvDirInit()!=(0x15f0+897-0x1971)){printf(
+,errno);}if(nvDirInit()!=(0xe8f+3530-0x1c59)){printf(
 "\x6e\x76\x44\x69\x72\x49\x6e\x69\x74\x20\x66\x61\x69\x6c\x65\x21" "\n");return-
-(0xb9+1934-0x846);}nvConfig();nvInit();while((0x1642+728-0x1919)){if(-
-(0x7c3+7789-0x262f)==msgrcv(msgId,&rcvBuf,sizeof(T_NV_MSG_INFO)-sizeof(long),
-MSG_TYPE_NV,(0xb36+6986-0x2680))){printf(
+(0x5a2+7666-0x2393);}nvConfig();nvInit();while((0x1a6b+3090-0x267c)){if(-
+(0x25ef+225-0x26cf)==msgrcv(msgId,&rcvBuf,sizeof(T_NV_MSG_INFO)-sizeof(long),
+MSG_TYPE_NV,(0x263+8625-0x2414))){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6d\x73\x67\x72\x63\x76\x20\x66\x61\x69\x6c\x2c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x21" "\n"
-,errno);continue;}analyMsg(&rcvBuf,&sndBuf);if(-(0x2b0+5590-0x1885)==msgsnd(
-msgId,&sndBuf,sizeof(T_NV_MSG_RESULT)-sizeof(long),(0x1b0d+992-0x1eed))){printf(
+,errno);continue;}analyMsg(&rcvBuf,&sndBuf);if(-(0x11d+5118-0x151a)==msgsnd(
+msgId,&sndBuf,sizeof(T_NV_MSG_RESULT)-sizeof(long),(0x19dd+3290-0x26b7))){printf
+(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6d\x73\x67\x73\x6e\x64\x20\x66\x61\x69\x6c\x2c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x21" "\n"
-,errno);continue;}}return((0x153+9249-0x2574));}static void configdir(char*dir){
+,errno);continue;}}return((0xaa+6507-0x1a15));}static void configdir(char*dir){
 DIR*dp;int ret;struct dirent*entry;struct stat statbuf;if((dp=opendir(dir))==
 NULL){fprintf(stderr,
 "\x63\x61\x6e\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x3a\x20\x25\x73" "\n"
 ,dir);return;}chdir(dir);while((entry=readdir(dp))!=NULL){ret=lstat(entry->
-d_name,&statbuf);if(ret<(0x82f+3720-0x16b7)){fprintf(stderr,
+d_name,&statbuf);if(ret<(0x88b+3070-0x1489)){fprintf(stderr,
 "\x6c\x73\x74\x61\x74\x20\x65\x72\x72\x6f\x72\x3a\x20\x25\x73" "\n",strerror(
 errno));chdir("\x2e\x2e");closedir(dp);return;}if(!S_ISDIR(statbuf.st_mode)){if(
-strcmp("\x2e",entry->d_name)==(0x282+4431-0x13d1)||strcmp("\x2e\x2e",entry->
-d_name)==(0x20c+5038-0x15ba))continue;if(!isNvConfiged(entry->d_name)){if(
+strcmp("\x2e",entry->d_name)==(0x11bb+1718-0x1871)||strcmp("\x2e\x2e",entry->
+d_name)==(0x4ab+2378-0xdf5))continue;if(!isNvConfiged(entry->d_name)){if(
 addConfigFile(entry->d_name,NULL)!=RESULT_SUCCESS)printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x63\x6f\x6e\x66\x69\x67\x20\x25\x73\x20\x65\x72\x72\x6f\x72\x21" "\n"
 ,entry->d_name);}}}chdir("\x2e\x2e");closedir(dp);}static void nvConfig(){char*
-val=NULL;FILE*fp=NULL;char buf[NV_MAX_CONFIG_LEN]={(0x40f+4911-0x173e)};fp=fopen
+val=NULL;FILE*fp=NULL;char buf[NV_MAX_CONFIG_LEN]={(0xdd6+1142-0x124c)};fp=fopen
 (NV_CONFIG_FILE,"\x72\x6f");if(!fp){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x6f\x70\x65\x6e\x20\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x21" "\n"
 ,NV_CONFIG_FILE,errno);return;}while(fgets(buf,NV_MAX_CONFIG_LEN,fp)){if(buf[
-(0x127d+2998-0x1e33)]=='\n'||buf[(0x1b9c+1791-0x229b)]==
-((char)(0x125+2115-0x945)))continue;val=strchr(buf,((char)(0x1a78+2031-0x222a)))
-;if(!val){printf(
+(0xaf8+2382-0x1446)]=='\n'||buf[(0x4ed+3799-0x13c4)]==
+((char)(0x1bd9+239-0x1ca5)))continue;val=strchr(buf,((char)(0xab+3859-0xf81)));
+if(!val){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x6f\x72\x6d\x61\x74\x20\x65\x72\x72\x6f\x72\x3a\x20\x73\x74\x72\x20\x3d\x20\x25\x73\x21" "\n"
-,NV_CONFIG_FILE,buf);continue;}buf[strlen(buf)-(0x644+3845-0x1548)]='\0';*val++=
+,NV_CONFIG_FILE,buf);continue;}buf[strlen(buf)-(0x211b+506-0x2314)]='\0';*val++=
 '\0';if(!isCfgConfiged(buf)){if(addConfigFile(val,buf)!=RESULT_SUCCESS)printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x63\x6f\x6e\x66\x69\x67\x20\x25\x73\x20\x65\x72\x72\x6f\x72\x21" "\n"
 ,buf);}}fclose(fp);configdir(NV_FS_MAIN_PATH);}static int nvDirInit(){if(access(
-NV_FS_PATH,F_OK)!=(0xd07+1833-0x1430)){if(mkdir(NV_FS_PATH,(0x9e9+4176-0x184c))
-!=(0x130a+1784-0x1a02)){printf(
+NV_FS_PATH,F_OK)!=(0xef0+351-0x104f)){if(mkdir(NV_FS_PATH,(0xe45+2189-0x14e5))!=
+(0xdd7+2382-0x1725)){printf(
 "\x6e\x65\x72\x76\x65\x72\x20\x6d\x6b\x64\x69\x72\x20\x25\x73\x20\x66\x61\x6c\x69\x2c\x65\x72\x72\x6e\x6f\x3d\x25\x64" "\n"
-,NV_FS_PATH,errno);return-(0x99a+470-0xb6f);}if(mkdir(NV_FS_MAIN_PATH,
-(0xedf+6254-0x2560))!=(0xe12+3746-0x1cb4)){printf(
+,NV_FS_PATH,errno);return-(0x21c+1486-0x7e9);}if(mkdir(NV_FS_MAIN_PATH,
+(0x9a5+4367-0x18c7))!=(0xb67+4670-0x1da5)){printf(
 "\x6e\x65\x72\x76\x65\x72\x20\x6d\x6b\x64\x69\x72\x20\x25\x73\x20\x66\x61\x6c\x69\x2c\x65\x72\x72\x6e\x6f\x3d\x25\x64" "\n"
-,NV_FS_MAIN_PATH,errno);return-(0x12cf+895-0x164d);}if(mkdir(NV_FS_BACKUP_PATH,
-(0x967+4521-0x1923))!=(0xe42+6320-0x26f2)){printf(
+,NV_FS_MAIN_PATH,errno);return-(0x1332+4518-0x24d7);}if(mkdir(NV_FS_BACKUP_PATH,
+(0xc4b+1819-0x1179))!=(0x116+948-0x4ca)){printf(
 "\x6e\x65\x72\x76\x65\x72\x20\x6d\x6b\x64\x69\x72\x20\x25\x73\x20\x66\x61\x6c\x69\x2c\x65\x72\x72\x6e\x6f\x3d\x25\x64" "\n"
-,NV_FS_BACKUP_PATH,errno);return-(0x19c+3152-0xdeb);}}else{if(access(
-NV_FS_MAIN_PATH,F_OK)!=(0xa52+214-0xb28)){if(mkdir(NV_FS_MAIN_PATH,
-(0xecc+4698-0x1f39))!=(0x959+2796-0x1445)){printf(
+,NV_FS_BACKUP_PATH,errno);return-(0xa21+3359-0x173f);}}else{if(access(
+NV_FS_MAIN_PATH,F_OK)!=(0x12a4+3900-0x21e0)){if(mkdir(NV_FS_MAIN_PATH,
+(0x19b3+2345-0x20ef))!=(0xb1d+6035-0x22b0)){printf(
 "\x6e\x65\x72\x76\x65\x72\x20\x6d\x6b\x64\x69\x72\x20\x25\x73\x20\x66\x61\x6c\x69\x2c\x65\x72\x72\x6e\x6f\x3d\x25\x64" "\n"
-,NV_FS_MAIN_PATH,errno);return-(0xea+2345-0xa12);}}if(access(NV_FS_BACKUP_PATH,
-F_OK)!=(0x1e7+6321-0x1a98)){if(mkdir(NV_FS_BACKUP_PATH,(0x296+8209-0x20ba))!=
-(0x15f+6474-0x1aa9)){printf(
+,NV_FS_MAIN_PATH,errno);return-(0xa7d+6228-0x22d0);}}if(access(NV_FS_BACKUP_PATH
+,F_OK)!=(0xb67+1885-0x12c4)){if(mkdir(NV_FS_BACKUP_PATH,(0xc78+1969-0x123c))!=
+(0x1684+306-0x17b6)){printf(
 "\x6e\x65\x72\x76\x65\x72\x20\x6d\x6b\x64\x69\x72\x20\x25\x73\x20\x66\x61\x6c\x69\x2c\x65\x72\x72\x6e\x6f\x3d\x25\x64" "\n"
-,NV_FS_BACKUP_PATH,errno);return-(0xbea+435-0xd9c);}}}return(0x655+4303-0x1724);
-}static void nvInit(){T_NV_NODE*list=NULL;char nvMainFile[NV_PATH_LEN]={
-(0x480+5877-0x1b75)};char nvBackupFile[NV_PATH_LEN]={(0x965+222-0xa43)};
+,NV_FS_BACKUP_PATH,errno);return-(0x4ca+7443-0x21dc);}}}return
+(0x18d+8017-0x20de);}static void nvInit(){T_NV_NODE*list=NULL;char nvMainFile[
+NV_PATH_LEN]={(0x8f8+2022-0x10de)};char nvBackupFile[NV_PATH_LEN]={
+(0x533+1185-0x9d4)};
 #ifdef FOTA_AB
-T_FLAGS_INFO flags_info={(0x3d3+8847-0x2662)};int ret=(0xce4+1110-0x113a);
+T_FLAGS_INFO flags_info={(0x792+2805-0x1287)};int ret=(0xdd7+4915-0x210a);
 #endif
 for(list=nv_list;list;list=list->next){snprintf(nvMainFile,NV_PATH_LEN,
 "\x25\x73\x2f\x25\x73",NV_FS_MAIN_PATH,list->nvFile);snprintf(nvBackupFile,
@@ -105,73 +108,73 @@
 nvMainFile)){if(!checkNvFs(nvBackupFile))restoreNvFs(nvBackupFile,nvMainFile);}
 else if(checkNvFs(nvBackupFile)){restoreNvFs(nvMainFile,nvBackupFile);}else{
 loadFactroyParam(list);nvcommit(list->nvFile);continue;}loadNvFs(list->nvFile);
-if(!strcmp(list->nvFile,NV_CFG)&&get_update_status()==(0x1414+2986-0x1fbc)){
+if(!strcmp(list->nvFile,NV_CFG)&&get_update_status()==(0x1391+3374-0x20bd)){
 reloadFactroyParam(list);delete_not_needed(list);nvcommit(list->nvFile);
 #ifdef FOTA_AB
 ret=flags_get(&flags_info);flags_info.boot_fota_flag.fota_status=
-(0x8e4+4025-0x189d);ret=flags_set(&flags_info);
+(0xd9d+2967-0x1934);ret=flags_set(&flags_info);
 #endif
-}}}uint hash(const char*s){uint hash=(0x159b+3924-0x24ef);while(*s){hash=
+}}}uint hash(const char*s){uint hash=(0x1398+1810-0x1aaa);while(*s){hash=
 NV_HASH_MUL*hash+*s++;}return hash;}static int loadFactroyParam(T_NV_NODE*list){
 char*val=NULL;FILE*fp=NULL;T_NV_CONFIG*config=NULL;char buf[NV_MAX_ITEM_LEN]={
-(0xb43+5595-0x211e)};for(config=list->fileList;config;config=config->next){fp=
+(0x1656+2747-0x2111)};for(config=list->fileList;config;config=config->next){fp=
 fopen(config->configFile,"\x72\x6f");if(!fp){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x6f\x70\x65\x6e\x20\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x21" "\n"
 ,config->configFile,errno);return RESULT_FILE_OPEN_FAIL;}while(fgets(buf,
-NV_MAX_ITEM_LEN,fp)){if(buf[(0x1ddf+2338-0x2701)]=='\n'||buf[(0x786+3488-0x1526)
-]==((char)(0x1822+248-0x18f7)))continue;val=strchr(buf,
-((char)(0x7df+1795-0xea5)));if(!val){printf(
+NV_MAX_ITEM_LEN,fp)){if(buf[(0x124d+5276-0x26e9)]=='\n'||buf[(0x2df+8093-0x227c)
+]==((char)(0x147+9511-0x264b)))continue;val=strchr(buf,
+((char)(0x163+3723-0xfb1)));if(!val){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x6f\x72\x6d\x61\x74\x20\x65\x72\x72\x6f\x72\x3a\x73\x74\x72\x69\x6e\x67\x20\x3d\x20\x25\x73" "\n"
-,config->configFile,buf);continue;}if(buf[strlen(buf)-(0x1302+2821-0x1e06)]==
-'\n')buf[strlen(buf)-(0x282+4287-0x1340)]='\0';*val++='\0';nvset(list->nvFile,
-buf,val,(0xd82+5730-0x23e3));}printf(
+,config->configFile,buf);continue;}if(buf[strlen(buf)-(0x95f+1394-0xed0)]=='\n')
+buf[strlen(buf)-(0x161a+1921-0x1d9a)]='\0';*val++='\0';nvset(list->nvFile,buf,
+val,(0x1276+3233-0x1f16));}printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6c\x6f\x61\x64\x46\x61\x63\x74\x72\x6f\x79\x50\x61\x72\x61\x6d\x20\x25\x73\x21" "\n"
 ,config->configFile);fclose(fp);}return RESULT_SUCCESS;}static bool checkNvFs(
-char*file){int len=(0x50a+5470-0x1a68);int cnt=(0x111+6981-0x1c56);FILE*fp=NULL;
-char*buf=NULL;struct stat statbuff={(0x832+2420-0x11a6)};if(stat(file,&statbuff)
-<(0x2103+633-0x237c))return false;len=statbuff.st_size;if(len<NV_CHECK_SIZE)
-return false;fp=fopen(file,"\x72\x6f");if(!fp)return false;buf=(char*)malloc(len
-);if(!buf){fclose(fp);return false;}cnt=(0x1863+283-0x197e);while(cnt<len){cnt=
-cnt+fread(buf+cnt,(0x100f+205-0x10db),len-cnt,fp);if(ferror(fp)){clearerr(fp);
-free(buf);fclose(fp);return false;}}if(len!=cnt){free(buf);fclose(fp);return 
-false;}if(getSum(buf,len-NV_CHECK_SIZE)+NV_FILE_FLAG!=*(uint*)(buf+len-
-NV_CHECK_SIZE)){free(buf);fclose(fp);return false;}free(buf);fclose(fp);return 
-true;}static int copyfile(const char*from,const char*to){int fd_to;int fd_from;
-char buf[(0x1f60+2659-0x19c3)];ssize_t nread;int ret=-(0x61b+118-0x690);fd_from=
-open(from,O_RDONLY);if(fd_from<(0xf5d+5190-0x23a3))return-(0x8d4+1218-0xd94);
-fd_to=open(to,O_RDWR|O_CREAT|O_TRUNC|O_SYNC,(0x125d+679-0x1364));if(fd_to<
-(0x538+5840-0x1c08)){ret=-(0x6b7+2144-0xf14);goto out_error;}while(
-(0x11fb+3785-0x20c3)){char*out_ptr;ssize_t nwritten;nread=read(fd_from,buf,
-sizeof(buf));if(nread==(0xdb4+5296-0x2264)){break;}else{if(nread<
-(0x12dc+2971-0x1e77)){if(errno==EINTR||errno==EAGAIN){continue;}else{ret=-
-(0x190d+242-0x19fb);goto out_error;}}}out_ptr=buf;do{nwritten=write(fd_to,
-out_ptr,nread);if(nwritten>(0xa29+6584-0x23e1)){nread-=nwritten;out_ptr+=
-nwritten;}else{if(nwritten<(0x76d+1983-0xf2c)){if(errno==EINTR||errno==EAGAIN){
-continue;}else{ret=-(0xf70+1124-0x13cf);goto out_error;}}}}while(nread>
-(0x616+5351-0x1afd));}ret=fsync(fd_to);if(ret<(0x21ef+11-0x21fa)){printf(
+char*file){int len=(0x1339+1926-0x1abf);int cnt=(0x610+976-0x9e0);FILE*fp=NULL;
+char*buf=NULL;struct stat statbuff={(0x360+2587-0xd7b)};if(stat(file,&statbuff)<
+(0x6a5+1081-0xade))return false;len=statbuff.st_size;if(len<NV_CHECK_SIZE)return
+ false;fp=fopen(file,"\x72\x6f");if(!fp)return false;buf=(char*)malloc(len);if(!
+buf){fclose(fp);return false;}cnt=(0x1d50+1685-0x23e5);while(cnt<len){cnt=cnt+
+fread(buf+cnt,(0x641+6863-0x210f),len-cnt,fp);if(ferror(fp)){clearerr(fp);free(
+buf);fclose(fp);return false;}}if(len!=cnt){free(buf);fclose(fp);return false;}
+if(getSum(buf,len-NV_CHECK_SIZE)+NV_FILE_FLAG!=*(uint*)(buf+len-NV_CHECK_SIZE)){
+free(buf);fclose(fp);return false;}free(buf);fclose(fp);return true;}static int 
+copyfile(const char*from,const char*to){int fd_to;int fd_from;char buf[
+(0x11f3+7679-0x1ff2)];ssize_t nread;int ret=-(0x387+8070-0x230c);fd_from=open(
+from,O_RDONLY);if(fd_from<(0x1a92+3130-0x26cc))return-(0x2e4+6521-0x1c5b);fd_to=
+open(to,O_RDWR|O_CREAT|O_TRUNC|O_SYNC,(0x899+7759-0x2548));if(fd_to<
+(0x1030+1273-0x1529)){ret=-(0x419+8950-0x270c);goto out_error;}while(
+(0x5f0+5802-0x1c99)){char*out_ptr;ssize_t nwritten;nread=read(fd_from,buf,sizeof
+(buf));if(nread==(0x9eb+6879-0x24ca)){break;}else{if(nread<(0x60a+110-0x678)){if
+(errno==EINTR||errno==EAGAIN){continue;}else{ret=-(0xcb5+5442-0x21f3);goto 
+out_error;}}}out_ptr=buf;do{nwritten=write(fd_to,out_ptr,nread);if(nwritten>
+(0xe7f+5947-0x25ba)){nread-=nwritten;out_ptr+=nwritten;}else{if(nwritten<
+(0x1170+2190-0x19fe)){if(errno==EINTR||errno==EAGAIN){continue;}else{ret=-
+(0x1cb9+299-0x1ddf);goto out_error;}}}}while(nread>(0x260+9380-0x2704));}ret=
+fsync(fd_to);if(ret<(0x525+1403-0xaa0)){printf(
 "\x53\x79\x6e\x63\x20\x46\x61\x69\x6c\x65\x64\x3a\x25\x73\x2c\x20\x66\x69\x6c\x65\x20\x70\x61\x74\x68\x3a\x25\x73"
-,strerror(errno),to);goto out_error;}if(close(fd_to)<(0x89b+3413-0x15f0)){fd_to=
--(0xb0b+2826-0x1614);ret=-(0x25f+3323-0xf54);goto out_error;}close(fd_from);
-return(0x7ca+3259-0x1485);out_error:printf(
+,strerror(errno),to);goto out_error;}if(close(fd_to)<(0x1f3d+1530-0x2537)){fd_to
+=-(0x75f+6431-0x207d);ret=-(0x1e16+1971-0x25c3);goto out_error;}close(fd_from);
+return(0x1989+2493-0x2346);out_error:printf(
 "\x63\x6f\x70\x79\x66\x69\x6c\x65\x20\x25\x73\x20\x74\x6f\x20\x25\x73\x20\x65\x72\x72\x6f\x72\x3a\x25\x64" "\n"
-,from,to,ret);close(fd_from);if(fd_to>=(0xbcf+4192-0x1c2f))close(fd_to);return 
+,from,to,ret);close(fd_from);if(fd_to>=(0xfbd+3801-0x1e96))close(fd_to);return 
 ret;}static int restoreNvFs(char*dstFile,char*srcFile){if(copyfile(srcFile,
-dstFile)!=(0x499+8254-0x24d7))return RESULT_FAIL;return RESULT_SUCCESS;}static 
-int loadNvFs(char*file){int len=(0x2245+1139-0x26b8);int cnt=(0x406+4477-0x1583)
-;FILE*fp=NULL;char*buf=NULL;char*name=NULL;char*value=NULL;char*eq=NULL;struct 
-stat statbuff={(0x91f+2966-0x14b5)};char nvFile[NV_PATH_LEN]={
-(0x316+8271-0x2365)};sprintf(nvFile,"\x25\x73\x2f\x25\x73",NV_FS_MAIN_PATH,file)
-;if(stat(nvFile,&statbuff)<(0x1799+3401-0x24e2))return RESULT_FAIL;len=statbuff.
+dstFile)!=(0x1141+5552-0x26f1))return RESULT_FAIL;return RESULT_SUCCESS;}static 
+int loadNvFs(char*file){int len=(0x715+4869-0x1a1a);int cnt=(0xb39+3384-0x1871);
+FILE*fp=NULL;char*buf=NULL;char*name=NULL;char*value=NULL;char*eq=NULL;struct 
+stat statbuff={(0x1297+1527-0x188e)};char nvFile[NV_PATH_LEN]={
+(0xd67+5218-0x21c9)};sprintf(nvFile,"\x25\x73\x2f\x25\x73",NV_FS_MAIN_PATH,file)
+;if(stat(nvFile,&statbuff)<(0x975+3867-0x1890))return RESULT_FAIL;len=statbuff.
 st_size;if(NV_CHECK_SIZE>len)return RESULT_FAIL;fp=fopen(nvFile,"\x72\x6f");if(!
 fp)return RESULT_FILE_OPEN_FAIL;len=len-NV_CHECK_SIZE;buf=(char*)malloc(len+
-(0x8a+4955-0x13e4));if(!buf){fclose(fp);return RESULT_MALLOC_FAIL;}memset(buf,
-(0x225+7662-0x2013),len+(0x1f9d+33-0x1fbd));cnt=(0x97a+5479-0x1ee1);while(cnt<
-len){cnt=cnt+fread(buf+cnt,(0x1ff1+1279-0x24ef),len-cnt,fp);if(ferror(fp)){
+(0x1cb9+2360-0x25f0));if(!buf){fclose(fp);return RESULT_MALLOC_FAIL;}memset(buf,
+(0x1040+3256-0x1cf8),len+(0x105a+3083-0x1c64));cnt=(0x709+4120-0x1721);while(cnt
+<len){cnt=cnt+fread(buf+cnt,(0x1f0c+584-0x2153),len-cnt,fp);if(ferror(fp)){
 clearerr(fp);fclose(fp);free(buf);return RESULT_FILE_READ_FAIL;}}if(cnt!=len){
 fclose(fp);free(buf);return RESULT_FILE_READ_FAIL;}buf[len]='\0';name=buf;while(
-*name){if(!(eq=strchr(name,((char)(0xdd1+3356-0x1ab0))))){break;}*eq='\0';value=
-eq+(0x2191+557-0x23bd);nvset(file,name,value,(0xf84+4202-0x1fed));*eq=
-((char)(0x726+7678-0x24e7));name=value+strlen(value)+(0x1d8+9088-0x2557);}free(
+*name){if(!(eq=strchr(name,((char)(0x1dc8+1952-0x252b))))){break;}*eq='\0';value
+=eq+(0xe5b+1394-0x13cc);nvset(file,name,value,(0x904+4166-0x1949));*eq=
+((char)(0x2d5+5417-0x17c1));name=value+strlen(value)+(0x11+4583-0x11f7);}free(
 buf);fclose(fp);return RESULT_SUCCESS;}static void analyMsg(T_NV_MSG_INFO*
 msgrecv,T_NV_MSG_RESULT*msgsnd){switch(msgrecv->nvType){case MSG_GET:msgsnd->
 result=nvget(msgrecv->file,msgrecv->key,msgsnd->value);break;case MSG_SET:msgsnd
@@ -187,100 +190,100 @@
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x70\x61\x72\x61\x6d\x20\x69\x6c\x6c\x65\x67\x61\x6c\x21" "\n"
 );return RESULT_INVAL;}if(configFile){newConfig=(T_NV_CONFIG*)malloc(sizeof(
 T_NV_CONFIG));if(!newConfig)return RESULT_MALLOC_FAIL;strncpy(newConfig->
-configFile,configFile,NV_PATH_LEN-(0x39d+8995-0x26bf));newConfig->configFile[
-NV_PATH_LEN-(0xa9c+6159-0x22aa)]='\0';newConfig->next=NULL;}for(list=nv_list;
-list;list=list->next){if(strcmp(list->nvFile,nvFile)==(0x915+2007-0x10ec))break;
-}if(!list){newList=(T_NV_NODE*)malloc(sizeof(T_NV_NODE));if(!newList){if(
+configFile,configFile,NV_PATH_LEN-(0x5e1+2259-0xeb3));newConfig->configFile[
+NV_PATH_LEN-(0x150+8368-0x21ff)]='\0';newConfig->next=NULL;}for(list=nv_list;
+list;list=list->next){if(strcmp(list->nvFile,nvFile)==(0x543+1630-0xba1))break;}
+if(!list){newList=(T_NV_NODE*)malloc(sizeof(T_NV_NODE));if(!newList){if(
 newConfig)free(newConfig);return RESULT_MALLOC_FAIL;}newList->next=NULL;strncpy(
-newList->nvFile,nvFile,NV_PATH_LEN-(0x216+4427-0x1360));newList->nvFile[
-NV_PATH_LEN-(0x1742+874-0x1aab)]='\0';memset(newList->nvTable,
-(0xdcf+1745-0x14a0),NV_HASH_LEN*(0xfc7+1769-0x16ac));newList->fileList=newConfig
-;if(!nv_list)nv_list=newList;else{newList->next=nv_list->next;nv_list->next=
-newList;}}else if(!list->fileList)list->fileList=newConfig;else{if(newConfig==
-NULL)return RESULT_FAIL;newConfig->next=list->fileList->next;list->fileList->
-next=newConfig;}return RESULT_SUCCESS;}static bool isCfgConfiged(char*configFile
-){T_NV_NODE*list=NULL;T_NV_CONFIG*config=NULL;for(list=nv_list;list;list=list->
-next){for(config=list->fileList;config;config=config->next){if(!strcmp(config->
-configFile,configFile))return true;}}return false;}static bool isNvConfiged(char
-*nvFile){T_NV_NODE*list=NULL;for(list=nv_list;list;list=list->next){if(!strcmp(
-list->nvFile,nvFile))return true;}return false;}static uint getSum(const char*s,
-int len){uint sum=(0x2225+1084-0x2661);char*data=(char*)s;while(len-- >
-(0xc59+2541-0x1646)){sum+=(*data++);}return sum;}static int saveNvFs(char*nvName
-,char*nvFile){int i=(0x116a+4658-0x239c);int sum=(0xd49+6560-0x26e9);int bufSize
-=(0x17db+2074-0x1ff5);int itemSize=(0xfb4+1923-0x1737);int ret=
-(0x6c9+7134-0x22a7);int fp=(0x83b+4997-0x1bc0);char*buf=NULL;T_NV_NODE*list=NULL
-;T_NV_ITEM*item=NULL;for(list=nv_list;list;list=list->next){if(strcmp(list->
-nvFile,nvName))continue;fp=open(nvFile,O_SYNC|O_RDWR|O_CREAT|O_TRUNC,
-(0x16d2+1633-0x1b93));if(fp==-(0x147f+691-0x1731)){printf(
+newList->nvFile,nvFile,NV_PATH_LEN-(0x279+4152-0x12b0));newList->nvFile[
+NV_PATH_LEN-(0x211+357-0x375)]='\0';memset(newList->nvTable,(0x1410+3588-0x2214)
+,NV_HASH_LEN*(0xf3f+5903-0x264a));newList->fileList=newConfig;if(!nv_list)
+nv_list=newList;else{newList->next=nv_list->next;nv_list->next=newList;}}else if
+(!list->fileList)list->fileList=newConfig;else{if(newConfig==NULL)return 
+RESULT_FAIL;newConfig->next=list->fileList->next;list->fileList->next=newConfig;
+}return RESULT_SUCCESS;}static bool isCfgConfiged(char*configFile){T_NV_NODE*
+list=NULL;T_NV_CONFIG*config=NULL;for(list=nv_list;list;list=list->next){for(
+config=list->fileList;config;config=config->next){if(!strcmp(config->configFile,
+configFile))return true;}}return false;}static bool isNvConfiged(char*nvFile){
+T_NV_NODE*list=NULL;for(list=nv_list;list;list=list->next){if(!strcmp(list->
+nvFile,nvFile))return true;}return false;}static uint getSum(const char*s,int 
+len){uint sum=(0x19a0+2329-0x22b9);char*data=(char*)s;while(len-- >
+(0x7c5+6614-0x219b)){sum+=(*data++);}return sum;}static int saveNvFs(char*nvName
+,char*nvFile){int i=(0x105f+3818-0x1f49);int sum=(0xad7+7136-0x26b7);int bufSize
+=(0x14f0+4020-0x24a4);int itemSize=(0x966+63-0x9a5);int ret=(0x504+6213-0x1d49);
+int fp=(0x515+8326-0x259b);char*buf=NULL;T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL
+;for(list=nv_list;list;list=list->next){if(strcmp(list->nvFile,nvName))continue;
+fp=open(nvFile,O_SYNC|O_RDWR|O_CREAT|O_TRUNC,(0x28b+7592-0x1e93));if(fp==-
+(0xc47+1419-0x11d1)){printf(
 "\x6f\x70\x65\x6e\x20\x25\x73\x20\x66\x61\x69\x6c\x2c\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
 ,nvFile,errno);return RESULT_FILE_OPEN_FAIL;}buf=(char*)malloc(NV_BLOCK_SIZE);if
-(!buf){close(fp);return RESULT_MALLOC_FAIL;}for(i=(0xc69+6638-0x2657);i<
+(!buf){close(fp);return RESULT_MALLOC_FAIL;}for(i=(0x2db+4563-0x14ae);i<
 NV_HASH_LEN;i++){for(item=list->nvTable[i];item;item=item->next){if(strcmp(
 nvFile,NV_FS_SHOW)&&!item->saveFlag)continue;itemSize=strlen(item->key)+strlen(
-item->value)+(0x1d3f+630-0x1fb3);if(bufSize+itemSize>NV_BLOCK_SIZE){if(write(fp,
-buf,bufSize)<(0x1c18+932-0x1fbc)){printf(
+item->value)+(0x3f1+8945-0x26e0);if(bufSize+itemSize>NV_BLOCK_SIZE){if(write(fp,
+buf,bufSize)<(0xeab+6060-0x2657)){printf(
 "\x65\x72\x72\x6f\x72\x20\x25\x73\x20\x25\x64\x3a\x20\x77\x72\x69\x74\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
 ,__FILE__,__LINE__,errno);close(fp);free(buf);return RESULT_FILE_WRITE_FAIL;}sum
-+=getSum(buf,bufSize);bufSize=(0xe00+5527-0x2397);}sprintf(buf+bufSize,
++=getSum(buf,bufSize);bufSize=(0x39b+535-0x5b2);}sprintf(buf+bufSize,
 "\x25\x73\x3d\x25\x73",item->key,item->value);bufSize+=itemSize;}}if(bufSize!=
-(0x1cc+3665-0x101d)){if(write(fp,buf,bufSize)<(0x14+7316-0x1ca8)){printf(
+(0x1b8+6729-0x1c01)){if(write(fp,buf,bufSize)<(0xe39+2723-0x18dc)){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x77\x72\x69\x74\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
 ,errno);close(fp);free(buf);return RESULT_FILE_WRITE_FAIL;}sum+=getSum(buf,
-bufSize);}sum+=NV_FILE_FLAG;if(write(fp,&sum,NV_CHECK_SIZE)<(0x1d9+819-0x50c)){
-printf(
+bufSize);}sum+=NV_FILE_FLAG;if(write(fp,&sum,NV_CHECK_SIZE)<(0x2011+387-0x2194))
+{printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x20\x77\x72\x69\x74\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64" "\n"
 ,errno);close(fp);free(buf);return RESULT_FILE_WRITE_FAIL;}ret=fsync(fp);free(
-buf);close(fp);if(ret<(0x547+6420-0x1e5b)){printf(
+buf);close(fp);if(ret<(0xf17+905-0x12a0)){printf(
 "\x53\x79\x6e\x63\x20\x46\x61\x69\x6c\x65\x64\x3a\x25\x73\x2c\x20\x66\x69\x6c\x65\x20\x70\x61\x74\x68\x3a\x25\x73"
 ,strerror(errno),nvFile);return ret;}return RESULT_SUCCESS;}return 
 RESULT_NO_FILE;}static int nvget(char*file,char*key,char*value){int index=
-(0xe34+5698-0x2476);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;for(list=nv_list;
+(0x16e0+1509-0x1cc5);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;for(list=nv_list;
 list;list=list->next){if(strcmp(list->nvFile,file))continue;index=hash(key)%
 NV_HASH_LEN;for(item=list->nvTable[index];item;item=item->next){if(strcmp(item->
-key,key))continue;strncpy(value,item->value,NV_MAX_VAL_LEN-(0x115+9033-0x245d));
-value[NV_MAX_VAL_LEN-(0x1385+4341-0x2479)]='\0';return RESULT_SUCCESS;}}return 
+key,key))continue;strncpy(value,item->value,NV_MAX_VAL_LEN-(0xcf7+779-0x1001));
+value[NV_MAX_VAL_LEN-(0x1bc+8288-0x221b)]='\0';return RESULT_SUCCESS;}}return 
 RESULT_NO_ITEM;}static int nvset(char*file,const char*key,const char*value,int 
-saveFlag){int index=(0x1e3+6539-0x1b6e);int ret=(0x1bba+654-0x1e48);int 
-key_buf_len=(0x130c+2829-0x1e19);int value_buf_len=(0x72f+6674-0x2141);T_NV_NODE
-*list=NULL;T_NV_ITEM*item=NULL;T_NV_ITEM*newItem=NULL;if(NULL==key||NULL==value)
-return RESULT_FAIL;key_buf_len=strlen(key)+(0x383+7336-0x202a);value_buf_len=
-strlen(value)+(0x161+6558-0x1afe);for(list=nv_list;list;list=list->next){if(
-strcmp(list->nvFile,file))continue;index=hash(key)%NV_HASH_LEN;for(item=list->
-nvTable[index];item;item=item->next){if(strcmp(item->key,key))continue;if(
-saveFlag)item->saveFlag=saveFlag;if(!strcmp(item->value,value))return 
-RESULT_SUCCESS;free(item->value);item->value=(char*)malloc(value_buf_len);if(!
-item->value)return RESULT_MALLOC_FAIL;strncpy(item->value,value,value_buf_len-
-(0xe1f+2406-0x1784));item->value[value_buf_len-(0x146+9599-0x26c4)]='\0';return 
-RESULT_SUCCESS;}newItem=(T_NV_ITEM*)malloc(sizeof(T_NV_ITEM));if(!newItem)return
- RESULT_MALLOC_FAIL;newItem->key=(char*)malloc(key_buf_len);if(!newItem->key){
+saveFlag){int index=(0xd61+5268-0x21f5);int ret=(0xaaa+2793-0x1593);int 
+key_buf_len=(0x135b+3339-0x2066);int value_buf_len=(0x4b+3162-0xca5);T_NV_NODE*
+list=NULL;T_NV_ITEM*item=NULL;T_NV_ITEM*newItem=NULL;if(NULL==key||NULL==value)
+return RESULT_FAIL;key_buf_len=strlen(key)+(0x644+4271-0x16f2);value_buf_len=
+strlen(value)+(0xce5+642-0xf66);for(list=nv_list;list;list=list->next){if(strcmp
+(list->nvFile,file))continue;index=hash(key)%NV_HASH_LEN;for(item=list->nvTable[
+index];item;item=item->next){if(strcmp(item->key,key))continue;if(saveFlag)item
+->saveFlag=saveFlag;if(!strcmp(item->value,value))return RESULT_SUCCESS;free(
+item->value);item->value=(char*)malloc(value_buf_len);if(!item->value)return 
+RESULT_MALLOC_FAIL;strncpy(item->value,value,value_buf_len-(0x11e4+4978-0x2555))
+;item->value[value_buf_len-(0x140f+1407-0x198d)]='\0';return RESULT_SUCCESS;}
+newItem=(T_NV_ITEM*)malloc(sizeof(T_NV_ITEM));if(!newItem)return 
+RESULT_MALLOC_FAIL;newItem->key=(char*)malloc(key_buf_len);if(!newItem->key){
 free(newItem);return RESULT_MALLOC_FAIL;}newItem->value=(char*)malloc(
 value_buf_len);if(!newItem->value){free(newItem->key);free(newItem);return 
-RESULT_MALLOC_FAIL;}strncpy(newItem->key,key,key_buf_len-(0x1520+575-0x175e));
-newItem->key[key_buf_len-(0xd98+3230-0x1a35)]='\0';strncpy(newItem->value,value,
-value_buf_len-(0xcd6+306-0xe07));newItem->value[value_buf_len-
-(0x175f+289-0x187f)]='\0';newItem->next=NULL;newItem->saveFlag=saveFlag;newItem
-->update_flag=(0x802+6800-0x2292);if(!list->nvTable[index])list->nvTable[index]=
+RESULT_MALLOC_FAIL;}strncpy(newItem->key,key,key_buf_len-(0xbb9+1232-0x1088));
+newItem->key[key_buf_len-(0x178+2228-0xa2b)]='\0';strncpy(newItem->value,value,
+value_buf_len-(0x1bb1+497-0x1da1));newItem->value[value_buf_len-
+(0xe07+3106-0x1a28)]='\0';newItem->next=NULL;newItem->saveFlag=saveFlag;newItem
+->update_flag=(0xd4d+750-0x103b);if(!list->nvTable[index])list->nvTable[index]=
 newItem;else{newItem->next=list->nvTable[index]->next;list->nvTable[index]->next
 =newItem;}return RESULT_SUCCESS;}ret=addConfigFile(file,NULL);if(ret==
 RESULT_SUCCESS)return nvset(file,key,value,saveFlag);else return ret;}static int
- nvunset(char*file,char*key){int index=(0xd81+1366-0x12d7);T_NV_NODE*list=NULL;
+ nvunset(char*file,char*key){int index=(0x5ea+3796-0x14be);T_NV_NODE*list=NULL;
 T_NV_ITEM*item=NULL;T_NV_ITEM*prev=NULL;for(list=nv_list;list;list=list->next){
 if(strcmp(list->nvFile,file))continue;index=hash(key)%NV_HASH_LEN;for(item=list
 ->nvTable[index];item;prev=item,item=item->next){if(strcmp(item->key,key))
 continue;if(!prev)list->nvTable[index]=item->next;else prev->next=item->next;
 free(item->key);free(item->value);free(item);return RESULT_SUCCESS;}}return 
-RESULT_NO_ITEM;}static int nvreset(char*file){int ret=(0x18d1+980-0x1ca5);
+RESULT_NO_ITEM;}static int nvreset(char*file){int ret=(0x347+6086-0x1b0d);
 T_NV_NODE*list=NULL;for(list=nv_list;list;list=list->next){if(strcmp(list->
 nvFile,file))continue;ret=nvclear(file);if(ret!=RESULT_SUCCESS)return ret;if(
 loadFactroyParam(list)!=RESULT_SUCCESS)return RESULT_FAIL;return nvcommit(file);
-}return RESULT_NO_FILE;}static int nvclear(char*file){int i=(0x1051+1122-0x14b3)
-;T_NV_NODE*list=NULL;T_NV_ITEM*cur=NULL;T_NV_ITEM*item=NULL;for(list=nv_list;
-list;list=list->next){if(strcmp(list->nvFile,file))continue;for(i=
-(0x1330+4044-0x22fc);i<NV_HASH_LEN;i++){for(item=list->nvTable[i];item;){cur=
-item;item=item->next;free(cur->key);free(cur->value);free(cur);}list->nvTable[i]
-=NULL;}return RESULT_SUCCESS;}return RESULT_NO_FILE;}static int nvcommit(char*
-file){int ret=(0x78b+6791-0x2212);char nvMainFile[NV_PATH_LEN]={
-(0x253+3847-0x115a)};char nvBackupFile[NV_PATH_LEN]={(0x1783+2848-0x22a3)};
+}return RESULT_NO_FILE;}static int nvclear(char*file){int i=(0x1de8+954-0x21a2);
+T_NV_NODE*list=NULL;T_NV_ITEM*cur=NULL;T_NV_ITEM*item=NULL;for(list=nv_list;list
+;list=list->next){if(strcmp(list->nvFile,file))continue;for(i=
+(0xd1d+3193-0x1996);i<NV_HASH_LEN;i++){for(item=list->nvTable[i];item;){cur=item
+;item=item->next;free(cur->key);free(cur->value);free(cur);}list->nvTable[i]=
+NULL;}return RESULT_SUCCESS;}return RESULT_NO_FILE;}static int nvcommit(char*
+file){int ret=(0x1286+2707-0x1d19);char nvMainFile[NV_PATH_LEN]={
+(0x1d0c+1656-0x2384)};char nvBackupFile[NV_PATH_LEN]={(0x101c+1513-0x1605)};
 sprintf(nvMainFile,"\x25\x73\x2f\x25\x73",NV_FS_MAIN_PATH,file);sprintf(
 nvBackupFile,"\x25\x73\x2f\x25\x73",NV_FS_BACKUP_PATH,file);ret=saveNvFs(file,
 nvMainFile);if(ret!=RESULT_SUCCESS)return ret;return restoreNvFs(nvBackupFile,
diff --git a/ap/app/zte_comm/nvserver/nvupdate.c b/ap/app/zte_comm/nvserver/nvupdate.c
index 46565f8..90ec1af 100755
--- a/ap/app/zte_comm/nvserver/nvupdate.c
+++ b/ap/app/zte_comm/nvserver/nvupdate.c
@@ -23,84 +23,84 @@
 #endif
 extern T_NV_NODE*nv_list;
 #ifdef FOTA_AB
-int get_update_status(void){T_FLAGS_INFO flags_info={(0x143a+1964-0x1be6)};
-unsigned int status=(0x663+612-0x8c7);int ret=(0x195c+474-0x1b36);ret=flags_get(
-&flags_info);status=flags_info.boot_fota_flag.fota_status;if(status==
-(0x740+7441-0x2450))return(0x16d9+3508-0x248b);else return(0x15e4+4022-0x259a);}
+int get_update_status(void){T_FLAGS_INFO flags_info={(0xc56+1828-0x137a)};
+unsigned int status=(0xa61+3485-0x17fe);int ret=(0x1f55+1413-0x24da);ret=
+flags_get(&flags_info);status=flags_info.boot_fota_flag.fota_status;if(status==
+(0x109+7756-0x1f54))return(0xc18+3727-0x1aa5);else return(0x864+3912-0x17ac);}
 #else
-int get_update_status(void){int update_status;FILE*fd=(0x1fe7+737-0x22c8);int 
+int get_update_status(void){int update_status;FILE*fd=(0x8aa+3942-0x1810);int 
 ret;char*filename=NULL;if(access(FOTA_UPDATE_STATUS_FILE_OLD,R_OK)==
-(0x1808+2242-0x20ca)){filename=FOTA_UPDATE_STATUS_FILE_OLD;}else{filename=
+(0x3f6+8063-0x2375)){filename=FOTA_UPDATE_STATUS_FILE_OLD;}else{filename=
 FOTA_UPDATE_STATUS_FILE;}printf(
 "get_update_status, read_update_status from %s\n",filename);fd=fopen(filename,
 "\x72\x62\x2b");if(fd==NULL){printf(
 "\x5b\x6e\x76\x73\x65\x72\x76\x65\x72\x5d\x75\x70\x64\x61\x74\x65\x5f\x73\x74\x61\x74\x75\x73\x20\x6f\x70\x65\x6e\x20\x20\x65\x72\x72\x6f\x72\x3a\x25\x73" "\n"
 ,strerror(errno));goto error0;}ret=fscanf(fd,"\x25\x64",(int*)&update_status);if
-(ret<(0xa61+4828-0x1d3d)){printf(
+(ret<(0x1f00+438-0x20b6)){printf(
 "\x67\x65\x74\x20\x69\x6e\x66\x6f\x20\x66\x72\x6f\x6d\x20\x66\x69\x6c\x65\x20\x65\x72\x72\x6f\x72\x3a\x25\x73" "\n"
 ,strerror(errno));fclose(fd);goto error0;}printf(
 "\x75\x70\x64\x61\x74\x65\x5f\x73\x74\x61\x74\x75\x73\x3d\x25\x64" "\n",
-update_status);fclose(fd);return update_status;error0:return-(0xf6a+854-0x12bf);
-}
+update_status);fclose(fd);return update_status;error0:return-(0x6c9+5426-0x1bfa)
+;}
 #endif
 int nvupdate(char*nv_file,char*config_file,const char*key,const char*value,int 
-saveFlag){int index=(0x1af9+1683-0x218c);int key_buf_len=(0x555+1941-0xcea);int 
-value_buf_len=(0x186b+2309-0x2170);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;
+saveFlag){int index=(0x386+929-0x727);int key_buf_len=(0x32c+3352-0x1044);int 
+value_buf_len=(0x17a+585-0x3c3);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;
 T_NV_ITEM*newItem=NULL;if(NULL==key||NULL==value)return RESULT_FAIL;printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6e\x76\x75\x70\x64\x61\x74\x65\x20\x6e\x76\x5f\x66\x69\x6c\x65\x3a\x25\x73\x20\x6b\x65\x79\x3a\x25\x73\x20\x76\x61\x6c\x75\x65\x3a\x25\x73" "\n"
-,nv_file,key,value);key_buf_len=strlen(key)+(0x1aa3+663-0x1d39);value_buf_len=
-strlen(value)+(0x18f+9358-0x261c);for(list=nv_list;list;list=list->next){if(
+,nv_file,key,value);key_buf_len=strlen(key)+(0xc25+402-0xdb6);value_buf_len=
+strlen(value)+(0xd7+5252-0x155a);for(list=nv_list;list;list=list->next){if(
 strcmp(list->nvFile,nv_file))continue;index=hash(key)%NV_HASH_LEN;for(item=list
 ->nvTable[index];item;item=item->next){if(strcmp(item->key,key))continue;if(
 saveFlag)item->saveFlag=saveFlag;if(!strcmp(item->value,value)){item->
-update_flag=(0x10b8+342-0x120d);printf(
+update_flag=(0x414+5234-0x1885);printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6e\x76\x75\x70\x64\x61\x74\x65\x20\x73\x61\x6d\x65\x73\x6b\x69\x70\x3a\x69\x74\x65\x6d\x2d\x3e\x6b\x65\x79\x3a\x25\x73\x20\x69\x74\x65\x6d\x2d\x3e\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x63\x6f\x6e\x66\x69\x67\x5f\x66\x69\x6c\x65\x3a\x25\x73" "\n"
 ,item->key,item->value,value,config_file);return RESULT_SUCCESS;}if(strstr(
-config_file,"\x75\x73\x65\x72")){if((0x5c8+835-0x90a)==item->update_flag){printf
-(
+config_file,"\x75\x73\x65\x72")){if((0x188+5416-0x16af)==item->update_flag){
+printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6e\x76\x75\x70\x64\x61\x74\x65\x20\x73\x65\x63\x6f\x6e\x64\x20\x63\x68\x61\x6e\x67\x65\x3a\x69\x74\x65\x6d\x2d\x3e\x6b\x65\x79\x3a\x25\x73\x20\x69\x74\x65\x6d\x2d\x3e\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x63\x6f\x6e\x66\x69\x67\x5f\x66\x69\x6c\x65\x3a\x25\x73" "\n"
 ,item->key,item->value,value,config_file);}else{item->update_flag=
-(0x74c+636-0x9c7);printf(
+(0x91d+139-0x9a7);printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6e\x76\x75\x70\x64\x61\x74\x65\x20\x75\x73\x65\x72\x73\x6b\x69\x70\x3a\x69\x74\x65\x6d\x2d\x3e\x6b\x65\x79\x3a\x25\x73\x20\x69\x74\x65\x6d\x2d\x3e\x76\x61\x6c\x75\x65\x31\x3a\x25\x73\x20\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x63\x6f\x6e\x66\x69\x67\x5f\x66\x69\x6c\x65\x3a\x25\x73" "\n"
 ,item->key,item->value,value,config_file);return RESULT_SUCCESS;}}printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x6b\x65\x79\x3d\x25\x73\x20\x63\x68\x61\x6e\x67\x65\x20\x76\x61\x6c\x75\x65\x3a\x25\x73\x20\x74\x6f\x20\x76\x61\x6c\x75\x65\x3d\x25\x73\x20" "\n"
 ,item->key,item->value,value);free(item->value);item->value=(char*)malloc(
 value_buf_len);if(!item->value)return RESULT_MALLOC_FAIL;strncpy(item->value,
-value,value_buf_len-(0x1745+619-0x19af));item->value[value_buf_len-
-(0x1ffc+469-0x21d0)]='\0';item->update_flag=(0x1224+1037-0x1630);return 
+value,value_buf_len-(0x103d+3904-0x1f7c));item->value[value_buf_len-
+(0x5c8+305-0x6f8)]='\0';item->update_flag=(0x11e2+1934-0x196f);return 
 RESULT_SUCCESS;}newItem=(T_NV_ITEM*)malloc(sizeof(T_NV_ITEM));if(!newItem){
 printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x52\x45\x53\x55\x4c\x54\x5f\x4d\x41\x4c\x4c\x4f\x43\x5f\x46\x41\x49\x4c\x31\x20" "\n"
 );return RESULT_MALLOC_FAIL;}newItem->key=(char*)malloc(strlen(key)+
-(0x1659+1613-0x1ca5));if(!newItem->key){free(newItem);printf(
+(0xc37+6367-0x2515));if(!newItem->key){free(newItem);printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x52\x45\x53\x55\x4c\x54\x5f\x4d\x41\x4c\x4c\x4f\x43\x5f\x46\x41\x49\x4c\x32" "\n"
 );return RESULT_MALLOC_FAIL;}newItem->value=(char*)malloc(value_buf_len);if(!
 newItem->value){free(newItem->key);free(newItem);printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x52\x45\x53\x55\x4c\x54\x5f\x4d\x41\x4c\x4c\x4f\x43\x5f\x46\x41\x49\x4c\x33\x20" "\n"
 );return RESULT_MALLOC_FAIL;}strncpy(newItem->key,key,key_buf_len-
-(0x1f92+1019-0x238c));newItem->key[key_buf_len-(0x1fb+279-0x311)]='\0';strncpy(
-newItem->value,value,value_buf_len-(0x5bb+3024-0x118a));newItem->value[
-value_buf_len-(0x87a+311-0x9b0)]='\0';newItem->next=NULL;newItem->saveFlag=
-saveFlag;newItem->update_flag=(0x210d+472-0x22e4);printf(
+(0x11ea+4455-0x2350));newItem->key[key_buf_len-(0x1e75+556-0x20a0)]='\0';strncpy
+(newItem->value,value,value_buf_len-(0x2cd+1769-0x9b5));newItem->value[
+value_buf_len-(0x555+8051-0x24c7)]='\0';newItem->next=NULL;newItem->saveFlag=
+saveFlag;newItem->update_flag=(0x103f+5836-0x270a);printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x61\x64\x64\x20\x6b\x65\x79\x3d\x25\x73\x2c\x20\x76\x61\x6c\x75\x65\x3d\x25\x73\x20" "\n"
 ,newItem->key,newItem->value);if(!list->nvTable[index])list->nvTable[index]=
 newItem;else{newItem->next=list->nvTable[index]->next;list->nvTable[index]->next
 =newItem;}return RESULT_SUCCESS;}return RESULT_FAIL;}int reloadFactroyParam(
 T_NV_NODE*list){char*val=NULL;FILE*fp=NULL;T_NV_CONFIG*config=NULL;char buf[
-NV_MAX_ITEM_LEN]={(0x70a+1556-0xd1e)};printf(
+NV_MAX_ITEM_LEN]={(0x16f4+3164-0x2350)};printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x72\x65\x6c\x6f\x61\x64\x46\x61\x63\x74\x72\x6f\x79\x50\x61\x72\x61\x6d\x20\x6e\x76\x46\x69\x6c\x65\x3a\x25\x73" "\n"
 ,list->nvFile);for(config=list->fileList;config;config=config->next){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x72\x65\x6c\x6f\x61\x64\x46\x61\x63\x74\x72\x6f\x79\x50\x61\x72\x61\x6d\x20\x63\x6f\x6e\x66\x69\x67\x46\x69\x6c\x65\x20\x73\x74\x61\x72\x74\x3a\x25\x73\x21" "\n"
 ,config->configFile);fp=fopen(config->configFile,"\x72\x6f");if(!fp){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x6f\x70\x65\x6e\x20\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x61\x69\x6c\x20\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x21" "\n"
 ,config->configFile,errno);return RESULT_FILE_OPEN_FAIL;}while(fgets(buf,
-NV_MAX_ITEM_LEN,fp)){if(buf[(0x1100+717-0x13cd)]=='\n'||buf[(0xb44+5762-0x21c6)]
-==((char)(0x111+4889-0x1407)))continue;val=strchr(buf,
-((char)(0x327+6366-0x1bc8)));if(!val){printf(
+NV_MAX_ITEM_LEN,fp)){if(buf[(0x132a+1872-0x1a7a)]=='\n'||buf[(0x1b8+6120-0x19a0)
+]==((char)(0xb13+4768-0x1d90)))continue;val=strchr(buf,
+((char)(0x1a99+2848-0x257c)));if(!val){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x65\x72\x72\x6f\x72\x3a\x25\x73\x20\x66\x69\x6c\x65\x20\x66\x6f\x72\x6d\x61\x74\x20\x65\x72\x72\x6f\x72\x3a\x73\x74\x72\x69\x6e\x67\x20\x3d\x20\x25\x73" "\n"
-,config->configFile,buf);continue;}buf[strlen(buf)-(0x1832+671-0x1ad0)]='\0';*
-val++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0x1693+1037-0x1a9f)
-);}printf(
+,config->configFile,buf);continue;}buf[strlen(buf)-(0xab8+5631-0x20b6)]='\0';*
+val++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0x326+6743-0x1d7c))
+;}printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x72\x65\x6c\x6f\x61\x64\x46\x61\x63\x74\x72\x6f\x79\x50\x61\x72\x61\x6d\x20\x63\x6f\x6e\x66\x69\x67\x46\x69\x6c\x65\x20\x65\x6e\x64\x3a\x25\x73\x21" "\n"
 ,config->configFile);fclose(fp);}return RESULT_SUCCESS;}void dump_list(T_NV_ITEM
 *list){if(list==NULL){printf(
@@ -108,12 +108,12 @@
 list->next;while(p!=NULL){printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x64\x75\x6d\x70\x20\x6b\x65\x79\x3d\x25\x73\x2c\x20\x76\x61\x6c\x75\x65\x3d\x25\x73\x2c\x20\x70\x3d\x30\x78\x25\x78" "\n"
 ,p->key,p->value,((unsigned int)p));p=p->next;}}int delete_not_needed(T_NV_NODE*
-list){int index=(0xff2+1821-0x170f);T_NV_ITEM*item=NULL;T_NV_ITEM head={
-(0x1062+5597-0x263f)};T_NV_ITEM*prev=&head;printf(
+list){int index=(0x1a5c+3012-0x2620);T_NV_ITEM*item=NULL;T_NV_ITEM head={
+(0x8fb+4667-0x1b36)};T_NV_ITEM*prev=&head;printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x64\x65\x6c\x65\x74\x65\x5f\x6e\x6f\x74\x5f\x6e\x65\x65\x64\x65\x64\x20\x65\x6e\x74\x65\x72\x20\x2a\x2a\x2a" "\n"
-);for(index=(0xb61+2216-0x1409);index<NV_HASH_LEN;index++){head.next=list->
-nvTable[index];prev=&head;for(item=prev->next;item;){if((0x1c20+418-0x1dc1)==
-item->update_flag){prev=item;item=item->next;}else{printf(
+);for(index=(0x179+6200-0x19b1);index<NV_HASH_LEN;index++){head.next=list->
+nvTable[index];prev=&head;for(item=prev->next;item;){if((0xf8+4954-0x1451)==item
+->update_flag){prev=item;item=item->next;}else{printf(
 "\x6e\x76\x73\x65\x72\x76\x65\x72\x20\x64\x65\x6c\x65\x74\x65\x20\x6b\x65\x79\x3d\x25\x73\x2c\x20\x76\x61\x6c\x75\x65\x3d\x25\x73\x20" "\n"
 ,item->key,item->value);prev->next=item->next;free(item->key);free(item->value);
 free(item);item=prev->next;}}list->nvTable[index]=head.next;}printf(