diff --git a/app/build.gradle b/app/build.gradle index 87b751ef..6da88914 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -98,7 +98,7 @@ dependencies { implementation "org.mozilla.components:browser-engine-gecko:75.0.0" implementation "org.mozilla.components:browser-icons:91.0.6" - implementation "org.mozilla.geckoview:geckoview: 90.0.20210705185941" + implementation "org.mozilla.geckoview:geckoview: 97.0.20220202182137" implementation "org.mozilla.components:concept-fetch:91.0.6" implementation "org.mozilla.components:concept-base:91.0.6" implementation "org.mozilla.components:support-utils:91.0.6" diff --git a/app/src/main/assets/Error/error-dark.html b/app/src/main/assets/Error/error-dark.html index 372c766c..26f08ddc 100644 --- a/app/src/main/assets/Error/error-dark.html +++ b/app/src/main/assets/Error/error-dark.html @@ -18,6 +18,19 @@ text-align: center; } +
diff --git a/app/src/main/assets/Error/error.html b/app/src/main/assets/Error/error.html index df56d347..4060fd24 100644 --- a/app/src/main/assets/Error/error.html +++ b/app/src/main/assets/Error/error.html @@ -18,7 +18,21 @@ text-align: center; } + +
@@ -36,6 +50,7 @@
+
\ No newline at end of file diff --git a/app/src/main/assets/Homepage/style/home/cs-sidebar-blade.css b/app/src/main/assets/Homepage/style/home/cs-sidebar-blade.css index 6d2376a7..3a9c0fb7 100644 --- a/app/src/main/assets/Homepage/style/home/cs-sidebar-blade.css +++ b/app/src/main/assets/Homepage/style/home/cs-sidebar-blade.css @@ -16,6 +16,7 @@ cursor: pointer; font-size: 0.90em; padding: 15px 10px 10px; + padding-bottom: 12px; border-bottom: 4px solid #fcfcfc; } .sidebar__catagory:hover{ diff --git a/app/src/main/assets/error/badcert-dark.html b/app/src/main/assets/error/badcert-dark.html new file mode 100644 index 00000000..78c5cdd9 --- /dev/null +++ b/app/src/main/assets/error/badcert-dark.html @@ -0,0 +1,53 @@ + + + + Secure Connection Failed + + + + + + + +
+ +
+

Secure Connection Failed

+

$ERROR_M2

+

$ERROR

+ + + + + +
+ + \ No newline at end of file diff --git a/app/src/main/assets/error/badcert.html b/app/src/main/assets/error/badcert.html new file mode 100644 index 00000000..31c525bc --- /dev/null +++ b/app/src/main/assets/error/badcert.html @@ -0,0 +1,56 @@ + + + + Secure Connection Failed + + + + + + + + +
+ +
+

Secure Connection Failed

+

$ERROR_M2

+

$ERROR

+ + + + +
+ + +
+ + \ No newline at end of file diff --git a/app/src/main/assets/homepage/style/home-dark/cs-sidebar-blade-dark.css b/app/src/main/assets/homepage/style/home-dark/cs-sidebar-blade-dark.css index bc8357d3..58acee42 100644 --- a/app/src/main/assets/homepage/style/home-dark/cs-sidebar-blade-dark.css +++ b/app/src/main/assets/homepage/style/home-dark/cs-sidebar-blade-dark.css @@ -16,6 +16,7 @@ cursor: pointer; font-size: 0.90em; padding: 15px 10px 10px; + padding-bottom: 12px; border-bottom: 4px solid #18171c; } .sidebar__catagory:hover{ diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoClients.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoClients.java index 63ef552c..f6160b22 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoClients.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoClients.java @@ -107,7 +107,7 @@ public class geckoClients loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext); }else { String mURL = mSession.getCurrentURL(); - if(mURL.equals("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mURL.startsWith(CONST_GENESIS_URL_CACHED) || mURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){ + if(mURL.equals("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mURL.startsWith(CONST_GENESIS_URL_CACHED) || mURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){ if(!mSession.canGoBack()){ mNestedGeckoView.releaseSession(); mSession.close(); @@ -116,7 +116,7 @@ public class geckoClients }else { mSession.goBack(); } - loadURL("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion", mNestedGeckoView, pcontext); + loadURL("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion", mNestedGeckoView, pcontext); } } } @@ -381,13 +381,14 @@ public class geckoClients } public void loadURL(String url, NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext) { + url = helperMethod.completeURL(url); mSession = (geckoSession)mNestedGeckoView.getSession(); if(mSession==null){ return; } if(mSession.onGetInitializeFromStartup()){ mSession.initURL(url); - if(!url.startsWith(CONST_REPORT_URL) && (url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?pG") || url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion?pG") || url.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || url.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED))){ + if(!url.startsWith(CONST_REPORT_URL) && (url.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?pG") || url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion?pG") || url.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || url.endsWith(constants.CONST_GENESIS_DOMAIN_URL_SLASHED))){ try{ mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL); if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(pcontext)){ @@ -527,7 +528,7 @@ public class geckoClients public void onReload(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext, boolean isThemeCall){ mSession.stop(); String url = mSession.getCurrentURL(); - if(url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?pG") || url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion?pG") || url.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || url.contains(constants.CONST_GENESIS_HELP_URL_SUB) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(url.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?pG") || url.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion?pG") || url.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || url.contains(constants.CONST_GENESIS_HELP_URL_SUB) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE) || url.contains(constants.CONST_GENESIS_HELP_URL_CACHE_DARK)){ loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext); }else if(!isThemeCall){ mSession.reload(); diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoSession.java index fb0149e6..e00011a0 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoSession.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/geckoManager/geckoSession.java @@ -22,6 +22,8 @@ import android.util.Base64; import android.util.Log; import android.view.autofill.AutofillManager; import android.view.autofill.AutofillValue; + +import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; @@ -69,6 +71,8 @@ import java.util.Date; import java.util.List; import java.util.Objects; +import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_BADCERT_CACHED; +import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_BADCERT_CACHED_DARK; import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_ERROR_CACHED; import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_ERROR_CACHED_DARK; import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_HELP_URL_CACHE; @@ -326,9 +330,14 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,true); if(mIsLoaded){ + if(helperMethod.getHost(var2).endsWith(".onion")){ + var2 = var2.replace("www.",""); + } + mCurrentURL = var2; - if(!var2.equals("about:blank")){ - event.invokeObserver(Arrays.asList(var2,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); + + if(!mCurrentURL.equals("about:blank")){ + event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR); mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update)); } if(!isPageLoading){ @@ -337,7 +346,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes mThemeChanged = false; } isPageLoading = true; - if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){ + if(!mCurrentURL.equals("about:blank") && !mCurrentTitle.equals("loading")){ mProgress = 5; mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update)); mThemeChanged = false; @@ -497,7 +506,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes }catch (Exception ignored){} if(wasBackPressed && mPastURLVerify){ - if(var2.equals("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || var2.startsWith(CONST_GENESIS_URL_CACHED) || var2.startsWith(CONST_GENESIS_URL_CACHED_DARK)){ + if(var2.equals("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || var2.startsWith(CONST_GENESIS_URL_CACHED) || var2.startsWith(CONST_GENESIS_URL_CACHED_DARK)){ if(var2.startsWith(CONST_GENESIS_URL_CACHED_DARK) && (status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get()))){ isPageLoading = false; event.invokeObserver(null, enums.etype.M_CHANGE_HOME_THEME); @@ -547,48 +556,53 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes public GeckoResult onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) { - if(var1.uri.endsWith("genesisconfigurenewidentity.com/")){ + String m_url = var1.uri; + if(helperMethod.getHost(m_url).endsWith(".onion")){ + m_url = m_url.replace("www.",""); + } + + if(m_url.endsWith("genesisconfigurenewidentity.com/")){ initURL(mPrevURL); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY_MESSAGED); return GeckoResult.fromValue(AllowOrDeny.DENY); } - String mNormalizeURL = helperMethod.normalize(var1.uri); + String mNormalizeURL = helperMethod.normalize(m_url); if(mNormalizeURL!=null && mNormalizeURL.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ initURL(constants.CONST_GENESIS_DOMAIN_URL); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS); return GeckoResult.fromValue(AllowOrDeny.DENY); } - if(!var1.uri.contains(constants.CONST_GENESIS_GMT_TIME_GET_KEY) && !var1.uri.startsWith(CONST_GENESIS_URL_CACHED) && !var1.uri.startsWith(CONST_GENESIS_URL_CACHED_DARK) && var1.uri.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){ + if(!m_url.contains(constants.CONST_GENESIS_GMT_TIME_GET_KEY) && !m_url.startsWith(CONST_GENESIS_URL_CACHED) && !m_url.startsWith(CONST_GENESIS_URL_CACHED_DARK) && var1.uri.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY) && !var1.uri.contains(constants.CONST_GENESIS_LOCAL_TIME_GET_KEY)){ - String mVerificationURL = setGenesisVerificationToken(var1.uri); + String mVerificationURL = setGenesisVerificationToken(m_url); initURL(mVerificationURL); 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); + else if(m_url.startsWith("mailto")){ + event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.M_ON_MAIL); return GeckoResult.fromValue(AllowOrDeny.ALLOW); } - else if(var1.uri.contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/advert__")){ - event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load); + else if(m_url.contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/advert__")){ + event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.on_playstore_load); return GeckoResult.fromValue(AllowOrDeny.DENY); } - else if(var1.uri.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED) || var1.uri.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?")){ + else if(m_url.equals(constants.CONST_GENESIS_DOMAIN_URL_SLASHED) || m_url.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/?")){ initURL(constants.CONST_GENESIS_DOMAIN_URL); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS); return GeckoResult.fromValue(AllowOrDeny.DENY); } - else if(var1.uri.equals("about:blank") && mIsLoaded){ + else if(m_url.equals("about:blank") && mIsLoaded){ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE); return GeckoResult.fromValue(AllowOrDeny.ALLOW); } else if(var1.target==2){ - event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.open_new_tab); + event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.open_new_tab); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR); return GeckoResult.fromValue(AllowOrDeny.DENY); } - else if(!var1.uri.equals("about:blank")){ + else if(!m_url.equals("about:blank")){ if(mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){ setURL(constants.CONST_GENESIS_DOMAIN_URL); }else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){ @@ -597,11 +611,11 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes }else { setURL(constants.CONST_GENESIS_HELP_URL_CACHE_DARK); } - }else if(!var1.uri.startsWith("resource://android/assets/homepage/")){ - setURL(var1.uri); + }else if(!m_url.startsWith("resource://android/assets/homepage/")){ + setURL(m_url); } - event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.start_proxy); + event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.start_proxy); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.search_update); /* Its Absence causes delay on first launch*/ @@ -644,6 +658,15 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes public GeckoResult onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) { + + if(helperMethod.getHost(var2).endsWith(".onion")){ + var2 = var2.replace("www.",""); + } + + if(var2.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd")){ + var2 = var2.replace("https","http"); + mCurrentURL = var2; + } if(mCurrentURL.contains("genesis.onion")){ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY); } @@ -656,10 +679,19 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes InputStream mResourceURL = null; try { - if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get())){ - mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED); - }else { - mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED_DARK); + if(var3.code==50){ + if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get())){ + mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_BADCERT_CACHED); + }else { + mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_BADCERT_CACHED_DARK); + } + } + else { + if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get())){ + mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED); + }else { + mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED_DARK); + } } }catch (Exception ex){ Log.i("asd","asd : " + ex.getMessage()); @@ -1063,6 +1095,9 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes } public void setURL(String pURL){ + if(helperMethod.getHost(pURL).endsWith(".onion")){ + pURL = pURL.replace("www.",""); + } mCurrentURL = pURL; } diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/homeController/homeController.java index b9b88746..61233278 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/homeController/homeController.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/appManager/homeManager/homeController/homeController.java @@ -1211,7 +1211,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba new Handler().postDelayed(() -> { dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false)); - if(status.sSettingDefaultSearchEngine.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(status.sSettingDefaultSearchEngine.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } @@ -1219,7 +1219,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoClient.resetSession(); mHomeViewController.onUpdateSearchBar(helperMethod.getDomainName(mHomeModel.getSearchEngine()), false, false,false); - if(status.sSettingDefaultSearchEngine.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ + if(status.sSettingDefaultSearchEngine.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ mHomeViewController.progressBarReset(); }else { mHomeViewController.onProgressBarUpdate(5, true); @@ -1235,7 +1235,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba } public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){ - if(status.sSettingDefaultSearchEngine.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(status.sSettingDefaultSearchEngine.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } @@ -1243,7 +1243,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba mGeckoClient.resetSession(); mHomeViewController.onUpdateSearchBar(helperMethod.getDomainName(mHomeModel.getSearchEngine()), false, false,false); - if(status.sSettingDefaultSearchEngine.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ + if(status.sSettingDefaultSearchEngine.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ mHomeViewController.progressBarReset(); }else { mHomeViewController.onProgressBarUpdate(5, true); @@ -1264,7 +1264,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba handler.postDelayed(() -> { onGetThumbnail(null, false); mHomeViewController.expandTopBar(false,mGeckoView.getMaxY()); - if(status.sSettingDefaultSearchEngine.startsWith("https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ + if(status.sSettingDefaultSearchEngine.startsWith("http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || !status.sOpenURLInNewTab || mGeckoClient.getSession().getCurrentURL().equals("about:blank") || mGeckoClient.getSession().getCurrentURL().contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion") || mGeckoClient.wasPreviousErrorPage() || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) || mGeckoClient.getSession().getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){ mHomeViewController.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED)); } mHomeViewController.onNewTabAnimation(Collections.singletonList(url), M_INITIALIZE_TAB_LINK); diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/constants/constants.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/constants/constants.java index e645ca49..85132e3a 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/constants/constants.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/constants/constants.java @@ -9,8 +9,8 @@ public class constants public static final String CONST_SAMSUNG_URL = "http://www.samsungapps.com/appquery/appDetail.as?appId=com.hiddenservices.genesissearchengine.production"; public static final String CONST_PRIVACY_POLICY_URL = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/privacy"; - public static final String CONST_REPORT_URL = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/reportus?url="; - public static final String CONST_SITEMAP = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/create"; + public static final String CONST_REPORT_URL = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/reportus?url="; + public static final String CONST_SITEMAP = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/create"; public static final String CONST_PACKAGE_NAME = "com.hiddenservices.genesissearchengine.production"; public static final String CONST_GENESIS_ONION = "genesis.onion"; public static final String CONST_GENESIS_ONION_V2 = "trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion"; @@ -33,8 +33,10 @@ public class constants public static final String CONST_GENESIS_URL_CACHED_DARK = "resource://android/assets/homepage/homepage-dark.html"; public static final String CONST_GENESIS_ERROR_CACHED = "error/error.html"; public static final String CONST_GENESIS_ERROR_CACHED_DARK = "error/error-dark.html"; - public static final String CONST_GENESIS_DOMAIN_URL_SLASHED = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/"; - public static final String CONST_GENESIS_DOMAIN_URL = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion"; + public static final String CONST_GENESIS_BADCERT_CACHED = "error/badcert.html"; + public static final String CONST_GENESIS_BADCERT_CACHED_DARK = "error/badcert-dark.html"; + public static final String CONST_GENESIS_DOMAIN_URL_SLASHED = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/"; + public static final String CONST_GENESIS_DOMAIN_URL = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion"; public static final String CONST_GENESIS_LOCAL_TIME_GET_KEY = "pLocalTimeVerificationToken"; public static final String CONST_GENESIS_GMT_TIME_GET_KEY = "pSecretToken"; public static final String CONST_GENESIS_HELP_URL_CACHE = "resource://android/assets/help/help.html"; diff --git a/app/src/main/java/com/hiddenservices/genesissearchengine.production/helperManager/helperMethod.java b/app/src/main/java/com/hiddenservices/genesissearchengine.production/helperManager/helperMethod.java index a487a367..64c269ab 100644 --- a/app/src/main/java/com/hiddenservices/genesissearchengine.production/helperManager/helperMethod.java +++ b/app/src/main/java/com/hiddenservices/genesissearchengine.production/helperManager/helperMethod.java @@ -218,14 +218,17 @@ public class helperMethod if(pURL.startsWith("www")){ pURL = "http://"+pURL; }else { - pURL = "http://www."+pURL; + pURL = "http://"+pURL; } }else { + if(pURL.startsWith("https://")){ + return pURL; + } pURL = pURL.replace("https://","").replace("http://",""); if(pURL.startsWith("www")){ pURL = "http://"+pURL; }else { - pURL = "http://www."+pURL; + pURL = "http://"+pURL; } } return pURL;