From 003c0b33e0eb50d92a9fc68887fc3868c3f30226 Mon Sep 17 00:00:00 2001 From: Genesis Date: Wed, 9 Jun 2021 12:56:18 +0500 Subject: [PATCH] Bug Fixes --- CHANGELOG | 12 +- INSTALL | 2 +- app/src/main/AndroidManifest.xml | 8 +- app/src/main/assets/Error/error-dark.html | 40 ------- .../assets/resources/style/cs-bootstrap.css | 4 +- .../homeController/homeController.java | 12 +- .../homeController/homeViewController.java | 81 ++++++++----- .../genesissearchengine/constants/enums.java | 2 +- .../genesissearchengine/constants/keys.java | 2 +- .../dataManager/imageDataModel.java | 5 +- .../libs/netcipher/NetCipher.java | 4 +- .../netcipher/client/StrongBuilderBase.java | 6 +- .../libs/netcipher/web/WebkitProxy.java | 6 +- .../ClientAuthContentProviderGenesis.java | 2 +- .../libs/providers/CookieContentProvider.java | 2 +- .../libs/providers/HSContentProvider.java | 2 +- .../OnionServiceContentProvider.java | 2 +- .../adPluginManager/adManager.java | 2 +- .../downloadReciever.java | 11 +- .../orbotPluginManager/orbotManager.java | 36 ++++-- .../pluginManager/pluginEnums.java | 2 +- .../res/layouts/home/layout/home_view.xml | 6 +- external/badvpn/lwip/src/netif/ppp/md5.c | 2 +- external/badvpn/lwip/src/netif/ppp/ppp.c | 2 +- .../guardianproject/netcipher/NetCipher.java | 2 +- .../netcipher/client/StrongBuilderBase.java | 4 +- .../netcipher/web/WebkitProxy.java | 4 +- .../android/service/OrbotService.java | 113 +++++++++++------- .../service/util/ExternalIPFetcher.java | 3 +- .../service/wrapper/orbotLocalConstants.java | 3 + 30 files changed, 211 insertions(+), 171 deletions(-) delete mode 100644 app/src/main/assets/Error/error-dark.html 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" />