[Feature][task-view-306]merge P56U08(patch6) 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: I8e809511ac30c97228dd110c304b4a08f4af36d7
diff --git a/ap/app/zte_comm/nvserver/nvupdate.c b/ap/app/zte_comm/nvserver/nvupdate.c
index 9c17d00..2830fc2 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={(0x150c+218-0x15e6)};
-unsigned int status=(0x631+1931-0xdbc);int ret=(0xb62+4294-0x1c28);ret=flags_get
-(&flags_info);status=flags_info.boot_fota_flag.fota_status;if(status==
-(0x1d6a+33-0x1d8a))return(0x120a+130-0x128a);else return(0x7fb+2992-0x13ab);}
+int get_update_status(void){T_FLAGS_INFO flags_info={(0xb6d+2186-0x13f7)};
+unsigned int status=(0x14c6+3759-0x2375);int ret=(0x2b3+7519-0x2012);ret=
+flags_get(&flags_info);status=flags_info.boot_fota_flag.fota_status;if(status==
+(0x8b0+6948-0x23d3))return(0x152b+3247-0x21d8);else return(0xed5+3378-0x1c07);}
#else
-int get_update_status(void){int update_status;FILE*fd=(0x12e3+3046-0x1ec9);int
+int get_update_status(void){int update_status;FILE*fd=(0x35b+3454-0x10d9);int
ret;char*filename=NULL;if(access(FOTA_UPDATE_STATUS_FILE_OLD,R_OK)==
-(0xa4b+4136-0x1a73)){filename=FOTA_UPDATE_STATUS_FILE_OLD;}else{filename=
+(0x1dec+1019-0x21e7)){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<(0x3b2+6806-0x1e48)){printf(
+(ret<(0x1063+3165-0x1cc0)){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-(0x1eb9+903-0x223f)
+update_status);fclose(fd);return update_status;error0:return-(0xba9+1750-0x127e)
;}
#endif
int nvupdate(char*nv_file,char*config_file,const char*key,const char*value,int
-saveFlag){int index=(0x16d5+2064-0x1ee5);int key_buf_len=(0x1015+4688-0x2265);
-int value_buf_len=(0x1a02+2063-0x2211);T_NV_NODE*list=NULL;T_NV_ITEM*item=NULL;
+saveFlag){int index=(0xfe9+3366-0x1d0f);int key_buf_len=(0x1ddd+1220-0x22a1);int
+ value_buf_len=(0x11db+1233-0x16ac);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)+(0xf88+2353-0x18b8);value_buf_len=
-strlen(value)+(0x1b06+966-0x1ecb);for(list=nv_list;list;list=list->next){if(
+,nv_file,key,value);key_buf_len=strlen(key)+(0x23e3+759-0x26d9);value_buf_len=
+strlen(value)+(0x1f4+2370-0xb35);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=(0xf45+629-0x11b9);printf(
+update_flag=(0x1b33+2662-0x2598);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((0xc55+661-0xee9)==item->update_flag){printf
-(
+config_file,"\x75\x73\x65\x72")){if((0xd51+5472-0x22b0)==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=
-(0xf8c+4865-0x228c);printf(
+(0x39a+7978-0x22c3);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-(0x197+2678-0xc0c));item->value[value_buf_len-
-(0x11b9+183-0x126f)]='\0';item->update_flag=(0x39+8225-0x2059);return
+value,value_buf_len-(0x1471+1707-0x1b1b));item->value[value_buf_len-
+(0xfa0+315-0x10da)]='\0';item->update_flag=(0x15e5+3127-0x221b);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)+
-(0xe7d+4259-0x1f1f));if(!newItem->key){free(newItem);printf(
+(0xcf1+2732-0x179c));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-
-(0xbc1+2804-0x16b4));newItem->key[key_buf_len-(0x30b+7106-0x1ecc)]='\0';strncpy(
-newItem->value,value,value_buf_len-(0x1fe9+1707-0x2693));newItem->value[
-value_buf_len-(0x642+5243-0x1abc)]='\0';newItem->next=NULL;newItem->saveFlag=
-saveFlag;newItem->update_flag=(0x822+2099-0x1054);printf(
+(0x1754+1643-0x1dbe));newItem->key[key_buf_len-(0x1b6f+2951-0x26f5)]='\0';
+strncpy(newItem->value,value,value_buf_len-(0x15fa+62-0x1637));newItem->value[
+value_buf_len-(0x1643+1681-0x1cd3)]='\0';newItem->next=NULL;newItem->saveFlag=
+saveFlag;newItem->update_flag=(0xe5c+5876-0x254f);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]={(0x10c7+3180-0x1d33)};printf(
+NV_MAX_ITEM_LEN]={(0x797+2019-0xf7a)};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[(0xb27+5945-0x2260)]=='\n'||buf[(0x7d7+3148-0x1423)]
-==((char)(0xa37+3124-0x1648)))continue;val=strchr(buf,
-((char)(0xb03+2794-0x15b0)));if(!val){printf(
+NV_MAX_ITEM_LEN,fp)){if(buf[(0x55c+170-0x606)]=='\n'||buf[(0x1edf+1859-0x2622)]
+==((char)(0x759+6410-0x2040)))continue;val=strchr(buf,((char)(0x1c21+58-0x1c1e))
+);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)-(0x360+4370-0x1471)]='\0';*
-val++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0xd3b+6418-0x264c))
-;}printf(
+,config->configFile,buf);continue;}buf[strlen(buf)-(0x1315+1949-0x1ab1)]='\0';*
+val++='\0';nvupdate(list->nvFile,config->configFile,buf,val,(0x253+3001-0xe0b));
+}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=(0xb62+4548-0x1d26);T_NV_ITEM*item=NULL;T_NV_ITEM head={
-(0xeac+36-0xed0)};T_NV_ITEM*prev=&head;printf(
+list){int index=(0xe24+3667-0x1c77);T_NV_ITEM*item=NULL;T_NV_ITEM head={
+(0xf42+5257-0x23cb)};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=(0x1431+306-0x1563);index<NV_HASH_LEN;index++){head.next=list->
-nvTable[index];prev=&head;for(item=prev->next;item;){if((0x1da4+94-0x1e01)==item
-->update_flag){prev=item;item=item->next;}else{printf(
+);for(index=(0x179f+1947-0x1f3a);index<NV_HASH_LEN;index++){head.next=list->
+nvTable[index];prev=&head;for(item=prev->next;item;){if((0x1996+2542-0x2383)==
+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(