Bug Fixes

Bug Fixes
master
Abdul Mannan 2022-02-16 17:40:39 +05:00
parent bef7e1e780
commit 46b3e4296c
12 changed files with 219 additions and 39 deletions

View File

@ -98,7 +98,7 @@ dependencies {
implementation "org.mozilla.components:browser-engine-gecko:75.0.0" implementation "org.mozilla.components:browser-engine-gecko:75.0.0"
implementation "org.mozilla.components:browser-icons:91.0.6" 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-fetch:91.0.6"
implementation "org.mozilla.components:concept-base:91.0.6" implementation "org.mozilla.components:concept-base:91.0.6"
implementation "org.mozilla.components:support-utils:91.0.6" implementation "org.mozilla.components:support-utils:91.0.6"

View File

@ -18,6 +18,19 @@
text-align: center; text-align: center;
} }
</style> </style>
<script type="text/javascript">
var advancedVisible = false;
function acceptAndContinue(temporary) {
document.addCertException(temporary).then(() => {
location.reload();
},
err => {
console.error("Unexpected error: " + err)
}
);
}
</script>
</head> </head>
<body style="background : black"> <body style="background : black">
<div class="container"> <div class="container">

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,7 @@
cursor: pointer; cursor: pointer;
font-size: 0.90em; font-size: 0.90em;
padding: 15px 10px 10px; padding: 15px 10px 10px;
padding-bottom: 12px;
border-bottom: 4px solid #fcfcfc; border-bottom: 4px solid #fcfcfc;
} }
.sidebar__catagory:hover{ .sidebar__catagory:hover{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,7 @@
cursor: pointer; cursor: pointer;
font-size: 0.90em; font-size: 0.90em;
padding: 15px 10px 10px; padding: 15px 10px 10px;
padding-bottom: 12px;
border-bottom: 4px solid #18171c; border-bottom: 4px solid #18171c;
} }
.sidebar__catagory:hover{ .sidebar__catagory:hover{

View File

@ -107,7 +107,7 @@ public class geckoClients
loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext); loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
}else { }else {
String mURL = mSession.getCurrentURL(); 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()){ if(!mSession.canGoBack()){
mNestedGeckoView.releaseSession(); mNestedGeckoView.releaseSession();
mSession.close(); mSession.close();
@ -116,7 +116,7 @@ public class geckoClients
}else { }else {
mSession.goBack(); 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) { public void loadURL(String url, NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext) {
url = helperMethod.completeURL(url);
mSession = (geckoSession)mNestedGeckoView.getSession(); mSession = (geckoSession)mNestedGeckoView.getSession();
if(mSession==null){ if(mSession==null){
return; return;
} }
if(mSession.onGetInitializeFromStartup()){ if(mSession.onGetInitializeFromStartup()){
mSession.initURL(url); 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{ try{
mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL); mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL);
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(pcontext)){ 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){ public void onReload(NestedGeckoView mNestedGeckoView, AppCompatActivity pcontext, boolean isThemeCall){
mSession.stop(); mSession.stop();
String url = mSession.getCurrentURL(); 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); loadURL(mSession.getCurrentURL(), mNestedGeckoView, pcontext);
}else if(!isThemeCall){ }else if(!isThemeCall){
mSession.reload(); mSession.reload();

View File

@ -22,6 +22,8 @@ import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.view.autofill.AutofillManager; import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue; import android.view.autofill.AutofillValue;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.UiThread; import androidx.annotation.UiThread;
@ -69,6 +71,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; 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;
import static com.hiddenservices.genesissearchengine.production.constants.constants.CONST_GENESIS_ERROR_CACHED_DARK; 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; 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); PrefsHelper.setPref(keys.PROXY_SOCKS_REMOTE_DNS,true);
if(mIsLoaded){ if(mIsLoaded){
if(helperMethod.getHost(var2).endsWith(".onion")){
var2 = var2.replace("www.","");
}
mCurrentURL = var2; 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)); mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update));
} }
if(!isPageLoading){ if(!isPageLoading){
@ -337,7 +346,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
mThemeChanged = false; mThemeChanged = false;
} }
isPageLoading = true; isPageLoading = true;
if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){ if(!mCurrentURL.equals("about:blank") && !mCurrentTitle.equals("loading")){
mProgress = 5; mProgress = 5;
mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update)); mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update));
mThemeChanged = false; mThemeChanged = false;
@ -497,7 +506,7 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
}catch (Exception ignored){} }catch (Exception ignored){}
if(wasBackPressed && mPastURLVerify){ 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()))){ if(var2.startsWith(CONST_GENESIS_URL_CACHED_DARK) && (status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get()))){
isPageLoading = false; isPageLoading = false;
event.invokeObserver(null, enums.etype.M_CHANGE_HOME_THEME); event.invokeObserver(null, enums.etype.M_CHANGE_HOME_THEME);
@ -547,48 +556,53 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
public GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession var2, @NonNull GeckoSession.NavigationDelegate.LoadRequest var1) { public GeckoResult<AllowOrDeny> 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); initURL(mPrevURL);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY_MESSAGED); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY_MESSAGED);
return GeckoResult.fromValue(AllowOrDeny.DENY); return GeckoResult.fromValue(AllowOrDeny.DENY);
} }
String mNormalizeURL = helperMethod.normalize(var1.uri); String mNormalizeURL = helperMethod.normalize(m_url);
if(mNormalizeURL!=null && mNormalizeURL.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){ if(mNormalizeURL!=null && mNormalizeURL.endsWith("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion")){
initURL(constants.CONST_GENESIS_DOMAIN_URL); initURL(constants.CONST_GENESIS_DOMAIN_URL);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS);
return GeckoResult.fromValue(AllowOrDeny.DENY); 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); initURL(mVerificationURL);
loadUri(mVerificationURL); loadUri(mVerificationURL);
return GeckoResult.fromValue(AllowOrDeny.DENY); return GeckoResult.fromValue(AllowOrDeny.DENY);
} }
else if(var1.uri.startsWith("mailto")){ else if(m_url.startsWith("mailto")){
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.M_ON_MAIL); event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.M_ON_MAIL);
return GeckoResult.fromValue(AllowOrDeny.ALLOW); return GeckoResult.fromValue(AllowOrDeny.ALLOW);
} }
else if(var1.uri.contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/advert__")){ else if(m_url.contains("trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/advert__")){
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.on_playstore_load); event.invokeObserver(Arrays.asList(m_url,mSessionID), enums.etype.on_playstore_load);
return GeckoResult.fromValue(AllowOrDeny.DENY); 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); initURL(constants.CONST_GENESIS_DOMAIN_URL);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_LOAD_HOMEPAGE_GENESIS);
return GeckoResult.fromValue(AllowOrDeny.DENY); 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, mTheme), enums.etype.ON_EXPAND_TOP_BAR);
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, false), enums.etype.M_ON_BANNER_UPDATE);
return GeckoResult.fromValue(AllowOrDeny.ALLOW); return GeckoResult.fromValue(AllowOrDeny.ALLOW);
} }
else if(var1.target==2){ 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); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.ON_EXPAND_TOP_BAR);
return GeckoResult.fromValue(AllowOrDeny.DENY); 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)){ if(mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
setURL(constants.CONST_GENESIS_DOMAIN_URL); setURL(constants.CONST_GENESIS_DOMAIN_URL);
}else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){ }else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
@ -597,11 +611,11 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
}else { }else {
setURL(constants.CONST_GENESIS_HELP_URL_CACHE_DARK); setURL(constants.CONST_GENESIS_HELP_URL_CACHE_DARK);
} }
}else if(!var1.uri.startsWith("resource://android/assets/homepage/")){ }else if(!m_url.startsWith("resource://android/assets/homepage/")){
setURL(var1.uri); 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); event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID), enums.etype.search_update);
/* Its Absence causes delay on first launch*/ /* Its Absence causes delay on first launch*/
@ -644,6 +658,15 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
public GeckoResult<String> onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) { public GeckoResult<String> 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")){ if(mCurrentURL.contains("genesis.onion")){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, mTheme), enums.etype.M_NEW_IDENTITY); 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; InputStream mResourceURL = null;
try { try {
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get())){ if(var3.code==50){
mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED); if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext.get())){
}else { mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_BADCERT_CACHED);
mResourceURL = mContext.get().getResources().getAssets().open(CONST_GENESIS_ERROR_CACHED_DARK); }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){ }catch (Exception ex){
Log.i("asd","asd : " + ex.getMessage()); Log.i("asd","asd : " + ex.getMessage());
@ -1063,6 +1095,9 @@ geckoSession extends GeckoSession implements GeckoSession.MediaDelegate,GeckoSes
} }
public void setURL(String pURL){ public void setURL(String pURL){
if(helperMethod.getHost(pURL).endsWith(".onion")){
pURL = pURL.replace("www.","");
}
mCurrentURL = pURL; mCurrentURL = pURL;
} }

View File

@ -1211,7 +1211,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
new Handler().postDelayed(() -> new Handler().postDelayed(() ->
{ {
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false)); 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)); 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(); mGeckoClient.resetSession();
mHomeViewController.onUpdateSearchBar(helperMethod.getDomainName(mHomeModel.getSearchEngine()), false, false,false); 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(); mHomeViewController.progressBarReset();
}else { }else {
mHomeViewController.onProgressBarUpdate(5, true); mHomeViewController.onProgressBarUpdate(5, true);
@ -1235,7 +1235,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
} }
public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){ 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)); 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(); mGeckoClient.resetSession();
mHomeViewController.onUpdateSearchBar(helperMethod.getDomainName(mHomeModel.getSearchEngine()), false, false,false); 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(); mHomeViewController.progressBarReset();
}else { }else {
mHomeViewController.onProgressBarUpdate(5, true); mHomeViewController.onProgressBarUpdate(5, true);
@ -1264,7 +1264,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
handler.postDelayed(() -> { handler.postDelayed(() -> {
onGetThumbnail(null, false); onGetThumbnail(null, false);
mHomeViewController.expandTopBar(false,mGeckoView.getMaxY()); 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.updateBannerAdvertStatus(false, (boolean)pluginController.getInstance().onAdsInvoke(null, pluginEnums.eAdManager.M_IS_ADVERT_LOADED));
} }
mHomeViewController.onNewTabAnimation(Collections.singletonList(url), M_INITIALIZE_TAB_LINK); mHomeViewController.onNewTabAnimation(Collections.singletonList(url), M_INITIALIZE_TAB_LINK);

View File

@ -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_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_PRIVACY_POLICY_URL = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/privacy";
public static final String CONST_REPORT_URL = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/reportus?url="; public static final String CONST_REPORT_URL = "http://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/reportus?url=";
public static final String CONST_SITEMAP = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion/create"; 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_PACKAGE_NAME = "com.hiddenservices.genesissearchengine.production";
public static final String CONST_GENESIS_ONION = "genesis.onion"; public static final String CONST_GENESIS_ONION = "genesis.onion";
public static final String CONST_GENESIS_ONION_V2 = "trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.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_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 = "error/error.html";
public static final String CONST_GENESIS_ERROR_CACHED_DARK = "error/error-dark.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_BADCERT_CACHED = "error/badcert.html";
public static final String CONST_GENESIS_DOMAIN_URL = "https://trcip42ymcgvv5hsa7nxpwdnott46ebomnn5pm5lovg5hpszyo4n35yd.onion"; 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_LOCAL_TIME_GET_KEY = "pLocalTimeVerificationToken";
public static final String CONST_GENESIS_GMT_TIME_GET_KEY = "pSecretToken"; 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"; public static final String CONST_GENESIS_HELP_URL_CACHE = "resource://android/assets/help/help.html";

View File

@ -218,14 +218,17 @@ public class helperMethod
if(pURL.startsWith("www")){ if(pURL.startsWith("www")){
pURL = "http://"+pURL; pURL = "http://"+pURL;
}else { }else {
pURL = "http://www."+pURL; pURL = "http://"+pURL;
} }
}else { }else {
if(pURL.startsWith("https://")){
return pURL;
}
pURL = pURL.replace("https://","").replace("http://",""); pURL = pURL.replace("https://","").replace("http://","");
if(pURL.startsWith("www")){ if(pURL.startsWith("www")){
pURL = "http://"+pURL; pURL = "http://"+pURL;
}else { }else {
pURL = "http://www."+pURL; pURL = "http://"+pURL;
} }
} }
return pURL; return pURL;