add geoip v6 file and support in TorService
This commit is contained in:
parent
e24ae6cb07
commit
d3c11bed4b
Binary file not shown.
Binary file not shown.
|
@ -77,6 +77,10 @@ public class TorBinaryInstaller implements TorServiceConstants {
|
||||||
outFile = new File(installFolder, GEOIP_ASSET_KEY);
|
outFile = new File(installFolder, GEOIP_ASSET_KEY);
|
||||||
streamToFile(is, outFile, false, true);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1645,8 +1645,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
||||||
|
|
||||||
if (entranceNodes.length() > 0 || exitNodes.length() > 0 || excludeNodes.length() > 0)
|
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 fileGeoIP = new File(appBinHome,GEOIP_ASSET_KEY);
|
||||||
|
File fileGeoIP6 = new File(appBinHome,GEOIP6_ASSET_KEY);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1658,6 +1659,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
|
||||||
}
|
}
|
||||||
|
|
||||||
mBinder.updateConfiguration("GeoIPFile", fileGeoIP.getAbsolutePath(), false);
|
mBinder.updateConfiguration("GeoIPFile", fileGeoIP.getAbsolutePath(), false);
|
||||||
|
mBinder.updateConfiguration("GeoIPv6File", fileGeoIP6.getAbsolutePath(), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -31,6 +31,8 @@ public interface TorServiceConstants {
|
||||||
|
|
||||||
//geoip data file asset key
|
//geoip data file asset key
|
||||||
public final static String GEOIP_ASSET_KEY = "geoip";
|
public final static String GEOIP_ASSET_KEY = "geoip";
|
||||||
|
public final static String GEOIP6_ASSET_KEY = "geoip6";
|
||||||
|
|
||||||
|
|
||||||
//various console cmds
|
//various console cmds
|
||||||
public final static String SHELL_CMD_CHMOD = "chmod";
|
public final static String SHELL_CMD_CHMOD = "chmod";
|
||||||
|
|
Loading…
Reference in New Issue