diff --git a/CHANGELOG b/CHANGELOG
index a03d4c9d..efe55693 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -303,7 +303,7 @@ f3211aca Fixes #236: Separate Constants For VPN, TOR and MAIN_APP
cde49d1a Removes the refresh button on the VPN Selection screen
351ef96f (bitmold-remove_orfox) Removes references to Orfox since it is being completely replaced with the Tor Browser for Android. Conversations surrounding this can be found here https://blog.torproject.org/comment/281767#comment-281767 and here https://trac.torproject.org/projects/tor/ticket/29955
656d39b7 (tag: 16.1.0-BETA-5-tor-0.4.0.4-rc) update to 16.1.0-BETA-5-tor-0.4.0.4-rc
-814fbb31 reset default ports to 9055, 8125 but make them dynamic if needed - ports will be checked and if not available, increment +1 - new setting add to allow static setting of http port value
+814fbb31 reset default ports to 9050, 8118 but make them dynamic if needed - ports will be checked and if not available, increment +1 - new setting add to allow static setting of http port value
827b905e ensure we are putting the right value in
144a4ed5 small change to attempt to address localization glitches
c4062678 Merge branch 'master' of github.com:n8fr8/orbot
@@ -366,7 +366,7 @@ a32452e7 Make text inputs in Orbot declare that they do want to opt out of IME p
cd6560fa Merge pull request #202 from bitmold/no_constraint_layout
a5d5c99f (public/master, gl/master) remove unused launcher art
9257b66f don't shrink or minify for now
-56917567 (tag: 16.0.6-BETA-2-tor-0.3.5.8) many small changes to support new binary loading, startup and more - improved handling of port conflicts - fixed loading of tor binary on arm64-v8a - changed how we execute shell commands
+56905067 (tag: 16.0.6-BETA-2-tor-0.3.5.8) many small changes to support new binary loading, startup and more - improved handling of port conflicts - fixed loading of tor binary on arm64-v8a - changed how we execute shell commands
8ed080f9 Removed Constraint Layout Dependency
2a76b7af (tag: 16.0.6-BETA-1-tor-0.3.5.8) updated to SDK 28, added android.permission.FOREGROUND_SERVICE permission
fb14c76c fixed strings with two many \\ escapes
@@ -914,8 +914,8 @@ Make the build process better and more reproduceable
/** 15.1.0-RC-2 / 16-January-2016 / 9ed17b551c29b9edf94d64f5f013ad607c21bbc5 **/
-Quick fix for Samsung Galaxy devices which have a port conflict on the default SOCKS 9055 part
-* 6ffea9e add ability to check if configured SOCKS port is available Samsung devices like to use 9055 (Since their hardware model is i9
+Quick fix for Samsung Galaxy devices which have a port conflict on the default SOCKS 9050 part
+* 6ffea9e add ability to check if configured SOCKS port is available Samsung devices like to use 9050 (Since their hardware model is i9
/** 15.1.0-RC-1 / 15-January-2016 / f541e9ffe14a2719863327bf262b48de135ee0fd **/
@@ -1455,7 +1455,7 @@ fc63929 ensure diag/test mode stop's Tor on activity exit
4716696 make transport settings dynamic (remove from torrc)
2fe57e8 pegging tor to 0.2.4.22
00b535e updated to 14.0.2.1
-c2be4ac ensure polipo conf is updated; default to 9051 for ctrl port
+c2be4ac ensure polipo conf is updated; default to 9050 for ctrl port
6ab9a7b reduce memory usage of polipo
b26b9d4 update to 14.0.2
aa8ff95 ensure readers are closed; ensure socks settings are applied
@@ -1470,7 +1470,7 @@ af51a98 allow support for adding custom lines to torrc
98ea6d5 update changelog
5776a87 update to 14.0.0-RC3
bf6a1da update state when service connects
-451cfed keep SOCKS port as default 9055 (instead of 'auto')
+451cfed keep SOCKS port as default 9050 (instead of 'auto')
f94e27a updated to 14.0.0-RC-1
bedeb71 more fixes for hidden service configuration now multiple ports are properly configured and notification will display correctl
051cce4 don't allow the tor control port socket to timeout
diff --git a/INSTALL b/INSTALL
index 086cb415..1624d1a2 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,7 +15,7 @@ with Eclipse: http://eclipse.org/
*** How to use ***
Currently, Orbot will work with any application that supports using
an HTTP or SOCKS Proxy. Once you start Tor using Orbot, you can then
-point your application to HTTP port 8125 or SOCKS port 9055 on localhost
+point your application to HTTP port 8118 or SOCKS port 9050 on localhost
IP 127.0.0.1.
If you have root access, and a version of Android with iptables that
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e498b729..ece44ee9 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -249,22 +249,22 @@
-
-
- $TITLE
-
-
-
-
-
-
-
-
-
-
$ERROR_M1
-
$ERROR_M2
-
$ERROR
-
-
-
$ERROR_M3
-
$ERROR_M4
-
$ERROR_M5
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/assets/resources/style/cs-bootstrap.css b/app/src/main/assets/resources/style/cs-bootstrap.css
index d02511e8..4e66e9e7 100644
--- a/app/src/main/assets/resources/style/cs-bootstrap.css
+++ b/app/src/main/assets/resources/style/cs-bootstrap.css
@@ -2089,7 +2089,7 @@ select.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.for
.input-group-sm > .input-group-append > select.input-group-text:not([size]):not([multiple]),
.input-group-sm > .input-group-prepend > select.btn:not([size]):not([multiple]),
.input-group-sm > .input-group-append > select.btn:not([size]):not([multiple]) {
- height: calc(1.8125rem + 2px);
+ height: calc(1.8118rem + 2px);
}
.form-control-lg, .input-group-lg > .form-control,
@@ -3763,7 +3763,7 @@ tbody.collapse.show {
}
.custom-select-sm {
- height: calc(1.8125rem + 2px);
+ height: calc(1.8118rem + 2px);
padding-top: 0.375rem;
padding-bottom: 0.375rem;
font-size: 75%;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
index ebcf2570..e0a0226c 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
@@ -234,7 +234,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
org.torproject.android.service.util.Prefs.setContext(activityContextManager.getInstance().getHomeController());
}
-
public void initWidget(){
if(status.sWidgetResponse == enums.WidgetResponse.SEARCHBAR){
if(!status.sSettingIsAppStarted){
@@ -912,6 +911,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mSearchbar.setEventHandler(new edittextManagerCallback());
mSearchbar.setOnFocusChangeListener((v, hasFocus) -> {
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
status.sUIInteracted = true;
if(!hasFocus)
{
@@ -1320,7 +1320,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onSetBannerAdMargin(true,(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}
- if(mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("genesishiddentechnologies.com") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
+ if(mGeckoClient.getSession().wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("genesishiddentechnologies.com") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
}else {
mHomeViewController.updateBannerAdvertStatus(true, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
@@ -1962,6 +1962,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
{
initTabCountForced();
}
+ else if(e_type.equals(enums.etype.M_ADVERT_LOADED))
+ {
+ return pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED);
+ }
else if(e_type.equals(enums.etype.M_NEW_LINK_IN_NEW_TAB))
{
postNewLinkTabAnimationInBackground(dataToStr(data.get(0)));
@@ -2014,6 +2018,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
else if(e_type.equals(enums.etype.M_GET_CURRENT_URL))
{
+ if(mGeckoClient==null || mGeckoClient.getSession()==null){
+ return null;
+ }
return mGeckoClient.getSession().getCurrentURL();
}
else if(e_type.equals(enums.etype.M_SPLASH_DISABLE))
@@ -2281,6 +2288,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_BOOTSTRAPPED,true));
mHomeViewController.onPageFinished();
mGeckoClient.onRedrawPixel(homeController.this);
+ mHomeViewController.onFullScreen();
}
else if(e_type.equals(M_RATE_APPLICATION)){
if(!status.sSettingIsAppRated){
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
index 6458fbc9..b29ab649 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
@@ -58,6 +58,8 @@ import java.util.List;
import java.util.concurrent.Callable;
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_DOMAIN_URL;
+import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE;
+import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_URL_CACHED_DARK;
import static org.mozilla.geckoview.GeckoSessionSettings.USER_AGENT_MODE_DESKTOP;
@@ -377,7 +379,7 @@ class homeViewController
mVoiceInput.setClickable(true);
mVoiceInput.setFocusable(true);
onUpdateSearchIcon(1);
- mVoiceInput.setVisibility(View.GONE);
+ mVoiceInput.setVisibility(View.INVISIBLE);
mNewTab.setVisibility(View.VISIBLE);
mMenu.setVisibility(View.VISIBLE);
mSearchbar.setFadingEdgeLength(helperMethod.pxFromDp(20));
@@ -500,18 +502,16 @@ class homeViewController
}
public void initStatusBarColor(boolean mInstant) {
+ int mDelay = 2000;
+ if(status.mThemeApplying || mInstant){
+ mDelay = 0;
+ }
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
ColorAnimator oneToTwo = new ColorAnimator(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2));
- int mDelay = 1250;
- if(status.mThemeApplying || mInstant){
- mDelay = 0;
- }
-
- Log.i("asdadsshadkkasjd","asdasdasd");
-
ValueAnimator animator = ObjectAnimator.ofFloat(0f, 1f);
- animator.setDuration(250).setStartDelay(mDelay);
+ animator.setDuration(200).setStartDelay(mDelay);
animator.addUpdateListener(animation ->
{
float v = (float) animation.getAnimatedValue();
@@ -523,6 +523,7 @@ class homeViewController
@Override
public void onAnimationEnd(Animator animation) {
mContext.getWindow().setStatusBarColor(ContextCompat.getColor(mContext, R.color.c_background));
+ onPostScreenDisable();
}
});
animator.addListener(new AnimatorListenerAdapter()
@@ -540,9 +541,25 @@ class homeViewController
});
animator.start();
}else {
- mSplashScreen.animate().alpha(0).setDuration(250).setStartDelay(0);
+ mSplashScreen.animate().alpha(0).setDuration(200).setStartDelay(mDelay).withEndAction(() -> onPostScreenDisable());
}
+ }
+ public void onPostScreenDisable(){
+ mProgressBarIndeterminate.setVisibility(View.GONE);
+ mSplashScreen.setClickable(false);
+ mSplashScreen.setFocusable(false);
+ mSearchbar.setEnabled(true);
+ mBlocker.setEnabled(false);
+
+ mBlocker.setVisibility(View.GONE);
+ mGatewaySplash.setVisibility(View.GONE);
+ mConnectButton.setVisibility(View.GONE);
+ mPanicButton.setVisibility(View.GONE);
+ mPanicButtonLandscape.setVisibility(View.GONE);
+
+ mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
+ mEvent.invokeObserver(null, enums.etype.M_SPLASH_DISABLE);
}
public void initSplashLoading(){
@@ -674,7 +691,7 @@ class homeViewController
mSplashScreen.setVisibility(View.GONE);
mBlocker.setEnabled(false);
}
-//C:\Users\MSi\AppData\Local\Android\ndk
+
private boolean mIsAnimating = false;
public void splashScreenDisable(){
mTopBar.setAlpha(1);
@@ -683,27 +700,7 @@ class homeViewController
if(!mIsAnimating){
mIsAnimating = true;
initStatusBarColor(false);
- mProgressBarIndeterminate.animate().setStartDelay(350).setDuration(250).alpha(0).withEndAction(() -> {
- new Handler().postDelayed(() ->
- {
- mProgressBarIndeterminate.setVisibility(View.GONE);
- mSplashScreen.setClickable(false);
- mSplashScreen.setFocusable(false);
- mSearchbar.setEnabled(true);
- mBlocker.setEnabled(false);
-
- mBlocker.setVisibility(View.GONE);
- mGatewaySplash.setVisibility(View.GONE);
- mConnectButton.setVisibility(View.GONE);
- mPanicButton.setVisibility(View.GONE);
- mPanicButtonLandscape.setVisibility(View.GONE);
-
- mEvent.invokeObserver(null, enums.etype.M_CACHE_UPDATE_TAB);
- mEvent.invokeObserver(null, enums.etype.M_SPLASH_DISABLE);
- }, 2000);
-
- });
mEvent.invokeObserver(null, enums.etype.M_WELCOME_MESSAGE);
mOrbotLogManager.setClickable(false);
status.sSettingIsAppRestarting = true;
@@ -933,6 +930,7 @@ class homeViewController
mBannerAds.setVisibility(View.GONE);
}
}
+ onFullScreen();
}
void updateBannerAdvertStatus(boolean status, boolean pIsAdvertLoaded){
@@ -1478,11 +1476,30 @@ class homeViewController
}
public void onFullScreen(){
+ Object mAdvertLoaded = mEvent.invokeObserver(null, enums.etype.M_ADVERT_LOADED);
+ Object mCurrentURL = mEvent.invokeObserver(null, enums.etype.M_GET_CURRENT_URL);
+
if(status.sFullScreenBrowsing || isFullScreen){
mWebviewContainer.setPadding(0,0,0,0);
}
else {
- mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ if(mAdvertLoaded!=null && (boolean)mAdvertLoaded){
+ if(mCurrentURL!=null){
+ String mURL = (String) mCurrentURL;
+ if(mURL.startsWith(CONST_GENESIS_URL_CACHED) || mURL.startsWith(CONST_GENESIS_URL_CACHED_DARK) || mURL.contains("genesishiddentechnologies.com") || mURL.startsWith(CONST_GENESIS_HELP_URL_CACHE) || mURL.startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ }else {
+ int orientation = mContext.getResources().getConfiguration().orientation;
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ } else {
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(110));
+ }
+ }
+ }
+ }else {
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ }
}
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java
index 40dbea9d..22a20ec8 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java
@@ -5,7 +5,7 @@ public class enums
/*Settings Manager*/
public enum etype{
M_CHANGE_HOME_THEME, on_update_favicon,M_RELOAD,ON_UPDATE_TAB_TITLE, ON_OPEN_TAB_VIEW,ON_NEW_TAB_ANIMATION, M_UPDATE_SESSION_STATE,ON_LOAD_REQUEST, GECKO_SCROLL_UP, GECKO_SCROLL_UP_ALWAYS, GECKO_SCROLL_DOWN, WAS_SCROLL_CHANGED, GECKO_SCROLL_DOWN_MOVE, GECKO_SCROLL_UP_MOVE, GECKO_SCROLL_DOWN_CALLER,ON_UPDATE_SEARCH_BAR,M_ON_MAIL,SESSION_ID,M_UPDATE_PIXEL_BACKGROUND, M_ON_SCROLL_BOUNDARIES, M_ON_SCROLL_TOP_BOUNDARIES, M_ON_SCROLL_NO_BOUNDARIES, M_INIT_PADDING, M_RATE_COUNT,M_CACHE_UPDATE_TAB,M_DEFAULT_BROWSER,
- on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE,
+ on_verify_selected_url_menu,FINDER_RESULT_CALLBACK,M_ADMOB_BANNER_RECHECK,M_OPEN_SESSION,M_DOWNLOAD_FAILURE, M_ADVERT_LOADED,
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT_FORCED,M_SPLASH_DISABLE,M_NEW_LINK_IN_NEW_TAB,M_RESET_SUGGESTION,
url_triggered, url_triggered_new_tab,url_clear,fetch_favicon, M_COPY_URL,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE,M_CLOSE_TAB,
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,progress_update_forced, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_NEW_IDENTITY, M_NEW_IDENTITY_MESSAGED, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error, M_ORBOT_LOADING,download_file_popup,on_init_ads, M_GET_CURRENT_URL,search_update, open_new_tab,open_new_tab_instant
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java
index 46858815..7745a57e 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/keys.java
@@ -54,7 +54,7 @@ public class keys
public static final String SETTING_SHOW_FONTS = "SETTING_SHOW_FONTS_V1";
public static final String SETTING_TOOLBAR_THEME = "SETTING_TOOLBAR_THEME_V1";
public static final String SETTING_THEME = "SETTING_THEME_LIGHT_V1";
- public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING_V1";
+ public static final String SETTING_FULL_SCREEN_BROWSIING = "SETTING_FULL_SCREEN_BROWSIING_V2";
public static final String SETTING_OPEN_URL_IN_NEW_TAB = "SETTING_OPEN_URL_IN_NEW_TAB_V1";
public static final String SETTING_LIST_VIEW = "SETTING_LIST_VIEW_V1";
public static final String SETTING_INSTALLED = "SETTING_INSTALLED_V1";
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/imageDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/imageDataModel.java
index 07496071..29bc263d 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/imageDataModel.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/imageDataModel.java
@@ -6,6 +6,9 @@ import android.graphics.BitmapFactory;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.dataManager.models.imageRowModel;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
+
+import org.torproject.android.service.wrapper.orbotLocalConstants;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
@@ -85,7 +88,7 @@ class imageDataModel
private Bitmap getBitmapFromURL(String src) {
try {
java.net.URL url = new java.net.URL(src);
- Proxy proxy = new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(CONST_PROXY_SOCKS, 9055));
+ Proxy proxy = new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(CONST_PROXY_SOCKS, orbotLocalConstants.mSOCKSPort));
HttpURLConnection connection = (HttpURLConnection) url.openConnection(proxy);
connection.setConnectTimeout(10000);
connection.setDoInput(true);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/NetCipher.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/NetCipher.java
index 7e5cbfad..a80bb339 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/NetCipher.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/NetCipher.java
@@ -25,6 +25,8 @@ import android.util.Log;
import com.darkweb.genesissearchengine.libs.netcipher.client.TlsOnlySocketFactory;
import com.darkweb.genesissearchengine.libs.netcipher.proxy.OrbotHelper;
+import org.torproject.android.service.wrapper.orbotLocalConstants;
+
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
@@ -47,7 +49,7 @@ public class NetCipher {
}
public final static Proxy ORBOT_HTTP_PROXY = new Proxy(Proxy.Type.HTTP,
- new InetSocketAddress("127.0.0.1", 8125));
+ new InetSocketAddress("127.0.0.1", orbotLocalConstants.mHTTPPort));
private static Proxy proxy;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/client/StrongBuilderBase.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/client/StrongBuilderBase.java
index a4eb1cbc..50149cd9 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/client/StrongBuilderBase.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/client/StrongBuilderBase.java
@@ -24,6 +24,8 @@ import android.content.Intent;
import com.darkweb.genesissearchengine.libs.netcipher.proxy.OrbotHelper;
import org.json.JSONObject;
+import org.torproject.android.service.wrapper.orbotLocalConstants;
+
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.security.KeyManagementException;
@@ -173,7 +175,7 @@ abstract public class
if (status.getStringExtra(OrbotHelper.EXTRA_STATUS)
.equals(OrbotHelper.STATUS_ON)) {
return(status.getIntExtra(OrbotHelper.EXTRA_PROXY_PORT_SOCKS,
- 9055));
+ orbotLocalConstants.mSOCKSPort));
}
return(-1);
@@ -183,7 +185,7 @@ abstract public class
if (status.getStringExtra(OrbotHelper.EXTRA_STATUS)
.equals(OrbotHelper.STATUS_ON)) {
return(status.getIntExtra(OrbotHelper.EXTRA_PROXY_PORT_HTTP,
- 8125));
+ orbotLocalConstants.mHTTPPort));
}
return(-1);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/web/WebkitProxy.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/web/WebkitProxy.java
index 5dbe2791..8bb0e1b0 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/web/WebkitProxy.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/netcipher/web/WebkitProxy.java
@@ -42,13 +42,15 @@ import android.util.ArrayMap;
import android.util.Log;
import android.webkit.WebView;
+import org.torproject.android.service.wrapper.orbotLocalConstants;
+
import ch.boye.httpclientandroidlib.HttpHost;
public class WebkitProxy {
private final static String DEFAULT_HOST = "localhost";//"127.0.0.1";
- private final static int DEFAULT_PORT = 8125;
- private final static int DEFAULT_SOCKS_PORT = 9055;
+ private final static int DEFAULT_PORT = orbotLocalConstants.mHTTPPort;
+ private final static int DEFAULT_SOCKS_PORT = orbotLocalConstants.mSOCKSPort;
private final static int REQUEST_CODE = 0;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/ClientAuthContentProviderGenesis.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/ClientAuthContentProviderGenesis.java
index 4612a226..46d4db5d 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/ClientAuthContentProviderGenesis.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/ClientAuthContentProviderGenesis.java
@@ -19,7 +19,7 @@ public class ClientAuthContentProviderGenesis extends ContentProvider {
V3ClientAuth.HASH,
V3ClientAuth.ENABLED,
};
- private static final String AUTH = "org.torproject.android.ui.v3onionservice.clientauth";
+ private static final String AUTH = "org.torproject.android.ui.v3onionservice.genesis.clientauth";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTH + "/v3auth");
private static final int V3AUTHS = 1, V3AUTH_ID = 2;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/CookieContentProvider.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/CookieContentProvider.java
index 8029fc33..1ecfb482 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/CookieContentProvider.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/CookieContentProvider.java
@@ -21,7 +21,7 @@ public class CookieContentProvider extends ContentProvider {
ClientCookie.AUTH_COOKIE_VALUE,
ClientCookie.ENABLED
};
- private static final String AUTH = "org.torproject.android.ui.hiddenservices.providers.cookie";
+ private static final String AUTH = "org.torproject.android.ui.hiddenservices.providers.genesis.cookie";
public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTH + "/cookie");
//UriMatcher
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/HSContentProvider.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/HSContentProvider.java
index 37ec23ac..124dc05a 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/HSContentProvider.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/HSContentProvider.java
@@ -26,7 +26,7 @@ public class HSContentProvider extends ContentProvider {
HiddenService.CREATED_BY_USER,
HiddenService.ENABLED
};
- private static final String AUTH = "org.torproject.android.ui.hiddenservices.providers";
+ private static final String AUTH = "org.torproject.android.ui.hiddenservices.providers.genesis";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTH + "/hs");
//UriMatcher
private static final int ONIONS = 1;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/OnionServiceContentProvider.java b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/OnionServiceContentProvider.java
index 12e537a5..223bba59 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/OnionServiceContentProvider.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/libs/providers/OnionServiceContentProvider.java
@@ -25,7 +25,7 @@ public class OnionServiceContentProvider extends ContentProvider {
};
private static final int ONIONS = 1, ONION_ID = 2;
- private static final String AUTH = "org.torproject.android.ui.v3onionservice";
+ private static final String AUTH = "org.torproject.android.ui.v3onionservice.genesis";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTH + "/v3");
private static final UriMatcher uriMatcher;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/adPluginManager/adManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/adPluginManager/adManager.java
index fd53651c..dffd0b68 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/adPluginManager/adManager.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/adPluginManager/adManager.java
@@ -53,7 +53,7 @@ public class adManager
{
bannerAdsLoading = true;
MobileAds.initialize(pAppContext.getApplicationContext(), initializationStatus -> { });
- RequestConfiguration configuration = new RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B1CF10D1F74698381CFF7BF9C485085B")).build();
+ RequestConfiguration configuration = new RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B1CF10D1F74698381CFF7BF9C485085B","D38EB6293679BC1D68FBDAC55A73DBA0")).build();
MobileAds.setRequestConfiguration(configuration);
initializeBannerAds();
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/downloadPluginManager/downloadReciever.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/downloadPluginManager/downloadReciever.java
index 354a356e..6dae7c65 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/downloadPluginManager/downloadReciever.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/downloadPluginManager/downloadReciever.java
@@ -29,9 +29,10 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.libs.netcipher.client.StrongHttpsClient;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
-import com.darkweb.genesissearchengine.pluginManager.pluginReciever.downloadNotificationReciever;
import com.example.myapplication.R;
import org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log;
+import org.torproject.android.service.wrapper.orbotLocalConstants;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
@@ -152,10 +153,10 @@ public class downloadReciever extends AsyncTask {
HttpURLConnection conection;
Proxy proxy;
if(helperMethod.getDomainName(f_url[0]).contains(".onion")){
- proxy = new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(PROXY_ADDRESS, 9055));
+ proxy = new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(PROXY_ADDRESS, orbotLocalConstants.mSOCKSPort));
conection = (HttpURLConnection) url.openConnection(proxy);
}else {
- Proxy mProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 8125));
+ Proxy mProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", orbotLocalConstants.mHTTPPort));
URLConnection mURLConnection = new URI(f_url[0]).toURL().openConnection(mProxy);
conection = (HttpURLConnection) mURLConnection;
}
@@ -218,9 +219,9 @@ public class downloadReciever extends AsyncTask {
StrongHttpsClient httpclient = new StrongHttpsClient(context);
if(helperMethod.getDomainName(f_url[0]).contains(".onion")){
- httpclient.useProxy(true, "SOCKS", "127.0.0.1", 9055);
+ httpclient.useProxy(true, "SOCKS", "127.0.0.1", orbotLocalConstants.mSOCKSPort);
}else {
- httpclient.useProxy(true, "SOCKS", "127.0.0.1", 9055);
+ httpclient.useProxy(true, "SOCKS", "127.0.0.1", orbotLocalConstants.mSOCKSPort);
}
HttpGet httpget = new HttpGet(urlEncoded);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotPluginManager/orbotManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotPluginManager/orbotManager.java
index 32e8b726..e45009ee 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotPluginManager/orbotManager.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotPluginManager/orbotManager.java
@@ -99,23 +99,31 @@ public class orbotManager
/*Proxy Manager*/
private void onSetProxy(){
+ PrefsHelper.setPref(keys.PROXY_TYPE, 1);
+ PrefsHelper.setPref(keys.PROXY_SOCKS,constants.CONST_PROXY_SOCKS);
+ PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, orbotLocalConstants.mSOCKSPort);
+ PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,constants.CONST_PROXY_SOCKS_VERSION);
+ PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,constants.CONST_PROXY_SOCKS_REMOTE_DNS);
+ }
+ private void onRestartProxy(){
+
+ Intent mServiceIntent = new Intent(mAppContext.get().getApplicationContext(), OrbotService.class);
+ mServiceIntent.setAction(ACTION_START);
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ mAppContext.get().stopService(mServiceIntent);
+ mAppContext.get().startForegroundService(mServiceIntent);
+ }
+ else
+ {
+ mAppContext.get().stopService(mServiceIntent);
+ mAppContext.get().startService(mServiceIntent);
+ }
}
private void initializeProxy(int pShowImages, boolean mClearOnExit)
{
- PrefsHelper.setPref(keys.PROXY_TYPE, 0);
- PrefsHelper.setPref(keys.PROXY_SOCKS,null);
- PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, null);
- PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,null);
- PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,null);
-
- PrefsHelper.setPref(keys.PROXY_TYPE, 1);
- PrefsHelper.setPref(keys.PROXY_SOCKS,constants.CONST_PROXY_SOCKS);
- PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, 9050);
- PrefsHelper.setPref(keys.PROXY_SOCKS_VERSION,constants.CONST_PROXY_SOCKS_VERSION);
- PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,constants.CONST_PROXY_SOCKS_REMOTE_DNS);
-
PrefsHelper.setPref(keys.PROXY_CACHE,constants.CONST_PROXY_CACHE);
PrefsHelper.setPref(keys.PROXY_MEMORY,constants.CONST_PROXY_MEMORY);
PrefsHelper.setPref(keys.PROXY_DO_NOT_TRACK_HEADER_ENABLED,constants.CONST_PROXY_DO_NOT_TRACK_HEADER_ENABLED);
@@ -303,6 +311,10 @@ public class orbotManager
{
onDestroy((boolean) pData.get(0));
}
+ else if(pEventType.equals(pluginEnums.eOrbotManager.M_RESTART_PROXY))
+ {
+ onRestartProxy();
+ }
return null;
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginEnums.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginEnums.java
index 43f952c3..a37ddb7d 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginEnums.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/pluginEnums.java
@@ -46,6 +46,6 @@ public class pluginEnums
/*Orbot Manager*/
public enum eOrbotManager{
- M_GET_NOTIFICATION_STATUS, M_NEW_CIRCUIT, M_DESTROY,M_ENABLE_NOTIFICATION, M_DISABLE_NOTIFICATION, M_DISABLE_NOTIFICATION_NO_BANDWIDTH, M_GET_LOGS, M_UPDATE_PRIVACY,M_START_ORBOT,M_IS_ORBOT_RUNNING, M_GET_ORBOT_STATUS, M_UPDATE_BRIDGES, M_UPDATE_VPN, M_SET_PROXY, M_SHOW_NOTIFICATION_STATUS, M_ORBOT_RUNNING
+ M_GET_NOTIFICATION_STATUS, M_NEW_CIRCUIT, M_DESTROY, M_RESTART_PROXY,M_ENABLE_NOTIFICATION, M_DISABLE_NOTIFICATION, M_DISABLE_NOTIFICATION_NO_BANDWIDTH, M_GET_LOGS, M_UPDATE_PRIVACY,M_START_ORBOT,M_IS_ORBOT_RUNNING, M_GET_ORBOT_STATUS, M_UPDATE_BRIDGES, M_UPDATE_VPN, M_SET_PROXY, M_SHOW_NOTIFICATION_STATUS, M_ORBOT_RUNNING
}
}
\ No newline at end of file
diff --git a/app/src/main/res/layouts/home/layout/home_view.xml b/app/src/main/res/layouts/home/layout/home_view.xml
index 46267256..d33ad41c 100644
--- a/app/src/main/res/layouts/home/layout/home_view.xml
+++ b/app/src/main/res/layouts/home/layout/home_view.xml
@@ -133,7 +133,7 @@
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center_vertical"
- android:layout_marginStart="-60dp"
+ android:layout_marginStart="-50dp"
android:layout_marginTop="-1dp"
android:layout_marginEnd="15dp"
android:background="@xml/hx_ripple_default_round"
@@ -145,7 +145,7 @@
android:scaleY="1.1"
android:src="@xml/ic_baseline_keyboard_voice"
android:tint="@color/c_text_v8"
- android:visibility="gone" />
+ android:visibility="invisible" />
diff --git a/external/badvpn/lwip/src/netif/ppp/md5.c b/external/badvpn/lwip/src/netif/ppp/md5.c
index dc3cc751..047ce3fd 100644
--- a/external/badvpn/lwip/src/netif/ppp/md5.c
+++ b/external/badvpn/lwip/src/netif/ppp/md5.c
@@ -303,7 +303,7 @@ Transform (u32_t *buf, u32_t *in)
II ( a, b, c, d, in[ 8], S41, UL(1873313359)); /* 57 */
II ( d, a, b, c, in[15], S42, UL(4264355552)); /* 58 */
II ( c, d, a, b, in[ 6], S43, UL(2734768916)); /* 59 */
- II ( b, c, d, a, in[13], S44, UL(1309151649)); /* 60 */
+ II ( b, c, d, a, in[13], S44, UL(1309050649)); /* 60 */
II ( a, b, c, d, in[ 4], S41, UL(4149444226)); /* 61 */
II ( d, a, b, c, in[11], S42, UL(3174756917)); /* 62 */
II ( c, d, a, b, in[ 2], S43, UL( 718787259)); /* 63 */
diff --git a/external/badvpn/lwip/src/netif/ppp/ppp.c b/external/badvpn/lwip/src/netif/ppp/ppp.c
index bfcf025b..8c28e7d2 100644
--- a/external/badvpn/lwip/src/netif/ppp/ppp.c
+++ b/external/badvpn/lwip/src/netif/ppp/ppp.c
@@ -319,7 +319,7 @@ static const u_short fcstab[256] = {
0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
- 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8125, 0xb3bb, 0xa232,
+ 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8118, 0xb3bb, 0xa232,
0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
diff --git a/libnetcipher/src/info/guardianproject/netcipher/NetCipher.java b/libnetcipher/src/info/guardianproject/netcipher/NetCipher.java
index 2a10c3fb..289e9b5c 100644
--- a/libnetcipher/src/info/guardianproject/netcipher/NetCipher.java
+++ b/libnetcipher/src/info/guardianproject/netcipher/NetCipher.java
@@ -46,7 +46,7 @@ public class NetCipher {
}
public final static Proxy ORBOT_HTTP_PROXY = new Proxy(Proxy.Type.HTTP,
- new InetSocketAddress("127.0.0.1", 8125));
+ new InetSocketAddress("127.0.0.1", orbotLocalConstants.mHTTPPort));
private static Proxy proxy;
diff --git a/libnetcipher/src/info/guardianproject/netcipher/client/StrongBuilderBase.java b/libnetcipher/src/info/guardianproject/netcipher/client/StrongBuilderBase.java
index 6c3eabdb..90124baa 100644
--- a/libnetcipher/src/info/guardianproject/netcipher/client/StrongBuilderBase.java
+++ b/libnetcipher/src/info/guardianproject/netcipher/client/StrongBuilderBase.java
@@ -178,7 +178,7 @@ abstract public class
if (status.getStringExtra(OrbotHelper.EXTRA_STATUS)
.equals(OrbotHelper.STATUS_ON)) {
return(status.getIntExtra(OrbotHelper.EXTRA_PROXY_PORT_SOCKS,
- 9055));
+ orbotLocalConstants.mSOCKSPort));
}
return(-1);
@@ -188,7 +188,7 @@ abstract public class
if (status.getStringExtra(OrbotHelper.EXTRA_STATUS)
.equals(OrbotHelper.STATUS_ON)) {
return(status.getIntExtra(OrbotHelper.EXTRA_PROXY_PORT_HTTP,
- 8125));
+ orbotLocalConstants.mHTTPPort));
}
return(-1);
diff --git a/libnetcipher/src/info/guardianproject/netcipher/web/WebkitProxy.java b/libnetcipher/src/info/guardianproject/netcipher/web/WebkitProxy.java
index f08917a4..de202f9b 100644
--- a/libnetcipher/src/info/guardianproject/netcipher/web/WebkitProxy.java
+++ b/libnetcipher/src/info/guardianproject/netcipher/web/WebkitProxy.java
@@ -48,8 +48,8 @@ import android.webkit.WebView;
public class WebkitProxy {
private final static String DEFAULT_HOST = "localhost";//"127.0.0.1";
- private final static int DEFAULT_PORT = 8125;
- private final static int DEFAULT_SOCKS_PORT = 9055;
+ private final static int DEFAULT_PORT = orbotLocalConstants.mHTTPPort;
+ private final static int DEFAULT_SOCKS_PORT = orbotLocalConstants.mSOCKSPort;
private final static int REQUEST_CODE = 0;
diff --git a/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java b/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java
index 39f1a6a9..a7b32432 100644
--- a/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java
+++ b/orbotmanager/src/main/java/org/torproject/android/service/OrbotService.java
@@ -94,10 +94,10 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
static final int NOTIFY_ID = 1;
private static final int ERROR_NOTIFY_ID = 3;
private static final int HS_NOTIFY_ID = 4;
- private static final Uri V2_HS_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hiddenservices.providers/hs");
- private static final Uri V3_ONION_SERVICES_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.v3onionservice/v3");
- private static final Uri COOKIE_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hiddenservices.providers.cookie/cookie");
- private static final Uri V3_CLIENT_AUTH_URI = Uri.parse("content://org.torproject.android.ui.v3onionservice.clientauth/v3auth");
+ private static final Uri V2_HS_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hiddenservices.providers.genesis/hs");
+ private static final Uri V3_ONION_SERVICES_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.v3onionservice.genesis/v3");
+ private static final Uri COOKIE_CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hiddenservices.providers.genesis.cookie/cookie");
+ private static final Uri V3_CLIENT_AUTH_URI = Uri.parse("content://org.torproject.android.ui.v3onionservice.genesis.clientauth/v3auth");
private final static String NOTIFICATION_CHANNEL_ID = "orbot_channel_1";
private static final String[] LEGACY_V2_ONION_SERVICE_PROJECTION = new String[]{
OnionService._ID,
@@ -603,14 +603,23 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
if (socksPortPref.indexOf(':') != -1)
socksPortPref = socksPortPref.split(":")[1];
- socksPortPref = checkPortOrAuto(socksPortPref);
String httpPortPref = prefs.getString(OrbotConstants.PREF_HTTP, (TorServiceConstants.HTTP_PROXY_PORT_DEFAULT));
if (httpPortPref.indexOf(':') != -1)
httpPortPref = httpPortPref.split(":")[1];
- httpPortPref = checkPortOrAuto(httpPortPref);
+
+ try{
+ socksPortPref = "9051";
+ orbotLocalConstants.mSOCKSPort = 9051;
+ orbotLocalConstants.mSOCKSPort = Integer.parseInt(socksPortPref);
+ orbotLocalConstants.mHTTPPort = Integer.parseInt(httpPortPref);
+
+ }catch (Exception ex){
+ orbotLocalConstants.mSOCKSPort = 9050;
+ orbotLocalConstants.mHTTPPort = 8118;
+ }
String isolate = "";
if (prefs.getBoolean(OrbotConstants.PREF_ISOLATE_DEST, false)) {
@@ -692,6 +701,14 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
return fileTorRcCustom;
}
+ public int getPortHTTP(){
+ return orbotLocalConstants.mHTTPPort;
+ }
+
+ public int getPortSOCKS(){
+ return orbotLocalConstants.mSOCKSPort;
+ }
+
private String checkPortOrAuto(String portString) {
if (!portString.equalsIgnoreCase("auto")) {
boolean isPortUsed = true;
@@ -752,6 +769,14 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
/**
* The entire process for starting tor and related services is run from this method.
*/
+ public void onRestart() {
+ try {
+ startTorService();
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ }
+ }
+
private void startTor() {
try {
@@ -896,44 +921,48 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
torServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
- torService = ((TorService.LocalBinder) iBinder).getService();
- try {
- conn = torService.getTorControlConnection();
- while (conn == null) {
- Log.v(TAG, "Waiting for Tor Control Connection...");
- Thread.sleep(500);
- conn = torService.getTorControlConnection();
- }
- mEventHandler = new TorEventHandler(OrbotService.this);
- logNotice("adding control port event handler");
- conn.setEventHandler(mEventHandler);
- ArrayList events = new ArrayList<>(Arrays.asList(
- TorControlCommands.EVENT_OR_CONN_STATUS,
- TorControlCommands.EVENT_CIRCUIT_STATUS,
- TorControlCommands.EVENT_NOTICE_MSG,
- TorControlCommands.EVENT_WARN_MSG,
- TorControlCommands.EVENT_ERR_MSG,
- TorControlCommands.EVENT_BANDWIDTH_USED,
- TorControlCommands.EVENT_NEW_DESC,
- TorControlCommands.EVENT_ADDRMAP));
- if (Prefs.useDebugLogging()) {
- events.add(TorControlCommands.EVENT_DEBUG_MSG);
- events.add(TorControlCommands.EVENT_INFO_MSG);
- }
+ new Thread(){
+ public void run(){
+ torService = ((TorService.LocalBinder) iBinder).getService();
+ try {
+ conn = torService.getTorControlConnection();
+ while (conn == null) {
+ Log.v(TAG, "Waiting for Tor Control Connection...");
+ Thread.sleep(500);
+ conn = torService.getTorControlConnection();
+ }
+ mEventHandler = new TorEventHandler(OrbotService.this);
+ logNotice("adding control port event handler");
+ conn.setEventHandler(mEventHandler);
+ ArrayList events = new ArrayList<>(Arrays.asList(
+ TorControlCommands.EVENT_OR_CONN_STATUS,
+ TorControlCommands.EVENT_CIRCUIT_STATUS,
+ TorControlCommands.EVENT_NOTICE_MSG,
+ TorControlCommands.EVENT_WARN_MSG,
+ TorControlCommands.EVENT_ERR_MSG,
+ TorControlCommands.EVENT_BANDWIDTH_USED,
+ TorControlCommands.EVENT_NEW_DESC,
+ TorControlCommands.EVENT_ADDRMAP));
+ if (Prefs.useDebugLogging()) {
+ events.add(TorControlCommands.EVENT_DEBUG_MSG);
+ events.add(TorControlCommands.EVENT_INFO_MSG);
+ }
- int mDelay = 3000;
- if(orbotLocalConstants.mIsTorInitialized){
- mDelay = 0;
- }
- Thread.sleep(mDelay);
+ int mDelay = 3000;
+ if(orbotLocalConstants.mIsTorInitialized){
+ mDelay = 0;
+ }
+ Thread.sleep(mDelay);
- conn.setEvents(events);
- logNotice("SUCCESS added control port event handler");
- } catch (InterruptedException | IOException e) {
- e.printStackTrace();
- stopTorOnError(e.getLocalizedMessage());
- conn = null;
- }
+ conn.setEvents(events);
+ logNotice("SUCCESS added control port event handler");
+ } catch (InterruptedException | IOException e) {
+ e.printStackTrace();
+ stopTorOnError(e.getLocalizedMessage());
+ conn = null;
+ }
+ }
+ }.start();
}
@Override
diff --git a/orbotmanager/src/main/java/org/torproject/android/service/util/ExternalIPFetcher.java b/orbotmanager/src/main/java/org/torproject/android/service/util/ExternalIPFetcher.java
index 957e1e65..0a9e5ad3 100644
--- a/orbotmanager/src/main/java/org/torproject/android/service/util/ExternalIPFetcher.java
+++ b/orbotmanager/src/main/java/org/torproject/android/service/util/ExternalIPFetcher.java
@@ -4,6 +4,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.torproject.android.service.OrbotService;
import org.torproject.android.service.TorEventHandler;
+import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.io.BufferedReader;
import java.io.InputStream;
@@ -18,7 +19,7 @@ public class ExternalIPFetcher implements Runnable {
private final static String ONIONOO_BASE_URL = "https://onionoo.torproject.org/details?fields=country_name,as_name,or_addresses&lookup=";
private OrbotService mService;
private TorEventHandler.Node mNode;
- private int mLocalHttpProxyPort = 8118;
+ private int mLocalHttpProxyPort = orbotLocalConstants.mHTTPPort;
public ExternalIPFetcher(OrbotService service, TorEventHandler.Node node, int localProxyPort) {
mService = service;
diff --git a/orbotmanager/src/main/java/org/torproject/android/service/wrapper/orbotLocalConstants.java b/orbotmanager/src/main/java/org/torproject/android/service/wrapper/orbotLocalConstants.java
index b5b7e4f6..95b45bc3 100644
--- a/orbotmanager/src/main/java/org/torproject/android/service/wrapper/orbotLocalConstants.java
+++ b/orbotmanager/src/main/java/org/torproject/android/service/wrapper/orbotLocalConstants.java
@@ -19,4 +19,7 @@ public class orbotLocalConstants
public static String mManualBridgeType = "";
public static boolean mNetworkState = true;
public static String mBridgesDefault = "";
+
+ public static int mHTTPPort = 8118;
+ public static int mSOCKSPort = 9051;
}