找到一段代码作为以后的参考:
char *propertyvalue = "no";
void load_tty_properties(void)
{
char supportDevice[PROP_VALUE_MAX];
char countryCode[PROP_VALUE_MAX];
property_get("ro.product.device", supportDevice,propertyvalue);
property_get("ro.config.versatility", countryCode,propertyvalue);
if((strncmp(supportDevice, "ASUS_Z00T", strlen("ASUS_Z00T"))==0)
&&(strncmp(countryCode, "US", strlen("US"))==0)){
ERROR("ro.asus.phone.tty set 1\n");
system("echo `getprop persist.sys.usb.config` > /factory/usb_config_backup"); //直接执行echo
property_set("ro.asus.phone.tty", "1");
}else {
ERROR("ro.asus.phone.tty set 0\n");
property_set("ro.asus.phone.tty", "0");
}
}