aboutsummaryrefslogtreecommitdiff
path: root/gethostsfile.cpp
blob: 72faa4718b16da532f924affb65445df1365d492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <string.h>
#include <netdb.h>
#include <sys/system_properties.h>

#include "gethostsfile.h"

const char* gethostsfile() {
       char hosts_setting[128];
       int prop_len = __system_property_get(AICP_HOSTS_SETTING_PROP,
                                            hosts_setting);
	if (prop_len > 0 && strncmp(hosts_setting, "true", 4) == 0) {
		return AICP_PATH_ADBLOCK_HOSTS;
	} else {
		return _PATH_HOSTS;
	}
}