diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/app_model.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/app_model.java index baade111..fd4fb8de 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/app_model.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/app_model.java @@ -155,7 +155,10 @@ public class app_model /*Navigation*/ public void addNavigation(String url,enums.navigationType type) { - navigation.add(new navigation_model(url,type)); + if(navigation.size()==0 || !navigation.get(navigation.size()-1).getURL().equals(url)) + { + navigation.add(new navigation_model(url,type)); + } } public ArrayList getNavigation() { return navigation; diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/application_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/application_controller.java index 5f15a6e0..c3860185 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/application_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/application_controller.java @@ -65,6 +65,7 @@ public class application_controller extends AppCompatActivity geckoclient.initialize(geckoView); app_model.getInstance().initialization(); initBoogle(); + downloadManager.getInstance().initialize(); } else { @@ -214,7 +215,7 @@ public class application_controller extends AppCompatActivity public void onloadURL(String url,boolean isHiddenWeb,boolean isUrlSavable) { if(isHiddenWeb) { - geckoclient.loadGeckoURL(url,geckoView,isUrlSavable); + geckoclient.loadGeckoURL(url,geckoView,isUrlSavable,webView.getVisibility()==View.VISIBLE); } else if(!app_model.getInstance().isUrlRepeatable(url,webView.getUrl()) || webView.getVisibility() == View.GONE) { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/downloadManager.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/downloadManager.java new file mode 100644 index 00000000..6fc642df --- /dev/null +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/downloadManager.java @@ -0,0 +1,21 @@ +package com.darkweb.genesissearchengine.appManager.home_activity; + + +public class downloadManager +{ + private static final downloadManager ourInstance = new downloadManager(); + + public static downloadManager getInstance() + { + return ourInstance; + } + + private downloadManager() + { + } + + public void initialize() + { + } + +} diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/geckoClients.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/geckoClients.java index afcc35f6..da4e0fc0 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/geckoClients.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/geckoClients.java @@ -1,10 +1,10 @@ package com.darkweb.genesissearchengine.appManager.home_activity; import android.os.Handler; +import android.util.Log; import android.view.View; import com.darkweb.genesissearchengine.constants.*; import com.darkweb.genesissearchengine.dataManager.preference_manager; -import com.darkweb.genesissearchengine.helperMethod; import com.darkweb.genesissearchengine.pluginManager.fabricManager; import com.darkweb.genesissearchengine.pluginManager.message_manager; import com.darkweb.genesissearchengine.pluginManager.orbot_manager; @@ -38,15 +38,19 @@ class geckoClients isAppRated = preference_manager.getInstance().getBool(keys.isAppRated,false); } - void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable) + void loadGeckoURL(String url,GeckoView geckoView,boolean isUrlSavable,boolean reinit) { boolean init_status = orbot_manager.getInstance().initOrbot(url); if (init_status) { + if(reinit) + { + initialize(geckoView); + } + this.isUrlSavable = isUrlSavable; navigatedURL = ""; loadingCompeleted = false; - initialize(geckoView); session1.loadUri(url); app_model.getInstance().getAppInstance().onRequestTriggered(true,url); app_model.getInstance().getAppInstance().onProgressBarUpdateView(4); @@ -71,18 +75,29 @@ class geckoClients geckoView.setAlpha(1); } + public void initializeDownloadManager() + { + //DownloadsFeature downloadsFeature = new DownloadsFeature(app_model.getInstance().getAppContext(),null,null,null,session1); + } + class navigationDelegate implements GeckoSession.NavigationDelegate { @Override public void onLocationChange(GeckoSession session, String url) { navigatedURL = url; + if(isUrlSavable && app_model.getInstance().getNavigation().size()>0 && !url.equals("about:blank")) + { + app_model.getInstance().addHistory(navigatedURL); + app_model.getInstance().addNavigation(navigatedURL,enums.navigationType.onion); + } } @Override - public GeckoResult onNewSession(GeckoSession session, String uri) + public GeckoResult onNewSession(GeckoSession session, String url) { - session1.loadUri(uri); + Log.i("FUCK2",url); + session1.loadUri(url); return null; } @@ -137,7 +152,7 @@ class geckoClients message_manager.getInstance().rateApp(); } } - else if(isAppRated) + else if(isAppRated || 1==1) { if(isFirstTimeLoad && navigatedURL.contains(".onion")) { @@ -159,11 +174,6 @@ class geckoClients app_model.getInstance().getAppInstance().onPageFinished(true); } - if(isUrlSavable && !app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).equals(navigatedURL)) - { - app_model.getInstance().addHistory(navigatedURL); - app_model.getInstance().addNavigation(navigatedURL,enums.navigationType.onion); - } isUrlSavable = true; isFirstTimeLoad = false; @@ -208,6 +218,11 @@ class geckoClients wasBackPressed = true; session1.stop(); + if(app_model.getInstance().getAppInstance().isInternetErrorOpened()) + { + initialize(geckoView); + } + session1.loadUri(app_model.getInstance().getNavigation().get(app_model.getInstance().getNavigation().size()-1).getURL()); } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/viewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/viewController.java index 4fb31d53..d591d0db 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/viewController.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/home_activity/viewController.java @@ -356,17 +356,21 @@ public class viewController { onProgressBarUpdate(4); webView.goBack(); - app_model.getInstance().getNavigation().remove(app_model.getInstance().getNavigation().size()-1); } else { onProgressBarUpdate(0); } + + /*CHANGED BUT NOT TESTED*/ + app_model.getInstance().getNavigation().remove(app_model.getInstance().getNavigation().size()-1); + webView.bringToFront(); webView.setAlpha(1); webView.setVisibility(View.VISIBLE); requestFailure.animate().alpha(0f).setDuration(200).withEndAction((() -> requestFailure.setVisibility(View.INVISIBLE))); onUpdateSearchBar(webView.getUrl()); + floatingButton.animate().alpha(0).withEndAction((() -> floatingButton.setVisibility(View.GONE))); } else { diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_ehandler.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_ehandler.java index 2d366476..3d95662c 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_ehandler.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_ehandler.java @@ -7,6 +7,7 @@ import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import com.darkweb.genesissearchengine.appManager.home_activity.app_model; import com.darkweb.genesissearchengine.constants.constants; +import com.darkweb.genesissearchengine.constants.enums; import com.darkweb.genesissearchengine.helperMethod; import com.darkweb.genesissearchengine.pluginManager.orbot_manager; import com.example.myapplication.R; @@ -75,6 +76,8 @@ public class list_ehandler { String url_temp = helperMethod.completeURL(url); + app_model.getInstance().addNavigation(url, enums.navigationType.onion); + if(!url_temp.contains("boogle") && !url_temp.equals(constants.backendGoogle) && !url_temp.equals(constants.backendBing)) { if(orbot_manager.getInstance().initOrbot(url_temp)) diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_view_controller.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_view_controller.java index bbb374f3..6e8c8c88 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_view_controller.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/list_manager/list_view_controller.java @@ -62,6 +62,7 @@ class list_view_controller table = strings.history_text; } database_controller.getInstance().execSQL("delete from "+table+" where 1"); + list_model.getInstance().getListInstance().initializeList(); } void updateListStatus(boolean animate) diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java index d6a05333..96a4d379 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/admanager.java @@ -30,8 +30,8 @@ public class admanager { MobileAds.initialize(app_model.getInstance().getAppInstance(), "ca-app-pub-5074525529134731~2926711128"); mInterstitialHidden_base = initAd("ca-app-pub-5074525529134731/1637043432"); - mInterstitialHidden_onion = initAd("ca-app-pub-5074525529134731/4332539288"); - mInterstitialInternal = initAd("ca-app-pub-5074525529134731/8478420705"); + //mInterstitialHidden_onion = initAd("ca-app-pub-5074525529134731/4332539288"); + //mInterstitialInternal = initAd("ca-app-pub-5074525529134731/8478420705"); } public InterstitialAd initAd(String id) @@ -47,12 +47,12 @@ public class admanager public void showAd(enums.adID id) { - if(id.equals(enums.adID.hidden_base)) + if(id.equals(enums.adID.hidden_onion_start)) { mInterstitialHidden_base.show(); mInterstitialHidden_base.loadAd(new AdRequest.Builder().build()); } - else if(id.equals(enums.adID.hidden_onion)) + /*else if(id.equals(enums.adID.hidden_onion)) { mInterstitialHidden_onion.show(); mInterstitialHidden_onion.loadAd(new AdRequest.Builder().build()); @@ -61,6 +61,6 @@ public class admanager { mInterstitialInternal.show(); mInterstitialInternal.loadAd(new AdRequest.Builder().build()); - } + }*/ } } diff --git a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java index 46e7082d..ba18233a 100644 --- a/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java +++ b/app/src/main/java/com/darkweb/genesissearchengine/pluginManager/message_manager.java @@ -204,7 +204,6 @@ public class message_manager builder.show(); } - public void reportURL() { Context application_context = app_model.getInstance().getAppContext(); diff --git a/app/variables.gradle b/app/variables.gradle index 42b5ab9e..5f163e56 100644 --- a/app/variables.gradle +++ b/app/variables.gradle @@ -1,18 +1,18 @@ /*arm versions*/ - project.ext.arm_vname = '188' - project.ext.arm_vcode = 188 + project.ext.arm_vname = '196' + project.ext.arm_vcode = 196 /*aarch versions*/ - project.ext.aarch_vname = '189' - project.ext.aarch_vcode = 189 + project.ext.aarch_vname = '197' + project.ext.aarch_vcode = 197 /*x86 versions*/ - project.ext.x86_vname = '190' - project.ext.x86_vcode = 190 + project.ext.x86_vname = '198' + project.ext.x86_vcode = 198 /*x64 versions*/ - project.ext.x64_vname = '191' - project.ext.x64_vcode = 191 + project.ext.x64_vname = '199' + project.ext.x64_vcode = 199 /*dimension*/ project.ext.dimen = 'abi'