diff --git a/src/usb_moded-config.c b/src/usb_moded-config.c index fd5488f..d24c07b 100644 --- a/src/usb_moded-config.c +++ b/src/usb_moded-config.c @@ -1061,6 +1061,23 @@ char * config_get_android_manufacturer(void) { return ssu_name; } +#else + /*Trying use /etc/hw-release to get MANUFACTURER_ID*/ + GKeyFile *hwReleaseFile; + GError *error = NULL; + + // Create a new GKeyFile object and a bitwise list of flags. + char *hw_name = NULL; + hwReleaseFile = g_key_file_new(); + if (g_key_file_load_from_file(hwReleaseFile, "/etc/hw-release", G_KEY_FILE_NONE, &error)) + { + hw_name = g_key_file_get_string(hwReleaseFile, NULL, "MANUFACTURER", NULL); + } + + if(hw_name) + { + return hw_name; + } #endif return config_get_conf_string(ANDROID_ENTRY, ANDROID_MANUFACTURER_KEY); @@ -1085,6 +1102,15 @@ char * config_get_android_product(void) { return ssu_name; } +#else + /*Trying use /etc/hw-release to get NAME*/ + GKeyFile *hwReleaseFile; + GError *error = NULL; + + hwReleaseFile = g_key_file_new(); + if (g_key_file_load_from_file(hwReleaseFile, "/etc/hw-release", G_KEY_FILE_NONE, &error)) { + return g_key_file_get_string(hwReleaseFile, NULL, "NAME", NULL); + } #endif return config_get_conf_string(ANDROID_ENTRY, ANDROID_PRODUCT_KEY);