Skip to content

Commit

Permalink
get geoip files as JARs from jcenter Maven repo
Browse files Browse the repository at this point in the history
  • Loading branch information
eighthave committed May 4, 2021
1 parent afb3ae7 commit 9b483cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions orbotservice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ dependencies {

implementation 'com.offbynull.portmapper:portmapper:2.0.5'

implementation 'info.guardianproject:geoip:20191217'

api 'info.guardianproject:jtorctl:0.4'

implementation 'com.github.tladesignz:IPtProxy:0.5.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.pm.ApplicationInfo;
import android.util.Log;

import org.torproject.android.service.TorServiceConstants;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand All @@ -16,12 +18,6 @@ public class CustomTorResourceInstaller {

private static final String TAG = "CustomTorResourceInstaller";

String COMMON_ASSET_KEY = "common/";

//geoip data file asset key
String GEOIP_ASSET_KEY = "geoip";
String GEOIP6_ASSET_KEY = "geoip6";

private File installFolder;
private Context context;

Expand Down Expand Up @@ -98,15 +94,14 @@ private static File[] listf(String directoryName) {
return fList;
}

//
/*
* Extract the Tor resources from the APK file using ZIP
*/
public void installGeoIP() throws IOException {
if (!installFolder.exists())
installFolder.mkdirs();
assetToFile(COMMON_ASSET_KEY + GEOIP_ASSET_KEY, GEOIP_ASSET_KEY, false, false);
assetToFile(COMMON_ASSET_KEY + GEOIP6_ASSET_KEY, GEOIP6_ASSET_KEY, false, false);
assetToFile(TorServiceConstants.GEOIP_ASSET_KEY, TorServiceConstants.GEOIP_ASSET_KEY, false, false);
assetToFile(TorServiceConstants.GEOIP6_ASSET_KEY, TorServiceConstants.GEOIP6_ASSET_KEY, false, false);
}

/*
Expand Down

0 comments on commit 9b483cf

Please sign in to comment.