本文主要是介绍c tool系列------如何在C文件中获取property,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
找到一段代码作为以后的参考:
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");
}
}
这篇关于c tool系列------如何在C文件中获取property的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!