Bug Fixes

Bug Fixes
master
msmannan00 2021-05-19 22:46:36 +05:00
parent 2d40f80bc1
commit 30a8bd0fcc
158 changed files with 2714 additions and 3174 deletions

View File

@ -6,6 +6,10 @@
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CollectionAddAllCanBeReplacedWithConstructor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConstantConditions" enabled="false" level="WARNING" enabled_by_default="false">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
</inspection_tool>
<inspection_tool class="Deprecation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="DifferentKotlinGradleVersion" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="EmptyStatementBody" enabled="false" level="WARNING" enabled_by_default="false">
@ -21,6 +25,7 @@
</inspection_tool>
<inspection_tool class="InfiniteLoopStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="InnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="IntegerDivisionInFloatingPointContext" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LambdaParameterTypeCanBeSpecified" enabled="false" level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="RawUseOfParameterizedType" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />

View File

@ -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": [

View File

@ -45,7 +45,7 @@
android:name="com.darkweb.genesissearchengine.appManager.proxyStatusManager.proxyStatusController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" />
<activity
android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController"
android:name="com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager.settingHomeController"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:label="@string/SETTING_HEADER"
android:launchMode="singleTop"
@ -145,10 +145,10 @@
</intent-filter>
</activity>
<activity android:name="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalShortcuts"
<activity android:name="com.darkweb.genesissearchengine.appManager.externalCommandManager.externalShortcutController"
android:launchMode="singleTop"/>
<activity android:name="com.darkweb.genesissearchengine.appManager.externalNavigationManager.externalNavigationController"
<activity android:name="com.darkweb.genesissearchengine.appManager.externalCommandManager.externalURLNavigationContoller"
android:launchMode="singleTask"
>
<intent-filter>
@ -194,27 +194,27 @@
android:value="be76c64dae2519d4ab8daaed88298da14c7c294f" />
<!-- Live Build -->
<!-- <meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-9340927969469822~8113004486" /> -->
<!-- Development Build -->
<!-- --> <meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6985886044951738~4177628900" />
android:value="ca-app-pub-9340927969469822~8113004486" />
<!-- Development Build -->
<!-- <meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6985886044951738~4177628900" /> -->
<service
android:name="com.darkweb.genesissearchengine.helperManager.downloadFileService"
android:name="com.darkweb.genesissearchengine.pluginManager.downloadPluginManager.downloadService"
android:enabled="true"
android:exported="false"
android:stopWithTask="true" />
<service
android:name="com.darkweb.genesissearchengine.helperManager.clearAllRecentServices"
android:name="com.darkweb.genesissearchengine.appManager.activityStateManager"
android:stopWithTask="true" />
<receiver android:name="com.darkweb.genesissearchengine.helperManager.userEngagementNotification" />
<receiver android:name="com.darkweb.genesissearchengine.pluginManager.notificationPluginManager.localEngagementManager" />
<receiver
android:name="com.darkweb.genesissearchengine.helperManager.downloadNotification"
android:name="com.darkweb.genesissearchengine.pluginManager.pluginReciever.downloadNotificationReciever"
android:exported="false">
<intent-filter>
<action android:name="Download_Cancelled" />
@ -224,7 +224,7 @@
<!-- Permissions File Provider Live
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.darkweb.genesissearchengine.provider.dev"
android:authorities="com.darkweb.genesissearchengine.production.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
@ -233,15 +233,15 @@
</provider>
<provider
android:authorities="com.darkweb.genesissearchengine.dev.provider"
android:name="com.darkweb.genesissearchengine.clientauth.ClientAuthContentProvider"
android:authorities="com.darkweb.genesissearchengine.production.provider"
android:name="com.darkweb.genesissearchengine.libs.clientauth.ClientAuthContentProvider"
android:exported="false"/>
-->
<!-- Permissions File Provider Dev -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.darkweb.genesissearchengine.provider.dev"
android:authorities="com.darkweb.genesissearchengine.production.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
@ -250,8 +250,8 @@
</provider>
<provider
android:authorities="com.darkweb.genesissearchengine.provider.dev"
android:name="com.darkweb.genesissearchengine.clientauth.ClientAuthContentProvider"
android:authorities="com.darkweb.genesissearchengine.production.provider"
android:name="com.darkweb.genesissearchengine.libs.clientauth.ClientAuthContentProvider"
android:exported="false"/>
<provider

View File

@ -9,9 +9,8 @@ import com.darkweb.genesissearchengine.appManager.historyManager.historyControll
import com.darkweb.genesissearchengine.appManager.homeManager.homeController.homeController;
import com.darkweb.genesissearchengine.appManager.orbotLogManager.orbotLogController;
import com.darkweb.genesissearchengine.appManager.settingManager.generalManager.settingGeneralController;
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage.settingHomeController;
import com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager.settingHomeController;
import com.darkweb.genesissearchengine.appManager.tabManager.tabController;
import com.darkweb.genesissearchengine.helperManager.theme;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@ -174,7 +173,7 @@ public class activityContextManager
for(int mCounter=0;mCounter<mStackList.size();mCounter++){
try{
if(!mStackList.get(mCounter).get().isFinishing()){
theme.getInstance().onConfigurationChanged(mStackList.get(mCounter).get());
activityThemeManager.getInstance().onConfigurationChanged(mStackList.get(mCounter).get());
}
}catch (Exception ignored){}
}

View File

@ -1,11 +1,11 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.appManager;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import com.darkweb.genesissearchengine.constants.status;
public class clearAllRecentServices extends Service {
public class activityStateManager extends Service {
@Override
public IBinder onBind(Intent intent) {

View File

@ -1,5 +1,4 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.appManager;
import android.content.Context;
import android.content.res.Configuration;
@ -9,23 +8,41 @@ import androidx.appcompat.app.AppCompatDelegate;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
public class theme {
public class activityThemeManager {
private boolean mLocalThemeChanged;
private static theme ourInstance = new theme();
private static activityThemeManager ourInstance = new activityThemeManager();
int mode = -1;
public static theme getInstance()
public static activityThemeManager getInstance()
{
return ourInstance;
}
public void onConfigurationChanged(AppCompatActivity pContext){
boolean sDefaultNightMode = (pContext.getApplicationContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
// if(status.sDefaultNightMode != sDefaultNightMode){
setupThemeLocal(pContext, sDefaultNightMode);
pContext.recreate();
// }
}
public boolean onInitTheme(AppCompatActivity pContext){
boolean mIsNightMode = (pContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
if(status.sTheme == enums.Theme.THEME_DEFAULT){
if(!status.sDefaultNightMode && mIsNightMode){
return true;
}else if(status.sDefaultNightMode && !mIsNightMode){
return true;
}
}
else{
if(status.sTheme != enums.Theme.THEME_DARK && mIsNightMode){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
return true;
}else if(status.sTheme == enums.Theme.THEME_DARK && !mIsNightMode){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
return true;
}
}
return false;
}
public void setupThemeLocal(Context context, boolean sDefaultNightMode) {
@ -36,26 +53,22 @@ public class theme {
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
mode = Configuration.UI_MODE_NIGHT_YES;
mLocalThemeChanged = true;
}
}else if(status.sTheme == enums.Theme.THEME_LIGHT){
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_NO){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
mode = Configuration.UI_MODE_NIGHT_NO;
mLocalThemeChanged = true;
}
}else {
if(!sDefaultNightMode){
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_NO){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
mode = Configuration.UI_MODE_NIGHT_NO;
mLocalThemeChanged = true;
}
}else {
if(AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
mode = Configuration.UI_MODE_NIGHT_YES;
mLocalThemeChanged = true;
}
}
}
@ -101,7 +114,6 @@ public class theme {
public Context initTheme(Context pContext){
boolean sDefaultNightMode = (pContext.getApplicationContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
boolean sDefaultNightModeCurrent = (pContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
if(status.sSettingIsAppStarted){
status.mThemeApplying = true;
@ -110,7 +122,6 @@ public class theme {
status.sDefaultNightMode = sDefaultNightMode;
pContext = setupTheme(pContext);
mLocalThemeChanged = false;
mode = -1;
return pContext;

View File

@ -15,6 +15,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;

View File

@ -23,19 +23,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.bookmarkRowModel;
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.Collections;
import java.util.List;
import java.util.Objects;
import static com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkEnums.eBookmarkViewCommands.M_VERTIFY_SELECTION_MENU;
import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_BOOKMARK;
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_CLEAR_BOOKMARK;
@ -89,7 +89,7 @@ public class bookmarkController extends AppCompatActivity
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}
@ -319,7 +319,7 @@ public class bookmarkController extends AppCompatActivity
mbookmarkModel.clearList();
((bookmarkAdapter) Objects.requireNonNull(mRecycleView.getAdapter())).invokeFilter(true );
mbookmarkViewController.onTrigger(bookmarkEnums.eBookmarkViewCommands.M_CLEAR_LIST, null);
databaseController.getInstance().execSQL(sql.SQL_CLEAR_BOOKMARK,null);
dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_BOOKMARK,null));
mRecycleView.setAlpha(0);
}
@ -365,7 +365,7 @@ public class bookmarkController extends AppCompatActivity
mbookmarkViewController.onTrigger(bookmarkEnums.eBookmarkViewCommands.M_UPDATE_LIST_IF_EMPTY, Arrays.asList(mbookmarkModel.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)){
mbookmarkViewController.onTrigger(M_VERTIFY_SELECTION_MENU, data);

View File

@ -1,5 +1,7 @@
package com.darkweb.genesissearchengine.appManager.bookmarkManager;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import java.util.ArrayList;
class bookmarkModel

View File

@ -21,7 +21,7 @@ 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;
@ -64,7 +64,7 @@ public class bridgeController extends AppCompatActivity {
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);

View File

@ -0,0 +1,66 @@
package com.darkweb.genesissearchengine.appManager.externalCommandManager;
import android.content.Intent;
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.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
import org.torproject.android.service.wrapper.orbotLocalConstants;
public class externalShortcutController 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), 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);
}
}

View File

@ -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 */

View File

@ -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());
}
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -1,5 +1,7 @@
package com.darkweb.genesissearchengine.appManager.historyManager;
import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import java.util.ArrayList;
class historyModel

View File

@ -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) + " <br>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) + " <br>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;
}
}

View File

@ -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<String> 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;
}

View File

@ -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;

View File

@ -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*/

View File

@ -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<mConnectButton.getY();
@ -516,7 +501,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
Prefs.setContext(base);
orbotLocalConstants.mHomeContext = new WeakReference<>(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);

View File

@ -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<Object> data, Object e_type){
mGeckoView.setPivotX(0);
mGeckoView.setPivotY(0);

View File

@ -21,7 +21,7 @@ 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;
@ -66,9 +66,10 @@ public class languageController 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);
}
}

View File

@ -71,7 +71,7 @@ public class orbotLogAdapter extends RecyclerView.Adapter<orbotLogAdapter.listVi
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(constants.CONST_LOG_DUCKDUCK + mModelList.get(this.getLayoutPosition()).getLog()));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(constants.CONST_LOG_DUCKDUCK + Uri.encode(" " + mModelList.get(this.getLayoutPosition()).getLog())));
intent.putExtra(SearchManager.QUERY, mDescription.getText());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activityContextManager.getInstance().getHomeController().startActivity(intent);

View File

@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
@ -21,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;
@ -82,20 +83,27 @@ public class orbotLogController extends AppCompatActivity {
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);
}
mNestedScrollView.stopNestedScroll();
helperMethod.onDelayHandler(orbotLogController.this, 150, () -> {
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE || newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
if(!orbotLogStatus.sUIInteracted && ((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE)>1)){
if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
mNestedScrollView.stopNestedScroll();
onScrollBottom();
mNestedScrollView.stopNestedScroll();
orbotLogStatus.sScrollPosition = -1;
}
}else {
mNestedScrollView.stopNestedScroll();
mNestedScrollView.scrollTo(0,0);
mNestedScrollView.smoothScrollTo(0,0);
mNestedScrollView.stopNestedScroll();
orbotLogStatus.sScrollPosition = 0;
}
orbotLogStatus.sScrollPosition = -1;
}
return null;
@ -104,7 +112,6 @@ public class orbotLogController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
}
private void initializeViews() {
mLogRecycleView = findViewById(R.id.pLogRecycleView);
mLogs = findViewById(R.id.pLogs);
@ -126,7 +133,7 @@ public class orbotLogController extends AppCompatActivity {
layoutManager.setReverseLayout(true);
mLogRecycleView.setAdapter(adapter);
Objects.requireNonNull(mLogRecycleView.getItemAnimator()).setAddDuration(250);
Objects.requireNonNull(mLogRecycleView.getItemAnimator()).setAddDuration(350);
mLogRecycleView.setNestedScrollingEnabled(false);
mLogRecycleView.setLayoutManager(new LinearLayoutManager(orbotLogController.this));
@ -151,38 +158,36 @@ public class orbotLogController extends AppCompatActivity {
@SuppressLint("NewApi") @SuppressWarnings("deprecation")
@Override
public void onGlobalLayout() {
if(orbotLogStatus.sScrollPosition!=-1 && orbotLogStatus.sUIInteracted){
if(orbotLogStatus.sOrientation==-1){
orbotLogStatus.sOrientation = getResources().getConfiguration().orientation;
}
if(orbotLogStatus.sOrientation != getResources().getConfiguration().orientation && orbotLogStatus.sScrollPosition!=-1 && orbotLogStatus.sScrollPosition!=0){
mNestedScrollView.stopNestedScroll();
orbotLogStatus.sScrollPosition = 0;
mNestedScrollView.scrollTo(0, orbotLogStatus.sScrollPosition);
}else if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
onScrollBottom();
orbotLogStatus.sOrientation = getResources().getConfiguration().orientation;
}else {
if(orbotLogStatus.sScrollPosition!=-1 && orbotLogStatus.sUIInteracted){
mNestedScrollView.scrollTo(0, orbotLogStatus.sScrollPosition);
}else if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
onScrollBottom();
}
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
mNestedScrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> orbotLogStatus.sScrollPosition = scrollY);
mNestedScrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
orbotLogStatus.sScrollPosition = scrollY;
});
}
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
mLogRecycleView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
orbotLogStatus.sOrientation = getResources().getConfiguration().orientation;
}
});
mNestedScrollView.setOnTouchListener((v, event) -> {
if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
orbotLogStatus.sUIInteracted = true;
}
if(event.getAction() == MotionEvent.ACTION_UP){
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
}
if(event.getAction() == MotionEvent.ACTION_UP){
mIsRecycleviewInteracting = false;
}else if(event.getAction() == MotionEvent.ACTION_DOWN){
mIsRecycleviewInteracting = true;
}
return false;
});
mLogRecycleView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
@ -193,21 +198,50 @@ public class orbotLogController extends AppCompatActivity {
}
});
mNestedScrollView.getViewTreeObserver() .addOnScrollChangedListener(() -> {
if (mNestedScrollView.getScrollY() == 0)
{
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
}
else if (mNestedScrollView.getChildAt(0).getBottom() <= (mNestedScrollView.getHeight() + mNestedScrollView.getScrollY())) {
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
mLogRecycleView.setOnTouchListener((v, event) -> onTouch(event));
mNestedScrollView.setOnTouchListener((v, event) -> onTouch(event));
mLogRecycleView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (!recyclerView.canScrollVertically(1) && newState==RecyclerView.SCROLL_STATE_IDLE) {
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
}
}
});
mNestedScrollView.getViewTreeObserver() .addOnScrollChangedListener(() -> {
if (mNestedScrollView.getChildAt(0).getBottom() <= (mNestedScrollView.getHeight() + mNestedScrollView.getScrollY())) {
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
if(!mIsRecycleviewInteracting){
orbotLogStatus.sUIInteracted = false;
}
}
if(mNestedScrollView.getScrollY() == 0){
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
}
});
}
public boolean onTouch(MotionEvent event){
if(event.getAction() == MotionEvent.ACTION_UP){
mIsRecycleviewInteracting = false;
if(mNestedScrollView.canScrollVertically(enums.ScrollDirection.VERTICAL)){
orbotLogStatus.sUIInteracted = true;
}
}else if(event.getAction() == MotionEvent.ACTION_DOWN){
mIsRecycleviewInteracting = true;
}
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);
return false;
}
private void logToString(){
if((int)mOrbotModel.onTrigger(M_GET_LIST_SIZE)>1){
for(int mCounter=0;mCounter<(int)mOrbotModel.onTrigger(M_GET_LIST_SIZE);mCounter++){
@ -243,6 +277,7 @@ public class orbotLogController extends AppCompatActivity {
if(!orbotLogStatus.sUIInteracted){
helperMethod.onDelayHandler(orbotLogController.this, 150, () -> {
Log.i("SUPFUCK4", orbotLogStatus.sUIInteracted + "");
if(!orbotLogStatus.sUIInteracted){
onScrollBottomAnimated(null);
}
@ -271,6 +306,7 @@ public class orbotLogController extends AppCompatActivity {
public void onScrollBottomAnimated(View view) {
mNestedScrollView.fullScroll(View.FOCUS_DOWN);
orbotLogStatus.sUIInteracted = false;
Log.i("SUPFUCK5", orbotLogStatus.sUIInteracted + "");
if(view!=null){
mOrbotLogViewController.onTrigger(M_FLOAT_BUTTON_UPDATE);

View File

@ -4,5 +4,5 @@ public class orbotLogStatus {
public static boolean sUIInteracted = false;
public static int sScrollPosition = -1;
public static int sOrientation = -1;
}

View File

@ -3,7 +3,6 @@ package com.darkweb.genesissearchengine.appManager.orbotManager;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
@ -18,10 +17,9 @@ import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.helperManager.SimpleGestureFilter;
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;
@ -39,7 +37,6 @@ public class orbotController extends AppCompatActivity {
private SwitchMaterial mBridgeSwitch;
private SwitchMaterial mVpnSwitch;
private LinearLayout mCustomizableBridgeMenu;
private GestureDetector mSwipeDirectionDetector;
/* INITIALIZATIONS */
@ -65,7 +62,7 @@ public class orbotController extends AppCompatActivity {
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
super.onConfigurationChanged(newConfig);
@ -88,16 +85,6 @@ public class orbotController extends AppCompatActivity {
/* LISTENERS */
private void onInitListener(){
mSwipeDirectionDetector=new GestureDetector(this,new SimpleGestureFilter(){
@Override
public boolean onSwipe(Direction direction) {
if (direction==Direction.left){
onClose(null);
}
return true;
}
});
}
public class orbotModelCallback implements eventObserver.eventListener{
@ -162,16 +149,6 @@ public class orbotController extends AppCompatActivity {
onClose(null);
}
@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();
float mEventX = ev.getX();

View File

@ -14,7 +14,7 @@ import com.darkweb.genesissearchengine.constants.constants;
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;
@ -52,7 +52,7 @@ public class proxyStatusController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -18,7 +18,7 @@ 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;
@ -63,7 +63,7 @@ public class settingAccessibilityController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -16,7 +16,7 @@ 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;
@ -58,7 +58,7 @@ public class settingAdvanceController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -11,19 +11,17 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.helpManager.helpController;
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.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;
@ -34,6 +32,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_BOOKMARK;
import static com.darkweb.genesissearchengine.constants.sql.SQL_CLEAR_HISTORY;
import static com.darkweb.genesissearchengine.pluginManager.pluginEnums.eMessageManager.M_DATA_CLEARED;
import static org.mozilla.geckoview.ContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY;
@ -60,7 +61,7 @@ public class settingClearController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}
@ -113,13 +114,13 @@ public class settingClearController extends AppCompatActivity {
if(mCheckBoxList.get(1).isChecked()){
mCheckBoxList.get(1).setChecked(false);
mCheckBoxList.get(1).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
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);
}
if(mCheckBoxList.get(2).isChecked()){
mCheckBoxList.get(2).setChecked(false);
mCheckBoxList.get(2).setButtonTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.c_checkbox_tint_default)));
databaseController.getInstance().execSQL(sql.SQL_CLEAR_BOOKMARK,null);
dataController.getInstance().invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_BOOKMARK,null));
dataController.getInstance().invokeBookmark(dataEnums.eBookmarkCommands.M_CLEAR_BOOKMARK ,null);
}
if(mCheckBoxList.get(3).isChecked()){

View File

@ -19,7 +19,7 @@ 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;
@ -66,7 +66,7 @@ public class settingGeneralController extends AppCompatActivity {
if(!mIsThemeChanging){
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -14,7 +14,7 @@ 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;
@ -55,7 +55,7 @@ public class settingLogController extends AppCompatActivity {
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -15,7 +15,7 @@ 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;
@ -48,7 +48,7 @@ public class settingNotificationController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -17,7 +17,7 @@ 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;
@ -55,7 +55,7 @@ public class settingPrivacyController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -16,7 +16,7 @@ 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;
@ -50,7 +50,7 @@ public class settingSearchController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager;
import android.content.Intent;
import android.content.res.Configuration;
@ -27,7 +27,7 @@ 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;
@ -69,9 +69,8 @@ public class settingHomeController 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){
if(activityThemeManager.getInstance().onInitTheme(this)){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
}
super.onConfigurationChanged(newConfig);

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager;
public class settingHomeEnums
{

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager;
import com.darkweb.genesissearchengine.eventObserver;

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomePage;
package com.darkweb.genesissearchengine.appManager.settingManager.settingHomeManager;
import android.os.Build;
import android.view.View;

View File

@ -16,7 +16,7 @@ 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;
@ -50,7 +50,7 @@ public class settingTrackingController extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
if(newConfig.uiMode != getResources().getConfiguration().uiMode){
activityContextManager.getInstance().onResetTheme();
theme.getInstance().onConfigurationChanged(this);
activityThemeManager.getInstance().onConfigurationChanged(this);
}
}

View File

@ -24,7 +24,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.helperManager.TopCropImageView;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.libs.views.ThumbnailCrop;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;
@ -288,7 +289,7 @@ public class tabAdapter extends RecyclerView.Adapter<tabAdapter.listViewHolder>
TextView mDate;
ImageView mLoadSession;
ImageButton mRemoveRow;
TopCropImageView mWebThumbnail;
ThumbnailCrop mWebThumbnail;
FrameLayout mSelectedView;
FrameLayout mItemSelectionMenu;
Button mItemSelectionMenuButton;

View File

@ -32,6 +32,7 @@ import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.example.myapplication.R;

View File

@ -2,10 +2,10 @@ package com.darkweb.genesissearchengine.appManager.tabManager;
import com.darkweb.genesissearchengine.dataManager.dataController;
import com.darkweb.genesissearchengine.dataManager.dataEnums;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
class tabModel

View File

@ -10,11 +10,12 @@ public class constants
public static final String CONST_SOFTWARE_URL = "https://genesishiddentechnologies.com/search?q=softwares+tools&p_num=1&s_type=all&p_num=1&s_type=all";
public static final String CONST_SOFTWARE_FINANCE = "https://genesishiddentechnologies.com/search?q=finance&p_num=1&s_type=all&p_num=1&s_type=all";
public static final String CONST_COMMUNITIES = "https://genesishiddentechnologies.com/search?q=news&p_num=1&s_type=all&p_num=1&s_type=all";
public static final String CONST_PLAYSTORE_URL = "http://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine";
public static final String CONST_PLAYSTORE_URL = "http://play.google.com/store/apps/details?id=com.darkweb.genesissearchengine.production";
public static final String CONST_PRIVACY_POLICY_URL = "https://genesishiddentechnologies.com/privacy";
public static final String CONST_REPORT_URL = "https://genesishiddentechnologies.com/reportus?url=";
public static final String CONST_SITEMAP = "https://genesishiddentechnologies.com/create";
public static final String CONST_PACKAGE_NAME = "com.darkweb.genesissearchengine.dev";
public static final String CONST_PACKAGE_NAME = "com.darkweb.genesissearchengine.production";
public static final String CONST_WIDGET_NAME = "com.darkweb.genesissearchengine.widget";
/*DRIVE URL DEV*/
@ -47,7 +48,7 @@ public class constants
public static final String CONST_BACKEND_DUCK_DUCK_GO_URL = "https://duckduckgo.com?q=$s&ia=web";
public static final String CONST_BACKEND_BING_URL = "https://bing.com/search?q=$s";
public static final String CONST_BACKEND_WIKI_URL = "https://en.wikipedia.org/wiki/$s";
public static final String CONST_LOG_DUCKDUCK = "https://duckduckgo.com/?q=tor ";
public static final String CONST_LOG_DUCKDUCK = "https://duckduckgo.com/?q=tor";
/*PROXY CONSTANTS*/

View File

@ -41,4 +41,9 @@ public class enums
public static final int VERTICAL = 1;
}
public static class WidgetCommands {
public static final String OPEN_APPLICATION = "mOpenApplication";
public static final String OPEN_VOICE = "mOpenVoice";
}
}

View File

@ -1,24 +1,33 @@
package com.darkweb.genesissearchengine.dataManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.eventObserver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class bookmarkDataModel {
/* Local Variables */
private eventObserver.eventListener mExternalEvents;
private ArrayList<bookmarkRowModel> mBookmarks;
public bookmarkDataModel(){
/* Initializations */
public bookmarkDataModel(eventObserver.eventListener pExternalEvents){
mBookmarks = new ArrayList<>();
mExternalEvents = pExternalEvents;
}
void initializebookmark(ArrayList<bookmarkRowModel> pBookmark){
mBookmarks = pBookmark;
}
/* Helper Methods */
private ArrayList<bookmarkRowModel> getBookmark() {
return mBookmarks;
}
@ -32,7 +41,7 @@ public class bookmarkDataModel {
int autoval = 0;
if(mBookmarks.size()> constants.CONST_MAX_BOOKMARK_SIZE)
{
databaseController.getInstance().execSQL("delete from bookmark where id="+ mBookmarks.get(mBookmarks.size()-1).getID(),null);
mExternalEvents.invokeObserver(Arrays.asList("delete from bookmark where id="+ mBookmarks.get(mBookmarks.size()-1).getID(),null), dataEnums.eBookmarkCallbackCommands.M_EXEC_SQL);
}
if(mBookmarks.size()>0)
@ -50,7 +59,7 @@ public class bookmarkDataModel {
params[1] = pURL;
if(!pTitle.equals("loading")){
databaseController.getInstance().execSQL("REPLACE INTO bookmark(id,title,url) VALUES("+autoval+",?,?);",params);
mExternalEvents.invokeObserver(Arrays.asList("REPLACE INTO bookmark(id,title,url) VALUES("+autoval+",?,?);",params), dataEnums.eBookmarkCallbackCommands.M_EXEC_SQL);
}
mBookmarks.add(0,new bookmarkRowModel(pTitle, pURL,autoval));
}
@ -65,9 +74,12 @@ public class bookmarkDataModel {
mBookmarks.remove(mCounter);
}
}
databaseController.getInstance().execSQL("delete from bookmark where id="+ pID,null);
mExternalEvents.invokeObserver(Arrays.asList("delete from bookmark where id="+ pID,null), dataEnums.eBookmarkCallbackCommands.M_EXEC_SQL);
}
/* External Triggers */
public Object onTrigger(dataEnums.eBookmarkCommands p_commands, List<Object> pData){
if(p_commands == dataEnums.eBookmarkCommands.M_GET_BOOKMARK){
return getBookmark();

View File

@ -9,24 +9,25 @@ import com.android.volley.toolbox.Volley;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import java.util.Arrays;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_BRIDGE_WEBSITES;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_BRIDGE_WEBSITES_DEV;
import static com.darkweb.genesissearchengine.constants.constants.CONST_SERVER;
import static com.darkweb.genesissearchengine.constants.constants.CONST_SERVER_DEV;
import static com.darkweb.genesissearchengine.constants.constants.*;
public class bridgesDataModel {
private String mBridges = "null";
/* Local Variables */
private String mBridges;
private boolean mLoading = false;
/* Initializations */
public bridgesDataModel(){
mBridges = status.sBridgesDefault;
}
/* Helper Methods */
private void onLoad(Context pContext){
if(!mLoading){
mLoading = true;
@ -66,6 +67,8 @@ public class bridgesDataModel {
return strings.GENERIC_EMPTY_SPACE;
}
/* External Triggers */
public Object onTrigger(dataEnums.eBridgeWebsiteCommands p_commands, List<Object> pData){
if(p_commands == dataEnums.eBridgeWebsiteCommands.M_LOAD){
onLoad((Context) pData.get(0));

View File

@ -2,14 +2,24 @@ package com.darkweb.genesissearchengine.dataManager;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.eventObserver;
import org.mozilla.geckoview.ContentBlocking;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.sql.*;
import static com.darkweb.genesissearchengine.constants.status.mThemeApplying;
import static org.mozilla.geckoview.ContentBlocking.CookieBehavior.ACCEPT_FIRST_PARTY;
public class dataController
{
@ -24,6 +34,7 @@ public class dataController
private helpDataModel mHelpDataModel;
private referenceWebsiteDataModel mReferenceWebsiteDataModel;
private bridgesDataModel mBridgeWebsiteDataModel;
private sqlCipherDataModel mSqlCipherDataModel;
/*Private Declarations*/
@ -36,36 +47,44 @@ public class dataController
/*Initializations*/
public void initialize(AppCompatActivity pAppContext){
mHistoryModel = new historyDataModel();
mTabModel = new tabDataModel();
mHistoryModel = new historyDataModel(new invokeHistoryCallbacks());
mTabModel = new tabDataModel(new invokeTabCallbacks());
mPreferenceModel = new preferenceDataModel(pAppContext);
mImageDataModel = new imageDataModel();
mBookmarkDataModel = new bookmarkDataModel();
mBookmarkDataModel = new bookmarkDataModel(new invokeBookmarkCallbacks());
mSuggestionDataModel = new suggestionDataModel(pAppContext);
mHelpDataModel = new helpDataModel();
mReferenceWebsiteDataModel = new referenceWebsiteDataModel();
mBridgeWebsiteDataModel = new bridgesDataModel();
mSqlCipherDataModel = new sqlCipherDataModel();
}
public void initializeListData(){
mReferenceWebsiteDataModel.onTrigger(dataEnums.eReferenceWebsiteCommands.M_LOAD,Collections.singletonList(activityContextManager.getInstance().getHomeController()));
mBridgeWebsiteDataModel.onTrigger(dataEnums.eBridgeWebsiteCommands.M_LOAD,Collections.singletonList(activityContextManager.getInstance().getHomeController()));
mBookmarkDataModel.initializebookmark(databaseController.getInstance().selectBookmark());
ArrayList<bookmarkRowModel> mBookmarks = (ArrayList<bookmarkRowModel>)invokeSQLCipher(dataEnums.eSqlCipherCommands.M_SELECT_BOOKMARK, null);
mBookmarkDataModel.initializebookmark(mBookmarks);
if(!status.sClearOnExit)
{
mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_INITIALIZE_HISTORY, Arrays.asList(databaseController.getInstance().selectHistory(0,constants.CONST_FETCHABLE_LIST_SIZE), databaseController.getInstance().getLargestHistoryID(),databaseController.getInstance().getLargestHistoryID()));
ArrayList<Object> mHistory = (ArrayList<Object>)invokeSQLCipher(dataEnums.eSqlCipherCommands.M_SELECT_HISTORY, Arrays.asList(0,constants.CONST_FETCHABLE_LIST_SIZE));
int mHistoryID = (int)invokeSQLCipher(dataEnums.eSqlCipherCommands.M_HISTORY_ID, null);
mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_INITIALIZE_HISTORY, Arrays.asList(mHistory, mHistoryID, mHistoryID));
}
else {
databaseController.getInstance().execSQL("delete from history where 1",null);
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList("delete from history where 1",null));
}
if(status.sRestoreTabs || mThemeApplying){
mTabModel.initializeTab(databaseController.getInstance().selectTabs());
ArrayList<tabRowModel> mTabs = (ArrayList<tabRowModel>)invokeSQLCipher(dataEnums.eSqlCipherCommands.M_SELECT_TABS, null);
mTabModel.initializeTab(mTabs);
activityContextManager.getInstance().getHomeController().initTabCountForced();
}else{
invokeTab(dataEnums.eTabCommands.M_CLEAR_TAB, null);
}
}
/*Recieving History*/
/*Trigger History*/
public Object invokeHistory(dataEnums.eHistoryCommands pCommands, List<Object> pData){
if(pCommands == dataEnums.eHistoryCommands.M_ADD_HISTORY){
@ -74,21 +93,40 @@ public class dataController
if(pCommands.equals(dataEnums.eHistoryCommands.M_LOAD_MORE_HISTORY)){
int m_history_size = (int) mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_HISTORY_SIZE,null) - 1;
return mHistoryModel.onTrigger(pCommands, Collections.singletonList(databaseController.getInstance().selectHistory(m_history_size+1,constants.CONST_FETCHABLE_LIST_SIZE)));
ArrayList<Object> mHistory = (ArrayList<Object>)invokeSQLCipher(dataEnums.eSqlCipherCommands.M_SELECT_HISTORY, Arrays.asList(m_history_size+1,constants.CONST_FETCHABLE_LIST_SIZE));
return mHistoryModel.onTrigger(pCommands, mHistory);
}else {
return mHistoryModel.onTrigger(pCommands, pData);
}
}
private class invokeHistoryCallbacks implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(dataEnums.eHistoryCallbackCommands.M_EXEC_SQL)){
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, data);
}
return null;
}
}
/*Trigger Suggestions*/
public Object invokeSuggestions(dataEnums.eSuggestionCommands pCommands, List<Object> pData){
return mSuggestionDataModel.onTrigger(pCommands, Arrays.asList(pData.get(0), mHistoryModel.onTrigger(dataEnums.eHistoryCommands.M_GET_HISTORY, null), mBookmarkDataModel.onTrigger(dataEnums.eBookmarkCommands.M_GET_BOOKMARK, null)));
}
/*Trigger Reference Websites*/
public Object invokeReferenceWebsite(dataEnums.eReferenceWebsiteCommands pCommands, List<Object> pData){
return mReferenceWebsiteDataModel.onTrigger(pCommands, null);
}
/*Recieving Preferences*/
/*Trigger Preferences*/
public Object invokePrefs(dataEnums.ePreferencesCommands pCommands, List<Object> pData){
if(mPreferenceModel==null){
return null;
@ -96,22 +134,106 @@ public class dataController
return mPreferenceModel.onTrigger(pCommands, pData);
}
/*Recieving Help*/
/*Trigger Help*/
public Object invokeHelp(dataEnums.eHelpCommands pCommands, List<Object> pData){
return mHelpDataModel.onTrigger(pCommands, pData);
}
/*Recieving History*/
/*Trigger Bookmarks*/
public Object invokeBookmark(dataEnums.eBookmarkCommands pCommands, List<Object> pData){
return mBookmarkDataModel.onTrigger(pCommands, pData);
}
private class invokeBookmarkCallbacks implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(dataEnums.eBookmarkCallbackCommands.M_EXEC_SQL)){
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, data);
}
return null;
}
}
/*Trigger Tabs*/
public Object invokeTab(dataEnums.eTabCommands pCommands, List<Object> pData){
return mTabModel.onTrigger(pCommands, pData);
}
private class invokeTabCallbacks implements eventObserver.eventListener{
@Override
public Object invokeObserver(List<Object> data, Object e_type)
{
if(e_type.equals(dataEnums.eTabCallbackCommands.M_EXEC_SQL)){
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, data);
}
return null;
}
}
/*Trigger Image Cache*/
public Object invokeImage(dataEnums.eImageCommands pCommands, List<Object> pData){
return mImageDataModel.onTrigger(pCommands, pData);
}
/*Trigger SQL Cipher Database*/
public Object invokeSQLCipher(dataEnums.eSqlCipherCommands pCommands, List<Object> pData){
return mSqlCipherDataModel.onTrigger(pCommands, pData);
}
/*Helper Methods*/
public void clearData(AppCompatActivity mContext){
dataController.getInstance().initialize(mContext);
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));
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_INIT, Collections.singletonList(mContext));
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_HISTORY,null));
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_BOOKMARK,null));
invokeSQLCipher(dataEnums.eSqlCipherCommands.M_EXEC_SQL, Arrays.asList(SQL_CLEAR_TAB,null));
status.initStatus(mContext);
}
}

View File

@ -2,11 +2,16 @@ package com.darkweb.genesissearchengine.dataManager;
public class dataEnums
{
/*Settings Manager*/
/* Triggers */
public enum eHistoryCommands {
M_GET_HISTORY, M_ADD_HISTORY, M_REMOVE_HISTORY, M_CLEAR_HISTORY,M_LOAD_MORE_HISTORY ,M_INITIALIZE_HISTORY, M_HISTORY_SIZE
}
public enum eSqlCipherCommands {
M_INIT, M_EXEC_SQL, M_SELECT_BOOKMARK, M_SELECT_HISTORY, M_SELECT_TABS, M_HISTORY_ID, M_DELETE_FROM_HISTORY
}
public enum eBookmarkCommands {
M_ADD_BOOKMARK, M_GET_BOOKMARK, M_DELETE_BOOKMARK, M_CLEAR_BOOKMARK;
}
@ -39,4 +44,17 @@ public class dataEnums
M_GET_HELP, M_SET_HELP
}
/* Callbacks */
public enum eHistoryCallbackCommands {
M_EXEC_SQL
}
public enum eTabCallbackCommands {
M_EXEC_SQL
}
public enum eBookmarkCallbackCommands {
M_EXEC_SQL
}
}

View File

@ -7,12 +7,18 @@ import java.util.List;
@SuppressLint("CommitPrefEdits")
class helpDataModel
{
/* Local Variables */
private ArrayList<helpDataModel> mHelpListModel;
/* Initializations */
helpDataModel(){
mHelpListModel = new ArrayList<>();
}
/* Helper Methods */
ArrayList<helpDataModel> getHelpModel(){
return mHelpListModel;
}
@ -22,10 +28,8 @@ class helpDataModel
mHelpListModel.addAll(pHelpListModel);
}
/*List Tabs*/
/* External Triggers */
/*List Suggestion*/
public Object onTrigger(dataEnums.eHelpCommands pCommands, List<Object> pData){
if(pCommands.equals(dataEnums.eHelpCommands.M_GET_HELP)){
return getHelpModel();

View File

@ -1,12 +1,13 @@
package com.darkweb.genesissearchengine.dataManager;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.constants.constants;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
@ -15,16 +16,24 @@ import java.util.Map;
public class historyDataModel {
/* Local Variables */
private eventObserver.eventListener mExternalEvents;
private int mMaxHistoryId = 0;
private int mHistorySize = 0;
private ArrayList<historyRowModel> mHistory;
private Map<Integer, historyRowModel> mHistoryCache;
public historyDataModel(){
public historyDataModel(eventObserver.eventListener pExternalEvents){
mHistory = new ArrayList<>();
mHistoryCache = new HashMap<>();
mExternalEvents = pExternalEvents;
}
/* Initializations */
void initializeHistory(ArrayList<historyRowModel> history, int pMaxHistoryId, int pHistorySize){
mMaxHistoryId = pMaxHistoryId;
mHistorySize = pHistorySize;
@ -44,6 +53,8 @@ public class historyDataModel {
}
}
/* Helper Methods */
private ArrayList<historyRowModel> getHistory() {
return mHistory;
}
@ -68,7 +79,7 @@ public class historyDataModel {
cal.setTime(mHistory.get(m_count).getDate());
if (dayOfYear == cal.get(Calendar.DAY_OF_YEAR)) {
databaseController.getInstance().execSQL("DELETE FROM history WHERE id = " + mHistory.get(m_count).getID(), null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM history WHERE id = " + mHistory.get(m_count).getID(), null), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
mHistoryCache.remove(mHistory.get(m_count).getID());
mHistory.remove(m_count);
m_count = m_count-1;
@ -97,12 +108,12 @@ public class historyDataModel {
params[0] = pUrl;
params[1] = pHeader;
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
databaseController.getInstance().execSQL("UPDATE history SET date = '" + m_date + "' , url = ? , title = ? WHERE id="+pID,params);
mExternalEvents.invokeObserver(Arrays.asList("UPDATE history SET date = '" + m_date + "' , url = ? , title = ? WHERE id="+pID,params), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
return pID;
}else {
if(mHistorySize > constants.CONST_MAX_LIST_DATA_SIZE)
{
databaseController.getInstance().execSQL("DELETE FROM history WHERE id IN (SELECT id FROM History ORDER BY id ASC LIMIT "+(constants.CONST_MAX_LIST_DATA_SIZE /2)+")",null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM history WHERE id IN (SELECT id FROM History ORDER BY id ASC LIMIT "+(constants.CONST_MAX_LIST_DATA_SIZE /2)+")",null), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
}
if(pHeader.equals("loading")){
@ -119,7 +130,7 @@ public class historyDataModel {
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
if(!pHeader.equals("loading")){
databaseController.getInstance().execSQL("REPLACE INTO history(id,date,url,title) VALUES("+ mMaxHistoryId +",'" + m_date + "',?,?);",params);
mExternalEvents.invokeObserver(Arrays.asList("REPLACE INTO history(id,date,url,title) VALUES("+ mMaxHistoryId +",'" + m_date + "',?,?);",params), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
}
mHistory.add(0,new historyRowModel(pHeader,pUrl, mMaxHistoryId));
@ -129,13 +140,12 @@ public class historyDataModel {
}
}
private void removeHistory(int pID){
databaseController.getInstance().execSQL("DELETE FROM history WHERE id = "+pID,null);
databaseController.getInstance().selectHistory(0,constants.CONST_FETCHABLE_LIST_SIZE);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM history WHERE id = "+pID,null), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
mHistoryCache.remove(pID);
mHistorySize -= 1;
}
private void clearHistory(){
databaseController.getInstance().execSQL("DELETE FROM history WHERE 1 ",null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM history WHERE 1 ",null), dataEnums.eHistoryCallbackCommands.M_EXEC_SQL);
mHistory.clear();
mHistoryCache.clear();
}
@ -148,6 +158,8 @@ public class historyDataModel {
return pHistory.size() > 0;
}
/* External Triggers */
public Object onTrigger(dataEnums.eHistoryCommands pCommands, List<Object> pData){
if(pCommands == dataEnums.eHistoryCommands.M_GET_HISTORY){
return getHistory();

View File

@ -4,7 +4,7 @@ import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.dataManager.models.imageManagerModel;
import com.darkweb.genesissearchengine.dataManager.models.imageRowModel;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import java.io.IOException;
import java.io.InputStream;
@ -15,17 +15,22 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.darkweb.genesissearchengine.constants.constants.CONST_PROXY_SOCKS;
import static com.darkweb.genesissearchengine.constants.enums.ImageQueueStatus.M_IMAGE_LOADED_SUCCESSFULLY;
import static com.darkweb.genesissearchengine.constants.enums.ImageQueueStatus.M_IMAGE_LOADING_FAILED;
import static com.darkweb.genesissearchengine.constants.constants.*;
import static com.darkweb.genesissearchengine.constants.enums.ImageQueueStatus.*;
@SuppressLint("CommitPrefEdits")
class imageDataModel
{
private Map<String, imageManagerModel> mImageCache;
/* Local Variables */
private Map<String, imageRowModel> mImageCache;
private Map<String, Integer> mParsedQueues;
private ArrayList<String> mRequestQueue;
/* Initializations */
public imageDataModel(){
mImageCache = new HashMap<>();
mParsedQueues = new HashMap<>();
@ -34,6 +39,7 @@ class imageDataModel
mBackgroundThread();
}
/* Helper Methods */
private void onRequestImage(String mURL){
String mCraftedURL = helperMethod.completeURL(helperMethod.getDomainName(mURL))+"/favicon.ico";
@ -61,10 +67,10 @@ class imageDataModel
mParsedQueues.put(mRequestQueue.get(0), enums.ImageQueueStatus.M_IMAGE_LOADING);
Bitmap mBitmap = getBitmapFromURL(mRequestQueue.get(0));
if(mBitmap==null){
mParsedQueues.put(mRequestQueue.get(0), enums.ImageQueueStatus.M_IMAGE_LOADING_FAILED);
mParsedQueues.put(mRequestQueue.get(0), M_IMAGE_LOADING_FAILED);
}else {
mParsedQueues.put(mRequestQueue.get(0), M_IMAGE_LOADED_SUCCESSFULLY);
mImageCache.put(mRequestQueue.get(0), new imageManagerModel(helperMethod.createRandomID(), "",mRequestQueue.get(0),mBitmap));
mImageCache.put(mRequestQueue.get(0), new imageRowModel(helperMethod.createRandomID(), "",mRequestQueue.get(0),mBitmap));
}
mRequestQueue.remove(0);
}
@ -93,7 +99,8 @@ class imageDataModel
}
}
/*List Suggestion*/
/* External Triggers */
public Object onTrigger(dataEnums.eImageCommands pCommands, List<Object> pData){
if(pCommands.equals(dataEnums.eImageCommands.M_REQUEST_IMAGE_URL)){

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.bookmarkManager;
package com.darkweb.genesissearchengine.dataManager.models;
import android.widget.ImageView;
import java.util.Calendar;

View File

@ -1,6 +1,5 @@
package com.darkweb.genesissearchengine.appManager.historyManager;
package com.darkweb.genesissearchengine.dataManager.models;
import android.os.Handler;
import android.widget.ImageView;
import java.util.Calendar;
import java.util.Date;

View File

@ -1,9 +1,8 @@
package com.darkweb.genesissearchengine.dataManager.models;
import android.graphics.Bitmap;
import java.util.Date;
public class imageManagerModel
public class imageRowModel
{
/*Private Variables*/
@ -13,7 +12,7 @@ public class imageManagerModel
private Bitmap mImage;
/*Initializations*/
public imageManagerModel(String pID, String pCreationDate, String pURL, Bitmap pImage){
public imageRowModel(String pID, String pCreationDate, String pURL, Bitmap pImage){
mID = pID;
mCreationDate = pCreationDate;
mURL = pURL;

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.appManager.tabManager;
package com.darkweb.genesissearchengine.dataManager.models;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

View File

@ -1,22 +1,29 @@
package com.darkweb.genesissearchengine.dataManager;
import android.annotation.SuppressLint;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import androidx.appcompat.app.AppCompatActivity;
import java.util.List;
public class preferenceDataModel {
/* Local Variables */
private SharedPreferences mPrefs;
private SharedPreferences.Editor mEdit;
/* Initializations */
@SuppressLint("CommitPrefEdits")
public preferenceDataModel(AppCompatActivity pAppContext){
mPrefs = PreferenceManager.getDefaultSharedPreferences(pAppContext);
mEdit = mPrefs.edit();
}
/* Helper Methods */
void clearPrefs(){
mEdit.clear();
mEdit.apply();
@ -51,6 +58,8 @@ public class preferenceDataModel {
return mPrefs.getInt(pValueKey, pValueDefault);
}
/* External Triggers */
public Object onTrigger(dataEnums.ePreferencesCommands pCommands, List<Object> pData){
if(pCommands == dataEnums.ePreferencesCommands.M_GET_BOOL){
return getBool((String)pData.get(0), (boolean)pData.get(1));

View File

@ -8,23 +8,25 @@ import com.android.volley.toolbox.Volley;
import com.darkweb.genesissearchengine.constants.keys;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import java.util.Arrays;
import java.util.List;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_REFERENCE_WEBSITES;
import static com.darkweb.genesissearchengine.constants.constants.CONST_GENESIS_REFERENCE_WEBSITES_DEV;
import static com.darkweb.genesissearchengine.constants.constants.CONST_SERVER;
import static com.darkweb.genesissearchengine.constants.constants.CONST_SERVER_DEV;
import static com.darkweb.genesissearchengine.constants.constants.*;
public class referenceWebsiteDataModel {
private String mReferenceWebsiteData = "null";
/* Local Variables */
private String mReferenceWebsiteData;
private boolean mLoading = false;
/* Initializations */
public referenceWebsiteDataModel(){
mReferenceWebsiteData = status.sReferenceWebsites;
}
/* Helper Methods */
private void onLoad(Context pContext){
if(!mLoading){
mLoading = true;
@ -64,6 +66,8 @@ public class referenceWebsiteDataModel {
return strings.GENERIC_EMPTY_SPACE;
}
/* External Triggers */
public Object onTrigger(dataEnums.eReferenceWebsiteCommands p_commands, List<Object> pData){
if(p_commands == dataEnums.eReferenceWebsiteCommands.M_LOAD){
onLoad((Context) pData.get(0));

View File

@ -1,13 +1,12 @@
package com.darkweb.genesissearchengine.databaseManager;
package com.darkweb.genesissearchengine.dataManager;
import android.content.ContentValues;
import android.database.Cursor;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.constants.constants;
import net.sqlcipher.database.SQLiteDatabaseHook;
import net.sqlcipher.database.SQLiteDatabase;
@ -17,28 +16,23 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import static com.darkweb.genesissearchengine.constants.constants.CONST_DATABASE_NAME;
public class databaseController
public class sqlCipherDataModel
{
/*Private Variables*/
private static final databaseController sOurInstance = new databaseController();
private static SQLiteDatabase sDatabaseInstance;
public static databaseController getInstance()
{
return sOurInstance;
}
/*Initializations*/
public void prepareDatabaseEnvironment(AppCompatActivity app_context) {
private void prepareDatabaseEnvironment(AppCompatActivity app_context) {
File databaseFile = app_context.getDatabasePath(CONST_DATABASE_NAME + "_SECURE");
if (!databaseFile.exists()) {
@ -46,7 +40,7 @@ public class databaseController
}
}
public void initialize(AppCompatActivity app_context)
private void initialize(AppCompatActivity app_context)
{
try
{
@ -68,7 +62,7 @@ public class databaseController
/*Helper Methods*/
public SQLiteDatabaseHook wrapHook(final SQLiteDatabaseHook hook) {
private SQLiteDatabaseHook wrapHook(final SQLiteDatabaseHook hook) {
if (hook == null)
{
return keyHook;
@ -100,7 +94,7 @@ public class databaseController
}
};
public void execSQL(String query,String[] params)
private void execSQL(String query,String[] params)
{
if(params==null)
{
@ -112,15 +106,7 @@ public class databaseController
}
}
public void execTab(String query, ContentValues params,String pID)
{
if(params!=null)
{
sDatabaseInstance.update(query, params, "mid = ?", new String[]{pID});
}
}
public ArrayList<historyRowModel> selectHistory(int pStartIndex,int pEndIndex){
private ArrayList<historyRowModel> selectHistory(int pStartIndex,int pEndIndex){
ArrayList<historyRowModel> tempmodel = new ArrayList<>();
Cursor c = sDatabaseInstance.rawQuery("SELECT * FROM history ORDER BY date DESC LIMIT " + pEndIndex + " OFFSET "+pStartIndex, null);
@ -145,7 +131,7 @@ public class databaseController
return tempmodel;
}
public ArrayList<tabRowModel> selectTabs(){
private ArrayList<tabRowModel> selectTabs(){
ArrayList<tabRowModel> mTempListModel = new ArrayList<>();
Cursor c = sDatabaseInstance.rawQuery("SELECT * FROM tab ORDER BY date ASC", null);
@ -175,7 +161,7 @@ public class databaseController
return mTempListModel;
}
public int getLargestHistoryID(){
private int getLargestHistoryID(){
int id = 0;
Cursor c = sDatabaseInstance.rawQuery("SELECT max(id) FROM history", null);
@ -193,7 +179,7 @@ public class databaseController
return id;
}
public ArrayList<bookmarkRowModel> selectBookmark(){
private ArrayList<bookmarkRowModel> selectBookmark(){
ArrayList<bookmarkRowModel> tempmodel = new ArrayList<>();
Cursor c = sDatabaseInstance.rawQuery("SELECT * FROM bookmark ORDER BY id DESC ", null);
@ -207,8 +193,36 @@ public class databaseController
return tempmodel;
}
public void deleteFromList(int index,String table) {
databaseController.getInstance().execSQL("delete from "+table+" where id="+index,null);
private void deleteFromList(int index,String table) {
execSQL("delete from "+table+" where id="+index,null);
}
/* External Triggers */
public Object onTrigger(dataEnums.eSqlCipherCommands pCommands, List<Object> pData){
if(pCommands == dataEnums.eSqlCipherCommands.M_INIT){
initialize((AppCompatActivity)pData.get(0));
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_EXEC_SQL){
execSQL((String)pData.get(0), (String[])pData.get(1));
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_SELECT_BOOKMARK){
return selectBookmark();
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_SELECT_HISTORY){
return selectHistory((int)pData.get(0), (int)pData.get(1));
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_SELECT_TABS){
return selectTabs();
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_HISTORY_ID){
return getLargestHistoryID();
}
else if(pCommands == dataEnums.eSqlCipherCommands.M_DELETE_FROM_HISTORY){
deleteFromList((int)pData.get(0), (String)pData.get(1));
}
return null;
}
}

View File

@ -4,15 +4,13 @@ import android.content.Context;
import android.view.textservice.SentenceSuggestionsInfo;
import android.view.textservice.SpellCheckerSession;
import android.view.textservice.SuggestionsInfo;
import android.view.textservice.TextServicesManager;
import com.darkweb.genesissearchengine.appManager.bookmarkManager.bookmarkRowModel;
import com.darkweb.genesissearchengine.appManager.historyManager.historyRowModel;
import com.darkweb.genesissearchengine.dataManager.models.bookmarkRowModel;
import com.darkweb.genesissearchengine.dataManager.models.historyRowModel;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import org.mozilla.gecko.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
@ -20,8 +18,6 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
/*Private Variables*/
private SpellCheckerSession mSpellCheckerSession;
private TextServicesManager mTextServicesManager;
private ArrayList<historyRowModel> mHintListLocalCache;
private ArrayList<historyRowModel> mCurrentList = new ArrayList<>();
@ -29,16 +25,12 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
/*Initializations*/
public suggestionDataModel(Context mContext){
mTextServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
mSpellCheckerSession = mTextServicesManager.newSpellCheckerSession(null, null, this, true);
mHintListLocalCache = initSuggestions();
}
/*Helper Methods*/
private ArrayList<historyRowModel> getDefaultSuggestionsOnStart(String pQuery, int mSize, ArrayList<String> mDuplicationHandler, boolean pDefaultHostChaned){
private ArrayList<historyRowModel> getDefaultSuggestionsOnStart(String pQuery){
if(pQuery.equals(strings.GENERIC_EMPTY_STR) || pQuery.trim().isEmpty()) {
pQuery = "hidden web";
@ -123,7 +115,6 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
}
mCurrentList = new ArrayList<>();
mCurrentList.clear();
String mQueryOriginal = pQuery;
pQuery = pQuery.replace("+","%").replace(" ","+");
ArrayList<historyRowModel> mHistory = pHistory;
@ -354,7 +345,7 @@ public class suggestionDataModel implements SpellCheckerSession.SpellCheckerSess
}
else if(pCommands == dataEnums.eSuggestionCommands.M_GET_DEFAULT_SUGGESTION)
{
return getDefaultSuggestionsOnStart((String) pData.get(0),0, null, false);
return getDefaultSuggestionsOnStart((String) pData.get(0));
}
return null;

View File

@ -4,28 +4,20 @@ import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.databaseManager.databaseController;
import com.darkweb.genesissearchengine.appManager.homeManager.geckoManager.geckoSession;
import com.darkweb.genesissearchengine.appManager.tabManager.tabRowModel;
import com.darkweb.genesissearchengine.dataManager.models.tabRowModel;
import com.darkweb.genesissearchengine.constants.enums;
import com.darkweb.genesissearchengine.constants.strings;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.eventObserver;
import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.geckoview.GeckoView;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
@ -33,17 +25,28 @@ import java.util.Locale;
@SuppressLint("CommitPrefEdits")
class tabDataModel
{
private ArrayList<tabRowModel> mTabs = new ArrayList<>();
ArrayList<tabRowModel> getTab(){
return mTabs;
/* Local Variables */
private eventObserver.eventListener mExternalEvents;
/* Initializations */
public tabDataModel(eventObserver.eventListener pExternalEvents){
mExternalEvents = pExternalEvents;
}
/*List Tabs*/
private ArrayList<tabRowModel> mTabs = new ArrayList<>();
void initializeTab(ArrayList<tabRowModel> pTabMdel){
mTabs.addAll(pTabMdel);
}
/* Helper Methods */
ArrayList<tabRowModel> getTab(){
return mTabs;
}
geckoSession getHomePage(){
if(mTabs.size()>0){
return mTabs.get(0).getSession();
@ -76,7 +79,7 @@ class tabDataModel
return enums.AddTabCallback.TAB_ADDED;
}
databaseController.getInstance().execSQL("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabModel.getmId() +"','" + m_date + "',?,?,?);",params);
mExternalEvents.invokeObserver(Arrays.asList("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabModel.getmId() +"','" + m_date + "',?,?,?);",params), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
}
return enums.AddTabCallback.TAB_ADDED;
}
@ -95,7 +98,7 @@ class tabDataModel
mTabs.remove(0);
}
databaseController.getInstance().execSQL("DELETE FROM tab WHERE 1",null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM tab WHERE 1",null), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
}
@ -115,7 +118,8 @@ class tabDataModel
break;
}
}
databaseController.getInstance().execSQL("DELETE FROM tab WHERE mid='" + mID + "'",null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM tab WHERE mid='" + mID + "'",null), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
}else {
for(int counter = 0; counter< mTabs.size(); counter++){
if(mTabs.get(counter).getSession().getSessionID().equals(mSession.getSessionID()))
@ -126,7 +130,7 @@ class tabDataModel
break;
}
}
databaseController.getInstance().execSQL("DELETE FROM tab WHERE mid='" + pID + "'",null);
mExternalEvents.invokeObserver(Arrays.asList("DELETE FROM tab WHERE mid='" + pID + "'",null), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
}
}
@ -137,7 +141,8 @@ class tabDataModel
if(mTabs.get(counter).getSession().getSessionID().equals(mSession.getSessionID()))
{
String m_date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.ENGLISH).format(Calendar.getInstance().getTime());
databaseController.getInstance().execSQL("UPDATE tab SET date = '" + m_date + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null);
mExternalEvents.invokeObserver(Arrays.asList("UPDATE tab SET date = '" + m_date + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
mTabs.add(0,mTabs.remove(counter));
break;
}
@ -154,7 +159,7 @@ class tabDataModel
if(mTabs.get(counter).getSession().getSessionID().equals(mSessionID))
{
databaseController.getInstance().execSQL("UPDATE tab SET session = '" + mSessionState + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null);
mExternalEvents.invokeObserver(Arrays.asList("UPDATE tab SET session = '" + mSessionState + "' WHERE mid='"+mTabs.get(counter).getmId() + "'",null), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
mTabs.add(0,mTabs.remove(counter));
break;
}
@ -184,7 +189,7 @@ class tabDataModel
return false;
}
databaseController.getInstance().execSQL("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabs.get(counter).getmId() +"','" + m_date + "',?,?,?);",params);
mExternalEvents.invokeObserver(Arrays.asList("REPLACE INTO tab(mid,date,title,url,theme) VALUES('"+ mTabs.get(counter).getmId() +"','" + m_date + "',?,?,?);",params), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
return true;
}
}
@ -220,39 +225,8 @@ class tabDataModel
}
}
@SuppressLint("HandlerLeak")
static Handler handler = new Handler()
{
@Override
public void dispatchMessage(@NonNull Message msg) {
super.dispatchMessage(msg);
}
@NonNull
@Override
public String getMessageName(@NonNull Message message) {
return super.getMessageName(message);
}
@Override
public boolean sendMessageAtTime(@NonNull Message msg, long uptimeMillis) {
return super.sendMessageAtTime(msg, uptimeMillis);
}
@Override
public String toString() {
return super.toString();
}
@Override
public void handleMessage(Message msg)
{
Log.i("FUCK","FUCK");
}
};
// int isLoading = 0;
public void updatePixels(String pSessionID, GeckoResult<Bitmap> pBitmapManager, ImageView pImageView, GeckoView pGeckoView, boolean pOpenTabView){
public void updatePixels(String pSessionID, GeckoResult<Bitmap> pBitmapManager, ImageView pImageView, boolean pOpenTabView){
new Thread(){
public void run(){
@ -260,7 +234,6 @@ class tabDataModel
for(int counter = 0; counter< mTabs.size(); counter++) {
int finalCounter = counter;
if (mTabs.get(counter).getSession().getSessionID().equals(pSessionID)) {
GeckoResult<Bitmap> mResult = pBitmapManager.withHandler(handler);
Bitmap mBitmap = pBitmapManager.poll(0);
ByteArrayOutputStream out = new ByteArrayOutputStream();
@ -274,15 +247,13 @@ class tabDataModel
mTabs.get(finalCounter).setmBitmap(decoded);
if(pImageView!=null){
activityContextManager.getInstance().getHomeController().runOnUiThread(() -> {
pImageView.setImageBitmap(mBitmap);
});
activityContextManager.getInstance().getHomeController().runOnUiThread(() -> pImageView.setImageBitmap(mBitmap));
}
byte[] mThumbnail = out.toByteArray();
ContentValues mContentValues = new ContentValues();
mContentValues.put("mThumbnail", mThumbnail);
databaseController.getInstance().execTab("tab",mContentValues, mTabs.get(finalCounter).getmId());
mExternalEvents.invokeObserver(Arrays.asList("tab",mContentValues, mTabs.get(finalCounter).getmId()), dataEnums.eTabCallbackCommands.M_EXEC_SQL);
}
}
}
@ -360,7 +331,7 @@ class tabDataModel
return getSuggestions((String) pData.get(0));
}
else if(pCommands == dataEnums.eTabCommands.M_UPDATE_PIXEL){
updatePixels((String)pData.get(0), (GeckoResult<Bitmap>)pData.get(1), (ImageView) pData.get(2), (GeckoView) pData.get(3), (Boolean) pData.get(4));
updatePixels((String)pData.get(0), (GeckoResult<Bitmap>)pData.get(1), (ImageView) pData.get(2), (Boolean) pData.get(4));
}
else if(pCommands == dataEnums.eTabCommands.M_HOME_PAGE){
return getHomePage();
@ -368,5 +339,4 @@ class tabDataModel
return null;
}
}

View File

@ -1,130 +0,0 @@
package com.darkweb.genesissearchengine.helperManager;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import java.net.URLConnection;
import java.util.List;
public class ProxySelector {
public static URLConnection openConnectionWithProxy(final URI uri) throws IOException {
return uri.toURL().openConnection(ProxySettings.getProxy());
}
public ProxySelector() {
}
public Proxy select(String scheme, String host) {
int port = -1;
Proxy proxy = null;
String nonProxyHostsKey = null;
boolean httpProxyOkay = true;
if ("http".equalsIgnoreCase(scheme)) {
port = 80;
nonProxyHostsKey = "http.nonProxyHosts";
proxy = lookupProxy("http.proxyHost", "http.proxyPort", Proxy.Type.HTTP, port);
} else if ("https".equalsIgnoreCase(scheme)) {
port = 443;
nonProxyHostsKey = "https.nonProxyHosts"; // RI doesn't support this
proxy = lookupProxy("https.proxyHost", "https.proxyPort", Proxy.Type.HTTP, port);
} else if ("ftp".equalsIgnoreCase(scheme)) {
port = 80; // not 21 as you might guess
nonProxyHostsKey = "ftp.nonProxyHosts";
proxy = lookupProxy("ftp.proxyHost", "ftp.proxyPort", Proxy.Type.HTTP, port);
} else if ("socket".equalsIgnoreCase(scheme)) {
httpProxyOkay = false;
} else {
return Proxy.NO_PROXY;
}
if (nonProxyHostsKey != null
&& isNonProxyHost(host, System.getProperty(nonProxyHostsKey))) {
return Proxy.NO_PROXY;
}
if (proxy != null) {
return proxy;
}
if (httpProxyOkay) {
proxy = lookupProxy("proxyHost", "proxyPort", Proxy.Type.HTTP, port);
if (proxy != null) {
return proxy;
}
}
proxy = lookupProxy("socksProxyHost", "socksProxyPort", Proxy.Type.SOCKS, 1080);
if (proxy != null) {
return proxy;
}
return Proxy.NO_PROXY;
}
/**
* Returns the proxy identified by the {@code hostKey} system property, or
* null.
*/
@Nullable
private Proxy lookupProxy(String hostKey, String portKey, Proxy.Type type, int defaultPort) {
final String host = System.getProperty(hostKey);
if (TextUtils.isEmpty(host)) {
return null;
}
final int port = getSystemPropertyInt(portKey, defaultPort);
if (port == -1) {
// Port can be -1. See bug 1270529.
return null;
}
return new Proxy(type, InetSocketAddress.createUnresolved(host, port));
}
private int getSystemPropertyInt(String key, int defaultValue) {
String string = System.getProperty(key);
if (string != null) {
try {
return Integer.parseInt(string);
} catch (NumberFormatException ignored) {
}
}
return defaultValue;
}
/**
* Returns true if the {@code nonProxyHosts} system property pattern exists
* and matches {@code host}.
*/
private boolean isNonProxyHost(String host, String nonProxyHosts) {
if (host == null || nonProxyHosts == null) {
return false;
}
// construct pattern
StringBuilder patternBuilder = new StringBuilder();
for (int i = 0; i < nonProxyHosts.length(); i++) {
char c = nonProxyHosts.charAt(i);
switch (c) {
case '.':
patternBuilder.append("\\.");
break;
case '*':
patternBuilder.append(".*");
break;
default:
patternBuilder.append(c);
}
}
// check whether the host is the nonProxyHosts.
String pattern = patternBuilder.toString();
return host.matches(pattern);
}
}

View File

@ -1,21 +0,0 @@
package com.darkweb.genesissearchengine.helperManager;
import java.net.InetSocketAddress;
import java.net.Proxy;
import ch.boye.httpclientandroidlib.HttpHost;
public class ProxySettings {
private static final String TOR_PROXY_ADDRESS = "127.0.0.1";
private static final int TOR_PROXY_PORT = 8118;
public static Proxy getProxy() {
// TODO make configurable
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(TOR_PROXY_ADDRESS, TOR_PROXY_PORT));
}
public static HttpHost getProxyHost() {
// TODO make configurable
return new HttpHost(TOR_PROXY_ADDRESS, TOR_PROXY_PORT);
}
}

View File

@ -1,102 +0,0 @@
package com.darkweb.genesissearchengine.helperManager;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
public class SimpleGestureFilter extends SimpleOnGestureListener{
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
float x1 = e1.getX();
float y1 = e1.getY();
float x2 = e2.getX();
float y2 = e2.getY();
Direction direction = getDirection(x1,y1,x2,y2);
return onSwipe(direction);
}
public boolean onSwipe(Direction direction){
return false;
}
/**
* Given two points in the plane p1=(x1, x2) and p2=(y1, y1), this method
* returns the direction that an arrow pointing from p1 to p2 would have.
* @param x1 the x position of the first point
* @param y1 the y position of the first point
* @param x2 the x position of the second point
* @param y2 the y position of the second point
* @return the direction
*/
public Direction getDirection(float x1, float y1, float x2, float y2){
double angle = getAngle(x1, y1, x2, y2);
return Direction.get(angle);
}
/**
*
* Finds the angle between two points in the plane (x1,y1) and (x2, y2)
* The angle is measured with 0/360 being the X-axis to the right, angles
* increase counter clockwise.
*
* @param x1 the x position of the first point
* @param y1 the y position of the first point
* @param x2 the x position of the second point
* @param y2 the y position of the second point
* @return the angle between two points
*/
public double getAngle(float x1, float y1, float x2, float y2) {
double rad = Math.atan2(y1-y2,x2-x1) + Math.PI;
return (rad*180/Math.PI + 180)%360;
}
public enum Direction{
up,
down,
left,
right;
/**
* Returns a direction given an angle.
* Directions are defined as follows:
*
* Up: [45, 135]
* Right: [0,45] and [315, 360]
* Down: [225, 315]
* Left: [135, 225]
*
* @param angle an angle from 0 to 360 - e
* @return the direction of an angle
*/
public static Direction get(double angle){
if(inRange(angle, 45, 135)){
return Direction.up;
}
else if(inRange(angle, 0,45) || inRange(angle, 315, 360)){
return Direction.right;
}
else if(inRange(angle, 225, 315)){
return Direction.down;
}
else{
return Direction.left;
}
}
/**
* @param angle an angle
* @param init the initial bound
* @param end the final bound
* @return returns true if the given angle is in the interval [init, end).
*/
private static boolean inRange(double angle, float init, float end){
return (angle >= init) && (angle < end);
}
}
}

View File

@ -700,7 +700,7 @@ public class helperMethod
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
try {
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.provider.dev", url);
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.production.provider", url);
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url.toString()));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@ -711,7 +711,7 @@ public class helperMethod
}
} else{
try {
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.provider.dev", url);
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.production.provider", url);
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url.toString()));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View File

@ -1,91 +0,0 @@
package com.darkweb.genesissearchengine.helperManager;
import android.app.Notification ;
import android.app.NotificationChannel ;
import android.app.NotificationManager ;
import android.app.PendingIntent;
import android.content.BroadcastReceiver ;
import android.content.Context ;
import android.content.Intent ;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import androidx.core.app.NotificationCompat;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.constants.strings;
import com.example.myapplication.R;
import java.util.Random;
public class userEngagementNotification extends BroadcastReceiver {
public void onReceive (Context context , Intent intent) {
final int NOTIFY_ID = status.mNotificationID;
String pTitle = strings.NOTIFICATION_TITLE;
String pBody = strings.NOTIFICATION_BODY[new Random().nextInt(strings.NOTIFICATION_BODY.length)];
// There are hardcoding only for show it's just strings
String name = "NOTIFICATION:INDENTIFIER:1001";
String id = "NOTIFICATION:INDENTIFIER:1001"; // The user-visible name of the channel.
String description = "NOTIFICATION:INDENTIFIER:1001"; // The user-visible description of the channel.
NotificationCompat.Builder builder;
NotificationManager mNotifManager = (NotificationManager)context.getSystemService(Context. NOTIFICATION_SERVICE ) ;
if (mNotifManager == null) {
mNotifManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = mNotifManager.getNotificationChannel(id);
if (mChannel == null) {
mChannel = new NotificationChannel(id, name, importance);
mChannel.setDescription(description);
mChannel.enableVibration(true);
mChannel.setLightColor(Color.GREEN);
mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
mNotifManager.createNotificationChannel(mChannel);
}
builder = new NotificationCompat.Builder(context, id);
PackageManager pm = context.getPackageManager();
Intent mIntent = activityContextManager.getInstance().getHomeController().getIntent();
PendingIntent pendIntent = PendingIntent.getActivity(activityContextManager.getInstance().getCurrentActivity(), 0, mIntent, PendingIntent.FLAG_ONE_SHOT);
builder.setContentTitle(pTitle) // required
.setSmallIcon(R.drawable.notification_logo) // required
.setContentText(pBody) // required
.setDefaults(Notification.DEFAULT_ALL)
.setAutoCancel(true)
.setCategory(Notification.CATEGORY_SERVICE)
.setContentIntent(pendIntent)
.setTicker(pTitle)
.setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
} else {
builder = new NotificationCompat.Builder(context);
PackageManager pm = context.getPackageManager();
Intent mIntent = activityContextManager.getInstance().getHomeController().getIntent();
PendingIntent pendIntent = PendingIntent.getActivity(activityContextManager.getInstance().getCurrentActivity(), 0, mIntent, PendingIntent. FLAG_ONE_SHOT);
builder.setContentTitle(pTitle) // required
.setSmallIcon(R.drawable.notification_logo) // required
.setContentText(pBody) // required
.setDefaults(Notification.DEFAULT_ALL)
.setAutoCancel(true)
.setContentIntent(pendIntent)
.setCategory(Notification.CATEGORY_SERVICE)
.setTicker(pTitle)
.setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})
.setPriority(Notification.PRIORITY_HIGH);
}
Notification notification = builder.build();
mNotifManager.notify(NOTIFY_ID, notification);
}
}

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.clientauth;
package com.darkweb.genesissearchengine.libs.clientauth;
import android.content.ContentProvider;
import android.content.ContentUris;
@ -19,7 +19,7 @@ public class ClientAuthContentProvider extends ContentProvider {
V3ClientAuth.HASH,
V3ClientAuth.ENABLED,
};
private static final String AUTH = "com.darkweb.genesissearchengine.clientauth.ClientAuthContentProvider";
private static final String AUTH = "com.darkweb.genesissearchengine.libs.clientauth.ClientAuthContentProvider";
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTH + "/v3auth");
private static final int V3AUTHS = 1, V3AUTH_ID = 2;

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.clientauth;
package com.darkweb.genesissearchengine.libs.clientauth;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

View File

@ -15,15 +15,15 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher;
package com.darkweb.genesissearchengine.libs.netcipher;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.darkweb.genesissearchengine.netcipher.client.TlsOnlySocketFactory;
import com.darkweb.genesissearchengine.netcipher.proxy.OrbotHelper;
import com.darkweb.genesissearchengine.libs.netcipher.client.TlsOnlySocketFactory;
import com.darkweb.genesissearchengine.libs.netcipher.proxy.OrbotHelper;
import java.io.IOException;
import java.net.HttpURLConnection;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.util.Log;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import ch.boye.httpclientandroidlib.HttpException;
import ch.boye.httpclientandroidlib.HttpHost;

View File

@ -14,16 +14,13 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.content.Intent;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import javax.net.ssl.TrustManager;
public interface StrongBuilder<T extends StrongBuilder, C> {

View File

@ -16,12 +16,12 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.content.Context;
import android.content.Intent;
import com.darkweb.genesissearchengine.netcipher.proxy.OrbotHelper;
import com.darkweb.genesissearchengine.libs.netcipher.proxy.OrbotHelper;
import org.json.JSONObject;
import java.net.InetSocketAddress;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.content.Context;
import android.content.Intent;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
public class StrongConstants {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.content.Context;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.content.Context;

View File

@ -17,7 +17,7 @@
* From https://stackoverflow.com/a/29946540
*/
package com.darkweb.genesissearchengine.netcipher.client;
package com.darkweb.genesissearchengine.libs.netcipher.client;
import android.net.SSLCertificateSocketFactory;
import android.os.Build;

View File

@ -16,7 +16,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import android.app.Activity;
import android.content.BroadcastReceiver;
@ -34,7 +34,6 @@ import android.util.Log;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import android.content.Context;
import android.content.Intent;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import java.io.IOException;
import java.net.InetSocketAddress;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import java.net.ConnectException;
import java.net.InetSocketAddress;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import java.io.IOException;
import java.io.ObjectInputStream;

View File

@ -12,7 +12,7 @@
limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import android.content.ComponentName;
import android.content.Context;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import android.content.Intent;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.proxy;
package com.darkweb.genesissearchengine.libs.netcipher.proxy;
import android.content.Context;
import android.util.Log;

View File

@ -16,7 +16,7 @@
* limitations under the License.
*/
package com.darkweb.genesissearchengine.netcipher.web;
package com.darkweb.genesissearchengine.libs.netcipher.web;
import java.io.IOException;
import java.io.PrintWriter;

View File

@ -1,15 +1,8 @@
package com.darkweb.genesissearchengine.helperManager;
import android.widget.Toast;
package com.darkweb.genesissearchengine.libs.trueTime;
import com.darkweb.genesissearchengine.constants.strings;
import com.instacart.library.truetime.TrueTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class trueTime {
@ -36,15 +29,7 @@ public class trueTime {
}
public String getLTZ(){
Date deviceTime = new Date();
return System.currentTimeMillis()+strings.GENERIC_EMPTY_STR;
}
private String _formatDate(Date date, String pattern, TimeZone timeZone) {
DateFormat format = new SimpleDateFormat(pattern, Locale.ENGLISH);
format.setTimeZone(timeZone);
return format.format(date);
}
}

View File

@ -1,15 +1,15 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.libs.views;
import android.graphics.Color;
public class colorAnimationReciever
public class ColorAnimator
{
private final int mStartColor, mEndColor;
private final float[] mStartHSV, mEndHSV;
private float[] mMove = new float[3];
public colorAnimationReciever(int start, int end) {
public ColorAnimator(int start, int end) {
mStartColor = start;
mEndColor = end;
mStartHSV = toHSV(start);

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.libs.views;
import android.app.Activity;
import android.graphics.Rect;

View File

@ -1,28 +1,23 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.libs.views;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
/**
* Created by chris on 7/27/16.
*/
public class TopCropImageView extends androidx.appcompat.widget.AppCompatImageView {
public class ThumbnailCrop extends androidx.appcompat.widget.AppCompatImageView {
public TopCropImageView(Context context) {
public ThumbnailCrop(Context context) {
super(context);
init();
}
public TopCropImageView(Context context, AttributeSet attrs) {
public ThumbnailCrop(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public TopCropImageView(Context context, AttributeSet attrs, int defStyleAttr) {
public ThumbnailCrop(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}

View File

@ -1,26 +1,29 @@
package com.darkweb.genesissearchengine.pluginManager;
package com.darkweb.genesissearchengine.pluginManager.adPluginManager;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.google.android.gms.ads.*;
import java.lang.ref.WeakReference;
import java.util.List;
class adManager
public class adManager
{
/*Private Variables */
private eventObserver.eventListener mEvent;
private WeakReference<AdView> mBannerAds;
private boolean mPaidStatus = false;
private boolean mPaidStatus;
private boolean bannerAdsLoading = false;
private boolean bannerAdsLoaded = false;
/*Initializations*/
adManager(eventObserver.eventListener pEvent, AdView pBannerAds, boolean pPaidStatus) {
public adManager(eventObserver.eventListener pEvent, AdView pBannerAds, boolean pPaidStatus) {
this.mEvent = pEvent;
this.mPaidStatus = pPaidStatus;
this.mBannerAds = new WeakReference(pBannerAds);
@ -74,13 +77,19 @@ class adManager
@Override
public void onAdClosed() {
}
@Override
public void onAdFailedToLoad(@NonNull LoadAdError var1) {
Log.i("sadsa","");
}
});
}
}
/*External Triggers*/
Object onTrigger(List<Object> pData, pluginEnums.eAdManager pEventType) {
public Object onTrigger(List<Object> pData, pluginEnums.eAdManager pEventType) {
if(pEventType.equals(pluginEnums.eAdManager.M_INITIALIZE_BANNER_ADS))
{
loadAds((AppCompatActivity)pData.get(0));

View File

@ -1,14 +1,15 @@
package com.darkweb.genesissearchengine.pluginManager;
package com.darkweb.genesissearchengine.pluginManager.analyticPluginManager;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.constants.status;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.flurry.android.FlurryAgent;
import java.lang.ref.WeakReference;
import java.util.List;
class analyticManager
public class analyticManager
{
/*Private Variables*/
@ -16,7 +17,7 @@ class analyticManager
/*Initializations*/
analyticManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent){
public analyticManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent){
this.mAppContext = pAppContext;
initialize();
}
@ -39,7 +40,7 @@ class analyticManager
}
}
void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
public void onTrigger(List<Object> pData, pluginEnums.eAnalyticManager pEventType) {
if(pEventType.equals(pluginEnums.eAnalyticManager.M_LOG_EVENT))
{
}

View File

@ -1,66 +0,0 @@
package com.darkweb.genesissearchengine.pluginManager;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.helperManager.localFileDownloader;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
class downloadManager
{
/*Private Variables*/
private WeakReference<AppCompatActivity> mAppContext;
private Map<Integer, localFileDownloader> mDownloads = new HashMap<>();
private eventObserver.eventListener mEvent;
/*Initializations*/
downloadManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent){
this.mAppContext = pAppContext;
this.mEvent = pEvent;
initialize();
}
private void initialize()
{
}
private void startDownload(String pPath,String pFile) {
int mID = helperMethod.createNotificationID();
localFileDownloader mFileDownloader = (localFileDownloader)new localFileDownloader(mAppContext.get().getApplicationContext(),pPath, pFile, mID, mEvent).execute(pPath);
mDownloads.put(mID,mFileDownloader);
}
private void cancelDownload(int pID) {
Objects.requireNonNull(mDownloads.get(pID)).onCancel();
}
private void onTriggerDownload(int pID) {
Objects.requireNonNull(mDownloads.get(pID)).onTrigger();
}
/*External Triggers*/
Object onTrigger(List<Object> pData, pluginEnums.eDownloadManager pEventType) {
if(pEventType.equals(pluginEnums.eDownloadManager.M_DOWNLOAD_FILE))
{
startDownload((String) pData.get(0),(String)pData.get(1));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_CANCEL))
{
cancelDownload((int) pData.get(0));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_TRIGGER))
{
onTriggerDownload((int) pData.get(0));
}
return null;
}
}

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.pluginManager.downloadPluginManager;
import android.app.NotificationManager;
import android.content.Context;
@ -6,21 +6,19 @@ import android.os.Environment;
import android.os.Handler;
import android.util.Base64;
import android.webkit.JavascriptInterface;
import androidx.core.app.NotificationCompat;
import com.example.myapplication.R;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.util.Date;
public class internalFileDownloadManager {
public class blobDownloader {
private Context context;
private NotificationManager nm;
public internalFileDownloadManager(Context context) {
public blobDownloader(Context context) {
this.context = context;
}
@ -49,6 +47,7 @@ public class internalFileDownloadManager {
}
return "javascript: console.log('It is not a Blob URL');";
}
private void convertBase64StringToPdfAndStoreIt(String base64PDf) throws IOException {
final int notificationId = 1;
String currentDateTime = DateFormat.getDateTimeInstance().format(new Date());
@ -72,11 +71,7 @@ public class internalFileDownloadManager {
nm.notify(notificationId, b.build());
Handler h = new Handler();
long delayInMilliseconds = 5000;
h.postDelayed(new Runnable() {
public void run() {
nm.cancel(notificationId);
}
}, delayInMilliseconds);
h.postDelayed(() -> nm.cancel(notificationId), delayInMilliseconds);
}
}
}

View File

@ -0,0 +1,89 @@
package com.darkweb.genesissearchengine.pluginManager.downloadPluginManager;
import android.os.Environment;
import androidx.appcompat.app.AppCompatActivity;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.darkweb.genesissearchengine.pluginManager.pluginReciever.downloadNotificationReciever;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class downloadManager
{
/* Private Variables */
private WeakReference<AppCompatActivity> mAppContext;
private Map<Integer, downloadReciever> mDownloads = new HashMap<>();
private eventObserver.eventListener mEvent;
/* Initializations */
public downloadManager(WeakReference<AppCompatActivity> pAppContext, eventObserver.eventListener pEvent){
this.mAppContext = pAppContext;
this.mEvent = pEvent;
initialize();
}
private void initialize()
{
}
private void startDownload(String pPath,String pFile) {
int mID = helperMethod.createNotificationID();
downloadReciever mFileDownloader = (downloadReciever)new downloadReciever(mAppContext.get().getApplicationContext(),pPath, pFile, mID, mEvent, downloadNotificationReciever.class).execute(pPath);
mDownloads.put(mID,mFileDownloader);
}
private void cancelDownload(int pID) {
Objects.requireNonNull(mDownloads.get(pID)).onCancel();
}
private void onTriggerDownload(int pID) {
if(mDownloads!=null && mDownloads.get(pID)!=null){
mDownloads.get(pID).onTrigger();
}
}
private void onStartSercvice(String mURL, String mPath){
mAppContext.get().startService(downloadService.getDownloadService(mAppContext.get().getApplicationContext(), mURL + "__" + mPath, Environment.DIRECTORY_DOWNLOADS));
}
private String downloadBlob(String pURL){
return blobDownloader.getBase64StringFromBlobUrl(pURL);
}
/* External Triggers */
public Object onTrigger(List<Object> pData, pluginEnums.eDownloadManager pEventType) {
if(pEventType.equals(pluginEnums.eDownloadManager.M_DOWNLOAD_FILE))
{
startDownload((String) pData.get(0),(String)pData.get(1));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_CANCEL))
{
cancelDownload((int) pData.get(0));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_TRIGGER))
{
onTriggerDownload((int) pData.get(0));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_START_SERVICE))
{
onStartSercvice((String) pData.get(0), (String) pData.get(1));
}
else if(pEventType.equals(pluginEnums.eDownloadManager.M_DOWNLOAD_BLOB))
{
return downloadBlob((String) pData.get(0));
}
return null;
}
}

View File

@ -1,4 +1,4 @@
package com.darkweb.genesissearchengine.helperManager;
package com.darkweb.genesissearchengine.pluginManager.downloadPluginManager;
import android.annotation.SuppressLint;
import android.app.DownloadManager;
@ -24,7 +24,8 @@ import androidx.core.content.FileProvider;
import com.darkweb.genesissearchengine.appManager.activityContextManager;
import com.darkweb.genesissearchengine.eventObserver;
import com.darkweb.genesissearchengine.netcipher.client.StrongHttpsClient;
import com.darkweb.genesissearchengine.helperManager.helperMethod;
import com.darkweb.genesissearchengine.libs.netcipher.client.StrongHttpsClient;
import com.darkweb.genesissearchengine.pluginManager.pluginController;
import com.darkweb.genesissearchengine.pluginManager.pluginEnums;
import com.example.myapplication.R;
@ -39,6 +40,7 @@ import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Collections;
@ -50,7 +52,7 @@ import static com.darkweb.genesissearchengine.constants.enums.etype.M_DOWNLOAD_F
import static java.lang.Thread.sleep;
public class localFileDownloader extends AsyncTask<String, Integer, String> {
public class downloadReciever extends AsyncTask<String, Integer, String> {
@SuppressLint("StaticFieldLeak")
private Context context;
@ -61,21 +63,21 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
private Boolean mIsCanceled = false;
private String PROXY_ADDRESS = "localhost";
private int PROXY_PORT = 9050;
private int mID;
private String mFileName;
private float mTotalByte;
private float mDownloadByte;
private String mURL;
private eventObserver.eventListener mEvent;
private Class<?> mBroadcastReciever;
public localFileDownloader(Context pContext, String pURL, String pFileName, int pID, eventObserver.eventListener pEvent) {
public downloadReciever(Context pContext, String pURL, String pFileName, int pID, eventObserver.eventListener pEvent, Class<?> pBroadcastReciever) {
this.context = pContext;
this.mFileName = pFileName;
this.mURL = pURL;
this.mID = pID;
this.mEvent = pEvent;
this.mBroadcastReciever = pBroadcastReciever;
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
@ -87,7 +89,7 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
protected void onPreExecute() {
super.onPreExecute();
Intent snoozeIntent = new Intent(context, downloadNotification.class);
Intent snoozeIntent = new Intent(context, mBroadcastReciever);
snoozeIntent.setAction("Download_Cancelled");
snoozeIntent.putExtra("N_ID", mID);
snoozeIntent.putExtra("N_COMMAND", 0);
@ -152,7 +154,9 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
proxy = new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(PROXY_ADDRESS, 9050));
conection = (HttpURLConnection) url.openConnection(proxy);
}else {
conection = (HttpURLConnection) ProxySelector.openConnectionWithProxy(new URI(f_url[0]));;
Proxy mProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 8118));
URLConnection mURLConnection = new URI(f_url[0]).toURL().openConnection(mProxy);
conection = (HttpURLConnection) mURLConnection;
}
conection.setRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0");
@ -168,7 +172,6 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
long total = 0;
mTotalByte = lenghtOfFile;
while ((count = mStream.read(data)) != -1) {
total += count;
int cur = (int) ((total * 100) / lenghtOfFile);
@ -219,7 +222,7 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
HttpGet httpget = new HttpGet(urlEncoded);
HttpResponse response = httpclient.execute(httpget);
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(response.getStatusLine()).append("\n\n");
InputStream mStream = response.getEntity().getContent();
@ -231,7 +234,6 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
long total = 0;
float lenghtOfFile = response.getEntity().getContentLength();
mTotalByte = lenghtOfFile;
int read;
while ((read = mStream.read(data)) != -1) {
total += read;
@ -285,13 +287,13 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
@Override
protected void onPostExecute(String file_url) {
Intent snoozeIntentPost = new Intent(context, downloadNotification.class);
Intent snoozeIntentPost = new Intent(context, mBroadcastReciever);
snoozeIntentPost.setAction("Download_Open");
snoozeIntentPost.putExtra("N_ID", mID);
snoozeIntentPost.putExtra("N_COMMAND", 1);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, mID, snoozeIntentPost, PendingIntent.FLAG_UPDATE_CURRENT);
Intent snoozeIntentPost1 = new Intent(context, downloadNotification.class);
Intent snoozeIntentPost1 = new Intent(context, mBroadcastReciever);
snoozeIntentPost1.setAction("Download_Cancelled");
snoozeIntentPost1.putExtra("N_ID", mID);
snoozeIntentPost1.putExtra("N_COMMAND", 2);
@ -316,7 +318,7 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.provider.dev", mFile);
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.production.provider", mFile);
ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.Downloads.TITLE, mFileName);
@ -329,7 +331,7 @@ public class localFileDownloader extends AsyncTask<String, Integer, String> {
ContentResolver database = context.getContentResolver();
database.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, contentValues);
} else {
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.provider.dev", mFile);
Uri uri = FileProvider.getUriForFile(context, "com.darkweb.genesissearchengine.production.provider", mFile);
String mime = helperMethod.getMimeType(uri.toString(), context);
if(mime!=null){
dm.addCompletedDownload(mFileName, mURL, false, mime, mFile.getAbsolutePath(), mFile.length(), false);

Some files were not shown because too many files have changed in this diff Show More