Bug Fixes

Bug Fixes
master
msmannan00 2021-03-25 02:13:45 +05:00
parent ea74b226c2
commit fc79df39a9
28 changed files with 459 additions and 171 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@
.hi_logo_text{
max-width: 450px;
width: 65%;
width: 90%;
height: auto;
display: block;
margin-top: -20px;

View File

@ -26,6 +26,7 @@ import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.editTextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
import com.darkweb.genesissearchengine.appManager.tabManager.tabEnums;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.sql;
@ -177,6 +178,30 @@ public class bookmarkController extends AppCompatActivity
mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.ON_CLOSE,Collections.singletonList(position));
}
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
boolean mStatus = (boolean) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_STATUS, null);
if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
if(mStatus){
return 0;
}
else {
final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
final int swipeFlags = 0;
return makeMovementFlags(swipeFlags, dragFlags);
}
} else {
if(mStatus){
return 0;
}
else {
final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
final int swipeFlags = 0;
return makeMovementFlags(swipeFlags, dragFlags);
}
}
}
@Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
Canvas mCanvas = (Canvas) mbookmarkViewController.onTrigger(bookmarkEnums.eBookmarkViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState));
@ -263,7 +288,7 @@ public class bookmarkController extends AppCompatActivity
public void onOpenMultipleTabs(View view) {
ArrayList<String> m_long_selected_urk = (ArrayList<String>) mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.GET_LONG_SELECTED_URL, null);
for(int m_counter=0;m_counter<m_long_selected_urk.size();m_counter++){
mHomeController.postNewLinkTabAnimation(m_long_selected_urk.get(m_counter));
mHomeController.postNewLinkTabAnimation(m_long_selected_urk.get(m_counter), false);
}
onBackPressed(null);
mbookmarkAdapter.onTrigger(bookmarkEnums.eBookmarkAdapterCommands.M_CLEAR_LONG_SELECTED_URL,null);

View File

@ -24,6 +24,7 @@ import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkEnums;
import com.darkweb.genesissearchengine.appManager.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.editTextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
@ -212,6 +213,30 @@ public class historyController extends AppCompatActivity
mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.ON_CLOSE,Collections.singletonList(position));
}
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
boolean mStatus = (boolean) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_STATUS, null);
if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
if(mStatus){
return 0;
}
else {
final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
final int swipeFlags = 0;
return makeMovementFlags(swipeFlags, dragFlags);
}
} else {
if(mStatus){
return 0;
}
else {
final int dragFlags = ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
final int swipeFlags = 0;
return makeMovementFlags(swipeFlags, dragFlags);
}
}
}
@Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
Canvas mCanvas = (Canvas) mHistoryViewController.onTrigger(historyEnums.eHistoryViewCommands.ON_GENERATE_SWIPABLE_BACKGROUND, Arrays.asList(c, viewHolder, dX, actionState));
@ -307,7 +332,7 @@ public class historyController extends AppCompatActivity
public void onOpenMultipleTabs(View view) {
ArrayList<String> m_long_selected_urk = (ArrayList<String>) mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.GET_LONG_SELECTED_URL, null);
for(int m_counter=0;m_counter<m_long_selected_urk.size();m_counter++){
mHomeController.postNewLinkTabAnimation(m_long_selected_urk.get(m_counter));
mHomeController.postNewLinkTabAnimation(m_long_selected_urk.get(m_counter), false);
}
onBackPressed(null);
mHistoryAdapter.onTrigger(historyEnums.eHistoryAdapterCommands.M_CLEAR_LONG_SELECTED_URL,null);
@ -394,7 +419,7 @@ public class historyController extends AppCompatActivity
}
else if(e_type.equals(enums.etype.url_triggered_new_tab)){
String url_temp = helperMethod.completeURL(data.get(0).toString());
mHomeController.postNewLinkTabAnimation(url_temp);
mHomeController.postNewLinkTabAnimation(url_temp,false);
finish();
}
else if(e_type.equals(enums.etype.fetch_favicon)){

View File

@ -198,10 +198,14 @@ public class geckoClients
mSession.initURL(constants.CONST_GENESIS_DOMAIN_URL);
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(context)){
String mURL = constants.CONST_GENESIS_URL_CACHED + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
mSession.getSettings().setAllowJavascript(true);
mSession.loadUri(mURL);
return;
}else {
String mURL = constants.CONST_GENESIS_URL_CACHED_DARK + "?pData="+ dataController.getInstance().invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands.M_FETCH,null);
mSession.getSettings().setAllowJavascript(true);
mSession.loadUri(mURL);
return;
}
}catch (Exception ex){
ex.printStackTrace();
@ -211,9 +215,13 @@ public class geckoClients
mSession.initURL(constants.CONST_GENESIS_HELP_URL);
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(context)){
mSession.getSettings().setAllowJavascript(true);
mSession.loadUri(constants.CONST_GENESIS_HELP_URL_CACHE);
return;
}else {
mSession.getSettings().setAllowJavascript(true);
mSession.loadUri(constants.CONST_GENESIS_HELP_URL_CACHE_DARK);
return;
}
}catch (Exception ex){
ex.printStackTrace();
@ -221,6 +229,7 @@ public class geckoClients
}else {
mSession.loadUri(url);
}
mSession.getSettings().setAllowJavascript(status.sSettingJavaStatus);
}
}
@ -254,7 +263,11 @@ public class geckoClients
mSession.goBackSession();
}
else if(isFinishAllowed){
event.invokeObserver(null, enums.etype.back_list_empty);
if(mSession.getRemovableFromBackPressed()){
event.invokeObserver(null, enums.etype.M_CLOSE_TAB);
}else {
event.invokeObserver(null, enums.etype.back_list_empty);
}
}
}
@ -288,6 +301,10 @@ public class geckoClients
}
}
public void setRemovableFromBackPressed(boolean pStatus){
mSession.setRemovableFromBackPressed(pStatus);
}
public void onStop(){
mSession.stop();

View File

@ -94,6 +94,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
private geckoDownloadManager mDownloadManager;
private String mTheme = null;
private boolean mPreviousErrorPage = false;
private boolean mRemovableFromBackPressed = false;
/*Temp Variables*/
private GeckoSession.HistoryDelegate.HistoryList mHistoryList = null;
@ -164,7 +165,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
void initURL(String url){
if(mIsLoaded){
isPageLoading = true;
mCurrentURL = url;
setURL(url);
mCurrentTitle = mCurrentURL;
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle), enums.etype.on_update_suggestion);
@ -326,16 +327,16 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
m_current_url_id = (int)event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.on_update_history);
}
if(newUrl.startsWith(CONST_GENESIS_URL_CACHED) || newUrl.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL;
setURL(constants.CONST_GENESIS_DOMAIN_URL);
}
else if(newUrl.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext)){
mCurrentURL = constants.CONST_GENESIS_HELP_URL;
setURL(constants.CONST_GENESIS_HELP_URL);
}else {
mCurrentURL = constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
setURL(constants.CONST_GENESIS_HELP_URL_CACHE_DARK);
}
}else {
mCurrentURL = newUrl;
}else if(!newUrl.equals("about:blank")){
setURL(newUrl);
}
if(!mCurrentURL.equals("about:blank")){
event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
@ -386,15 +387,15 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
}
else if(!var1.uri.equals("about:blank")){
if(mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED) || mCurrentURL.startsWith(CONST_GENESIS_URL_CACHED_DARK)){
mCurrentURL = constants.CONST_GENESIS_DOMAIN_URL;
setURL(constants.CONST_GENESIS_DOMAIN_URL);
}else if(mCurrentURL.equals(constants.CONST_GENESIS_HELP_URL_CACHE)){
if(status.sTheme == enums.Theme.THEME_LIGHT || helperMethod.isDayMode(mContext)){
mCurrentURL = constants.CONST_GENESIS_HELP_URL;
setURL(constants.CONST_GENESIS_HELP_URL);
}else {
mCurrentURL = constants.CONST_GENESIS_HELP_URL_CACHE_DARK;
setURL(constants.CONST_GENESIS_HELP_URL_CACHE_DARK);
}
}else{
mCurrentURL = var1.uri;
setURL(var1.uri);
}
event.invokeObserver(Arrays.asList(var1.uri,mSessionID), enums.etype.start_proxy);
@ -702,7 +703,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
public String getCurrentURL(){
if(mCurrentURL.equals("resource://android/assets/Homepage/homepage.html")){
mCurrentURL = "https://boogle.store";
setURL("https://boogle.store");
}
return mCurrentURL;
}
@ -723,6 +724,14 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
mCurrentURL = pURL;
}
public void setRemovableFromBackPressed(boolean pStatus){
mRemovableFromBackPressed = pStatus;
}
public boolean getRemovableFromBackPressed(){
return mRemovableFromBackPressed;
}
public void setTheme(String pTheme){
mTheme = pTheme;
}

View File

@ -9,16 +9,13 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.speech.RecognizerIntent;
@ -35,7 +32,6 @@ import android.webkit.URLUtil;
import android.widget.*;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
@ -306,17 +302,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.mThemeApplying = false;
}
public void onInitDefaultTab(){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model!=null){
if(!mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
onLoadTab(model.getSession(),true,true);
}
}else {
postNewTabAnimation(false, false);
}
}
@SuppressLint("ClickableViewAccessibility")
private void initSuggestionView(ArrayList<historyRowModel> pList, String pSearch){
hintAdapter mAdapter = new hintAdapter(pList,new hintViewCallback(), this, pSearch);
@ -370,10 +355,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
}
public void onRedrawXML(){
setContentView(R.layout.home_view);
}
public void initializeAppModel()
{
mHomeViewController = new homeViewController();
@ -468,12 +449,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void initializeGeckoView(boolean isForced, boolean pDatabaseSavable){
mGeckoClient.initialize(mGeckoView, new geckoViewCallback(), this,isForced);
onSaveCurrentTab(mGeckoClient.getSession(),pDatabaseSavable);
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null));
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false);
}
public void initTab(boolean isKeyboardOpened){
postNewTabAnimation(isKeyboardOpened, false);
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null));
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false);
}
@Override
@ -497,7 +478,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
try{
mRenderedBitmap = mGeckoView.capturePixels();
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, pImageView, mGeckoView, pLoadTabView));
}catch (Exception ignored){}
}catch (Exception ex){
ex.printStackTrace();
if(pLoadTabView){
onOpenTabReady();
}
}
}
@ -526,7 +512,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onLoadURL(String url){
mAppBar.animate().cancel();
mHomeViewController.onClearSelections(true);
mGeckoView.getSession().stop();
Objects.requireNonNull(mGeckoView.getSession()).stop();
mGeckoClient.loadURL(url.replace("genesis.onion","boogle.store"));
}
@ -536,12 +522,17 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokeTab(dataEnums.eTabCommands.MOVE_TAB_TO_TOP, Collections.singletonList(mTempSession));
}
mGeckoClient.getmRuntime();
mGeckoClient.initSession(mTempSession);
mGeckoView.releaseSession();
mGeckoView.setSession(mTempSession);
if(!mTempSession.isOpen()){
mTempSession.open(mGeckoClient.getmRuntime());
onLoadURL(mTempSession.getCurrentURL());
}
mHomeViewController.onClearSelections(false);
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP3:",(String)mTempSession.getCurrentURL());
mHomeViewController.onUpdateSearchBar(mTempSession.getCurrentURL(),false,true, false);
if(mTempSession.getProgress()>0 && mTempSession.getProgress()<100){
mHomeViewController.onProgressBarUpdate(mTempSession.getProgress(), false);
@ -552,11 +543,12 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onValidateInitializeFromStartup();
mGeckoClient.onSessionReinit();
mHomeViewController.onUpdateStatusBarTheme(mTempSession.getTheme(), false);
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP4:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(), false, false, false);
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
mRenderedBitmap = mGeckoView.capturePixels();
try{
mRenderedBitmap = mGeckoView.capturePixels();
}catch (Exception ignored){}
if(pExpandAppBar){
mHomeViewController.expandTopBar();
@ -570,6 +562,10 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onProgressBarUpdate(mGeckoClient.getSession().getProgress(),true);
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView, false));
mGeckoView.invalidate();
mGeckoView.refreshDrawableState();
mGeckoView.requestFocus();
}
/*-------------------------------------------------------USER EVENTS-------------------------------------------------------*/
@ -681,15 +677,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE)
{
onSearchBarInvoked(v);
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP5:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),true,true, false);
mHomeViewController.onClearSelections(true);
mGeckoClient.setLoading(true);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
mHomeViewController.onClearSelections(false);
}, 500);
handler.postDelayed(() -> mHomeViewController.onClearSelections(false), 500);
}
return true;
});
@ -717,10 +709,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
final Handler handler = new Handler();
handler.postDelayed(() ->
{
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}, 300);
handler.postDelayed(() -> getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE), 300);
}else {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
@ -794,7 +783,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
if(!mGeckoClient.isLoading()){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP8:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, false);
}
helperMethod.hideKeyboard(homeController.this);
@ -845,7 +833,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(validated_url!=null){
url = validated_url;
}
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP9:",(String)url);
mHomeViewController.onUpdateSearchBar(url,false,true, false);
onLoadURL(url);
}
@ -861,22 +848,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
onLoadURL(pURL);
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP14:",(String)pURL);
mHomeViewController.onUpdateSearchBar(pURL,false,true, false);
}
public void onSuggestionMove(View view){
String val = view.getTag().toString();
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP11:",(String)val);
mHomeViewController.onUpdateSearchBar(val,false,false, true);
}
public void applyTheme(){
status.mCurrentReloadURL = mSearchbar.getText().toString();
onResume();
recreate();
}
public void onHomeButton(View view){
onLoadURL(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
mHomeViewController.onUpdateLogo();
@ -899,11 +878,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onHideLoadTabDialog();
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_RECENT_TAB, null);
if(model!=null && !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
Log.i("FUCK::1","URL");
Log.i("FUCK::1",model.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(model.getSession().getCurrentURL(),false,false,true);
Log.i("FUCK::2","URL");
Log.i("FUCK::2",model.getSession().getCurrentURL());
onLoadTab(model.getSession(), false,true);
Log.i("FUCK::3","url");
Log.i("FUCK::3",model.getSession().getCurrentURL());
}
}
@ -922,12 +901,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void postNewTabAnimation(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){
initializeGeckoView(true, true);
if(status.sOpenURLInNewTab){
if(mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){
mGeckoView.getSession().open(mGeckoClient.getmRuntime());
}
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP12:",(String)helperMethod.getDomainName(status.sSettingSearchStatus));
mHomeViewController. onUpdateSearchBar(helperMethod.getDomainName(status.sSettingSearchStatus),false,true, false);
}else {
onLoadURL("about:blank");
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP13:",(String)strings.HOME_BLANK_PAGE);
mHomeViewController. onUpdateSearchBar(strings.HOME_BLANK_PAGE,false,true, false);
mHomeViewController.onNewTab();
}
@ -936,13 +917,16 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
}
public void postNewLinkTabAnimation(String url){
public void postNewLinkTabAnimation(String url,boolean isRemovable){
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_UPDATE_PIXEL, Arrays.asList(mGeckoClient.getSession().getSessionID(), mRenderedBitmap, null, mGeckoView,false));
initializeGeckoView(true, true);
mHomeViewController.progressBarReset();
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP15:",(String)url);
mHomeViewController.onUpdateSearchBar(url,false,true, false);
mGeckoClient.loadURL(url);
if(isRemovable){
mGeckoClient.setRemovableFromBackPressed(true);
}
}
public void postNewLinkTabAnimationInBackgroundTrigger(String url){
@ -958,13 +942,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.progressBarReset();
mGeckoClient.initURL(url);
mGeckoClient.loadURL(url);
mGeckoClient.getSession().setURL(url);
onSaveCurrentTab(mGeckoClient.getSession(),false);
onLoadTab(mSession,false,false);
mAppBar.setTag(R.id.expandableBar,true);
initTabCount();
mHomeViewController.onUpdateSearchBar(url,false,true, false);
mHomeViewController.onUpdateSearchBar(mSession.getCurrentURL(),false,true, false);
}
public void onNewTab(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){
@ -973,9 +958,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}catch (Exception ignored){}
final Handler handler = new Handler();
handler.postDelayed(() -> {
mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), M_INITIALIZE_TAB_SINGLE);
}, 100);
handler.postDelayed(() -> mHomeViewController.onNewTabAnimation(Arrays.asList(isKeyboardOpenedTemp, isKeyboardOpened), M_INITIALIZE_TAB_SINGLE), 100);
}
public void onNewTabBackground(boolean isKeyboardOpenedTemp, boolean isKeyboardOpened){
@ -1029,7 +1012,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onDisableTabViewController(){
onResume();
onResumeDump();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), true);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onExitAndClearBackup();
@ -1039,7 +1022,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@Override
public void onBackPressed(){
if(mTabFragment.getVisibility()==View.VISIBLE){
onResume();
onResumeDump();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onPostExit();
@ -1120,6 +1103,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(mSplashScreen.getAlpha()>0){
mHomeViewController.initSplashOrientation();
}
if(mSearchEngineBar.getVisibility() == View.VISIBLE){
mHomeViewController.onClearSelections(true);
}
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
}
@ -1131,7 +1117,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
helperMethod.hideKeyboard(this);
}
if(mTabFragment.getVisibility()==View.VISIBLE){
onResume();
onResumeDump();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(), false);
mHomeViewController.onHideTabContainer();
activityContextManager.getInstance().getTabController().onPostExit();
@ -1162,18 +1148,20 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mSearchbar.selectAll();
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
}
if(status.sSettingIsAppStarted && mAppRestarted){
onUpdateStatusBarTheme();
activityContextManager.getInstance().onClearStack();
if(mGeckoView!=null){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null || !mGeckoClient.getSession().getSessionID().equals(model.getSession().getSessionID())){
if(model==null){
onInitDefaultTab();
}else {
onLoadTab(model.getSession(), false,true);
if(model!=null){
if(mGeckoView!=null && mGeckoView.getSession()!=null && !mGeckoView.getSession().isOpen()){
onReDrawGeckoview();
onLoadURL(model.getSession().getCurrentURL());
}else if(mGeckoView != null){
mGeckoView.requestFocus();
mGeckoView.setSession(model.getSession());
}
}
}
if(mAppBar!=null){
mHomeViewController.expandTopBar();
@ -1183,39 +1171,52 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mAppRestarted = true;
pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION );
if(mGeckoView!=null){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model!=null){
if(!mGeckoView.getSession().isOpen()){
onReDrawGeckoview();
onLoadURL(model.getSession().getCurrentURL());
}else {
mGeckoView.releaseSession();
mGeckoView.requestFocus();
mGeckoView.setSession(model.getSession());
/*If error page at background session tab it will not load unless click | Issue with actual firefox app too*/
if(mGeckoClient.wasPreviousErrorPage()){
mHomeViewController.performDummyClick();
}
}
}
}
initWidget();
super.onResume();
}
public void onLoadTabOnClear(){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null){
onNewIntent(getIntent());
onOpenLinkNewTab(helperMethod.getDomainName(mHomeModel.getSearchEngine()));
public void onResumeDump()
{
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_RESUME);
activityContextManager.getInstance().setCurrentActivity(this);
if (mGeckoClient.getSession()!=null && mGeckoClient!=null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mGeckoClient.getUriPermission()!=null) {
this.revokeUriPermission(mGeckoClient.getUriPermission(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
if(isSuggestionSearchOpened){
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null){
onOpenLinkNewTab(status.sSettingSearchStatus);
}
isSuggestionChanged = true;
isFocusChanging = false;
isSuggestionSearchOpened = false;
mSearchbar.requestFocus();
mSearchbar.setText(helperMethod.urlDesigner(mSearchBarPreviousText, this, mSearchbar.getCurrentTextColor()));
mSearchbar.selectAll();
mHomeViewController.initSearchBarFocus(true, isKeyboardOpened);
}
}
public void OnClearSuggestion(View view){
mSearchbar.clearFocus();
if(status.sSettingIsAppStarted && mAppRestarted) {
onUpdateStatusBarTheme();
activityContextManager.getInstance().onClearStack();
tabRowModel model = (tabRowModel)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_CURRENT_TAB, null);
if(model==null){
initializeGeckoView(false,false);
onLoadURL(helperMethod.getDomainName(status.sSettingSearchStatus));
}
}
if(mAppBar!=null){
mHomeViewController.expandTopBar();
mAppBar.refreshDrawableState();
mAppBar.invalidate();
}
mAppRestarted = true;
pluginController.getInstance().onNotificationInvoke(null, pluginEnums.eNotificationManager.M_CLEAR_NOTIFICATION );
initTabCountForced();
initWidget();
}
@Override
@ -1229,10 +1230,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.setLoading(true);
onSearchBarInvoked(mSearchbar);
final Handler handler = new Handler();
handler.postDelayed(() ->
{
mGeckoView.clearFocus();
}, 500);
handler.postDelayed(() -> mGeckoView.clearFocus(), 500);
}
}
else if(requestCode==1){
@ -1334,7 +1332,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void initTabCount(){
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null));
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), false);
}
public void initTabCountForced(){
mHomeViewController.initTab((int)dataController.getInstance().invokeTab(dataEnums.eTabCommands.GET_TOTAL_TAB, null), true);
}
/*-------------------------------------------------------CALLBACKS-------------------------------------------------------*/
@ -1346,7 +1348,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
public void onClearSearchBar(View view){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP16:",(String)strings.GENERIC_EMPTY_STR);
mHomeViewController.onUpdateSearchBar(strings.GENERIC_EMPTY_STR, false, true, false);
}
@ -1545,7 +1546,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
postNewTabAnimation((boolean)data.get(0),(boolean)data.get(1));
}
else if(e_type.equals(M_INITIALIZE_TAB_LINK)){
postNewLinkTabAnimation((String)data.get(0));
postNewLinkTabAnimation((String)data.get(0),false);
}
else if(e_type.equals(enums.etype.on_init_ads))
{
@ -1554,10 +1555,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.M_WELCOME_MESSAGE)){
if(status.sSettingIsWelcomeEnabled){
final Handler handler = new Handler();
Runnable runnable = () ->
{
pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_WELCOME);
};
Runnable runnable = () -> pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_WELCOME);
handler.postDelayed(runnable, 1300);
}
}
@ -1571,13 +1569,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
status.sSettingRedirectStatus = strings.GENERIC_EMPTY_STR;
}else {
if(status.mThemeApplying){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP17:",(String)data.get(0));
mHomeViewController.onUpdateSearchBar(data.get(0).toString(),false, false, false);
mHomeViewController.splashScreenDisableInstant();
onLoadTabOnResume();
}
onLoadURL(data.get(0).toString());
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP18:",(String)data.get(0));
mHomeViewController.onUpdateSearchBar(dataToStr(data.get(0),mGeckoClient.getSession().getCurrentURL()),false,true, false);
}
}
@ -1645,7 +1641,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
mHomeViewController.initSearchBarFocus(false, isKeyboardOpened);
if(!mGeckoClient.isLoading()){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP19:",(String)mGeckoClient.getSession().getCurrentURL());
mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, false);
}
helperMethod.hideKeyboard(homeController.this);
@ -1695,7 +1690,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onProgressBarUpdate((int)data.get(0), true);
}
else if(e_type.equals(enums.etype.ON_UPDATE_SEARCH_BAR)){
org.mozilla.thirdparty.com.google.android.exoplayer2.util.Log.i("SUPPPP11:",(String)data.get(0));
mHomeViewController.onUpdateSearchBar((String)data.get(0), false, false, false);
}
else if(e_type.equals(enums.etype.ON_FIRST_PAINT)){
@ -1710,6 +1704,9 @@ public class homeController extends AppCompatActivity implements ComponentCallba
else if(e_type.equals(enums.etype.back_list_empty)){
helperMethod.onMinimizeApp(homeController.this);
}
else if(e_type.equals(enums.etype.M_CLOSE_TAB)){
onCloseCurrentTab(mGeckoClient.getSession());
}
else if(e_type.equals(enums.etype.M_ADMOB_BANNER_RECHECK)){
if(data.get(2).toString().startsWith(CONST_GENESIS_URL_CACHED) || data.get(2).toString().startsWith(CONST_GENESIS_URL_CACHED_DARK) || helperMethod.getHost(data.get(2).toString()).contains("boogle.store") || data.get(2).toString().startsWith(CONST_GENESIS_HELP_URL_CACHE) || data.get(2).toString().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
mHomeViewController.updateBannerAdvertStatus(false,true);
@ -1758,7 +1755,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getSession().getTheme(),false);
}
else if(e_type.equals(enums.etype.on_update_favicon)){
dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList((String)data.get(0)));
dataController.getInstance().invokeImage(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL,Collections.singletonList(data.get(0)));
}
else if(e_type.equals(M_LONG_PRESS_WITH_LINK)){
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_WITH_LINK);
@ -1770,7 +1767,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().onMessageManagerInvoke(data, M_LONG_PRESS_URL);
}
else if(e_type.equals(enums.etype.open_new_tab)){
postNewLinkTabAnimation(dataToStr(data.get(0)));
if(status.sSettingPopupStatus){
pluginController.getInstance().onMessageManagerInvoke(Collections.singletonList(homeController.this), M_POPUP_BLOCKED);
}else {
postNewLinkTabAnimation(dataToStr(data.get(0)), true);
}
}
else if(e_type.equals(enums.etype.on_close_sesson)){
if(!onCloseCurrentTab(mGeckoClient.getSession())){

View File

@ -224,6 +224,7 @@ class homeViewController
public void onShowTabContainer(){
if(mTabFragment.getAlpha()==0 || mTabFragment.getAlpha()==1){
onUpdateStatusBarTheme(null, false);
mTabFragment.setAlpha(0);
mTabFragment.setTranslationY(0);
mTabFragment.setVisibility(View.VISIBLE);
@ -246,6 +247,8 @@ class homeViewController
public void onHideTabContainer(){
if(mTabFragment.getAlpha()==1){
mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME);
mTabFragment.animate()
.setDuration(150)
.alpha(0f).withEndAction(() -> mTabFragment.setVisibility(View.GONE));
@ -363,26 +366,29 @@ class homeViewController
}
}
void initTab(int count){
mNewTab.animate().cancel();
mNewTab.animate().withLayer()
.rotationX(60)
.alpha(0.4f)
.setDuration(120)
.withEndAction(
new Runnable() {
@Override public void run() {
mNewTab.setRotationX(-60);
mNewTab.animate().withLayer()
.rotationX(0)
.alpha(1)
.setDuration(150)
.start();
void initTab(int count, boolean pForced){
if(!pForced){
mNewTab.animate().cancel();
mNewTab.animate().withLayer()
.rotationX(60)
.alpha(0.4f)
.setDuration(120)
.withEndAction(
new Runnable() {
@Override public void run() {
mNewTab.setRotationX(-60);
mNewTab.animate().withLayer()
.rotationX(0)
.alpha(1)
.setDuration(150)
.start();
}
}
}
).start();
).start();
}
mNewTab.setText((count+strings.GENERIC_EMPTY_STR));
}
public void recreateStatusBar(){
@ -805,7 +811,7 @@ class homeViewController
mColor = -1;
}
if(pTheme!=null && status.sToolbarTheme && mColor!=-1 && helperMethod.getColorDensity(mColor)<0.80){
if(!mSearchbar.isFocused() && pTheme!=null && status.sToolbarTheme && mColor!=-1 && helperMethod.getColorDensity(mColor)<0.80){
mTopBar.setBackgroundColor(mColor);
mSearchbar.setTextColor(helperMethod.invertedGrayColor(mColor));
mSearchbar.setHintTextColor(helperMethod.invertedGrayColor(mColor));
@ -841,6 +847,7 @@ class homeViewController
mSearchLock.setTag(R.id.themed,true);
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(7));
mSearchbar.setBackground(gradientDrawable1);
mSearchbar.setHintTextColor(ColorUtils.blendARGB(helperMethod.invertedShadeColor(mColor,0.10f), Color.BLACK, 0.2f));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mContext.getWindow().setStatusBarColor(Color.parseColor(pTheme));
@ -865,22 +872,29 @@ class homeViewController
mContext.getWindow().setStatusBarColor(mContext.getResources().getColor(R.color.blue_dark));
}
GradientDrawable gradientDrawable1 = new GradientDrawable();
gradientDrawable1.setColor(ContextCompat.getColor(mContext, R.color.c_edittext_background));
gradientDrawable1.setCornerRadius(helperMethod.pxFromDp(7));
gradientDrawable1.setStroke(helperMethod.pxFromDp(2), ContextCompat.getColor(mContext, R.color.c_edittext_background));
mSearchbar.setBackground(gradientDrawable1);
Drawable drawable;
Resources res = mContext.getResources();
try {
drawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_generic_tab_button));
mNewTab.setBackground(drawable);
drawable = Drawable.createFromXml(res, res.getXml(R.xml.gx_generic_input));
mSearchbar.setBackground(drawable);
mVoiceInput.setBackground(drawable);
} catch (Exception ignored) {
Drawable drawableTemp = Drawable.createFromXml(res, res.getXml(R.xml.gx_generic_input));
mVoiceInput.setBackground(drawableTemp);
} catch (Exception ex) {
ex.printStackTrace();
}
mNewTab.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
mMenu.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mVoiceInput.setColorFilter(ContextCompat.getColor(mContext, R.color.c_navigation_tint));
mSearchbar.setTextColor(ContextCompat.getColor(mContext, R.color.c_text_v1));
mSearchbar.setHintTextColor(ContextCompat.getColor(mContext, R.color.c_text_v2));
onUpdateSearchIcon(1);
if(status.sTheme != enums.Theme.THEME_DARK && !status.sDefaultNightMode){
@ -925,12 +939,14 @@ class homeViewController
mSearchEngineBar.setAlpha(0f);
mSearchEngineBar.animate().setDuration(delay).alpha(1);
mSearchEngineBar.setVisibility(View.VISIBLE);
onUpdateStatusBarTheme(null, false);
}
}else {
mSearchEngineBar.animate().setDuration(delay).alpha(0).withEndAction(() -> {
mSearchEngineBar.animate().cancel();
mSearchEngineBar.setAlpha(0f);
mSearchEngineBar.setVisibility(View.GONE);
mEvent.invokeObserver(null, enums.etype.M_UPDATE_THEME);
});
}
}

View File

@ -33,6 +33,7 @@ public class settingPrivacyController extends AppCompatActivity {
private settingPrivacyModel mSettingPrivacyModel;
private settingPrivacyViewController mSettingPrivacyViewController;
private SwitchMaterial mJavaScript;
private SwitchMaterial mPopup;
private SwitchMaterial mDoNotTrack;
private SwitchMaterial mClearDataOnExit;
private ArrayList<RadioButton> mCookie = new ArrayList<>();
@ -60,13 +61,14 @@ public class settingPrivacyController extends AppCompatActivity {
mJavaScript = findViewById(R.id.pJavascript);
mDoNotTrack = findViewById(R.id.pDoNotTrack);
mClearDataOnExit = findViewById(R.id.pClearDataOnExit);
mPopup = findViewById(R.id.pPopup);
mCookie.add(findViewById(R.id.pCookieRadioOption1));
mCookie.add(findViewById(R.id.pCookieRadioOption2));
mCookie.add(findViewById(R.id.pCookieRadioOption3));
mCookie.add(findViewById(R.id.pCookieRadioOption4));
activityContextManager.getInstance().onStack(this);
mSettingPrivacyViewController = new settingPrivacyViewController(this, new settingPrivacyController.settingAccessibilityViewCallback(), mJavaScript, mDoNotTrack, mClearDataOnExit, mCookie);
mSettingPrivacyViewController = new settingPrivacyViewController(this, new settingPrivacyController.settingAccessibilityViewCallback(), mJavaScript, mDoNotTrack, mClearDataOnExit, mCookie, mPopup);
mSettingPrivacyModel = new settingPrivacyModel(new settingPrivacyController.settingAccessibilityModelCallback());
}
@ -133,6 +135,12 @@ public class settingPrivacyController extends AppCompatActivity {
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,status.sSettingJavaStatus));
}
public void onPopup(View view){
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_POPUP, Collections.singletonList(!status.sSettingPopupStatus));
mPopup.toggle();
dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_POPUP,status.sSettingPopupStatus));
}
public void onDoNotTrack(View view){
mSettingChanged = true;
mSettingPrivacyModel.onTrigger(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK, Collections.singletonList(!status.sStatusDoNotTrack));

View File

@ -2,9 +2,9 @@ package com.darkweb.genesissearchengine.appManager.settingManager.privacyManager
class settingPrivacyEnums
{
/*History Manager*/
/*Privacy Manager*/
public enum ePrivacyModel {
M_SET_JAVASCRIPT, M_SET_DONOT_TRACK, M_SET_TRACKING_PROTECTION, M_SET_COOKIES, M_SET_CLEAR_PRIVATE_DATA
M_SET_JAVASCRIPT, M_SET_POPUP, M_SET_DONOT_TRACK, M_SET_COOKIES, M_SET_CLEAR_PRIVATE_DATA
}
public enum ePrivacyViewController {

View File

@ -35,6 +35,10 @@ class settingPrivacyModel
status.sStatusDoNotTrack = pStatus;
}
private void onPopup(boolean pStatus){
status.sSettingPopupStatus = pStatus;
}
private void onCookies(View pView){
if(pView.getId() == R.id.pCookieOption1){
status.sSettingCookieStatus = ACCEPT_ALL;
@ -61,6 +65,9 @@ class settingPrivacyModel
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_DONOT_TRACK)){
onDoNotTrack((boolean)pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_POPUP)){
onPopup((boolean)pData.get(0));
}
else if(pCommands.equals(settingPrivacyEnums.ePrivacyModel.M_SET_COOKIES)){
onCookies((View) pData.get(0));
}

View File

@ -30,10 +30,11 @@ class settingPrivacyViewController
private SwitchMaterial mDoNotTrack;
private SwitchMaterial mClearDataOnExit;
private ArrayList<RadioButton> mCookie;
private SwitchMaterial mPopup;
/*Initializations*/
settingPrivacyViewController(settingPrivacyController pContext, eventObserver.eventListener pEvent, SwitchMaterial pJavaScript, SwitchMaterial pDoNotTrack, SwitchMaterial pClearDataOnExit, ArrayList<RadioButton> pCookie)
settingPrivacyViewController(settingPrivacyController pContext, eventObserver.eventListener pEvent, SwitchMaterial pJavaScript, SwitchMaterial pDoNotTrack, SwitchMaterial pClearDataOnExit, ArrayList<RadioButton> pCookie, SwitchMaterial pPopup)
{
this.mEvent = pEvent;
this.mContext = pContext;
@ -41,6 +42,7 @@ class settingPrivacyViewController
this.mClearDataOnExit = pClearDataOnExit;
this.mCookie = pCookie;
this.mDoNotTrack = pDoNotTrack;
this.mPopup = pPopup;
initViews();
initPostUI();
@ -70,6 +72,12 @@ class settingPrivacyViewController
this.mJavaScript.setChecked(false);
}
if(status.sSettingPopupStatus){
this.mPopup.setChecked(true);
}else{
this.mPopup.setChecked(false);
}
if(status.sClearOnExit){
this.mClearDataOnExit.setChecked(true);
}else{

View File

@ -243,6 +243,7 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
mBorder = itemView.findViewById(R.id.pBorder);
itemView.setClickable(true);
mRemoveRow.setEnabled(true);
if(model.getmId()==null){
mItemSelectionMenu.setVisibility(View.VISIBLE);
@ -352,8 +353,6 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
}
}else if(v.getId() == R.id.pRemoveRow){
v.setEnabled(false);
v.setFocusableInTouchMode(false);
v.setClickable(false);
onRemoveRowCross(this.getLayoutPosition());
}
else if(v.getId() == R.id.pItemSelectionMenuButton){

View File

@ -145,8 +145,9 @@ public class tabController extends Fragment
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
boolean mStatus = (boolean) mTabAdapter.onTrigger(tabEnums.eTabAdapterCommands.M_SELECTION_MENU_SHOWING, null);
if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
if((Integer) viewHolder.itemView.getTag() >= mListModel.getList().size()){
if((Integer) viewHolder.itemView.getTag() >= mListModel.getList().size() || mStatus){
return 0;
}
else {
@ -155,7 +156,7 @@ public class tabController extends Fragment
return makeMovementFlags(swipeFlags, dragFlags);
}
} else {
if((Integer) viewHolder.itemView.getTag() >= mListModel.getList().size()){
if((Integer) viewHolder.itemView.getTag() >= mListModel.getList().size() || mStatus){
return 0;
}
else {
@ -229,7 +230,6 @@ public class tabController extends Fragment
public void initTabCount(int pDelay)
{
//mtabViewController.onTrigger(tabEnums.eTabViewCommands.INIT_TAB_COUNT, Collections.singletonList(mListModel.getList().size()));
final Handler handler = new Handler();
handler.postDelayed(() ->
{
@ -239,7 +239,7 @@ public class tabController extends Fragment
mRecycleView.setLayoutParams(params);
}
}, pDelay);
activityContextManager.getInstance().getHomeController().initTabCountForced();
}
public void onClose(){

View File

@ -7,7 +7,7 @@ public class enums
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,M_ADMOB_BANNER_RECHECK,
welcome, reload,download_folder, M_UPDATE_THEME,M_ON_BANNER_UPDATE, M_LOAD_HOMEPAGE_GENESIS,M_INIT_TAB_COUNT,
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,
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,M_CLOSE_TAB,
on_close_sesson,on_long_press, on_full_screen,on_handle_external_intent,on_update_suggestion_url,progress_update,progress_update_forced, ON_EXPAND_TOP_BAR,recheck_orbot,on_url_load,on_playstore_load,back_list_empty,start_proxy, ON_UPDATE_THEME, M_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
}

View File

@ -29,6 +29,7 @@ public class keys
public static final String SETTING_SEARCH_ENGINE = "SEARCH_ENGINE";
public static final String SETTING_FIRST_INSTALLED = "FIRST_INSTALLED";
public static final String SETTING_JAVA_SCRIPT = "JAVA_SCRIPT";
public static final String SETTING_POPUP = "POPUP";
public static final String SETTING_HISTORY_CLEAR = "HISTORY_CLEAR";
public static final String SETTING_GATEWAY = "pref_bridges_enabled_auto";
public static final String SETTING_GATEWAY_MANUAL = "pref_bridges_enabled_manual";

View File

@ -30,6 +30,7 @@ public class status
public static boolean sSettingSearchHistory = false;
public static boolean sSearchSuggestionStatus = false;
public static boolean sSettingJavaStatus = true;
public static boolean sSettingPopupStatus = false;
public static boolean sClearOnExit = true;
public static boolean sSettingIsAppPaused = false;
public static boolean sSettingIsWelcomeEnabled = true;
@ -74,6 +75,7 @@ public class status
status.sSettingSearchHistory = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true));
status.sSearchSuggestionStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true));
status.sSettingJavaStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true));
status.sSettingPopupStatus = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_POPUP,true));
status.sClearOnExit = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true));
status.sBridgeGatewayAuto = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_GATEWAY,true));
status.sBridgeGatewayManual = (boolean)dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_GET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,false));

View File

@ -1,6 +1,7 @@
package com.darkweb.genesissearchengine.pluginManager;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
@ -9,6 +10,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.net.Uri;
import android.os.Handler;
import android.util.Log;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
@ -161,6 +163,26 @@ class messageManager
}
private void popupBlocked()
{
final Handler handler = new Handler();
Runnable runnable = () -> {
mDialog.dismiss();
};
initializeDialog(R.layout.popup_block_popup, Gravity.BOTTOM);
mDialog.findViewById(R.id.pOpenPrivacy).setOnClickListener(v -> {
mEvent.invokeObserver(null, M_OPEN_PRIVACY);
mDialog.dismiss();
handler.removeCallbacks(runnable);
});
mDialog.setOnDismissListener(dialog -> handler.removeCallbacks(runnable));
handler.postDelayed(runnable, 1500);
}
private void notSupportMessage()
{
initializeDialog(R.layout.popup_not_supported, Gravity.BOTTOM);
@ -584,6 +606,11 @@ class messageManager
/*VERIFIED*/
newIdentityCreated();
break;
case M_POPUP_BLOCKED:
/*VERIFIED*/
popupBlocked();
break;
}
}
}

View File

@ -208,12 +208,8 @@ public class pluginController
mMessageManager.onTrigger(Arrays.asList(mHomeController, Collections.singletonList(pData.get(0).toString())),M_START_ORBOT);
}
}
else if(pEventType.equals(M_CLEAR_HISTORY)){
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
mContextManager.getHistoryController().onclearData();
mHomeController.onClearSession();
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
mHomeController.initTab(true);
else if(pEventType.equals(M_OPEN_PRIVACY)){
helperMethod.openActivity(settingPrivacyController.class, constants.CONST_LIST_HISTORY, mHomeController,true);
}
else if(pEventType.equals(M_CLEAR_BOOKMARK)){
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,pData);

View File

@ -28,10 +28,10 @@ public class pluginEnums
/*Message Manager*/
public enum eMessageManager{
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
M_RESET, M_DATA_CLEARED, M_SECURE_CONNECTION, M_POPUP_BLOCKED,M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_RATE_SUCCESS, M_RATE_FAILURE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
}
public enum eMessageManagerCallbacks{
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION
M_CANCEL_WELCOME, M_APP_RATED, M_DOWNLOAD_FILE_MANUAL, M_OPEN_LINK_CURRENT_TAB, M_COPY_LINK, M_REQUEST_BRIDGES, M_SET_BRIDGES, M_OPEN_LINK_NEW_TAB, M_CLEAR_TAB, M_RATE_APPLICATION, M_OPEN_PRIVACY
}
/*Download Manager*/

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pToastLayoutRoot"
android:translationZ="5dp"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pMainLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="15dp"
android:background="@xml/ax_background_inverted"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/pDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:alpha="0.8"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/SETTING_PRIVACY_POPUP_INFO_ALERT"
android:textAlignment="textStart"
android:textColor="@color/c_alert_text_inverted"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/pMainLayout"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp" />
<Button
android:id="@+id/pOpenPrivacy"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@xml/ax_ripple_default_round_right"
android:padding="0dp"
android:text="@string/HOME_MENU_SETTING"
android:textAllCaps="false"
android:textColor="@color/c_button_text_v1_inverted"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view6"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginEnd="18dp"
android:background="@color/c_border_background_divider"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/pOpenPrivacy"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -47,6 +47,7 @@
android:textAlignment="viewStart"
android:textColor="@color/c_alert_text"
android:textDirection="locale"
android:maxLines="5"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pHeader"

View File

@ -67,6 +67,7 @@
android:alpha="0.6"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:maxLines="5"
android:text="@string/GENERAL_DEFAULT_TEXT"
android:textAlignment="textStart"
android:textColor="@color/c_alert_text"

View File

@ -38,6 +38,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:alpha="0.6"
android:maxLines="5"
android:ellipsize="start"
android:paddingStart="15dp"
android:paddingEnd="15dp"

View File

@ -41,6 +41,7 @@
android:textColor="@color/c_alert_text"
android:alpha="0.6"
android:paddingEnd="15dp"
android:maxLines="5"
android:layout_marginEnd="20dp"
android:textDirection="locale"
android:textAlignment="viewStart"

View File

@ -240,6 +240,72 @@
</LinearLayout>
<LinearLayout
android:id="@+id/pOption5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:background="@xml/gx_ripple_gray"
android:orientation="horizontal"
android:onClick="onPopup"
android:weightSum="7">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:clickable="false"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="20dp"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/SETTING_PRIVACY_POPUP"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v1"
android:textSize="14sp"
tools:ignore="RtlSymmetry" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:alpha="1"
android:background="@android:color/transparent"
android:clickable="false"
android:padding="0dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/SETTING_PRIVACY_POPUP_INFO"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="@color/c_text_v6"
android:textSize="13.5sp"
tools:ignore="RtlSymmetry" />
</LinearLayout>
<com.google.android.material.switchmaterial.SwitchMaterial
android:layout_width="0dp"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:id="@+id/pPopup"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:theme="@style/SCBSwitch"
android:layout_weight="1"
android:contentDescription="@string/GENERAL_TODO" />
</LinearLayout>
<LinearLayout
android:id="@+id/pOption1"
android:layout_width="match_parent"

View File

@ -118,8 +118,11 @@
<string name="SETTING_PRIVACY_TRACKING_OPTION3" translatable="true">Strict Policy</string>
<string name="SETTING_PRIVACY_TRACKING_OPTION3_INFO" translatable="true">Stop all known trackers, Pages will load faster but some functionality might not work</string>
<string name="SETTING_PRIVACY_JAVASCRIPT" translatable="true">Javascript</string>
<string name="SETTING_PRIVACY_JAVASCRIPT" translatable="true">Allow Javascript | Toggle to Enable Javascript</string>
<string name="SETTING_PRIVACY_JAVASCRIPT_INFO" translatable="true">Disable java scripting for various script attacks</string>
<string name="SETTING_PRIVACY_POPUP" translatable="true">Block Popup | Toggle to Disable Popup Advert</string>
<string name="SETTING_PRIVACY_POPUP_INFO" translatable="true">Remove popup advertizement. Might break functionaly of some websites</string>
<string name="SETTING_PRIVACY_POPUP_INFO_ALERT" translatable="true">Popup blocked</string>
<string name="SETTING_ADVANCE_HEADER" translatable="true">Settings | Advance</string>
<string name="SETTING_ADVANCE_RESTORE_TAB" translatable="true">Restore tabs</string>
<string name="SETTING_ADVANCE_RESTORE_TAB_INFO" translatable="true">Don\'t restore after quitting browser</string>