blob: d6d0bc6b54db62eea0657c31dc78bb47d848ad7c [file] [log] [blame]
/* SPDX-License-Identifier: MediaTekProprietary */
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <errno.h>
#include <cutils/properties.h>
#define PROP_CORE_PROP_LOCAL "/data/local.prop"
int main(int argc, char* const argv[]) {
char value[PROPERTY_VALUE_MAX];
if (argc < 2)
{
FILE *fp;
if ((fp = fopen(PROP_CORE_PROP_LOCAL, "r")) == NULL) {
printf("Open prop file fail\n");
return -1;
}
while (!feof(fp)) {
fgets(value, PROPERTY_VALUE_MAX, fp);
printf("%s", value);
}
fclose(fp);
printf("\n");
return 0;
} else {
property_get(argv[1], value, "");
printf("%s\n", value);
}
return 0;
}