diff --git a/.idea/misc.xml b/.idea/misc.xml
index 2f64cc4e..ea5b2ba5 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -62,8 +62,8 @@
-
-
+
+
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java
index edc54a59..a7446400 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoClients.java
@@ -69,20 +69,24 @@ public class geckoClients
mSession = (geckoSession) geckoView.getSession();
}
else {
- if(geckoView.getSession()!=null){
- //geckoView.releaseSession();
- }
mSession = new geckoSession(new geckoViewClientCallback(),mSessionID,context, geckoView);
- //mSession.open(mRuntime);
mSession.getSettings().setUseTrackingProtection(status.sStatusDoNotTrack);
mSession.getSettings().setFullAccessibilityTree(true);
mSession.getSettings().setUserAgentMode(USER_AGENT_MODE_MOBILE);
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
- //geckoView.setSession(mSession);
+ if(geckoView.getSession()!=null){
+ geckoView.releaseSession();
+ mSession.open(mRuntime);
+ geckoView.setSession(mSession);
+ onUpdateFont();
+ }else if(status.sSettingIsAppStarted){
+ mSession.open(mRuntime);
+ geckoView.setSession(mSession);
+ onUpdateFont();
+ }
}
mSession.onSetInitializeFromStartup();
- //onUpdateFont();
}
public void postInitRuntime(GeckoView geckoView, AppCompatActivity context){
@@ -313,8 +317,10 @@ public class geckoClients
}
public void onLoadFavIcon(AppCompatActivity pcontext){
- BrowserIconManager mIconManager = new BrowserIconManager();
- mIconManager.onLoadIcon(pcontext.getApplicationContext(), mRuntime);
+ if(mRuntime!=null){
+ BrowserIconManager mIconManager = new BrowserIconManager();
+ mIconManager.onLoadIcon(pcontext.getApplicationContext(), mRuntime);
+ }
}
private int getCookiesBehaviour(){
@@ -356,6 +362,7 @@ public class geckoClients
}
public void resetSession(){
+ mSession.onStopMedia();
mSessionID = strings.GENERIC_EMPTY_STR;
}
@@ -371,6 +378,7 @@ public class geckoClients
public void initSession(geckoSession mSession){
mSessionID = mSession.getSessionID();
+ this.mSession.onStopMedia();
this.mSession = mSession;
}
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoSession.java
index 467d55ab..13eaeaf5 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoSession.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/geckoManager/geckoSession.java
@@ -120,7 +120,7 @@ geckoSession extends GeckoSession implements MediaSession.Delegate,GeckoSession.
public boolean mCloseRequested = false;
public boolean mOnBackPressed = false;
public SessionState mSessionState;
- MediaSession.Delegate mMediaSession;
+ MediaSession mMediaSession = null;
geckoSession(eventObserver.eventListener event,String mSessionID,AppCompatActivity mContext, GeckoView pGeckoView){
@@ -150,12 +150,14 @@ geckoSession extends GeckoSession implements MediaSession.Delegate,GeckoSession.
@Override
public void onActivated(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
MediaSession.Delegate.super.onActivated(session, mediaSession);
+ mMediaSession = mediaSession;
}
@Override
public void onDeactivated(@NonNull GeckoSession session, @NonNull MediaSession mediaSession) {
MediaSession.Delegate.super.onDeactivated(session, mediaSession);
isMediaRunning = false;
+ mMediaSession = null;
}
@Override
@@ -239,8 +241,8 @@ geckoSession extends GeckoSession implements MediaSession.Delegate,GeckoSession.
}
public void onStopMedia(){
- if(isMediaRunning){
- close();
+ if(isMediaRunning && mMediaSession!=null){
+ mMediaSession.stop();
}
}
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
index 13e460d9..f9fb8e1f 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeController.java
@@ -5,6 +5,8 @@ import android.app.ActivityManager;
import android.app.DownloadManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
+import android.content.ClipData;
+import android.content.ClipboardManager;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.Context;
@@ -46,7 +48,6 @@ import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentContainerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-
import com.applovin.mediation.ads.MaxAdView;
import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.bookmarkManager.bookmarkSettings.bookmarkSettingController;
@@ -79,7 +80,6 @@ import com.hiddenservices.onionservices.pluginManager.pluginController;
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import com.example.myapplication.R;
import com.widget.onionservices.widgetManager.widgetController;
-
import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
@@ -96,9 +96,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.Callable;
-
import mozilla.components.support.utils.DownloadUtils;
-
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode;
@@ -181,6 +179,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private CoordinatorLayout mCoordinatorLayout;
private ImageView mImageDivider;
private ImageButton mPopoupFindCopy;
+ private ImageButton mPopoupFindPaste;
/*Redirection Objects*/
private GeckoResult mRenderedBitmap = null;
@@ -197,8 +196,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private String mSearchBarPreviousText = strings.GENERIC_EMPTY_STR;
private Handler mScrollHandler = null;
private Runnable mScrollRunnable = null;
+ private String clipboard = "";
private int mResponseRequestCode = 10112;
+ private boolean msearchstatuscopy = false;
/*-------------------------------------------------------INITIALIZATION-------------------------------------------------------*/
@@ -509,6 +510,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mPanicButtonLandscape = findViewById(R.id.pPanicButtonLandscape);
mGenesisLogo = findViewById(R.id.pGenesisLogo);
mPopoupFindCopy = findViewById(R.id.pPopoupFindCopy);
+ mPopoupFindPaste = findViewById(R.id.pPopoupFindPaste);
mGeckoView.setSaveEnabled(false);
mGeckoView.setSaveFromParentEnabled(false);
@@ -998,12 +1000,25 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void afterTextChanged(Editable s) {
- if(mSearchbar.getText().length()==0){
- mPopoupFindCopy.setEnabled(false);
- mPopoupFindCopy.setAlpha(0.2f);
- }else {
- mPopoupFindCopy.setEnabled(true);
- mPopoupFindCopy.setAlpha(1f);
+ if(msearchstatuscopy){
+ if(mSearchbar.getText().length()==0){
+ mPopoupFindCopy.setVisibility(View.GONE);
+ }else {
+ mPopoupFindCopy.setVisibility(View.VISIBLE);
+ mPopoupFindCopy.setAlpha(1f);
+ mPopoupFindCopy.setEnabled(true);
+ }
+
+ if(mSearchbar.getText().toString().equals(clipboard) || clipboard.length()<=0){
+ mPopoupFindPaste.setVisibility(View.GONE);
+ if(mPopoupFindCopy.getVisibility() == View.GONE){
+ mPopoupFindCopy.setVisibility(View.VISIBLE);
+ mPopoupFindCopy.setEnabled(false);
+ mPopoupFindCopy.setAlpha(0.2f);
+ }
+ }else {
+ mPopoupFindPaste.setVisibility(View.VISIBLE);
+ }
}
}
@@ -1020,6 +1035,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.sUIInteracted = true;
if(!hasFocus)
{
+ msearchstatuscopy = false;
mWasEdittextChanged = false;
mSearchBarWasBackButtonPressed = true;
new Handler().postDelayed(() ->
@@ -1043,6 +1059,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
mSearchbar.setSelection(0);
}else {
+ msearchstatuscopy = true;
mSearchBarWasBackButtonPressed = false;
if(!isFocusChanging){
if(!status.mThemeApplying){
@@ -1467,7 +1484,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateFindBar(false);
mHomeViewController.onClearSelections(isKeyboardOpened);
mTopBarContainer.getLayoutTransition().setDuration(0);
-
mSearchbar.clearFocus();
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,false, true);
@@ -1791,10 +1807,27 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onCopySearch(View view){
if(mSearchBarPreviousText.length()==0){
helperMethod.copyURL(mSearchbar.getText().toString(),this);
+ clipboard = mSearchbar.getText().toString();
}else {
helperMethod.copyURL(mSearchBarPreviousText,this);
+ clipboard = mSearchBarPreviousText;
}
helperMethod.showToastMessage("copied to clipboard", this);
+
+ if(mSearchbar.getText().toString().length()>0 || mSearchbar.getText().toString().equals(clipboard) || clipboard.length()<=0){
+ mPopoupFindPaste.setVisibility(View.GONE);
+ }else {
+ mPopoupFindPaste.setVisibility(View.VISIBLE);
+ }
+ }
+
+ public void onCopyPaste(View view){
+ ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
+ ClipData pasteData = manager.getPrimaryClip();
+ ClipData.Item item = pasteData.getItemAt(0);
+ String paste = item.getText().toString();
+ mSearchbar.setText(paste);
+ mSearchbar.selectAll();
}
public void onFindNext(View view){
@@ -2329,6 +2362,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateSearchEngineBar(false, 150);
((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onClearAdapter();
}
+ msearchstatuscopy = false;
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, true);
helperMethod.hideKeyboard(homeController.this);
diff --git a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java
index dac01284..ac5c6937 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/appManager/homeManager/homeController/homeViewController.java
@@ -43,7 +43,6 @@ import androidx.fragment.app.FragmentContainerView;
import androidx.recyclerview.widget.RecyclerView;
import com.applovin.mediation.ads.MaxAdView;
-import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.constants.*;
import com.hiddenservices.onionservices.dataManager.dataController;
import com.hiddenservices.onionservices.dataManager.dataEnums;
@@ -118,6 +117,7 @@ class homeViewController
private boolean isFullScreen = false;
private MovementMethod mSearchBarMovementMethod = null;
private boolean mIsTopBarExpanded = true;
+ private NestedScrollView.MarginLayoutParams mDefaultMargin = null;
void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, ProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, MaxAdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo, ImageButton pPanicButtonLandscape){
this.mContext = context;
@@ -225,6 +225,8 @@ class homeViewController
}
params1.setMargins(0, 0, 0,(helperMethod.pxFromDp(60)+mBannerHeight)*-1);
mNestedScroll.setLayoutParams(params1);
+
+
}
public void initSearchEngineView(){
@@ -259,6 +261,9 @@ class homeViewController
return;
}
if(!status.sFullScreenBrowsing){
+ //View child = mAppBar.getChildAt(0);
+ //AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) child.getLayoutParams();
+ //params.setMargins(0, 0, 0,helperMethod.pxFromDp(0));
}else {
int paddingDp = 0;
if(isFullScreen){
@@ -525,7 +530,7 @@ class homeViewController
});
animator.start();
}else {
- mSplashScreen.animate().alpha(0).setDuration(200).setStartDelay(mDelay).withEndAction(() -> onPostScreenDisable());
+ mSplashScreen.animate().alpha(0).setDuration(200).setStartDelay(mDelay).withEndAction(() -> onPostScreenDisable());
}
}
@@ -880,12 +885,12 @@ class homeViewController
}
if(!canGoForward){
- back.setEnabled(false);
- back.setColorFilter(Color.argb(255, 191, 191, 191));
+ back.setEnabled(false);
+ back.setColorFilter(Color.argb(255, 191, 191, 191));
}
if(!isLoading){
- close.setVisibility(View.GONE);
- mRefresh.setVisibility(View.VISIBLE);
+ close.setVisibility(View.GONE);
+ mRefresh.setVisibility(View.VISIBLE);
}else {
close.setVisibility(View.VISIBLE);
mRefresh.setVisibility(View.GONE);
@@ -997,11 +1002,11 @@ class homeViewController
void removeBanner(){
if(!isFullScreen){
if(isLandscape){
- mBannerAds.setVisibility(View.GONE);
- }else {
+ mBannerAds.setVisibility(View.GONE);
+ }else {
mEvent.invokeObserver(null, enums.etype.M_ON_BANNER_UPDATE);
- }
- onFullScreen(false);
+ }
+ onFullScreen(false);
}
}
@@ -1499,6 +1504,7 @@ class homeViewController
private int mDefaultColor = 0;
private int mBannerHeight = 0;
+ private boolean mFullScreenBrowsingTemp = false;
void onFullScreenUpdate(boolean pStatus){
int value = !pStatus ? 1 : 0;
@@ -1508,12 +1514,18 @@ class homeViewController
mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.black));
if(pStatus){
+ mDefaultMargin = (NestedScrollView.MarginLayoutParams) mNestedScroll.getLayoutParams();
mDefaultColor = mContext.getWindow().getNavigationBarColor();
mContext.getWindow().setNavigationBarColor(Color.BLACK);
new Handler().postDelayed(() ->
{
+ NestedScrollView.MarginLayoutParams params = (NestedScrollView.MarginLayoutParams) mNestedScroll.getLayoutParams();
+ mFullScreenBrowsingTemp = true;
+ status.sFullScreenBrowsing = false;
+ onFullScreen(false);
+
final int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
@@ -1522,9 +1534,7 @@ class homeViewController
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
mContext.getWindow().getDecorView().setSystemUiVisibility(flags);
mContext.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
- mBannerAds.setVisibility(View.GONE);
- NestedScrollView.MarginLayoutParams params = (NestedScrollView.MarginLayoutParams) mNestedScroll.getLayoutParams();
params.setMargins(0, 0, 0,0);
mNestedScroll.setLayoutParams(params);
@@ -1548,8 +1558,6 @@ class homeViewController
mGeckoView.setLayoutParams(new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT));
- initTopBarPadding();
-
this.mBlockerFullSceen.animate().setStartDelay(250).setDuration(200).alpha(0).withEndAction(() -> {
mBlockerFullSceen.setVisibility(View.GONE);
});
@@ -1558,12 +1566,12 @@ class homeViewController
if(isLandscape){
params.setMargins(0, 0, 0,-helperMethod.pxFromDp(120));
}else {
- if(mBannerAds.getHeight()>0){
+ if(mBannerAds.getHeight()>0 && mBannerAds.getVisibility()==View.VISIBLE){
Object mAdvertLoaded = mEvent.invokeObserver(null, enums.etype.M_ADVERT_LOADED);
if(mAdvertLoaded!=null && (boolean)mAdvertLoaded){
- params.setMargins(0, 0, 0,-helperMethod.pxFromDp(35) - helperMethod.pxFromDp(mBannerAds.getHeight()));
+ params.setMargins(0, 0, 0,-helperMethod.pxFromDp(170));
}else {
- params.setMargins(0, 0, 0,-helperMethod.pxFromDp(70) - helperMethod.pxFromDp(mBannerAds.getHeight()));
+ params.setMargins(0, 0, 0,-helperMethod.pxFromDp(120));
}
}else {
params.setMargins(0, 0, 0,-helperMethod.pxFromDp(120));
@@ -1573,21 +1581,21 @@ class homeViewController
if(isLandscape){
params.setMargins(0, 0, 0,-helperMethod.pxFromDp(60));
}else {
- if(mBannerAds.getHeight()>0){
+ if(mBannerAds.getHeight()>0 && mBannerAds.getVisibility()==View.VISIBLE){
params.setMargins(0, 0, 0,-helperMethod.pxFromDp(120));
}else {
- params.setMargins(0, 0, 0,-helperMethod.pxFromDp(0));
+ params.setMargins(0, 0, 0,-helperMethod.pxFromDp(120));
}
}
}
- status.sFullScreenBrowsing = false;
-
mNestedScroll.setLayoutParams(params);
+ mBannerAds.setVisibility(View.GONE);
+ initTopBarPadding();
}, 200);
}else {
-
+ mFullScreenBrowsingTemp = false;
NestedScrollView.MarginLayoutParams params = (NestedScrollView.MarginLayoutParams) mNestedScroll.getLayoutParams();
params.setMargins(0, 0, 0,helperMethod.pxFromDp(60)*-1);
mNestedScroll.setLayoutParams(params);
@@ -1610,6 +1618,7 @@ class homeViewController
status.sFullScreenBrowsing = (boolean) dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,false));
+ params.setMargins(mDefaultMargin.leftMargin,mDefaultMargin.topMargin,mDefaultMargin.rightMargin,mDefaultMargin.bottomMargin);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if(status.sTheme == enums.Theme.THEME_DARK || status.sDefaultNightMode){
mContext.getWindow().getDecorView().setSystemUiVisibility(0);
@@ -1621,7 +1630,7 @@ class homeViewController
}
mContext.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- initTopBarPadding();
+ //initTopBarPadding();
mIsTopBarExpanded = false;
mAppBar.setExpanded(true,false);
@@ -1644,11 +1653,18 @@ class homeViewController
}
if(status.sFullScreenBrowsing){
- int orientation = mContext.getResources().getConfiguration().orientation;
- if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
- mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60 + 60));
- } else {
- mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(110));
+ if(!mFullScreenBrowsingTemp){
+ View child = mAppBar.getChildAt(0);
+ AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) child.getLayoutParams();
+ if(isLandscape){
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ }else {
+ if(mBannerAds.getHeight()>0 && mBannerAds.getVisibility() == View.VISIBLE){
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(110));
+ }else {
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60));
+ }
+ }
}
}
else {
@@ -1662,7 +1678,7 @@ class homeViewController
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60 + 60));
} else {
- mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60) + mBannerAds.getHeight() + mTopBar.getHeight());
+ mWebviewContainer.setPadding(0,0,0,helperMethod.pxFromDp(60) + helperMethod.pxFromDp(50) + mTopBar.getHeight());
}
}
}
diff --git a/app/src/main/java/com/hiddenservices/onionservices/helperManager/helperMethod.java b/app/src/main/java/com/hiddenservices/onionservices/helperManager/helperMethod.java
index 9622ffd1..0d210c5f 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/helperManager/helperMethod.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/helperManager/helperMethod.java
@@ -75,7 +75,11 @@ import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
+import java.net.DatagramSocket;
import java.net.MalformedURLException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
@@ -259,6 +263,33 @@ public class helperMethod
}
}
+ public static boolean availablePort(int port) {
+ ServerSocket ss = null;
+ DatagramSocket ds = null;
+ try {
+ ss = new ServerSocket(port);
+ ss.setReuseAddress(true);
+ ds = new DatagramSocket(port);
+ ds.setReuseAddress(true);
+ return true;
+ } catch (IOException e) {
+ } finally {
+ if (ds != null) {
+ ds.close();
+ }
+
+ if (ss != null) {
+ try {
+ ss.close();
+ } catch (IOException e) {
+ /* should not be thrown */
+ }
+ }
+ }
+
+ return false;
+ }
+
public static String completeURL(String pURL){
if(pURL.equals("about:blank") || pURL.equals("about:config")){
return pURL;
diff --git a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/orbotPluginManager/orbotManager.java b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/orbotPluginManager/orbotManager.java
index f45fa18d..d9bb0e26 100644
--- a/app/src/main/java/com/hiddenservices/onionservices/pluginManager/orbotPluginManager/orbotManager.java
+++ b/app/src/main/java/com/hiddenservices/onionservices/pluginManager/orbotPluginManager/orbotManager.java
@@ -13,6 +13,7 @@ import java.util.List;
import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.keys;
import com.hiddenservices.onionservices.eventObserver;
+import com.hiddenservices.onionservices.helperManager.helperMethod;
import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import static android.content.Context.MODE_PRIVATE;
import static com.hiddenservices.onionservices.pluginManager.orbotPluginManager.orbotPluginEnums.eLogManager.M_GET_CLEANED_LOGS;
@@ -45,6 +46,11 @@ public class orbotManager
}
private void onInitlizeOrbot(String pBridgeCustomBridge, boolean pBridgeGatewayManual, String pBridgeCustomType, boolean pBridgeStatus, String pBridgesDefault){
+
+ if(helperMethod.availablePort(9050)){
+ orbotLocalConstants.mSOCKSPort = 9050;
+ }
+
orbotLocalConstants.mBridges = pBridgeCustomBridge;
orbotLocalConstants.mIsManualBridge = pBridgeGatewayManual;
orbotLocalConstants.mManualBridgeType = pBridgeCustomType;
diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_content_paste.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_content_paste.xml
new file mode 100644
index 00000000..a38e3d9d
--- /dev/null
+++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_content_paste.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable-mdpi/splashlogoclip.png b/app/src/main/res/drawable-mdpi/splashlogoclip.png
index 2c508855..60b7e246 100644
Binary files a/app/src/main/res/drawable-mdpi/splashlogoclip.png and b/app/src/main/res/drawable-mdpi/splashlogoclip.png differ
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 b761bcdc..11503f0e 100644
--- a/app/src/main/res/layouts/home/layout/home_view.xml
+++ b/app/src/main/res/layouts/home/layout/home_view.xml
@@ -12,7 +12,7 @@
maxads:adUnitId="6afabb72c853c683"
xmlns:maxads="http://schemas.applovin.com/android/1.0"
android:id="@+id/adView"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
@@ -37,7 +37,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/c_background"
- android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:translationZ="3dp"
app:layout_scrollFlags="enterAlwaysCollapsed">
@@ -47,7 +46,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
- android:overScrollMode="never"
android:orientation="vertical"
app:layout_scrollFlags="enterAlwaysCollapsed"
app:scrimAnimationDuration="10">
@@ -236,10 +234,8 @@
android:id="@+id/pNestedScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:overScrollMode="never"
android:background="@color/clear_alpha"
android:fillViewport="true"
-
android:isScrollContainer="true"
android:measureAllChildren="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
@@ -248,20 +244,18 @@
android:id="@+id/pWebLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/c_background"
+ android:background="@color/c_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- android:overScrollMode="never"
app:layout_constraintTop_toBottomOf="@+id/pTopLayout">
+
+