[Feature][ZXW-285]merge P56U05 version

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

Change-Id: Ied657102425a179a89ef41847170152e8a5d437c
diff --git a/ap/app/zte_comm/nvserver/nvupdate.c b/ap/app/zte_comm/nvserver/nvupdate.c
index 8d51bd0..1a0399d 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={(0x16c2+2939-0x223d)};
-unsigned int status=(0xaf7+3581-0x18f4);int ret=(0x17b5+859-0x1b10);ret=
+int get_update_status(void){T_FLAGS_INFO flags_info={(0x1cca+2585-0x26e3)};
+unsigned int status=(0x1c24+2541-0x2611);int ret=(0xe98+3151-0x1ae7);ret=
 flags_get(&flags_info);status=flags_info.boot_fota_flag.fota_status;if(status==
-(0x41b+6325-0x1ccf))return(0x17b1+3919-0x26fe);else return(0x1bb0+2232-0x2468);}
+(0x48c+2936-0x1003))return(0x1168+3705-0x1fdf);else return(0xb69+401-0xcfa);}
 #else
-int get_update_status(void){int update_status;FILE*fd=(0x1045+3306-0x1d2f);int 
+int get_update_status(void){int update_status;FILE*fd=(0x13cf+4189-0x242c);int 
 ret;char*filename=NULL;if(access(FOTA_UPDATE_STATUS_FILE_OLD,R_OK)==
-(0x20a3+1251-0x2586)){filename=FOTA_UPDATE_STATUS_FILE_OLD;}else{filename=
+(0x112c+1492-0x1700)){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<(0x3cc+6429-0x1ce9)){printf(
+(ret<(0x1d1+7241-0x1e1a)){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-(0x6b1+2172-0xf2c);
-}
+update_status);fclose(fd);return update_status;error0:return-
+(0x1bc0+1709-0x226c);}
 #endif
 int nvupdate(char*nv_file,char*config_file,const char*key,const char*value,int 
-saveFlag){int index=(0xa68+1703-0x110f);int key_buf_len=(0x204+777-0x50d);int 
-value_buf_len=(0xc7+2396-0xa23);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;
+saveFlag){int index=(0x98+2303-0x997);int key_buf_len=(0x174a+2664-0x21b2);int 
+value_buf_len=(0x28a+3592-0x1092);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)+(0x59d+8203-0x25a7);value_buf_len=
-strlen(value)+(0x7a6+1752-0xe7d);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(
+,nv_file,key,value);key_buf_len=strlen(key)+(0xed9+2226-0x178a);value_buf_len=
+strlen(value)+(0x84+3837-0xf80);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=(0x645+7069-0x21e1);printf(
+update_flag=(0x677+1197-0xb23);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((0x725+2101-0xf59)==item->update_flag){
+config_file,"\x75\x73\x65\x72")){if((0x4ed+3709-0x1369)==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=
-(0x1db+3244-0xe86);printf(
+(0x1fa1+1702-0x2646);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-(0x1c92+957-0x204e));item->value[value_buf_len-
-(0x1631+889-0x19a9)]='\0';item->update_flag=(0x1aa8+1411-0x202a);return 
+value,value_buf_len-(0xbf0+2421-0x1564));item->value[value_buf_len-
+(0x16f4+1898-0x1e5d)]='\0';item->update_flag=(0x1128+4897-0x2448);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)+
-(0x1d55+1863-0x249b));if(!newItem->key){free(newItem);printf(
+(0x1689+2517-0x205d));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-
-(0x660+969-0xa28));newItem->key[key_buf_len-(0x8a1+4762-0x1b3a)]='\0';strncpy(
-newItem->value,value,value_buf_len-(0x1814+694-0x1ac9));newItem->value[
-value_buf_len-(0xf82+1089-0x13c2)]='\0';newItem->next=NULL;newItem->saveFlag=
-saveFlag;newItem->update_flag=(0x13d7+2400-0x1d36);printf(
+(0x13d6+3760-0x2285));newItem->key[key_buf_len-(0xe03+4148-0x1e36)]='\0';strncpy
+(newItem->value,value,value_buf_len-(0x966+4530-0x1b17));newItem->value[
+value_buf_len-(0x2284+310-0x23b9)]='\0';newItem->next=NULL;newItem->saveFlag=
+saveFlag;newItem->update_flag=(0xf48+423-0x10ee);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]={(0x364+5569-0x1925)};printf(
+NV_MAX_ITEM_LEN]={(0x71c+701-0x9d9)};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[(0x1eb3+1110-0x2309)]=='\n'||buf[
-(0x1055+4252-0x20f1)]==((char)(0x67+9795-0x2687)))continue;val=strchr(buf,
-((char)(0x38f+5711-0x19a1)));if(!val){printf(
+NV_MAX_ITEM_LEN,fp)){if(buf[(0x14b+5434-0x1685)]=='\n'||buf[(0x1b22+1496-0x20fa)
+]==((char)(0x2e9+6018-0x1a48)))continue;val=strchr(buf,
+((char)(0x18c7+930-0x1c2c)));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)-(0x42b+925-0x7c7)]='\0';*val
-++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0x526+6646-0x1f1b));}
-printf(
+,config->configFile,buf);continue;}buf[strlen(buf)-(0x145b+4445-0x25b7)]='\0';*
+val++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0x534+5683-0x1b66))
+;}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,11 +108,11 @@
 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=(0x240+470-0x416);T_NV_ITEM*item=NULL;T_NV_ITEM head={
-(0xc7b+3002-0x1835)};T_NV_ITEM*prev=&head;printf(
+list){int index=(0x1b40+391-0x1cc7);T_NV_ITEM*item=NULL;T_NV_ITEM head={
+(0x10ca+3240-0x1d72)};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=(0x1d1c+733-0x1ff9);index<NV_HASH_LEN;index++){head.next=list->
-nvTable[index];prev=&head;for(item=prev->next;item;){if((0x1d2+6318-0x1a7f)==
+);for(index=(0x1de9+1126-0x224f);index<NV_HASH_LEN;index++){head.next=list->
+nvTable[index];prev=&head;for(item=prev->next;item;){if((0xe14+6253-0x2680)==
 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);