[tor-commits] [orbot/master] get geoip files as JARs from jcenter Maven repo
n8fr8 at torproject.org
n8fr8 at torproject.org
Wed Dec 22 21:55:07 UTC 2021
commit 9b483cfd01177e575ac46487466b9ea0e39911d2
Author: Hans-Christoph Steiner <hans at eds.org>
Date: Wed Dec 18 11:38:28 2019 +0100
get geoip files as JARs from jcenter Maven repo
---
app-mini/src/main/assets/common/geoip | 0
app-mini/src/main/assets/common/geoip6 | 0
orbotservice/build.gradle | 2 ++
.../android/service/util/CustomTorResourceInstaller.java | 13 ++++---------
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/app-mini/src/main/assets/common/geoip b/app-mini/src/main/assets/common/geoip
deleted file mode 100644
index e69de29b..00000000
diff --git a/app-mini/src/main/assets/common/geoip6 b/app-mini/src/main/assets/common/geoip6
deleted file mode 100644
index e69de29b..00000000
diff --git a/orbotservice/build.gradle b/orbotservice/build.gradle
index 0d6b162e..65b6d6b2 100644
--- a/orbotservice/build.gradle
+++ b/orbotservice/build.gradle
@@ -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'
diff --git a/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java b/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java
index b39b6ae7..fc8acde1 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/util/CustomTorResourceInstaller.java
@@ -4,6 +4,8 @@ import android.content.Context;
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;
@@ -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;
@@ -98,15 +94,14 @@ public class CustomTorResourceInstaller {
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);
}
/*
More information about the tor-commits
mailing list