diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 977f3a88..279d02fa 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -6,6 +6,10 @@
+
+
+
+
@@ -21,6 +25,7 @@
+
diff --git a/app/google-services.json b/app/google-services.json
index 9fa43cf3..71935c15 100755
--- a/app/google-services.json
+++ b/app/google-services.json
@@ -10,7 +10,7 @@
"client_info": {
"mobilesdk_app_id": "1:1026582312920:android:056aacc3b6f0c3b3f164ad",
"android_client_info": {
- "package_name": "com.darkweb.genesissearchengine.dev"
+ "package_name": "com.darkweb.genesissearchengine.production"
}
},
"oauth_client": [
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 24ba4b5a..39df419c 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -45,7 +45,7 @@
android:name="com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" />
-
-
@@ -194,27 +194,27 @@
android:value="be76c64dae2519d4ab8daaed88298da14c7c294f" />
-
-
-
+ android:value="ca-app-pub-9340927969469822~8113004486" />
+
+
+
-
+
@@ -224,7 +224,7 @@
activityContextManager.getInstance().getHomeController().onStartApplication(null), 3000);
+ }
+
+ helperMethod.onDelayHandler(activityContextManager.getInstance().getHomeController(), 800, () -> {
+
+ /* Start Required Activity */
+
+ Intent intent = new Intent(this.getIntent());
+ intent.setClassName(this.getApplicationContext(), homeController.class.getName());
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+
+ this.startActivity(intent);
+ overridePendingTransition(R.anim.fade_in_lang, R.anim.fade_out_lang);
+
+ return null;
+ });
+ }
+
+ public void panicExitInvoked() {
+ dataController.getInstance().clearData(this);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalCommandManager/externalURLNavigationContoller.java
similarity index 84%
rename from app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java
rename to app/src/main/java/com/darkweb/genesissearchengine/appManager/externalCommandManager/externalURLNavigationContoller.java
index 17796412..fb50d5c0 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalNavigationController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalCommandManager/externalURLNavigationContoller.java
@@ -1,4 +1,4 @@
-package com.darkweb.genesissearchengine.appManager.externalNavigationManager;
+package com.darkweb.genesissearchengine.appManager.externalCommandManager;
import android.content.Intent;
import android.net.Uri;
@@ -8,14 +8,16 @@ import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
+import com.example.myapplication.R;
+
import static com.darkweb.genesissearchengine.constants.constants.CONST_PACKAGE_NAME;
-public class externalNavigationController extends AppCompatActivity {
+public class externalURLNavigationContoller extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- Uri data = externalNavigationController.this.getIntent().getData();
+ Uri data = externalURLNavigationContoller.this.getIntent().getData();
if(data == null || status.sSettingIsAppStarted){
/* Close Activity */
@@ -26,7 +28,7 @@ public class externalNavigationController extends AppCompatActivity {
/* Create Request Handler */
if(status.sSettingIsAppStarted && data!=null){
- helperMethod.onDelayHandler(this, 3000, () -> {
+ helperMethod.onDelayHandler(this, 250, () -> {
activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(activityContextManager.getInstance().getHomeController().completeURL(data.toString()));
activityContextManager.getInstance().getHomeController().onClearSelectionTab();
return null;
@@ -36,6 +38,7 @@ public class externalNavigationController extends AppCompatActivity {
Intent bringToForegroundIntent = new Intent(activityContextManager.getInstance().getHomeController(), homeController.class);
bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(bringToForegroundIntent);
+ overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
}
else if(status.sSettingIsAppRunning){
@@ -58,13 +61,11 @@ public class externalNavigationController extends AppCompatActivity {
status.sExternalWebsite = data.toString();
}
- this.startActivity(intent);
- this.overridePendingTransition(0, 0);
-
/* Bring Application To Front */
Intent launchIntent = getPackageManager().getLaunchIntentForPackage(CONST_PACKAGE_NAME);
startActivity(launchIntent);
+ overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
/* Close Activity */
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java
deleted file mode 100644
index be006bf2..00000000
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/externalNavigationManager/externalShortcuts.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package com.darkweb.genesissearchengine.appManager.externalNavigationManager;
-
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import androidx.appcompat.app.AppCompatActivity;
-import com.darkweb.genesissearchengine.appManager.activityContextManager;
-import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
-import com.darkweb.genesissearchengine.constants.constants;
-import com.darkweb.genesissearchengine.constants.enums;
-import com.darkweb.genesissearchengine.constants.keys;
-import com.darkweb.genesissearchengine.constants.sql;
-import com.darkweb.genesissearchengine.constants.status;
-import com.darkweb.genesissearchengine.constants.strings;
-import com.darkweb.genesissearchengine.dataManager.dataController;
-import com.darkweb.genesissearchengine.dataManager.dataEnums;
-import com.darkweb.genesissearchengine.databaseManager.databaseController;
-import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.example.myapplication.R;
-import org.mozilla.geckoview.ContentBlocking;
-import org.torproject.android.service.wrapper.orbotLocalConstants;
-import java.util.Arrays;
-
-import static com.darkweb.genesissearchengine.constants.constants.CONST_PACKAGE_NAME;
-import static org.mozilla.geckoview.ContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY;
-
-public class externalShortcuts extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- status.sSettingIsAppStarted = false;
- orbotLocalConstants.mIsTorInitialized = false;
- boolean mConnect = false;
-
- if (getIntent() != null && getIntent().getStringExtra("shortcut") != null) {
- String bundleString = getIntent().getStringExtra("shortcut");
- switch (bundleString) {
- case "erase":
- setContentView(R.layout.popup_data_cleared_shortcut);
- panicExitInvoked();
- new Handler().postDelayed(this::finish, 3000);
- return;
- case "erase_and_open":
- panicExitInvoked();
- mConnect = true;
- break;
- case "Restart":
- break;
- }
- }
-
- setContentView(R.layout.empty_view);
-
- if(mConnect){
- new Handler().postDelayed(() -> activityContextManager.getInstance().getHomeController().onStartApplication(null), 2000);
- }
-
- new Handler().postDelayed(() ->
- {
- /* Start Required Activity */
-
- Intent intent = new Intent(this.getIntent());
- intent.setClassName(this.getApplicationContext(), homeController.class.getName());
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
-
- this.startActivity(intent);
- overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
-
- }, 800);
- }
-
-
- @Override
- protected void onNewIntent(Intent intent)
- {
- super.onNewIntent(intent);
- Uri data = intent.getData();
- if(data!=null){
- activityContextManager.getInstance().getHomeController().onOpenLinkNewTab(data.toString());
- Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.darkweb.genesissearchengine");
- startActivity(launchIntent);
- overridePendingTransition(R.anim.fade_in_instant, R.anim.fade_out_instant);
- }
- }
-
- public void panicExitInvoked() {
- status.sSettingIsAppStarted = false;
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_HISTORY,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SEARCH_SUGGESTION,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_JAVA_SCRIPT,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_HISTORY_CLEAR,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_GATEWAY_MANUAL,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_IS_WELCOME_ENABLED,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.PROXY_IS_APP_RATED,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.VPN_ENABLED,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.BRIDGE_ENABLES,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FONT_ADJUSTABLE,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_ZOOM,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_VOICE_INPUT,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_TRACKING_PROTECTION, ContentBlocking.AntiTracking.DEFAULT));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_DONOT_TRACK,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_COOKIE_ADJUSTABLE,ACCEPT_FIRST_PARTY));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_FLOAT, Arrays.asList(keys.SETTING_FONT_SIZE,100));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE, strings.SETTING_DEFAULT_LANGUAGE));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_LANGUAGE_REGION,strings.SETTING_DEFAULT_LANGUAGE_REGION));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.SETTING_SEARCH_ENGINE, constants.CONST_BACKEND_GENESIS_URL));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_BRIDGE_1,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_NOTIFICATION_STATUS,1));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_RESTORE_TAB,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_CHARACTER_ENCODING,false));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_SHOW_IMAGES,0));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_FONTS,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_TOOLBAR_THEME,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_FULL_SCREEN_BROWSIING,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_INT, Arrays.asList(keys.SETTING_THEME, enums.Theme.THEME_DEFAULT));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_LIST_VIEW,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_SHOW_TAB_GRID,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_OPEN_URL_IN_NEW_TAB,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_BOOL, Arrays.asList(keys.SETTING_POPUP,true));
- dataController.getInstance().invokePrefs(dataEnums.ePreferencesCommands.M_SET_STRING, Arrays.asList(keys.BRIDGE_CUSTOM_TYPE,strings.BRIDGE_CUSTOM_BRIDGE_OBFS4));
-
- databaseController.getInstance().initialize(this);
- databaseController.getInstance().execSQL(sql.SQL_CLEAR_HISTORY,null);
- databaseController.getInstance().execSQL(sql.SQL_CLEAR_BOOKMARK,null);
- databaseController.getInstance().execSQL(sql.SQL_CLEAR_TAB,null);
- status.initStatus(activityContextManager.getInstance().getHomeController());
-
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/helpManager/helpController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/helpManager/helpController.java
index 00c58369..bbfd4c97 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/helpManager/helpController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/helpManager/helpController.java
@@ -22,7 +22,7 @@ import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.darkweb.genesissearchengine.helperManager.theme;
+import com.darkweb.genesissearchengine.appManager.activityThemeManager;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@@ -63,9 +63,10 @@ public class helpController extends AppCompatActivity {
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
+
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
- theme.getInstance().onConfigurationChanged(this);
+ activityThemeManager.getInstance().onConfigurationChanged(this);
}
super.onConfigurationChanged(newConfig);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java
index 664b1b16..d5380939 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyAdapter.java
@@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
+import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
index 5417d530..77313025 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyController.java
@@ -24,19 +24,18 @@ 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.databaseManager.databaseController;
+import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.editTextManager;
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
-import com.darkweb.genesissearchengine.constants.sql;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.darkweb.genesissearchengine.helperManager.theme;
+import com.darkweb.genesissearchengine.appManager.activityThemeManager;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@@ -45,6 +44,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static com.darkweb.genesissearchengine.appManager.historyManager.historyEnums.eHistoryViewCommands.M_VERTIFY_SELECTION_MENU;
+import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_HISTORY;
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_CLEAR_HISTORY;
public class historyController extends AppCompatActivity
@@ -88,9 +88,10 @@ public class historyController extends AppCompatActivity
public void onConfigurationChanged(@NonNull Configuration newConfig) {
pluginController.getInstance().onLanguageInvoke(Collections.singletonList(this), pluginEnums.eLangManager.M_ACTIVITY_CREATED);
super.onConfigurationChanged(newConfig);
+
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
- theme.getInstance().onConfigurationChanged(this);
+ activityThemeManager.getInstance().onConfigurationChanged(this);
}
}
@@ -360,7 +361,7 @@ public class historyController extends AppCompatActivity
mHistoryModel.clearList();
mHistoryAdapter.invokeFilter(true );
mHistoryViewController.onTrigger(historyEnums.eHistoryViewCommands.M_CLEAR_LIST, null);
- databaseController.getInstance().execSQL(sql.SQL_CLEAR_HISTORY,null);
+ dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_HISTORY,null));
}
private void onLoadMoreHistory(boolean pLoadingEnabled) {
@@ -431,7 +432,7 @@ public class historyController extends AppCompatActivity
mHistoryViewController.onTrigger(historyEnums.eHistoryViewCommands.M_UPDATE_LIST_IF_EMPTY, Arrays.asList(mHistoryModel.getList().size(),300));
}
else if(e_type.equals(enums.etype.remove_from_database)){
- databaseController.getInstance().deleteFromList((int)data.get(0),strings.HISTORY_TITLE);
+ dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_DELETE_FROM_HISTORY, Arrays.asList(data.get(0),strings.HISTORY_TITLE));
}
else if(e_type.equals(enums.etype.on_verify_selected_url_menu)){
mHistoryViewController.onTrigger(M_VERTIFY_SELECTION_MENU, data);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyModel.java
index 6b32f15e..88c95aa6 100755
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyModel.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/historyManager/historyModel.java
@@ -1,5 +1,7 @@
package com.darkweb.genesissearchengine.appManager.historyManager;
+import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
+
import java.util.ArrayList;
class historyModel
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/pageErrorHandler.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/errorHandler.java
similarity index 79%
rename from app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/pageErrorHandler.java
rename to app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/errorHandler.java
index 9e90a9c5..405ef5f7 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/pageErrorHandler.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/errorHandler.java
@@ -10,19 +10,16 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-public class pageErrorHandler
+public class errorHandler
{
private AppCompatActivity mContext;
private String mErrorTemplate;
- public String loadErrorPage(final int category, final int error, AppCompatActivity mContext, String url, InputStream mResourceURL) {
+ public String createErrorPage(final int category, final int error,AppCompatActivity mContext,String url, InputStream mResourceURL) {
this.mContext = mContext;
-
- try {
- if (mErrorTemplate == null) {
- StringBuilder builder = new StringBuilder();
- InputStream stream = mResourceURL;
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
+ if (mErrorTemplate == null) {
+ StringBuilder builder = new StringBuilder();
+ try (InputStream stream = mResourceURL; BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
String line;
while ((line = reader.readLine()) != null) {
@@ -31,46 +28,23 @@ public class pageErrorHandler
}
mErrorTemplate = builder.toString();
+ } catch (IOException e) {
+ return null;
}
- String title = helperMethod.getHost(url);
+ }
+ String title = helperMethod.getHost(url);
- if(url==null){
- url = "Hidden Error";
- }
- if(title==null){
- title = "Hidden Error";
- }
-
- String replaceUrl = errorToString(error).replace("$URL",url);
- String errorPage = createErrorPage("CODE : " + categoryToString(category) + "
TYPE : " + replaceUrl.replace("$TITLE",title),url,mResourceURL);
- errorPage = translateMessage(errorPage,"CODE : " + categoryToString(category));
- return errorPage;
- }catch (Exception ex){
- return strings.GENERIC_EMPTY_STR;
+ if(url==null){
+ url = "Hidden Error";
+ }
+ if(title==null){
+ title = "Hidden Error";
}
- }
-
- private String createErrorPage(final String error, String url, InputStream mResourceURL) throws IOException {
- if(error==null){
- return strings.GENERIC_EMPTY_STR;
- }
-
- StringBuilder builder = new StringBuilder();
- InputStream stream = mResourceURL;
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
-
- String line;
- while ((line = reader.readLine()) != null) {
- builder.append(line);
- builder.append("\n");
- }
-
- mErrorTemplate = builder.toString();
-
- String replaceUrl = mErrorTemplate.replace("$URL",url);
-
- return replaceUrl;
+ String replaceUrl = errorToString(error).replace("$URL",url);
+ String errorPage = createErrorPage("CODE : " + categoryToString(category) + "
TYPE : " + replaceUrl.replace("$TITLE",title),url,mResourceURL);
+ errorPage = translateMessage(errorPage,"CODE : " + categoryToString(category));
+ return errorPage;
}
private String translateMessage(String message,String error){
@@ -165,5 +139,29 @@ public class pageErrorHandler
return "UNKNOWN";
}
}
+ private String createErrorPage(final String error,String url, InputStream mResourceURL) {
+ if(error==null){
+ return strings.GENERIC_EMPTY_STR;
+ }
+
+ if (mErrorTemplate == null) {
+ StringBuilder builder = new StringBuilder();
+ try (InputStream stream = mResourceURL; BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
+
+ String line;
+ while ((line = reader.readLine()) != null) {
+ builder.append(line);
+ builder.append("\n");
+ }
+
+ mErrorTemplate = builder.toString();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+ String replaceUrl = mErrorTemplate.replace("$URL",url);
+
+ return replaceUrl;
+ }
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java
index a68edae5..e088a4c7 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/geckoManager/geckoSession.java
@@ -34,11 +34,11 @@ import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
-import com.darkweb.genesissearchengine.helperManager.internalFileDownloadManager;
-import com.darkweb.genesissearchengine.helperManager.downloadFileService;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.darkweb.genesissearchengine.helperManager.trueTime;
+import com.darkweb.genesissearchengine.libs.trueTime.trueTime;
+import com.darkweb.genesissearchengine.pluginManager.pluginController;
+import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
import org.json.JSONObject;
import org.mozilla.gecko.util.ThreadUtils;
@@ -58,6 +58,7 @@ import java.lang.ref.WeakReference;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -201,7 +202,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
if(!url.equals("about:blank") && !url.equals("about:config"))
{
mProgress = 5;
- event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
+ onProgressStart();
}
m_current_url_id = -1;
}
@@ -290,8 +291,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
isPageLoading = true;
if(!var2.equals("about:blank") && !mCurrentTitle.equals("loading")){
mProgress = 5;
- event.invokeObserver(Arrays.asList(5, mSessionID), enums.etype.progress_update);
- //mTheme = null;
+ mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update));
mThemeChanged = false;
}
}
@@ -327,15 +327,20 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
if(!mFullScreen){
mProgress = progress;
- if(progress==100){
- if(!mIsProgressBarChanging){
- mIsProgressBarChanging = true;
- mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
- event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND);
- }
- }else {
+ if(progress<=20) {
mIsProgressBarChanging = false;
- mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
+ mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update));
+ }else {
+ if(progress==100){
+ if(!mIsProgressBarChanging){
+ mIsProgressBarChanging = true;
+ mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
+ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme), enums.etype.M_UPDATE_PIXEL_BACKGROUND);
+ }
+ }else {
+ mIsProgressBarChanging = false;
+ mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(mProgress,mSessionID), enums.etype.progress_update));
+ }
}
}
@@ -344,6 +349,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
}
}
+ public void onProgressStart(){
+ if(!getCurrentURL().equals("about:blank") && !getCurrentURL().contains("genesishiddentechnologies.com") && !wasPreviousErrorPage() && !getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED) && !getCurrentURL().startsWith(CONST_GENESIS_URL_CACHED_DARK) && !getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE) && !getCurrentURL().startsWith(CONST_GENESIS_HELP_URL_CACHE_DARK)){
+ mContext.get().runOnUiThread(() -> event.invokeObserver(Arrays.asList(5,mSessionID), enums.etype.progress_update));
+ }
+ }
+
public void onRedrawPixel(){
event.invokeObserver(Arrays.asList("",mSessionID,mCurrentTitle, m_current_url_id, mTheme, false), dataEnums.eTabCommands.M_UPDATE_PIXEL);
}
@@ -491,9 +502,12 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
checkApplicationRate();
/* Its Absence causes delay on first launch*/
+
+ event.invokeObserver(Arrays.asList(mCurrentURL,mSessionID,mCurrentTitle, m_current_url_id, mTheme, this), enums.etype.ON_UPDATE_SEARCH_BAR);
+
if(!mCurrentURL.contains("genesishiddentechnologies.com")){
mProgress = 5;
- event.invokeObserver(Arrays.asList(5, mSessionID, mCurrentURL), enums.etype.progress_update_forced);
+ onProgressStart();
}
return GeckoResult.fromValue(AllowOrDeny.ALLOW);
@@ -528,7 +542,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
public GeckoResult onLoadError(@NonNull GeckoSession var1, @Nullable String var2, WebRequestError var3) {
if(status.sSettingIsAppStarted){
- pageErrorHandler handler = new pageErrorHandler();
+ errorHandler handler = new errorHandler();
mProgress = 0;
mPreviousErrorPage = true;
event.invokeObserver(Arrays.asList(var2,mSessionID), enums.etype.on_load_error);
@@ -545,7 +559,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
}
- return GeckoResult.fromValue("data:text/html," + handler.loadErrorPage(var3.category, var3.code,mContext.get(),var2, mResourceURL));
+ return GeckoResult.fromValue("data:text/html," + handler.createErrorPage(var3.category, var3.code,mContext.get(),var2, mResourceURL));
}
return null;
}
@@ -718,7 +732,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
{
if(mDownloadManager.getDownloadURL()!=null && mDownloadManager.getDownloadFile()!=null){
if(!createAndSaveFileFromBase64Url(mDownloadManager.getDownloadURL().toString())){
- mContext.get().startService(downloadFileService.getDownloadService(mContext.get().getApplicationContext(), mDownloadManager.getDownloadURL()+"__"+mDownloadManager.getDownloadFile(), Environment.DIRECTORY_DOWNLOADS));
+ pluginController.getInstance().onDownloadInvoke(Arrays.asList(mDownloadManager.getDownloadURL()+"__"+mDownloadManager.getDownloadFile(), Environment.DIRECTORY_DOWNLOADS), pluginEnums.eDownloadManager.M_START_SERVICE);
}
}
}
@@ -727,7 +741,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
{
if(downloadURL!=null && downloadFile!=null){
if(!createAndSaveFileFromBase64Url(downloadURL.toString())){
- mContext.get().startService(downloadFileService.getDownloadService(mContext.get().getApplicationContext(), downloadURL + "__" + downloadFile, Environment.DIRECTORY_DOWNLOADS));
+ pluginController.getInstance().onDownloadInvoke(Arrays.asList(downloadURL + "__" + downloadFile, Environment.DIRECTORY_DOWNLOADS), pluginEnums.eDownloadManager.M_START_SERVICE);
}
}
}
@@ -775,7 +789,7 @@ public class geckoSession extends GeckoSession implements GeckoSession.MediaDele
String filename;
if(url.startsWith("blob")){
- loadUri(internalFileDownloadManager.getBase64StringFromBlobUrl(url));
+ loadUri((String) pluginController.getInstance().onDownloadInvoke(Collections.singletonList(url), pluginEnums.eDownloadManager.M_DOWNLOAD_BLOB));
return true;
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java
index 1fc0ec6a..bcebc3b0 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintAdapter.java
@@ -18,7 +18,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
-import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
+import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.appManager.tabManager.tabEnums;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintModel.java
index 9eec3d2e..f689cd7e 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintModel.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/hintManager/hintModel.java
@@ -1,9 +1,5 @@
package com.darkweb.genesissearchengine.appManager.homeManager.hintManager;
-import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
-
-import java.util.ArrayList;
-
public class hintModel
{
/*Private Variables*/
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
index cc3246ae..25dbed0c 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeController.java
@@ -23,7 +23,6 @@ import android.speech.RecognizerIntent;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
-import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
@@ -44,10 +43,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkController;
-import com.darkweb.genesissearchengine.constants.sql;
-import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyController;
-import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
+import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.NestedGeckoView;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.*;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
@@ -57,8 +54,8 @@ import com.darkweb.genesissearchengine.appManager.languageManager.languageContro
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
import com.darkweb.genesissearchengine.appManager.orbotManager.orbotController;
import com.darkweb.genesissearchengine.appManager.settingManager.searchEngineManager.settingSearchController;
-import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
-import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
+import com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager.settingHomeController;
+import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
@@ -66,16 +63,14 @@ import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
-import com.darkweb.genesissearchengine.helperManager.KeyboardUtils;
-import com.darkweb.genesissearchengine.helperManager.clearAllRecentServices;
-import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
+import com.darkweb.genesissearchengine.libs.views.KeyboardUtils;
+import com.darkweb.genesissearchengine.appManager.activityStateManager;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.darkweb.genesissearchengine.helperManager.theme;
-import com.darkweb.genesissearchengine.helperManager.trueTime;
+import com.darkweb.genesissearchengine.appManager.activityThemeManager;
+import com.darkweb.genesissearchengine.libs.trueTime.trueTime;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
-import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
import com.example.myapplication.R;
import com.google.android.gms.ads.AdView;
import org.mozilla.geckoview.ContentBlocking;
@@ -105,6 +100,7 @@ import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE
import static com.darkweb.genesissearchengine.constants.enums.etype.M_INITIALIZE_TAB_SINGLE;
import static com.darkweb.genesissearchengine.constants.enums.etype.M_NEW_LINK_IN_NEW_TAB;
import static com.darkweb.genesissearchengine.constants.enums.etype.open_new_tab;
+import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_HISTORY;
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.*;
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManagerCallbacks.M_RATE_APPLICATION;
import static java.lang.Character.isLetter;
@@ -116,7 +112,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private homeViewController mHomeViewController;
private homeModel mHomeModel;
private geckoClients mGeckoClient = null;
- private GestureDetector mSwipeDirectionDetector;
/*View Webviews*/
private NestedGeckoView mGeckoView = null;
@@ -124,7 +119,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
private ConstraintLayout mWebViewContainer;
/*View Objects*/
- private AnimatedProgressBar mProgressBar;
+ private ProgressBar mProgressBar;
private ConstraintLayout mSplashScreen;
private editTextManager mSearchbar;
private ImageView mLoadingIcon;
@@ -191,7 +186,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
pluginController.getInstance().preInitialize(this);
dataController.getInstance().initialize(this);
status.initStatus(this);
- databaseController.getInstance().initialize(this);
+ dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_INIT, Collections.singletonList(this));
trueTime.getInstance().initTime();
super.onCreate(savedInstanceState);
@@ -462,16 +457,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
}
- @Override
- public boolean dispatchTouchEvent(MotionEvent event) {
- if(inSignatureArea(event)){
- try{
- //mSwipeDirectionDetector.onTouchEvent(event);
- }catch (Exception ignored){ }
- }
- return super.dispatchTouchEvent(event);
- }
-
public boolean inSignatureArea(MotionEvent ev) {
float mEventY = ev.getY();
return mEventY>mTopBar.getY()+mTopBar.getHeight() && mEventY(base);
- Context mContext = theme.getInstance().initTheme(base);
+ Context mContext = activityThemeManager.getInstance().initTheme(base);
activityContextManager.getInstance().setApplicationContext(mContext.getApplicationContext());
super.attachBaseContext(LocaleHelper.onAttach(mContext, Prefs.getDefaultLocale()));
}
@@ -761,7 +746,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
@SuppressLint("ClickableViewAccessibility")
private void initializeLocalEventHandlers() {
- startService(new Intent(getBaseContext(), clearAllRecentServices.class));
+ startService(new Intent(getBaseContext(), activityStateManager.class));
registerReceiver(downloadStatus,new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
@@ -790,8 +775,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if(mFindText.getText().length()==0 && mGeckoClient!=null){
mGeckoClient.getSession().getFinder().clear();
mHomeViewController.onUpdateFindBarCount(0,0);
- }else {
- assert mGeckoClient != null;
+ }else if(mGeckoClient!=null){
mGeckoClient.getSession().findInPage(mFindText.getText().toString(), GeckoSession.FINDER_FIND_MATCH_CASE & GeckoSession.FINDER_DISPLAY_HIGHLIGHT_ALL);
}
@@ -950,22 +934,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
}
});
- mSwipeDirectionDetector=new GestureDetector(this,new SimpleGestureFilter(){
-
- @Override
- public boolean onSwipe(Direction direction) {
- if(mSplashScreen.getAlpha()>=1 && mSplashScreen.getVisibility()==View.VISIBLE){
- if (direction==Direction.left){
- helperMethod.openActivity(orbotLogController.class, constants.CONST_LIST_HISTORY, homeController.this, true);
- }
- else if (direction==Direction.right){
- helperMethod.openActivity(orbotController.class, constants.CONST_LIST_HISTORY, homeController.this, true);
- }
- }
- return true;
- }
- });
-
KeyboardUtils.addKeyboardToggleListener(this, isVisible -> isKeyboardOpened = isVisible);
mNestedScroll.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
@@ -1385,12 +1353,14 @@ public class homeController extends AppCompatActivity implements ComponentCallba
mGeckoClient.onExitFullScreen();
mHomeViewController.onUpdateStatusBarTheme(mGeckoClient.getTheme(), false);
pluginController.getInstance().onMessageManagerInvoke(null, M_RESET);
- pluginController.getInstance().onNotificationInvoke(Collections.singletonList(1296000000) , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
+ pluginController.getInstance().onNotificationInvoke(Collections.singletonList(172800000) , pluginEnums.eNotificationManager.M_CREATE_NOTIFICATION);
mSearchBarWasBackButtonPressed = false;
if(status.sSettingIsAppStarted){
status.sUIInteracted = true;
}
mHomeViewController.onUpdateFindBar(false);
+ mHomeViewController.onClearSelections(isKeyboardOpened);
+ mTopBarContainer.getLayoutTransition().setDuration(0);
}
@Override
@@ -1885,7 +1855,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
- databaseController.getInstance().execSQL(sql.SQL_CLEAR_HISTORY,null);
+ dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_HISTORY,null));
dataController.getInstance().invokeHistory(dataEnums.eHistoryCommands.M_CLEAR_HISTORY ,null);
activityContextManager.getInstance().getHomeController().onClearCache();
dataController.getInstance().invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
@@ -2009,11 +1979,13 @@ public class homeController extends AppCompatActivity implements ComponentCallba
final Handler handler = new Handler();
Runnable runnable = () -> {
if(!status.sUIInteracted){
- mHomeViewController.closeMenu();
- mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, true);
- mSearchbar.clearFocus();
- pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_WELCOME);
- status.sUIInteracted = true;
+ if(mHomeViewController!=null){
+ mHomeViewController.closeMenu();
+ mHomeViewController.onUpdateSearchBar(mGeckoClient.getSession().getCurrentURL(),false,true, true);
+ mSearchbar.clearFocus();
+ pluginController.getInstance().onMessageManagerInvoke(Arrays.asList(strings.GENERIC_EMPTY_STR, homeController.this), M_WELCOME);
+ status.sUIInteracted = true;
+ }
}
};
handler.postDelayed(runnable, 2500);
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java
index 9383c82f..aa6308e3 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeModel.java
@@ -40,6 +40,4 @@ class homeModel
return mURL;
}
}
-
-
}
diff --git a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
index 1ef06a7c..03ddfd6c 100644
--- a/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
+++ b/app/src/main/java/com/darkweb/genesissearchengine/appManager/homeManager/homeController/homeViewController.java
@@ -41,10 +41,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.*;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
-import com.darkweb.genesissearchengine.helperManager.colorAnimationReciever;
+import com.darkweb.genesissearchengine.libs.views.ColorAnimator;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
-import com.darkweb.genesissearchengine.widget.progressBar.AnimatedProgressBar;
import com.example.myapplication.R;
import com.google.android.gms.ads.AdView;
import com.google.android.material.appbar.AppBarLayout;
@@ -69,7 +68,7 @@ class homeViewController
/*ViewControllers*/
private com.google.android.material.appbar.AppBarLayout mAppBar;
private ConstraintLayout mWebviewContainer;
- private AnimatedProgressBar mProgressBar;
+ private ProgressBar mProgressBar;
private editTextManager mSearchbar;
private ConstraintLayout mSplashScreen;
private TextView mLoadingText;
@@ -117,7 +116,7 @@ class homeViewController
private Runnable mTabDialogRunnable = null;
private boolean mIsTopBarExpanded = true;
- void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, AnimatedProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo,ImageButton pPanicButtonLandscape){
+ void initialization(eventObserver.eventListener event, AppCompatActivity context, Button mNewTab, ConstraintLayout webviewContainer, TextView loadingText, ProgressBar progressBar, editTextManager searchbar, ConstraintLayout splashScreen, ImageView loading, AdView banner_ads, ImageButton gateway_splash, LinearLayout top_bar, GeckoView gecko_view, ImageView backsplash, Button connect_button, View pFindBar, EditText pFindText, TextView pFindCount, androidx.constraintlayout.widget.ConstraintLayout pTopLayout, ImageButton pVoiceInput, ImageButton pMenu, androidx.core.widget.NestedScrollView pNestedScroll, ImageView pBlocker, ImageView pBlockerFullSceen, View mSearchEngineBar, TextView pCopyright, RecyclerView pHistListView, com.google.android.material.appbar.AppBarLayout pAppBar, ImageButton pOrbotLogManager, ConstraintLayout pInfoLandscape, ConstraintLayout pInfoPortrait, ProgressBar pProgressBarIndeterminate, FragmentContainerView pTabFragment, LinearLayout pTopBarContainer, ImageView pSearchLock, View pPopupLoadNewTab, ImageView pTopBarHider, ImageView pNewTabBlocker, CoordinatorLayout mCoordinatorLayout, ImageView pImageDivider, ImageButton pPanicButton, ImageView pGenesisLogo,ImageButton pPanicButtonLandscape){
this.mContext = context;
this.mProgressBar = progressBar;
this.mSearchbar = searchbar;
@@ -211,6 +210,7 @@ class homeViewController
mGenesisLogo.setLayoutParams(newLayoutParams);
}
});
+
}
@SuppressLint("WrongConstant")
@@ -409,7 +409,9 @@ class homeViewController
} catch (Exception ex) {
ex.printStackTrace();
}
- mVoiceInput.setVisibility(View.VISIBLE);
+ if(status.sSettingIsAppStarted){
+ mVoiceInput.setVisibility(View.VISIBLE);
+ }
mVoiceInput.setClickable(true);
mVoiceInput.setFocusable(true);
}, 0);
@@ -489,7 +491,7 @@ class homeViewController
public void initStatusBarColor(boolean mInstant) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- colorAnimationReciever oneToTwo = new colorAnimationReciever(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2));
+ ColorAnimator oneToTwo = new ColorAnimator(ContextCompat.getColor(mContext, R.color.landing_ease_blue), ContextCompat.getColor(mContext, R.color.green_dark_v2));
int mDelay = 1350;
if(status.mThemeApplying || mInstant){
@@ -931,19 +933,16 @@ class homeViewController
if(!mSearchbar.hasFocus() || pClearText || pBypassFocus){
if(mSearchEngineBar.getVisibility() == View.GONE || pBypassFocus){
int delay = 0;
- handlerLocalUrl = url;
+ handlerLocalUrl = url;
if(searchBarUpdateHandler.hasMessages(100)){
- return;
+ searchBarUpdateHandler.removeMessages(100);
}
searchBarUpdateHandler.sendEmptyMessage(100);
- searchBarUpdateHandler.postDelayed(() ->
- {
- searchBarUpdateHandler.removeMessages(100);
- triggerUpdateSearchBar(handlerLocalUrl,showProtocol, pClearText);
- mSearchbar.setTag(R.id.msearchbarProcessing,false);
- }, delay);
+ searchBarUpdateHandler.removeMessages(100);
+ triggerUpdateSearchBar(handlerLocalUrl,showProtocol, pClearText);
+ mSearchbar.setTag(R.id.msearchbarProcessing,false);
}
}
}
@@ -1214,6 +1213,10 @@ class homeViewController
}
void onProgressBarUpdate(int value, boolean mForced){
+
+ if(progressAnimator!=null){
+ progressAnimator.cancel();
+ }
if(mSearchbar.getText().toString().equals("genesis.onion") && !mForced || (boolean)mSearchbar.getTag(R.id.msearchbarProcessing)){
mProgressBar.setProgress(0);
mProgressBar.setVisibility(View.GONE);
@@ -1225,18 +1228,26 @@ class homeViewController
if(value != mProgressBar.getProgress()){
if(value<=5 && value>0){
- mProgressBar.setProgress(5);
+ setProgressAnimate(5,70);
}else {
- mProgressBar.setProgress(value);
+ setProgressAnimate(value,200);
}
if(value >= 100 || value<=0){
- mProgressBar.animate().alpha(0).withEndAction(() -> mProgressBar.setProgress(0));
+ mProgressBar.animate().alpha(0).setStartDelay(200).withEndAction(() -> mProgressBar.setProgress(0));
}else {
mProgressBar.setAlpha(1);
}
}
}
+ ObjectAnimator progressAnimator = null;
+ private void setProgressAnimate(int pValue, int pSpeed)
+ {
+ progressAnimator = ObjectAnimator.ofInt(mProgressBar, "progress", pValue);
+ progressAnimator.setDuration(pSpeed);
+ progressAnimator.start();
+ }
+
public void onNewTabAnimation(List