add geoip v6 file and support in TorService

This commit is contained in:
Nathan Freitas 2014-01-09 21:32:07 -05:00
parent e24ae6cb07
commit d3c11bed4b
5 changed files with 10 additions and 2 deletions

Binary file not shown.

BIN
res/raw/geoip6.mp3 Normal file

Binary file not shown.

View File

@ -77,6 +77,10 @@ public class TorBinaryInstaller implements TorServiceConstants {
outFile = new File(installFolder, GEOIP_ASSET_KEY);
streamToFile(is, outFile, false, true);
is = context.getResources().openRawResource(R.raw.geoip6);
outFile = new File(installFolder, GEOIP6_ASSET_KEY);
streamToFile(is, outFile, false, true);
return true;
}

View File

@ -1645,8 +1645,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst
if (entranceNodes.length() > 0 || exitNodes.length() > 0 || excludeNodes.length() > 0)
{
//only apple GeoIP if you need it
//only apply GeoIP if you need it
File fileGeoIP = new File(appBinHome,GEOIP_ASSET_KEY);
File fileGeoIP6 = new File(appBinHome,GEOIP6_ASSET_KEY);
try
{
@ -1658,6 +1659,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
}
mBinder.updateConfiguration("GeoIPFile", fileGeoIP.getAbsolutePath(), false);
mBinder.updateConfiguration("GeoIPv6File", fileGeoIP6.getAbsolutePath(), false);
}
catch (Exception e)

View File

@ -31,6 +31,8 @@ public interface TorServiceConstants {
//geoip data file asset key
public final static String GEOIP_ASSET_KEY = "geoip";
public final static String GEOIP6_ASSET_KEY = "geoip6";
//various console cmds
public final static String SHELL_CMD_CHMOD = "chmod";