diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 96d756d7..67f6ee6a 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -64,6 +64,7 @@ android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:label="@string/SETTING_HEADER" android:windowSoftInputMode="adjustPan" /> + - +

@@ -40,8 +40,8 @@

- Genesis Search - + Genesis Search +
@@ -50,8 +50,6 @@
-

Privacy, simplified Help Spread Genesis!

-
@@ -64,10 +62,10 @@
-
-
-
-
+
+
+
+
@@ -79,22 +77,20 @@
- -
+
--> diff --git a/app/src/main/assets/Homepage/javascript/enum-homepage.js b/app/src/main/assets/Homepage/javascript/enum-homepage.js index f23f5ed7..5a5f9694 100644 --- a/app/src/main/assets/Homepage/javascript/enum-homepage.js +++ b/app/src/main/assets/Homepage/javascript/enum-homepage.js @@ -20,4 +20,5 @@ var ReferenceWebsitesDataID = { mIcon : "mIcon", mHeader : "mHeader", mBody : "mBody", + mUrl : "mUrl", }; diff --git a/app/src/main/assets/Homepage/javascript/js-homepage.js b/app/src/main/assets/Homepage/javascript/js-homepage.js index b742d062..5e8ebcc1 100644 --- a/app/src/main/assets/Homepage/javascript/js-homepage.js +++ b/app/src/main/assets/Homepage/javascript/js-homepage.js @@ -19,7 +19,7 @@ class homepage { Object.keys(obj).forEach(function(key) { var mObject = obj[key]; - mReferenceHTML += '
'+mObject[ReferenceWebsitesDataID.mHeader]+'

'+mObject[ReferenceWebsitesDataID.mBody]+'

' + mReferenceHTML += '
❏
'+mObject[ReferenceWebsitesDataID.mHeader]+'

'+mObject[ReferenceWebsitesDataID.mBody]+'

' }); @@ -52,5 +52,10 @@ function onTriggerScriptHandler(pCommand) { /*Default Loaders*/ $(window).on('load', function() { + /* For Local Testing */ + //var mResponseJson = '[{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://wikileaks.org/static/img/wl-logo.png", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"},{ "mIcon":"https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", "mHeader":"Experience", "mBody":"Donec id elit non mi porta gravida at eget metus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui"}]'; + //setTimeout(mHomepageLoader.onLoadReferenceWebsites, 500); + //setTimeout(mHomepageLoader.onLoadReferenceWebsiteContent, 1000, mResponseJson); + onTriggerScriptHandler(Commands.onLoadReferenceWebsites) }); diff --git a/app/src/main/assets/Homepage/style/cs-homepage.css b/app/src/main/assets/Homepage/style/cs-homepage.css index b73b73a4..aef3d58e 100644 --- a/app/src/main/assets/Homepage/style/cs-homepage.css +++ b/app/src/main/assets/Homepage/style/cs-homepage.css @@ -1,6 +1,15 @@ /*Search*/ +.clear_selection{ + moz-user-select: none; + -webkit-user-select: none; + -ms-user-select:none; + user-select:none; + -o-user-select:none; +} + #hi_search_container { margin-top:15vh; + margin-bottom: -25px; } @media only screen and (max-width: 943px) { @@ -207,6 +216,10 @@ } } +.hi_reference_website{ + cursor: pointer; +} + .hi_container_size { min-height: 100% !important; @@ -228,6 +241,54 @@ -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; } + +.hi_loader_item{ + height:10px; + border-width:0; + color:gray; + background-color:#cccccc; +} + +.hi_reference_body{ + margin-left: 0px; + line-height: 18px; + margin-top: 15px; + color: #8c8c8c; + font-size: 14px; +} + +.hi_reference_header{ + margin-left: 50px; + padding-left: 10px; + border-left: 4px solid #ecf2f9; + font-weight: bold; + font-size: 16px; + color: #4080bf; + height: 40px; + padding-top:9px; +} + +.hi_image_container{ + width: 40px; + height: 40px; + border-radius: 100px; + float: left; + background-color: #f5f5f5; + display: flex; +} + +.hi_reference_image{ + max-width: 22px; /* Or whatever */ + max-height: 22px; /* Or whatever */ + margin: auto; /* Magic! */ + border-radius: 4px; + + float:left; + font-size: 20px; + color: #bfbfbf; + font-weight: bold; +} + line-style /* Safari */ @-webkit-keyframes spin { diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png index eafd4e8d..e53e4c41 100644 Binary files a/app/src/main/ic_launcher-playstore.png and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java index 1f2a1285..73e3432b 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoClients.java @@ -240,8 +240,8 @@ public class geckoClients } } - public boolean canGoBack(){ - return mSession.canGoBack(); + public boolean canGoForward(){ + return mSession.canGoForward(); } public boolean isLoading(){ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java index c7990fc2..4fb8ed4d 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java @@ -339,6 +339,10 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele loadUri(mVerificationURL); return GeckoResult.fromValue(AllowOrDeny.DENY); } + else if(var1.uri.startsWith("mailto")){ + event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.M_ON_MAIL); + return GeckoResult.fromValue(AllowOrDeny.ALLOW); + } else if(var1.uri.contains("boogle.store/advert__")){ event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load); return GeckoResult.fromValue(AllowOrDeny.DENY); @@ -358,7 +362,6 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele return GeckoResult.fromValue(AllowOrDeny.DENY); } else if(!var1.uri.equals("about:blank")){ - mCurrentURL = var1.uri; if(mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED)){ mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL; }else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){ @@ -370,6 +373,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele checkApplicationRate(); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR); + /* Its Absence causes delay on first launch*/ + if(mCurrentURL.contains("boogle.store")){ + event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update_forced); + } + mCurrentURL = var1.uri; + return GeckoResult.fromValue(AllowOrDeny.ALLOW); }else { return GeckoResult.fromValue(AllowOrDeny.DENY); @@ -748,7 +757,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele if (mHistoryList != null && index >= 0 && index < mHistoryList.size()) { - event.invokeObserver(Arrays.asList(mHistoryList.get(index), mSessionID), enums.etype.start_proxy); + event.invokeObserver(Arrays.asList(mHistoryList.get(index).getUri(), mSessionID), enums.etype.start_proxy); new Handler().postDelayed(this::goForward, 100); } }else { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java index 4f0abedf..cf027d85 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java @@ -33,10 +33,11 @@ public class hintAdapter extends RecyclerView.Adapter mHintList; private AppCompatActivity mContext; private eventObserver.eventListener mEvent; - ImageView[] mWebIcon = new ImageView[15]; + private String mSearch; + private ImageView[] mWebIcon = new ImageView[15]; + private boolean mCounters=false; - boolean mCounters=false; - public hintAdapter(ArrayList pHintList, eventObserver.eventListener pEvent, AppCompatActivity pContext) { + public hintAdapter(ArrayList pHintList, eventObserver.eventListener pEvent, AppCompatActivity pContext, String pSearch) { this.mHintList = new ArrayList(); int maxCounter=5; if(pHintList.size() pHintList){ - mHintList.clear(); - mHintList.addAll(pHintList); + public void onUpdateAdapter(ArrayList pHintList, String pSearch){ + //mHintList.clear(); + mHintList = pHintList; + mSearch = pSearch; notifyDataSetChanged(); } @@ -131,7 +133,7 @@ public class hintAdapter extends RecyclerView.Adapter mRenderedBitmap = null; @@ -177,6 +180,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba initLandingPage(); initLocalLanguage(); onInitResume(false); + initSuggestions(); } public void onInitBooleans(){ @@ -189,6 +193,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba mSearchBarLoading = false; } + public void initSuggestions(){ + mSuggestions = (ArrayList)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mSearchbar.getText().toString())); + } + public void onInitResume(boolean pStatus){ if(status.mThemeApplying){ mSplashScreen.setAlpha(0); @@ -204,7 +212,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba onLoadTabOnResume(); mSearchLock.setColorFilter(ContextCompat.getColor(this, R.color.c_lock_tint)); } - initSuggestionView(new ArrayList<>()); + initSuggestionView(new ArrayList<>(), strings.GENERIC_EMPTY_STR); } public void onLoadTabOnResume(){ @@ -262,18 +270,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba } @SuppressLint("ClickableViewAccessibility") - private void initSuggestionView(ArrayList pList){ + private void initSuggestionView(ArrayList pList, String pSearch){ LinearLayoutManager layoutManager = new LinearLayoutManager(this); - hintAdapter mAdapter = new hintAdapter(pList,new hintViewCallback(), this); + hintAdapter mAdapter = new hintAdapter(pList,new hintViewCallback(), this, pSearch); layoutManager.setReverseLayout(true); mHintListView.setAdapter(mAdapter); - mHintListView.setNestedScrollingEnabled(false); - mHintListView.setHasFixedSize(true); - mHintListView.setItemViewCacheSize(10); - mHintListView.setDrawingCacheEnabled(true); - mHintListView.setDrawingCacheEnabled(true); - mHintListView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); mHintListView.setLayoutManager(new LinearLayoutManager(this)); Objects.requireNonNull(mHintListView.getItemAnimator()).setChangeDuration(0); @@ -286,7 +288,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onUpdateSuggestionList(ArrayList pList){ - ((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onUpdateAdapter(pList); + ((hintAdapter) Objects.requireNonNull(mHintListView.getAdapter())).onUpdateAdapter(pList, mSearchbar.getText().toString()); } private void initLocalLanguage() { @@ -358,13 +360,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba mFindBar = findViewById(R.id.pFindBar); mInfoPortrait = findViewById(R.id.pInfoPortrait); mInfoLandscape = findViewById(R.id.pInfoLandscape); + mProgressBarIndeterminate = findViewById(R.id.pProgressBarIndeterminate); mGeckoView.setSaveEnabled(false); mGeckoView.setSaveFromParentEnabled(false); mGeckoView.setAutofillEnabled(true); mGeckoClient = new geckoClients(); - mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait); + mHomeViewController.initialization(new homeViewCallback(),this,mNewTab, mWebViewContainer, mLoadingText, mProgressBar, mSearchbar, mSplashScreen, mLoadingIcon, mBannerAds, mGatewaySplash, mTopBar, mGeckoView, mBackSplash, mConnectButton, mFindBar, mFindText, mFindCount, mTopLayout, mVoiceInput, mMenu, mNestedScroll, mBlocker, mBlockerFullSceen, mSearchEngineBar, mCopyright, mHintListView, mAppBar, mOrbotLogManager, mInfoLandscape, mInfoPortrait, mProgressBarIndeterminate); mGeckoView.onSetHomeEvent(new nestedGeckoViewCallback()); mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,false); mGeckoClient.onValidateInitializeFromStartup(); @@ -491,7 +494,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.onClearSelections(false); mHomeViewController.onUpdateSearchBar(mTempSession.getCurrentURL(),false,true); if(mTempSession.getProgress()>0 && mTempSession.getProgress()<100){ - mHomeViewController.onProgressBarUpdate(mTempSession.getProgress()); + mHomeViewController.onProgressBarUpdate(mTempSession.getProgress(), false); }else { mHomeViewController.progressBarReset(); } @@ -663,6 +666,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba public void afterTextChanged(Editable s) { if(status.sSearchSuggestionStatus && isSuggestionChanged){ + if(!mSearchBarLoading && mSearchEngineBar.getVisibility() != View.VISIBLE){ + mSuggestions = (ArrayList)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mSearchbar.getText().toString())); + initSuggestionView(mSuggestions, s.toString()); + } mSuggestions = (ArrayList)dataController.getInstance().invokeSuggestions(dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS, Collections.singletonList(mSearchbar.getText().toString())); if(mSuggestions.size()>0){ if(!isSuggestionSearchOpened && mSearchbar.isFocused()){ @@ -671,7 +678,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } } if(mHintListView.getAdapter()==null){ - initSuggestionView(mSuggestions); + initSuggestionView(mSuggestions, s.toString()); mSearchEngineBar.setVisibility(View.VISIBLE); mSearchEngineBar.setAlpha(1); }else { @@ -682,7 +689,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mSearchBarLoading = true; mEdittextChanged.postDelayed(postToServerRunnable, 0); }else{ - mEdittextChanged.postDelayed(postToServerRunnable, 300); + mEdittextChanged.postDelayed(postToServerRunnable, 500); } } } @@ -833,6 +840,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba }, 100); } + public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){ + mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), M_INITIALIZE_TAB_SINGLE); + } + public void onOpenLinkNewTab(String url){ onGetThumbnail(null); @@ -862,7 +873,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED); helperMethod.hideKeyboard(this); - mHomeViewController.onOpenMenu(view,mGeckoClient.canGoBack(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent()); + mHomeViewController.onOpenMenu(view,mGeckoClient.canGoForward(),!(mProgressBar.getAlpha()<=0 || mProgressBar.getVisibility() ==View.INVISIBLE),mGeckoClient.getUserAgent()); } public void onFullScreenSettingChanged(){ @@ -929,12 +940,20 @@ public class homeController extends AppCompatActivity implements ComponentCallba { mHomeViewController.onSetBannerAdMargin(false, true); } + + } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){ mHomeViewController.setOrientation(false); if(mGeckoClient.getFullScreenStatus()) { mHomeViewController.onSetBannerAdMargin(true,(boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } + + if(mGeckoClient.getSession().getCurrentURL().contains("boogle.store") || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED)){ + mHomeViewController.updateBannerAdvertStatus(false); + }else { + mHomeViewController.updateBannerAdvertStatus(true); + } } if(mSplashScreen.getAlpha()>0){ mHomeViewController.initSplashOrientation(); @@ -1198,6 +1217,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba { pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(this, mGeckoClient.getSession().getCurrentURL()), M_BOOKMARK); } + else if (menuId == R.id.pMenuOpenRecentTab) + { + helperMethod.openActivity(tabController.class, constants.CONST_LIST_HISTORY, homeController.this,true); + overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); + } else if (menuId == R.id.pMenuOpenNewTab) { helperMethod.hideKeyboard(this); @@ -1240,6 +1264,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } if (menuId == R.id.menu22) { helperMethod.hideKeyboard(this); + mHomeViewController.onProgressBarUpdate(5,true); mGeckoClient.onForwardPressed(); } if (menuId == R.id.menu23) { @@ -1250,7 +1275,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba helperMethod.hideKeyboard(this); onHomeButton(view); } - if (menuId == R.id.menu26 || menuId == R.id.menu27 || menuId == R.id.menu28) { + if (menuId == R.id.menu26 || menuId == R.id.menu27) { helperMethod.hideKeyboard(this); mGeckoClient.toogleUserAgent(); mGeckoClient.onReload(); @@ -1346,7 +1371,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba else if(status.sSettingIsAppStarted){ mHomeViewController.onPageFinished(); mGeckoClient.onRedrawPixel(); - mHomeViewController.onProgressBarUpdate(5); + mHomeViewController.onProgressBarUpdate(5, false); onLoadTabOnResume(); } } @@ -1431,7 +1456,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba mHomeViewController.updateBannerAdvertStatus((boolean)data.get(3)); } else if(e_type.equals(enums.etype.progress_update)){ - mHomeViewController.onProgressBarUpdate((int)data.get(0)); + mHomeViewController.onProgressBarUpdate((int)data.get(0), false); + } + else if(e_type.equals(enums.etype.progress_update_forced)){ + mHomeViewController.onProgressBarUpdate((int)data.get(0), true); } else if(e_type.equals(enums.etype.ON_UPDATE_SEARCH_BAR)){ mHomeViewController.onUpdateSearchBar((String)data.get(0), false, false); @@ -1527,7 +1555,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba else if(e_type.equals(enums.etype.FINDER_RESULT_CALLBACK)){ mHomeViewController.onUpdateFindBarCount((int)data.get(0),(int)data.get(1)); } - + else if(e_type.equals(enums.etype.M_ON_MAIL)){ + helperMethod.sendCustomMail(homeController.this, (String)data.get(0)); + } return null; } } 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 3d741ffa..56fd3300 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 @@ -19,6 +19,7 @@ import android.graphics.drawable.StateListDrawable; import android.os.Build; import android.os.Handler; import android.os.Message; +import android.text.method.MovementMethod; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -93,12 +94,15 @@ class homeViewController private ConstraintLayout mInfoPortrait; private ConstraintLayout mInfoLandscape; private NestedScrollView mNestedScroll; + private ProgressBar mProgressBarIndeterminate; /*Local Variables*/ private Callable mLogs = null; private boolean isLandscape = false; + private boolean isFullScreen = false; + private MovementMethod mSearchBarMovementMethod = null; - void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView 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){ + void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView 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){ this.mContext = context; this.mProgressBar = progressBar; this.mSearchbar = searchbar; @@ -129,6 +133,7 @@ class homeViewController this.mInfoPortrait = pInfoPortrait; this.mInfoLandscape = pInfoLandscape; this.mNestedScroll = pNestedScroll; + this.mProgressBarIndeterminate = pProgressBarIndeterminate; initSplashScreen(); createUpdateUiHandler(); @@ -140,6 +145,8 @@ class homeViewController public void initializeViews(){ mNestedScroll.setNestedScrollingEnabled(true); this.mBlockerFullSceen.setVisibility(View.GONE); + mSearchBarMovementMethod = mSearchbar.getMovementMethod(); + mSearchbar.setMovementMethod(null); final Handler handler = new Handler(); handler.postDelayed(() -> @@ -182,19 +189,23 @@ class homeViewController mVoiceInput.setVisibility(View.GONE); mNewTab.setVisibility(View.VISIBLE); mMenu.setVisibility(View.VISIBLE); + mSearchbar.setFadingEdgeLength(helperMethod.pxFromDp(20)); + mSearchbar.setMovementMethod(null); if(status.sSettingLanguageRegion.equals("Ur")){ mSearchbar.setPadding(helperMethod.pxFromDp(17),0,mSearchbar.getPaddingRight(),0); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mSearchbar.getLayoutParams(); params.leftMargin = helperMethod.pxFromDp(5); }else { - mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(45),0); + mSearchbar.setPadding(mSearchbar.getPaddingLeft(),0,helperMethod.pxFromDp(5),0); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mSearchbar.getLayoutParams(); params.rightMargin = helperMethod.pxFromDp(10); } }); }else { + mSearchbar.setMovementMethod(mSearchBarMovementMethod); + mSearchbar.setFadingEdgeLength(helperMethod.pxFromDp(0)); Drawable drawable; Resources res = mContext.getResources(); try { @@ -255,7 +266,7 @@ class homeViewController public void initStatusBarColor(boolean mInstant) { animatedColor oneToTwo = new animatedColor(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2)); - int mDelay = 200; + int mDelay = 450; if(status.mThemeApplying || mInstant){ mDelay = 0; } @@ -318,6 +329,8 @@ class homeViewController mLoadingText.setVisibility(View.VISIBLE); mLoadingText.animate().setStartDelay(0).alpha(1); + mProgressBarIndeterminate.setVisibility(View.VISIBLE); + mProgressBarIndeterminate.animate().alpha(1); mConnectButton.setEnabled(false); mSplashScreen.setEnabled(false); mBlocker.setClickable(true); @@ -414,12 +427,20 @@ class homeViewController triggerPostUI(); mProgressBar.setVisibility(View.GONE); mSplashScreen.animate().cancel(); - mSplashScreen.animate().setDuration(350).setStartDelay(200).alpha(0).withEndAction(() -> { + mProgressBarIndeterminate.animate().setDuration(250).alpha(0).withEndAction(() -> mSplashScreen.animate().setDuration(350).setStartDelay(200).alpha(0).withEndAction(() -> { + mProgressBarIndeterminate.setVisibility(View.GONE); mSplashScreen.setClickable(false); mSplashScreen.setFocusable(false); + mProgressBarIndeterminate.setVisibility(View.GONE); mSearchbar.setEnabled(true); mBlocker.setEnabled(false); - }); + + mProgressBarIndeterminate.setVisibility(View.GONE); + mBlocker.setVisibility(View.GONE); + mGatewaySplash.setVisibility(View.GONE); + mConnectButton.setVisibility(View.GONE); + + })); mEvent.invokeObserver(null, enums.etype.M_WELCOME_MESSAGE); mOrbotLogManager.setClickable(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -443,7 +464,7 @@ class homeViewController /*-------------------------------------------------------Helper Methods-------------------------------------------------------*/ - void onOpenMenu(View view, boolean canGoBack, boolean isLoading, int userAgent){ + void onOpenMenu(View view, boolean canGoForward, boolean isLoading, int userAgent){ if(popupWindow!=null){ popupWindow.dismiss(); @@ -482,7 +503,7 @@ class homeViewController CheckBox desktop = popupView.findViewById(R.id.menu27); desktop.setChecked(userAgent==USER_AGENT_MODE_DESKTOP); - if(!canGoBack){ + if(!canGoForward){ back.setEnabled(false); back.setColorFilter(Color.argb(255, 191, 191, 191)); } @@ -548,7 +569,7 @@ class homeViewController void onSetBannerAdMargin(boolean status,boolean isAdLoaded){ if(isAdLoaded){ - if(status && !isLandscape){ + if(status && !isLandscape && !isFullScreen){ mBannerAds.setVisibility(View.VISIBLE); final Handler handler = new Handler(); @@ -565,14 +586,18 @@ class homeViewController void updateBannerAdvertStatus(boolean status){ if(status){ - mBannerAds.animate().cancel(); - mBannerAds.setAlpha(0); - mBannerAds.animate().alpha(1); - mBannerAds.setVisibility(View.VISIBLE); + if(mBannerAds.getAlpha()==0){ + mBannerAds.animate().cancel(); + mBannerAds.setAlpha(0); + mBannerAds.animate().alpha(1); + mBannerAds.setVisibility(View.VISIBLE); + } onSetBannerAdMargin(true,true); }else{ - mBannerAds.animate().cancel(); - mBannerAds.animate().alpha(0).withEndAction(() -> mBannerAds.setVisibility(View.GONE)); + if(mBannerAds.getAlpha()==1){ + mBannerAds.animate().cancel(); + mBannerAds.animate().alpha(0).withEndAction(() -> mBannerAds.setVisibility(View.GONE)); + } onSetBannerAdMargin(false,true); } } @@ -803,8 +828,8 @@ class homeViewController mGeckoView.setForeground(ContextCompat.getDrawable(mContext, R.color.c_background)); } - void onProgressBarUpdate(int value){ - if(mSearchbar.getText().toString().equals("genesis.onion")){ + void onProgressBarUpdate(int value, boolean mForced){ + if(mSearchbar.getText().toString().equals("genesis.onion") && !mForced){ mProgressBar.setProgress(0); mProgressBar.setVisibility(View.GONE); return; @@ -857,12 +882,15 @@ class homeViewController int value = !status ? 1 : 0; if(status) { + isFullScreen = true; }else { this.mBlockerFullSceen.setVisibility(View.VISIBLE); this.mBlockerFullSceen.setAlpha(1f); + isFullScreen = false; } if(status){ + onProgressBarUpdate(100, false); this.mBlockerFullSceen.setVisibility(View.VISIBLE); this.mBlockerFullSceen.setAlpha(0f); this.mBlockerFullSceen.animate().setStartDelay(0).setDuration(200).alpha(1).withEndAction(() -> { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageController.java index 75dda5ff..e4d1043b 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/languageManager/languageController.java @@ -136,6 +136,9 @@ public class languageController extends AppCompatActivity { mDefaultLanguageNotSupported = true; } }else { + if(status.sSettingLanguage.equals(pLanguageCode)){ + return true; + } status.sSettingLanguage = pLanguageCode; status.sSettingLanguageRegion = pLanguageRegion; } @@ -160,7 +163,7 @@ public class languageController extends AppCompatActivity { } status.mThemeApplying = true; - activityContextManager.getInstance().getHomeController().recreate(); + //activityContextManager.getInstance().getHomeController().recreate(); return true; } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/settingHomePage/settingHomeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/settingHomePage/settingHomeController.java index 51ca9dd6..3c26b5be 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/settingHomePage/settingHomeController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/settingManager/settingHomePage/settingHomeController.java @@ -29,6 +29,9 @@ import com.darkweb.genesissearchengine.helperManager.helperMethod; import com.darkweb.genesissearchengine.pluginManager.pluginController; import com.darkweb.genesissearchengine.pluginManager.pluginEnums; import com.example.myapplication.R; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -192,7 +195,22 @@ public class settingHomeController extends AppCompatActivity } public void onReportWebsite(View view) { - pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(activityContextManager.getInstance().getHomeController().onGetCurrentURL(), this), M_REPORT_URL); + try { + finish(); + activityContextManager.getInstance().getHomeController().onLoadURL(constants.CONST_REPORT_URL + URLEncoder.encode(activityContextManager.getInstance().getHomeController().onGetCurrentURL(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + + public void onSitemap(View view) { + finish(); + activityContextManager.getInstance().getHomeController().onLoadURL(constants.CONST_SITEMAP); + } + + public void onPrivacyPolicy(View view) { + finish(); + activityContextManager.getInstance().getHomeController().onLoadURL(constants.CONST_PRIVACY_POLICY_URL); } public void onRateApplication(View view) { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java index 01ad0a0d..8d98a0d8 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/tabManager/tabController.java @@ -189,7 +189,7 @@ public class tabController extends AppCompatActivity } public void onNewTabInvoked(){ - mHomeController.onNewTab(true,false); + mHomeController.onNewTabBackground(true,false); onClose(); overridePendingTransition(R.anim.popup_anim_in, R.anim.popup_anim_out); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java index 73a8b5ca..bc3dead3 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/constants.java @@ -13,6 +13,9 @@ public class constants public static final String CONST_MARKET_URL = "https://boogle.store/search?q=news&p_num=1&s_type=all&p_num=1&s_type=all"; public static final String CONST_SERVER = "https://drive.google.com/uc?export=download&id=1es7XOAWCktGGfSnJu_o8W4_LZuudjR-T"; public static final String CONST_PLAYSTORE_URL = "http://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine"; + public static final String CONST_PRIVACY_POLICY_URL = "https://boogle.store/privacy"; + public static final String CONST_REPORT_URL = "https://boogle.store/reportus?url="; + public static final String CONST_SITEMAP = "https://boogle.store/create"; /*URL CONSTANTS*/ 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 d87a297e..aaf922c1 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/enums.java @@ -4,11 +4,11 @@ public class enums { /*Settings Manager*/ public enum etype{ - on_update_favicon,ON_UPDATE_TAB_TITLE, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR, + on_update_favicon,ON_UPDATE_TAB_TITLE, ON_LOAD_REQUEST,GECKO_SCROLL_CHANGED,ON_UPDATE_SEARCH_BAR,M_ON_MAIL, on_verify_selected_url_menu,FINDER_RESULT_CALLBACK, welcome, reload,download_folder,M_ON_BANNER_UPDATE, url_triggered, url_triggered_new_tab,url_clear,fetch_favicon, fetch_thumbnail,url_clear_at,remove_from_database,is_empty,M_HOME_PAGE,M_PRELOAD_URL,ON_KEYBOARD_CLOSE, - on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_UPDATE_TITLE_BAR,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error,download_file_popup,on_init_ads,search_update, open_new_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_INITIALIZE_TAB_SINGLE, M_INITIALIZE_TAB_LINK,on_request_completed, on_update_history,on_update_suggestion,M_WELCOME_MESSAGE,ON_UPDATE_TITLE_BAR,ON_FIRST_PAINT, ON_LOAD_TAB_ON_RESUME, ON_SESSION_REINIT,on_page_loaded,on_load_error,download_file_popup,on_init_ads,search_update, open_new_tab } /*General Enums*/ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java index 9ca0efac..98c7ad06 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/constants/status.java @@ -88,9 +88,9 @@ public class status status.sStatusDoNotTrack = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,true)); status.sSettingCookieStatus = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY)); status.sSettingFontSize = (int)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100)); - status.mReferenceWebsites = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE)); + status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE,strings.SETTING_DEFAULT_LANGUAGE)); - status.sSettingLanguage = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,strings.HOME_REFERENCE_WEBSITES_DEFAULT)); + status.mReferenceWebsites = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,strings.HOME_REFERENCE_WEBSITES_DEFAULT)); status.sSettingLanguageRegion = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION)); status.sSettingSearchStatus = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE,constants.CONST_BACKEND_GENESIS_URL)); status.sBridgeCustomBridge = (String)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4)); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataEnums.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataEnums.java index 5f7b4e94..2d41387c 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataEnums.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/dataEnums.java @@ -20,7 +20,7 @@ public class dataEnums } public enum eSuggestionCommands{ - M_GET_SUGGESTIONS + M_GET_SUGGESTIONS, M_GET_DEFAULT_SUGGESTION } public enum eTabCommands{ diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/referenceWebsiteDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/referenceWebsiteDataModel.java index 72ee1f97..dbcec395 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/referenceWebsiteDataModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/referenceWebsiteDataModel.java @@ -5,8 +5,11 @@ import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; +import com.darkweb.genesissearchengine.constants.keys; import com.darkweb.genesissearchengine.constants.status; import com.darkweb.genesissearchengine.constants.strings; + +import java.util.Arrays; import java.util.List; import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_REFERENCE_WEBSITES; @@ -25,10 +28,19 @@ public class referenceWebsiteDataModel { StringRequest stringRequest = new StringRequest(Request.Method.GET, CONST_GENESIS_REFERENCE_WEBSITES, response -> { - mReferenceWebsiteData = response; - mLoading = false; + if(response.length()>10){ + mReferenceWebsiteData = response; + status.mReferenceWebsites = response; + dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.HOME_REFERENCE_WEBSITES,status.mReferenceWebsites)); + mLoading = false; + }else { + mReferenceWebsiteData = status.mReferenceWebsites; + } }, - error -> {}); + error -> { + mReferenceWebsiteData = status.mReferenceWebsites; + mLoading = false; + }); RequestQueue requestQueue = Volley.newRequestQueue(pContext); requestQueue.add(stringRequest); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java index 8dc419a1..76f0cd33 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/dataManager/suggestionDataModel.java @@ -7,7 +7,6 @@ import android.text.style.SuggestionSpan; import android.view.textservice.SentenceSuggestionsInfo; import android.view.textservice.SpellCheckerSession; import android.view.textservice.SuggestionsInfo; -import android.view.textservice.TextInfo; import android.view.textservice.TextServicesManager; import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel; @@ -25,6 +24,8 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess private SpellCheckerSession mSpellCheckerSession; private TextServicesManager mTextServicesManager; private ArrayList mHintListLocalCache; + private ArrayList mCurrentList = new ArrayList<>(); + /*Initializations*/ @@ -36,202 +37,214 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess /*Helper Methods*/ + private ArrayList getDefaultSuggestions(String pQuery){ + for(int count = 0; count<= mHintListLocalCache.size()-1 && mHintListLocalCache.size()<500; count++){ + if(mHintListLocalCache.get(count).getHeader().toLowerCase().contains(pQuery)){ + mCurrentList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); + }else if(mHintListLocalCache.get(count).getDescription().toLowerCase().contains(pQuery)){ + if(mCurrentList.size()==0){ + mCurrentList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); + }else { + mCurrentList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); + } + } + } + + return mCurrentList; + } + private ArrayList getSuggestions(String pQuery, ArrayList pHistory, ArrayList pBookmarks){ + + mCurrentList = new ArrayList<>(); + mCurrentList.clear(); + pQuery = pQuery.replace("+","%").replace(" ","+"); ArrayList mHistory = pHistory; ArrayList mBookmarks = pBookmarks; pQuery = pQuery.toLowerCase(); - ArrayList mList = new ArrayList<>(); + ArrayList mDuplicationHandler = new ArrayList<>(); - if(status.sSettingSearchHistory) { - for (int count = 0; count <= mBookmarks.size() - 1 && mBookmarks.size() < 500; count++) { - if (mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)) { - mList.add(0, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1)); - } else if (mList.size() > 0 && mBookmarks.get(count).getDescription().toLowerCase().contains(pQuery)) { - mList.add(mList.size() - 1, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1)); - } - } - } - - String mQueryOriginal = pQuery; if(status.sSettingSearchHistory){ pQuery = pQuery.toLowerCase(); for(int count = 0; count<= mHistory.size()-1 && mHistory.size()<500; count++){ historyRowModel mTempModel; - if(mHistory.get(count).getHeader().toLowerCase().contains(pQuery)){ - mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1); - if(!mList.contains(mTempModel)){ - mList.add(mTempModel); + if(!mDuplicationHandler.contains(mHistory.get(count).getDescription())){ + if(mHistory.get(count).getHeader().toLowerCase().contains(pQuery)){ + mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1); + if(!mCurrentList.contains(mTempModel)){ + mDuplicationHandler.add(mTempModel.getDescription()); + mCurrentList.add(mTempModel); + } + }else if(mHistory.get(count).getDescription().toLowerCase().contains(pQuery)){ + mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1); + if(!mCurrentList.contains(mTempModel)){ + mDuplicationHandler.add(mTempModel.getDescription()); + mCurrentList.add(mTempModel); + } } - }else if(mHistory.get(count).getDescription().toLowerCase().contains(pQuery)){ - mTempModel = new historyRowModel(mHistory.get(count).getHeader(),mHistory.get(count).getDescription(),-1); - if(!mList.contains(mTempModel)){ - mList.add(mTempModel); + if(mCurrentList.size()>8){ + break; } } } } - for(int count = 0; count<= mHintListLocalCache.size()-1 && mHintListLocalCache.size()<500; count++){ - if(mHintListLocalCache.get(count).getHeader().toLowerCase().contains(pQuery)){ - mList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); - }else if(mHintListLocalCache.get(count).getDescription().toLowerCase().contains(pQuery)){ - if(mList.size()==0){ - mList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); - }else { - mList.add(new historyRowModel(mHintListLocalCache.get(count).getHeader(),mHintListLocalCache.get(count).getDescription(),-1)); - } - } - } - - /*Duplicate handler*/ - ArrayList mDuplicateHandler = new ArrayList<>(); - for(int mCounter=0;mCounter8) { + for (int count = 0; count <= mBookmarks.size() - 1 && mBookmarks.size() < 500; count++) { + if(!mDuplicationHandler.contains(mBookmarks.get(count).getDescription())){ + if (mBookmarks.get(count).getHeader().toLowerCase().contains(pQuery)) { + mDuplicationHandler.add(mBookmarks.get(count).getDescription()); + mCurrentList.add(mCurrentList.size() - 1,new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1)); + } else if (mCurrentList.size() > 0 && mBookmarks.get(count).getDescription().toLowerCase().contains(pQuery)) { + mDuplicationHandler.add(mBookmarks.get(count).getDescription()); + mCurrentList.add(mCurrentList.size() - 1, new historyRowModel(mBookmarks.get(count).getHeader(), mBookmarks.get(count).getDescription(), -1)); } - if(!pQuery.equals(pQuery.substring(0,sepPos)+".onion")){ - mList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".onion", strings.GENERIC_EMPTY_STR,-1)); + if(mCurrentList.size()>8){ + break; } } } - mList.add( 0,new historyRowModel(mQueryOriginal, strings.GENERIC_EMPTY_STR,-1)); } - if (Pattern.matches("[a-zA-Z]+",pQuery)){ - Spannable str = new SpannableString(pQuery); - SuggestionSpan[] spanned = str.getSpans(0, pQuery.length(), SuggestionSpan.class); - for (SuggestionSpan suggestionSpan : spanned) { - mList.add(0, new historyRowModel(suggestionSpan.toString(), strings.GENERIC_EMPTY_STR, -1)); + if(mCurrentList.size()<8) { + getDefaultSuggestions(pQuery); + } + + if(mCurrentList.size()<8){ + String mQueryOriginal = pQuery; + + if(!pQuery.equals(strings.GENERIC_EMPTY_STR) && !pQuery.equals("about:blank") && !pQuery.contains("?") && !pQuery.contains("/") && !pQuery.contains(" ") && !pQuery.contains(" ") && !pQuery.contains("\n")){ + if(mCurrentList.size()<3){ + int sepPos = pQuery.indexOf("."); + if (sepPos == -1) { + mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".com", strings.GENERIC_EMPTY_STR,-1)); + mCurrentList.add( 0,new historyRowModel(mQueryOriginal+".onion", strings.GENERIC_EMPTY_STR,-1)); + }else + { + if(!pQuery.equals(pQuery.substring(0,sepPos)+".com")){ + mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".com", strings.GENERIC_EMPTY_STR,-1)); + } + if(!pQuery.equals(pQuery.substring(0,sepPos)+".onion")){ + mCurrentList.add( 0,new historyRowModel(pQuery.substring(0,sepPos)+".onion", strings.GENERIC_EMPTY_STR,-1)); + } + } + } } } - return mList; + if(pQuery.length()>0){ + mCurrentList.add( 0,new historyRowModel(pQuery, strings.GENERIC_EMPTY_STR,-1)); + } + return mCurrentList; } private ArrayList initSuggestions(){ - ArrayList mHintList = new ArrayList<>(); + mHintListLocalCache = new ArrayList<>(); - mHintList.add(new historyRowModel("Duckduckgo","https://duckduckgo.com",-1 )); - mHintList.add(new historyRowModel("BBC","https://bbc.com",-1 )); - mHintList.add(new historyRowModel("Youtube","https://youtube.com",-1 )); - mHintList.add(new historyRowModel("Facebook","https://facebook.com",-1 )); - mHintList.add(new historyRowModel("Twitter","https://twitter.com",-1 )); - mHintList.add(new historyRowModel("Amazon","https://amazon.com",-1 )); - mHintList.add(new historyRowModel("IMDB","https://imdb.com",-1 )); - mHintList.add(new historyRowModel("Reddit","https://reddit.com",-1 )); - mHintList.add(new historyRowModel("Pinterest","https://pinterest.com",-1 )); - mHintList.add(new historyRowModel("EBay","https://ebay.com",-1 )); - mHintList.add(new historyRowModel("Trip Advisor","https://tripadvisor.com",-1 )); - mHintList.add(new historyRowModel("Craigslist","https://craigslist.com",-1 )); - mHintList.add(new historyRowModel("Walmart","https://walmart.com",-1 )); - mHintList.add(new historyRowModel("Instagram","https://instagram.com",-1 )); - mHintList.add(new historyRowModel("Google","https://google.com",-1 )); - mHintList.add(new historyRowModel("NY Times","https://nytimes.com",-1 )); - mHintList.add(new historyRowModel("Apple","https://apple.com",-1 )); - mHintList.add(new historyRowModel("Linkedin","https://linkedin.com",-1 )); - mHintList.add(new historyRowModel("Play.Google","https://play.google.com",-1 )); - mHintList.add(new historyRowModel("ESPN","https://espn.com",-1 )); - mHintList.add(new historyRowModel("Webmd","https://webmd.com",-1 )); - mHintList.add(new historyRowModel("CNN","https://cnn.com",-1 )); - mHintList.add(new historyRowModel("Homedepot","https://homedepot.com",-1 )); - mHintList.add(new historyRowModel("ETSY","https://etsy.com",-1 )); - mHintList.add(new historyRowModel("Netflix","https://netflix.com",-1 )); - mHintList.add(new historyRowModel("Quora","https://quora.com",-1 )); - mHintList.add(new historyRowModel("Microsoft","https://microsoft.com",-1 )); - mHintList.add(new historyRowModel("Target","https://target.com",-1 )); - mHintList.add(new historyRowModel("Merriam Webster","https://merriam-webster.com",-1 )); - mHintList.add(new historyRowModel("Forbes","https://forbes.com",-1 )); - mHintList.add(new historyRowModel("Mapquest","https://mapquest.com",-1 )); - mHintList.add(new historyRowModel("NIH","https://nih.gov",-1 )); - mHintList.add(new historyRowModel("Gamepedia","https://gamepedia.com",-1 )); - mHintList.add(new historyRowModel("Yahoo","https://yahoo.com",-1 )); - mHintList.add(new historyRowModel("Healthline","https://healthline.com",-1 )); - mHintList.add(new historyRowModel("Foxnews","https://foxnews.com",-1 )); - mHintList.add(new historyRowModel("All Recipes","https://allrecipes.com",-1 )); - mHintList.add(new historyRowModel("Quizlet","https://quizlet.com",-1 )); - mHintList.add(new historyRowModel("Weather","https://weather.com",-1 )); - mHintList.add(new historyRowModel("Bestbuy","https://bestbuy.com",-1 )); - mHintList.add(new historyRowModel("Urbandictionary","https://urbandictionary.com",-1 )); - mHintList.add(new historyRowModel("Mayoclinic","https://mayoclinic.org",-1 )); - mHintList.add(new historyRowModel("AOL","https://aol.com",-1 )); - mHintList.add(new historyRowModel("Genius","https://genius.com",-1 )); - mHintList.add(new historyRowModel("Zillow","https://zillow.com",-1 )); - mHintList.add(new historyRowModel("Usatoday","https://usatoday.com",-1 )); - mHintList.add(new historyRowModel("Glassdoor","https://glassdoor.com",-1 )); - mHintList.add(new historyRowModel("MSN","https://msn.com",-1 )); - mHintList.add(new historyRowModel("Rotten Tomatoes","https://rottentomatoes.com",-1 )); - mHintList.add(new historyRowModel("Lowes","https://lowes.com",-1 )); - mHintList.add(new historyRowModel("Dictionary","https://dictionary.com",-1 )); - mHintList.add(new historyRowModel("Business Insider","https://businessinsider.com",-1 )); - mHintList.add(new historyRowModel("US News","https://usnews.com",-1 )); - mHintList.add(new historyRowModel("Medical News Today","https://medicalnewstoday.com",-1 )); - mHintList.add(new historyRowModel("Britannica","https://britannica.com",-1 )); - mHintList.add(new historyRowModel("Washington Post","https://washingtonpost.com",-1 )); - mHintList.add(new historyRowModel("USPS","https://usps.com",-1 )); - mHintList.add(new historyRowModel("Finance Yahoo","https://finance.yahoo.com",-1 )); - mHintList.add(new historyRowModel("IRS","https://finance.irs.gov",-1 )); - mHintList.add(new historyRowModel("Yellow Pages","https://yellowpages.com",-1 )); - mHintList.add(new historyRowModel("Chase","https://chase.com",-1 )); - mHintList.add(new historyRowModel("Retail Menot","https://retailmenot.com",-1 )); - mHintList.add(new historyRowModel("Accuweather","https://accuweather.com",-1 )); - mHintList.add(new historyRowModel("Way Fair","https://wayfair.com",-1 )); - mHintList.add(new historyRowModel("GO","https://go.com",-1 )); - mHintList.add(new historyRowModel("Live","https://live.com",-1 )); - mHintList.add(new historyRowModel("Login Yahoo","https://login.yahoo.com",-1 )); - mHintList.add(new historyRowModel("Steam Community","https://steamcommunity.com",-1 )); - mHintList.add(new historyRowModel("XFinity","https://xfinity.com",-1 )); - mHintList.add(new historyRowModel("CNET","https://cnet.com",-1 )); - mHintList.add(new historyRowModel("IGN","https://ign.com",-1 )); - mHintList.add(new historyRowModel("Steam Powered","https://steampowered.com",-1 )); - mHintList.add(new historyRowModel("Macys","https://macys.com",-1 )); - mHintList.add(new historyRowModel("Wikihow","https://wikihow.com",-1 )); - mHintList.add(new historyRowModel("Mail Yahoo","https://mail.yahoo.com",-1 )); - mHintList.add(new historyRowModel("Wiktionary","https://wiktionary.com",-1 )); - mHintList.add(new historyRowModel("Cbssports","https://cbssports.com",-1 )); - mHintList.add(new historyRowModel("CNBC","https://cnbc.com",-1 )); - mHintList.add(new historyRowModel("Bank Of America","https://bankofamerica.com",-1 )); - mHintList.add(new historyRowModel("Expedia","https://expedia.com",-1 )); - mHintList.add(new historyRowModel("Wellsfargo","https://wellsfargo.com",-1 )); - mHintList.add(new historyRowModel("Groupon","https://groupon.com",-1 )); - mHintList.add(new historyRowModel("Twitch","https://twitch.com",-1 )); - mHintList.add(new historyRowModel("Khan Academy","https://khanacademy.com",-1 )); - mHintList.add(new historyRowModel("The Guardian","https://theguardian.com",-1 )); - mHintList.add(new historyRowModel("Paypal","https://paypal.com",-1 )); - mHintList.add(new historyRowModel("Spotify","https://spotify.com",-1 )); - mHintList.add(new historyRowModel("ATT","https://att.com",-1 )); - mHintList.add(new historyRowModel("NFL","https://nfl.com",-1 )); - mHintList.add(new historyRowModel("Realtor","https://realtor.com",-1 )); - mHintList.add(new historyRowModel("CA Gov","https://ca.gov",-1 )); - mHintList.add(new historyRowModel("Good Reads","https://goodreads.com",-1 )); - mHintList.add(new historyRowModel("Office","https://office.com",-1 )); - mHintList.add(new historyRowModel("UFL","https://ufl.com",-1 )); - mHintList.add(new historyRowModel("MLB","https://mlb.com",-1 )); - mHintList.add(new historyRowModel("Food Network","https://foodnetwork.com",-1 )); - mHintList.add(new historyRowModel("Apartments","https://apartments.com",-1 )); - mHintList.add(new historyRowModel("NPR","https://npr.com",-1 )); - mHintList.add(new historyRowModel("Wow Head","https://wowhead.com",-1 )); - mHintList.add(new historyRowModel("Bing","https://bing.com",-1 )); - mHintList.add(new historyRowModel("Google","https://google.com",-1 )); - mHintList.add(new historyRowModel("Genesis Search","https://genesis.onion",-1 )); + mHintListLocalCache.add(new historyRowModel("Duckduckgo","https://duckduckgo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("BBC","https://bbc.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Youtube","https://youtube.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Facebook","https://facebook.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Twitter","https://twitter.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Amazon","https://amazon.com",-1 )); + mHintListLocalCache.add(new historyRowModel("IMDB","https://imdb.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Reddit","https://reddit.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Pinterest","https://pinterest.com",-1 )); + mHintListLocalCache.add(new historyRowModel("EBay","https://ebay.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Trip Advisor","https://tripadvisor.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Craigslist","https://craigslist.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Walmart","https://walmart.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Instagram","https://instagram.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Google","https://google.com",-1 )); + mHintListLocalCache.add(new historyRowModel("NY Times","https://nytimes.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Apple","https://apple.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Linkedin","https://linkedin.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Play.Google","https://play.google.com",-1 )); + mHintListLocalCache.add(new historyRowModel("ESPN","https://espn.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Webmd","https://webmd.com",-1 )); + mHintListLocalCache.add(new historyRowModel("CNN","https://cnn.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Homedepot","https://homedepot.com",-1 )); + mHintListLocalCache.add(new historyRowModel("ETSY","https://etsy.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Netflix","https://netflix.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Quora","https://quora.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Microsoft","https://microsoft.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Target","https://target.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Merriam Webster","https://merriam-webster.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Forbes","https://forbes.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Mapquest","https://mapquest.com",-1 )); + mHintListLocalCache.add(new historyRowModel("NIH","https://nih.gov",-1 )); + mHintListLocalCache.add(new historyRowModel("Gamepedia","https://gamepedia.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Yahoo","https://yahoo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Healthline","https://healthline.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Foxnews","https://foxnews.com",-1 )); + mHintListLocalCache.add(new historyRowModel("All Recipes","https://allrecipes.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Quizlet","https://quizlet.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Weather","https://weather.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Bestbuy","https://bestbuy.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Urbandictionary","https://urbandictionary.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Mayoclinic","https://mayoclinic.org",-1 )); + mHintListLocalCache.add(new historyRowModel("AOL","https://aol.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Genius","https://genius.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Zillow","https://zillow.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Usatoday","https://usatoday.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Glassdoor","https://glassdoor.com",-1 )); + mHintListLocalCache.add(new historyRowModel("MSN","https://msn.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Rotten Tomatoes","https://rottentomatoes.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Lowes","https://lowes.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Dictionary","https://dictionary.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Business Insider","https://businessinsider.com",-1 )); + mHintListLocalCache.add(new historyRowModel("US News","https://usnews.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Medical News Today","https://medicalnewstoday.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Britannica","https://britannica.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Washington Post","https://washingtonpost.com",-1 )); + mHintListLocalCache.add(new historyRowModel("USPS","https://usps.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Finance Yahoo","https://finance.yahoo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("IRS","https://finance.irs.gov",-1 )); + mHintListLocalCache.add(new historyRowModel("Yellow Pages","https://yellowpages.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Chase","https://chase.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Retail Menot","https://retailmenot.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Accuweather","https://accuweather.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Way Fair","https://wayfair.com",-1 )); + mHintListLocalCache.add(new historyRowModel("GO","https://go.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Live","https://live.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Login Yahoo","https://login.yahoo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Steam Community","https://steamcommunity.com",-1 )); + mHintListLocalCache.add(new historyRowModel("XFinity","https://xfinity.com",-1 )); + mHintListLocalCache.add(new historyRowModel("CNET","https://cnet.com",-1 )); + mHintListLocalCache.add(new historyRowModel("IGN","https://ign.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Steam Powered","https://steampowered.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Macys","https://macys.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Wikihow","https://wikihow.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Mail Yahoo","https://mail.yahoo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Wiktionary","https://wiktionary.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Cbssports","https://cbssports.com",-1 )); + mHintListLocalCache.add(new historyRowModel("CNBC","https://cnbc.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Bank Of America","https://bankofamerica.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Expedia","https://expedia.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Wellsfargo","https://wellsfargo.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Groupon","https://groupon.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Twitch","https://twitch.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Khan Academy","https://khanacademy.com",-1 )); + mHintListLocalCache.add(new historyRowModel("The Guardian","https://theguardian.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Paypal","https://paypal.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Spotify","https://spotify.com",-1 )); + mHintListLocalCache.add(new historyRowModel("ATT","https://att.com",-1 )); + mHintListLocalCache.add(new historyRowModel("NFL","https://nfl.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Realtor","https://realtor.com",-1 )); + mHintListLocalCache.add(new historyRowModel("CA Gov","https://ca.gov",-1 )); + mHintListLocalCache.add(new historyRowModel("Good Reads","https://goodreads.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Office","https://office.com",-1 )); + mHintListLocalCache.add(new historyRowModel("UFL","https://ufl.com",-1 )); + mHintListLocalCache.add(new historyRowModel("MLB","https://mlb.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Food Network","https://foodnetwork.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Apartments","https://apartments.com",-1 )); + mHintListLocalCache.add(new historyRowModel("NPR","https://npr.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Wow Head","https://wowhead.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Bing","https://bing.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Google","https://google.com",-1 )); + mHintListLocalCache.add(new historyRowModel("Genesis Search","https://genesis.onion",-1 )); - return mHintList; + return mHintListLocalCache; } /*External Redirections*/ @@ -240,7 +253,11 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess if(pCommands == dataEnums.eSuggestionCommands.M_GET_SUGGESTIONS) { - return getSuggestions((String) pData.get(0), (ArrayList)pData.get(1), (ArrayList)pData.get(2)); + return getSuggestions((String) pData.get(0), (ArrayList)pData.get(1), (ArrayList)pData.get(2)); + } + else if(pCommands == dataEnums.eSuggestionCommands.M_GET_DEFAULT_SUGGESTION) + { + return getDefaultSuggestions((String) pData.get(0)); } return null; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java index c44dc929..c346e6b1 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/helperManager/helperMethod.java @@ -189,6 +189,20 @@ public class helperMethod context.startActivity(Intent.createChooser(emailIntent, "Send email...")); } + public static void sendCustomMail(Context context, String pURL){ + String mail = pURL.replaceFirst("mailto:", ""); + + Intent selectorIntent = new Intent(Intent.ACTION_SENDTO); + selectorIntent.setData(Uri.parse("mailto:")); + + final Intent emailIntent = new Intent(Intent.ACTION_SEND); + emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{mail}); + emailIntent.putExtra(Intent.EXTRA_SUBJECT, "get bridges"); + emailIntent.putExtra(Intent.EXTRA_TEXT, "get bridges"); + emailIntent.setSelector( selectorIntent ); + context.startActivity(Intent.createChooser(emailIntent, "get transport")); + } + public static void sendBridgeEmail(Context context){ Intent selectorIntent = new Intent(Intent.ACTION_SENDTO); selectorIntent.setData(Uri.parse("mailto:")); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java index fad86c9d..c307776e 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/messageManager.java @@ -339,7 +339,7 @@ class messageManager mDialog.dismiss(); }); mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> { - mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_COPY_LINK); + mEvent.invokeObserver(Collections.singletonList(mData.get(0)), M_OPEN_LINK_NEW_TAB); mDialog.dismiss(); }); mDialog.findViewById(R.id.pOption3).setOnClickListener(v -> { @@ -390,7 +390,6 @@ class messageManager initializeDialog(R.layout.popup_download_full, Gravity.CENTER); ((TextView) mDialog.findViewById(R.id.pHeader)).setText(mTitle); ((TextView) mDialog.findViewById(R.id.pDescription)).setText((data_local)); - mDialog.findViewById(R.id.pDismiss).setOnClickListener(v -> mDialog.dismiss()); mDialog.findViewById(R.id.pOption1).setOnClickListener(v -> { mEvent.invokeObserver(Collections.singletonList(url), M_OPEN_LINK_NEW_TAB); mDialog.dismiss(); diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java index 93d0c306..fe5384c1 100755 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/orbotManager.java @@ -82,7 +82,7 @@ class orbotManager /*Proxy Manager*/ private void onSetProxy(String url){ - if(url.contains("boogle.store")){ + /* if(url.contains("boogle.store")){ PrefsHelper.setPref(keys.PROXY_TYPE, 0); PrefsHelper.setPref(keys.PROXY_SOCKS,null); PrefsHelper.setPref(keys.PROXY_SOCKS_PORT, null); @@ -95,7 +95,13 @@ class orbotManager 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_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); } private void initializeProxy() diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_policy.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_policy.xml new file mode 100644 index 00000000..c1c6bfe8 --- /dev/null +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_policy.xml @@ -0,0 +1,6 @@ + + + + diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_report.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_report.xml index 811e67b8..6dad13de 100644 --- a/app/src/main/res/custom-xml/images/xml/ic_baseline_report.xml +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_report.xml @@ -1,10 +1,5 @@ - - + + diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_sitemap.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_sitemap.xml new file mode 100644 index 00000000..a70b101a --- /dev/null +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_sitemap.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/custom-xml/images/xml/ic_baseline_star_fill.xml b/app/src/main/res/custom-xml/images/xml/ic_baseline_star_fill.xml new file mode 100644 index 00000000..940869ce --- /dev/null +++ b/app/src/main/res/custom-xml/images/xml/ic_baseline_star_fill.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable-anydpi-v24/notification_logo.xml b/app/src/main/res/drawable-anydpi-v24/notification_logo.xml new file mode 100644 index 00000000..2e56bcd1 --- /dev/null +++ b/app/src/main/res/drawable-anydpi-v24/notification_logo.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-hdpi/genesis_logo.png b/app/src/main/res/drawable-hdpi/genesis_logo.png index edafe1c7..1ae787c6 100644 Binary files a/app/src/main/res/drawable-hdpi/genesis_logo.png and b/app/src/main/res/drawable-hdpi/genesis_logo.png differ diff --git a/app/src/main/res/drawable-hdpi/genesis_logo_bordered.png b/app/src/main/res/drawable-hdpi/genesis_logo_bordered.png index 6aa6bcb9..1c3adf7f 100644 Binary files a/app/src/main/res/drawable-hdpi/genesis_logo_bordered.png and b/app/src/main/res/drawable-hdpi/genesis_logo_bordered.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_notifyerr.png b/app/src/main/res/drawable-hdpi/ic_stat_notifyerr.png new file mode 100644 index 00000000..77a5aba0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_stat_notifyerr.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_tor.png b/app/src/main/res/drawable-hdpi/ic_stat_tor.png new file mode 100644 index 00000000..52dde786 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_stat_tor.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_tor_off.png b/app/src/main/res/drawable-hdpi/ic_stat_tor_off.png new file mode 100644 index 00000000..77a5aba0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_stat_tor_off.png differ diff --git a/app/src/main/res/drawable-hdpi/notification_logo.png b/app/src/main/res/drawable-hdpi/notification_logo.png index 135cb03c..701eed46 100644 Binary files a/app/src/main/res/drawable-hdpi/notification_logo.png and b/app/src/main/res/drawable-hdpi/notification_logo.png differ diff --git a/app/src/main/res/drawable-hdpi/splashlogoclip.png b/app/src/main/res/drawable-hdpi/splashlogoclip.png index cdfb0d3f..ed150ba0 100644 Binary files a/app/src/main/res/drawable-hdpi/splashlogoclip.png and b/app/src/main/res/drawable-hdpi/splashlogoclip.png differ diff --git a/app/src/main/res/drawable-ldpi/splashlogoclip.png b/app/src/main/res/drawable-ldpi/splashlogoclip.png index fab8e7c3..60b7e246 100644 Binary files a/app/src/main/res/drawable-ldpi/splashlogoclip.png and b/app/src/main/res/drawable-ldpi/splashlogoclip.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_notifyerr.png b/app/src/main/res/drawable-mdpi/ic_stat_notifyerr.png new file mode 100644 index 00000000..6e1afc1b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_stat_notifyerr.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_tor.png b/app/src/main/res/drawable-mdpi/ic_stat_tor.png new file mode 100644 index 00000000..c87b4212 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_stat_tor.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_tor_off.png b/app/src/main/res/drawable-mdpi/ic_stat_tor_off.png new file mode 100644 index 00000000..6e1afc1b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_stat_tor_off.png differ diff --git a/app/src/main/res/drawable-mdpi/notification_logo.png b/app/src/main/res/drawable-mdpi/notification_logo.png index a28bcb2c..a360f7ff 100644 Binary files a/app/src/main/res/drawable-mdpi/notification_logo.png and b/app/src/main/res/drawable-mdpi/notification_logo.png differ diff --git a/app/src/main/res/drawable-mdpi/splashlogoclip.png b/app/src/main/res/drawable-mdpi/splashlogoclip.png index 82c5cc88..2c508855 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/drawable-xhdpi/ic_stat_notifyerr.png b/app/src/main/res/drawable-xhdpi/ic_stat_notifyerr.png new file mode 100644 index 00000000..ce9a19ac Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_stat_notifyerr.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_tor.png b/app/src/main/res/drawable-xhdpi/ic_stat_tor.png new file mode 100644 index 00000000..a983cc61 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_stat_tor.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_tor_off.png b/app/src/main/res/drawable-xhdpi/ic_stat_tor_off.png new file mode 100644 index 00000000..ce9a19ac Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_stat_tor_off.png differ diff --git a/app/src/main/res/drawable-xhdpi/notification_logo.png b/app/src/main/res/drawable-xhdpi/notification_logo.png index 9e6453ca..7fa68cd9 100644 Binary files a/app/src/main/res/drawable-xhdpi/notification_logo.png and b/app/src/main/res/drawable-xhdpi/notification_logo.png differ diff --git a/app/src/main/res/drawable-xhdpi/splashlogoclip.png b/app/src/main/res/drawable-xhdpi/splashlogoclip.png index 2ea09c64..0e60e2f8 100644 Binary files a/app/src/main/res/drawable-xhdpi/splashlogoclip.png and b/app/src/main/res/drawable-xhdpi/splashlogoclip.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_notifyerr.png b/app/src/main/res/drawable-xxhdpi/ic_stat_notifyerr.png new file mode 100644 index 00000000..1862d95a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_stat_notifyerr.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_tor.png b/app/src/main/res/drawable-xxhdpi/ic_stat_tor.png new file mode 100644 index 00000000..6e448876 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_stat_tor.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_tor_off.png b/app/src/main/res/drawable-xxhdpi/ic_stat_tor_off.png new file mode 100644 index 00000000..1862d95a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_stat_tor_off.png differ diff --git a/app/src/main/res/drawable-xxhdpi/notification_logo.png b/app/src/main/res/drawable-xxhdpi/notification_logo.png index 78edb2eb..7966a86b 100644 Binary files a/app/src/main/res/drawable-xxhdpi/notification_logo.png and b/app/src/main/res/drawable-xxhdpi/notification_logo.png differ diff --git a/app/src/main/res/drawable-xxhdpi/splashlogoclip.png b/app/src/main/res/drawable-xxhdpi/splashlogoclip.png index 05ba9cbb..2d4b6791 100644 Binary files a/app/src/main/res/drawable-xxhdpi/splashlogoclip.png and b/app/src/main/res/drawable-xxhdpi/splashlogoclip.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_stat_notifyerr.png b/app/src/main/res/drawable-xxxhdpi/ic_stat_notifyerr.png new file mode 100644 index 00000000..d000f4cb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_stat_notifyerr.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_stat_tor.png b/app/src/main/res/drawable-xxxhdpi/ic_stat_tor.png new file mode 100644 index 00000000..081d5b53 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_stat_tor.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_stat_tor_off.png b/app/src/main/res/drawable-xxxhdpi/ic_stat_tor_off.png new file mode 100644 index 00000000..d000f4cb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_stat_tor_off.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/notification_logo.png b/app/src/main/res/drawable-xxxhdpi/notification_logo.png index 7c3b530b..d0525c2f 100644 Binary files a/app/src/main/res/drawable-xxxhdpi/notification_logo.png and b/app/src/main/res/drawable-xxxhdpi/notification_logo.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/splashlogoclip.png b/app/src/main/res/drawable-xxxhdpi/splashlogoclip.png index 13269895..7c4c9e0a 100644 Binary files a/app/src/main/res/drawable-xxxhdpi/splashlogoclip.png and b/app/src/main/res/drawable-xxxhdpi/splashlogoclip.png differ diff --git a/app/src/main/res/layouts/alert/layout/popup_abi_error.xml b/app/src/main/res/layouts/alert/layout/popup_abi_error.xml deleted file mode 100644 index 38d256ab..00000000 --- a/app/src/main/res/layouts/alert/layout/popup_abi_error.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/layouts/alert/layout/popup_download_file.xml b/app/src/main/res/layouts/alert/layout/popup_download_file.xml deleted file mode 100644 index 38d256ab..00000000 --- a/app/src/main/res/layouts/alert/layout/popup_download_file.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/layouts/alert/layout/popup_download_full.xml b/app/src/main/res/layouts/alert/layout/popup_download_full.xml index 0d20131a..b08bb5d2 100644 --- a/app/src/main/res/layouts/alert/layout/popup_download_full.xml +++ b/app/src/main/res/layouts/alert/layout/popup_download_full.xml @@ -411,30 +411,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/pDescription" /> - - -