class Configuration {

    public static Configuration read(Reader reader) throws IOException {
        Configuration config = GSON.fromJson(reader, Configuration.class);

        if (config.whitelist.items.isEmpty()) {
            config.whitelist = new Whitelist();
            config.whitelist.items.add("com.android.vending");
        }

        if (config.version > VERSION)
            throw new IOException("Unhandled file format version");

        for (int i = config.minorVersion + 1; i <= MINOR_VERSION; i++) {
            config.runUpdate(i);
        }
        config.updateURL("http://someonewhocares.org/hosts/hosts", "https://someonewhocares.org/hosts/hosts", 0);


        return config;
    }

}