Skip to content
Snippets Groups Projects

Replace obfs4proxy with lyrebird, add tests for CDN77

Merged akwizgran requested to merge lyrebird into main
1 unresolved thread
6 files
+ 39
35
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -26,7 +26,7 @@ import static java.util.Locale.ROOT;
@@ -26,7 +26,7 @@ import static java.util.Locale.ROOT;
@HiltViewModel
@HiltViewModel
class MainViewModel extends AndroidViewModel {
class MainViewModel extends AndroidViewModel {
private static final String OBFS4_LIB_NAME = "libobfs4proxy.so";
private static final String LYREBIRD_LIB_NAME = "liblyrebird.so";
private static final String STATE_DIR_NAME = "state";
private static final String STATE_DIR_NAME = "state";
private static final String FASTLY_URL = "https://moat.torproject.org.global.prod.fastly.net/";
private static final String FASTLY_URL = "https://moat.torproject.org.global.prod.fastly.net/";
@@ -58,11 +58,11 @@ class MainViewModel extends AndroidViewModel {
@@ -58,11 +58,11 @@ class MainViewModel extends AndroidViewModel {
countryCode = countryCode.toLowerCase(ROOT);
countryCode = countryCode.toLowerCase(ROOT);
Application app = getApplication();
Application app = getApplication();
String nativeLibDir = app.getApplicationInfo().nativeLibraryDir;
String nativeLibDir = app.getApplicationInfo().nativeLibraryDir;
File obfs4Lib = new File(nativeLibDir, OBFS4_LIB_NAME);
File lyrebirdLib = new File(nativeLibDir, LYREBIRD_LIB_NAME);
File stateDir = app.getDir(STATE_DIR_NAME, MODE_PRIVATE);
File stateDir = app.getDir(STATE_DIR_NAME, MODE_PRIVATE);
String url = azure ? AZURE_URL : FASTLY_URL;
String url = azure ? AZURE_URL : FASTLY_URL;
String front = azure ? AZURE_FRONT : FASTLY_FRONT;
String front = azure ? AZURE_FRONT : FASTLY_FRONT;
MoatApi moat = new MoatApi(obfs4Lib, stateDir, url, front);
MoatApi moat = new MoatApi(lyrebirdLib, stateDir, url, front);
try {
try {
List<Bridges> bridges = moat.getWithCountry(countryCode);
List<Bridges> bridges = moat.getWithCountry(countryCode);
StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
Loading