void writepcmtofile(const char * fname,const void* buffer, size_t bytes)
{
static FILE *fp=NULL;
if(fp==NULL || access( fname, F_OK )==-1){
fp = fopen(fname, "ab+" );
if(fp==NULL){
ALOGI("can't open file!");
fp=NULL;
return;
}
}
if(fp!=NULL){
fwrite(buffer , 1 , bytes , fp );
ALOGI("write to file %d bytes",bytes);
}
}
adb shell setenforce 0
adb shell chmod 777 /data/user